Ver código fonte

自助检索修改

xiaoqiao 1 ano atrás
pai
commit
fefcd1b876

Diferenças do arquivo suprimidas por serem muito extensas
+ 673 - 527
lib/华北油田Ai检索.PDM


Diferenças do arquivo suprimidas por serem muito extensas
+ 679 - 533
lib/华北油田Ai检索.pdb


+ 26 - 12
src/main/java/com/bowintek/practice/services/impl/SubjectServiceImpl.java

@@ -64,8 +64,8 @@ public class SubjectServiceImpl implements SubjectService {
 
         if (model.getIsReferences() == 0) {
             model.setExecSql(model.getTabCode());
-        }else{
-            model.setExecSql(model.getExecSql().replaceAll("\\n",""));
+        } else {
+            model.setExecSql(model.getExecSql().replaceAll("\\n", ""));
         }
         List<SrTag> tagList = tagMapper.selectByExample(null);
 
@@ -88,7 +88,7 @@ public class SubjectServiceImpl implements SubjectService {
             result = subjectMapper.updateByPrimaryKey(model);
         }
         //新加标签
-        Arrays.stream(model.getTagList()).forEach(tag -> {
+        Arrays.stream(model.getTagList()).filter(tag->!StringUtils.IsNullEmpty(tag)).forEach(tag -> {
             SrTag dbTag = tagList.stream().filter(f -> f.getTagName().equals(tag.trim())).findFirst().orElse(null);
             if (dbTag == null) {
                 dbTag = new SrTag();
@@ -108,15 +108,18 @@ public class SubjectServiceImpl implements SubjectService {
             SrSubjectfieldExample.Criteria criteria = example.or();
             criteria.andSubIdEqualTo(model.getSubId());
             List<SrSubjectfield> dbList = subjectfieldMapper.selectByExample(example);
-            List<String> ids = fieldList.stream().map(x -> x.getFieldId()).collect(Collectors.toList());
 
-            //删除字段前先删除关联标签
-            SrSubjectfieldtagExample ftExp = new SrSubjectfieldtagExample();
-            ftExp.or().andFieldIdIn(dbList.stream().map(x -> x.getFieldId()).collect(Collectors.toList()));
-            subjectfieldtagMapper.deleteByExample(ftExp);
+            if (dbList.size() > 0) {
+                List<String> ids = fieldList.stream().map(x -> x.getFieldId()).collect(Collectors.toList());
 
-            criteria.andFieldIdNotIn(ids);
-            subjectfieldMapper.deleteByExample(example);
+                //删除字段前先删除关联标签
+                SrSubjectfieldtagExample ftExp = new SrSubjectfieldtagExample();
+                ftExp.or().andFieldIdIn(dbList.stream().map(x -> x.getFieldId()).collect(Collectors.toList()));
+                subjectfieldtagMapper.deleteByExample(ftExp);
+
+                criteria.andFieldIdNotIn(ids);
+                subjectfieldMapper.deleteByExample(example);
+            }
 
             fieldList.stream().forEach(x -> {
                 long count = dbList.stream().filter(f -> f.getFieldId().equals(x.getFieldId())).count();
@@ -135,7 +138,7 @@ public class SubjectServiceImpl implements SubjectService {
                     subjectfieldMapper.insertSelective(x);
                 }
                 //新加标签
-                Arrays.stream(x.getTagList()).forEach(tag -> {
+                Arrays.stream(x.getTagList()).filter(tag->!StringUtils.IsNullEmpty(tag)).forEach(tag -> {
                     SrTag dbTag = tagList.stream().filter(f -> f.getTagName().equals(tag.trim())).findFirst().orElse(null);
                     if (dbTag == null) {
                         dbTag = new SrTag();
@@ -166,7 +169,18 @@ public class SubjectServiceImpl implements SubjectService {
             SrSubjectfieldExample example = new SrSubjectfieldExample();
             SrSubjectfieldExample.Criteria criteria = example.or();
             criteria.andSubIdIn(idList);
-            subjectfieldMapper.selectByExample(example);
+            List<String> fieldList = subjectfieldMapper.selectByExample(example).stream().map(SrSubjectfield::getFieldId).collect(Collectors.toList());
+            if (fieldList.size() > 0) {
+                SrSubjectfieldtagExample tagExp = new SrSubjectfieldtagExample();
+                tagExp.or().andFieldIdIn(fieldList);
+                subjectfieldtagMapper.deleteByExample(tagExp);
+            }
+            subjectfieldMapper.deleteByExample(example);
+
+            //删除关联标签
+            SrSubjecttagExample stExp = new SrSubjecttagExample();
+            stExp.or().andSubIdIn(idList);
+            subjecttagMapper.deleteByExample(stExp);
 
             SrSubjectExample subExp = new SrSubjectExample();
             subExp.or().andSubIdIn(idList);

+ 1 - 2
vue/src/components/basic/query/drag-where.vue

@@ -310,7 +310,7 @@ export default defineComponent({
           options = this.operDics;
           break;
       }
-      if (operation == undefined && options != undefined) {
+      if (operation == undefined && options != undefined && options.length > 0) {
         operation = options[0].value;
       }
       return operation;
@@ -353,7 +353,6 @@ export default defineComponent({
 }
 
 .query-area-item-time {
-  width: 380px !important;
 }
 
 .query-area-body-edit {

+ 3 - 3
vue/src/components/basic/query/select-column.vue

@@ -5,7 +5,7 @@
         <b>列表显示字段</b>
         <DoubleLeftOutlined @click="showColumns=false"/>
       </div>
-      <div style="margin-left: 10px;">
+      <div style="margin-left: 1px;">
         <div :style="{ borderBottom: '1px solid #E9E9E9' }">
           <a-checkbox
             v-model:checked="checkAll"
@@ -171,7 +171,7 @@ export default defineComponent({
 
 <style lang="less" scoped>
 .query-index-column {
-  width: 20%;
+  width: 220px;
   border: solid 1px #e5e7eb;
   height: 100%;
 
@@ -180,7 +180,7 @@ export default defineComponent({
     padding: 10px;
 
     .ant-checkbox-wrapper:first-child {
-      margin-left: 8px;
+      margin-left: 10px;
     }
 
     .lable-operation {

+ 2 - 2
vue/src/components/basic/query/select-field.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     title="高级设置"
-    :width="700"
+    :width="800"
     :visible="options.visible"
     :ok-text="'确认'"
     :cancel-text="'取消'"
@@ -126,7 +126,7 @@ export default defineComponent({
   .field-item {
     width: 22%;
     border: 2px solid #eef0f4;
-    height: 50px;
+    height: 28px;
     display: flex;
     align-items: baseline;
     padding-left: 5px;