Browse Source

自助检索修改

xiaoqiao 1 year ago
parent
commit
5ba69a2690

File diff suppressed because it is too large
+ 591 - 533
lib/华北油田Ai检索.PDM


File diff suppressed because it is too large
+ 147 - 135
lib/华北油田Ai检索.pdb


+ 5 - 5
src/main/java/com/bowintek/practice/model/SrSubjectfield.java

@@ -17,7 +17,7 @@ public class SrSubjectfield {
 
     private String dataType;
 
-    private Integer queryTypeId;
+    private Integer queryType;
 
     private String dictionaryCode;
 
@@ -99,12 +99,12 @@ public class SrSubjectfield {
         this.dataType = dataType == null ? null : dataType.trim();
     }
 
-    public Integer getQueryTypeId() {
-        return queryTypeId;
+    public Integer getQueryType() {
+        return queryType;
     }
 
-    public void setQueryTypeId(Integer queryTypeId) {
-        this.queryTypeId = queryTypeId;
+    public void setQueryType(Integer queryType) {
+        this.queryType = queryType;
     }
 
     public String getDictionaryCode() {

+ 24 - 24
src/main/java/com/bowintek/practice/model/SrSubjectfieldExample.java

@@ -654,63 +654,63 @@ public class SrSubjectfieldExample {
             return (Criteria) this;
         }
 
-        public Criteria andQueryTypeIdIsNull() {
-            addCriterion("queryTypeId is null");
+        public Criteria andQueryTypeIsNull() {
+            addCriterion("queryType is null");
             return (Criteria) this;
         }
 
-        public Criteria andQueryTypeIdIsNotNull() {
-            addCriterion("queryTypeId is not null");
+        public Criteria andQueryTypeIsNotNull() {
+            addCriterion("queryType is not null");
             return (Criteria) this;
         }
 
-        public Criteria andQueryTypeIdEqualTo(Integer value) {
-            addCriterion("queryTypeId =", value, "queryTypeId");
+        public Criteria andQueryTypeEqualTo(Integer value) {
+            addCriterion("queryType =", value, "queryType");
             return (Criteria) this;
         }
 
-        public Criteria andQueryTypeIdNotEqualTo(Integer value) {
-            addCriterion("queryTypeId <>", value, "queryTypeId");
+        public Criteria andQueryTypeNotEqualTo(Integer value) {
+            addCriterion("queryType <>", value, "queryType");
             return (Criteria) this;
         }
 
-        public Criteria andQueryTypeIdGreaterThan(Integer value) {
-            addCriterion("queryTypeId >", value, "queryTypeId");
+        public Criteria andQueryTypeGreaterThan(Integer value) {
+            addCriterion("queryType >", value, "queryType");
             return (Criteria) this;
         }
 
-        public Criteria andQueryTypeIdGreaterThanOrEqualTo(Integer value) {
-            addCriterion("queryTypeId >=", value, "queryTypeId");
+        public Criteria andQueryTypeGreaterThanOrEqualTo(Integer value) {
+            addCriterion("queryType >=", value, "queryType");
             return (Criteria) this;
         }
 
-        public Criteria andQueryTypeIdLessThan(Integer value) {
-            addCriterion("queryTypeId <", value, "queryTypeId");
+        public Criteria andQueryTypeLessThan(Integer value) {
+            addCriterion("queryType <", value, "queryType");
             return (Criteria) this;
         }
 
-        public Criteria andQueryTypeIdLessThanOrEqualTo(Integer value) {
-            addCriterion("queryTypeId <=", value, "queryTypeId");
+        public Criteria andQueryTypeLessThanOrEqualTo(Integer value) {
+            addCriterion("queryType <=", value, "queryType");
             return (Criteria) this;
         }
 
-        public Criteria andQueryTypeIdIn(List<Integer> values) {
-            addCriterion("queryTypeId in", values, "queryTypeId");
+        public Criteria andQueryTypeIn(List<Integer> values) {
+            addCriterion("queryType in", values, "queryType");
             return (Criteria) this;
         }
 
-        public Criteria andQueryTypeIdNotIn(List<Integer> values) {
-            addCriterion("queryTypeId not in", values, "queryTypeId");
+        public Criteria andQueryTypeNotIn(List<Integer> values) {
+            addCriterion("queryType not in", values, "queryType");
             return (Criteria) this;
         }
 
-        public Criteria andQueryTypeIdBetween(Integer value1, Integer value2) {
-            addCriterion("queryTypeId between", value1, value2, "queryTypeId");
+        public Criteria andQueryTypeBetween(Integer value1, Integer value2) {
+            addCriterion("queryType between", value1, value2, "queryType");
             return (Criteria) this;
         }
 
-        public Criteria andQueryTypeIdNotBetween(Integer value1, Integer value2) {
-            addCriterion("queryTypeId not between", value1, value2, "queryTypeId");
+        public Criteria andQueryTypeNotBetween(Integer value1, Integer value2) {
+            addCriterion("queryType not between", value1, value2, "queryType");
             return (Criteria) this;
         }
 

+ 4 - 9
src/main/java/com/bowintek/practice/services/impl/GenSqlStringServiceImpl.java

@@ -155,10 +155,10 @@ public class GenSqlStringServiceImpl implements GenSqlStringService {
         String whereString = "";
         for(int i=0;i<data.wheres.size();i++){
             SrTempfield stf = data.wheres.get(i);
-            int dataType = getDataType(stf.getQueryType());
-            if(dataType==0 || dataType==3) whereString += genWhereString(stf);
-            else if(dataType==1) whereString += genWhereNumber(stf);
-            else if(dataType==2) whereString += genWhereDate(stf);
+
+            if(stf.getQueryType()==1 || stf.getQueryType()==4) whereString += genWhereString(stf);
+            else if(stf.getQueryType()==2) whereString += genWhereNumber(stf);
+            else if(stf.getQueryType()==3) whereString += genWhereDate(stf);
         }
 
         //生成排序字段
@@ -194,11 +194,6 @@ public class GenSqlStringServiceImpl implements GenSqlStringService {
         return IsNullEmpty(displayName)? fieldName : displayName;
     }
 
-    public int getDataType(Integer queryType){
-        if(queryType!=null && (queryType<=4)) return queryType-1;
-        return -1;
-    }
-
     public static boolean IsNullEmpty(String value) {
         return value == null || value.isEmpty();
     }

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

@@ -241,7 +241,7 @@ public class SubjectServiceImpl implements SubjectService {
                 errorInfo += "查询类型不在支持范围!";
 
             if (stringUtils.IsNullOrEmpty(errorInfo)) {
-                item.setQueryTypeId(dicQueryType.getValue());
+                item.setQueryType(dicQueryType.getValue());
                 item.setSettingTypeId(dicSettingType.getValue());
                 item.setIsSearchField(Constant.YES.equals(item.getIsSearchFieldText()) ? 1 : 0);
                 item.setIsForeignKey(Constant.YES.equals(item.getIsForeignKeyText()) ? 1 : 0);

+ 19 - 9
src/main/java/com/bowintek/practice/services/impl/TempServiceImpl.java

@@ -234,10 +234,15 @@ public class TempServiceImpl implements TempService {
         });
 
         //保存模板 维度、度量、查询信息
-        rtn.effectCount += tempCQuery.batchInsertDimension(data.bases);
-        rtn.effectCount += tempCQuery.batchInsertField(data.wheres);
-        rtn.effectCount += tempCQuery.batchInsertMeasure(data.measures);
-
+        if(data.bases.size()>0) {
+            rtn.effectCount += tempCQuery.batchInsertDimension(data.bases);
+        }
+        if(data.wheres.size()>0) {
+            rtn.effectCount += tempCQuery.batchInsertField(data.wheres);
+        }
+        if(data.measures.size()>0) {
+            rtn.effectCount += tempCQuery.batchInsertMeasure(data.measures);
+        }
         return rtn;
     }
 
@@ -247,7 +252,7 @@ public class TempServiceImpl implements TempService {
         List<HashMap<String, Object>> subjectTrees = subjectCQuery.getListToHashMap(likeName);
 
         List<HashMap<String, Object>> tagTree = new ArrayList<>();
-        tagList.stream().forEach(tag -> {
+        for (TagVo tag : tagList) {
             List<HashMap<String, Object>> tagSubList = subjectTrees.stream().filter(sub -> Arrays.stream(tag.getSubIdList()).anyMatch(e -> e.equals(sub.get("subId").toString()))).map(x ->
             {
                 x.put("title", x.get("subjectName"));
@@ -262,7 +267,12 @@ public class TempServiceImpl implements TempService {
             treeNode.put("columnList", tag.getColumnList());
             treeNode.put("filterFields", tag.getFilterFieldList());
             tagTree.add(treeNode);
-        });
+        };
+        if (!StringUtils.IsNullEmpty(likeName)) {
+            tagTree = tagTree.stream().filter(x -> x.get("title").toString().contains(likeName)
+                    && ((List<HashMap<String, Object>>) x.get("children")).size() > 0
+            ).collect(Collectors.toList());
+        }
         return tagTree;
     }
 
@@ -273,7 +283,7 @@ public class TempServiceImpl implements TempService {
                                                            String groupName) {
         List<HashMap<String, Object>> fields = subFields.stream()
                 .filter(x -> subId.equals((String) x.get("subId"))
-                        && queryTypeIds.indexOf(x.get("settingTypeId")) >= 0)
+                        && queryTypeIds.indexOf(x.get("queryType")) >= 0)
                 .collect(Collectors.toList());
 
         //生成树标题,key
@@ -300,7 +310,7 @@ public class TempServiceImpl implements TempService {
     }
 
     @Override
-    public List<HashMap<String, Object>> getSubjectFieldList(String subId,String tagId,Integer fixedType) {
-        return subjectCQuery.getSubjectField(subId,tagId,fixedType);
+    public List<HashMap<String, Object>> getSubjectFieldList(String subId, String tagId, Integer fixedType) {
+        return subjectCQuery.getSubjectField(subId, tagId, fixedType);
     }
 }

+ 1 - 1
src/main/resources/generatorConfig.xml

@@ -120,6 +120,6 @@
             <columnOverride column="StandardMajorID" javaType="java.lang.Integer" jdbcType="INTEGER" />
             <table schema="" tableName="Sys_Log"><property name="useActualColumnNames" value="true"/></table>
         </table>-->
-        <table schema="" tableName="sr_saerchTemp"><property name="useActualColumnNames" value="true"/></table>
+        <table schema="" tableName="sr_subjectfield"><property name="useActualColumnNames" value="true"/></table>
     </context>
 </generatorConfiguration>

+ 14 - 14
src/main/resources/mapping/SrSubjectfieldMapper.xml

@@ -10,7 +10,7 @@
     <result column="settingTypeId" jdbcType="INTEGER" property="settingTypeId" />
     <result column="fieldDesc" jdbcType="VARCHAR" property="fieldDesc" />
     <result column="dataType" jdbcType="VARCHAR" property="dataType" />
-    <result column="queryTypeId" jdbcType="INTEGER" property="queryTypeId" />
+    <result column="queryType" jdbcType="INTEGER" property="queryType" />
     <result column="dictionaryCode" jdbcType="VARCHAR" property="dictionaryCode" />
     <result column="status" jdbcType="INTEGER" property="status" />
     <result column="disOrder" jdbcType="INTEGER" property="disOrder" />
@@ -80,7 +80,7 @@
   </sql>
   <sql id="Base_Column_List">
     fieldId, subId, fieldCode, fieldName, fieldAlias, settingTypeId, fieldDesc, dataType, 
-    queryTypeId, dictionaryCode, status, disOrder, isSearchField, isForeignKey, referencesTab, 
+    queryType, dictionaryCode, status, disOrder, isSearchField, isForeignKey, referencesTab, 
     foreignKey, displayColumn
   </sql>
   <select id="selectByExample" parameterType="com.bowintek.practice.model.SrSubjectfieldExample" resultMap="BaseResultMap">
@@ -116,13 +116,13 @@
   <insert id="insert" parameterType="com.bowintek.practice.model.SrSubjectfield">
     insert into sr_subjectfield (fieldId, subId, fieldCode, 
       fieldName, fieldAlias, settingTypeId, 
-      fieldDesc, dataType, queryTypeId, 
+      fieldDesc, dataType, queryType, 
       dictionaryCode, status, disOrder, 
       isSearchField, isForeignKey, referencesTab, 
       foreignKey, displayColumn)
     values (#{fieldId,jdbcType=VARCHAR}, #{subId,jdbcType=VARCHAR}, #{fieldCode,jdbcType=VARCHAR}, 
       #{fieldName,jdbcType=VARCHAR}, #{fieldAlias,jdbcType=VARCHAR}, #{settingTypeId,jdbcType=INTEGER}, 
-      #{fieldDesc,jdbcType=VARCHAR}, #{dataType,jdbcType=VARCHAR}, #{queryTypeId,jdbcType=INTEGER}, 
+      #{fieldDesc,jdbcType=VARCHAR}, #{dataType,jdbcType=VARCHAR}, #{queryType,jdbcType=INTEGER}, 
       #{dictionaryCode,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{disOrder,jdbcType=INTEGER}, 
       #{isSearchField,jdbcType=INTEGER}, #{isForeignKey,jdbcType=INTEGER}, #{referencesTab,jdbcType=VARCHAR}, 
       #{foreignKey,jdbcType=VARCHAR}, #{displayColumn,jdbcType=VARCHAR})
@@ -154,8 +154,8 @@
       <if test="dataType != null">
         dataType,
       </if>
-      <if test="queryTypeId != null">
-        queryTypeId,
+      <if test="queryType != null">
+        queryType,
       </if>
       <if test="dictionaryCode != null">
         dictionaryCode,
@@ -207,8 +207,8 @@
       <if test="dataType != null">
         #{dataType,jdbcType=VARCHAR},
       </if>
-      <if test="queryTypeId != null">
-        #{queryTypeId,jdbcType=INTEGER},
+      <if test="queryType != null">
+        #{queryType,jdbcType=INTEGER},
       </if>
       <if test="dictionaryCode != null">
         #{dictionaryCode,jdbcType=VARCHAR},
@@ -269,8 +269,8 @@
       <if test="row.dataType != null">
         dataType = #{row.dataType,jdbcType=VARCHAR},
       </if>
-      <if test="row.queryTypeId != null">
-        queryTypeId = #{row.queryTypeId,jdbcType=INTEGER},
+      <if test="row.queryType != null">
+        queryType = #{row.queryType,jdbcType=INTEGER},
       </if>
       <if test="row.dictionaryCode != null">
         dictionaryCode = #{row.dictionaryCode,jdbcType=VARCHAR},
@@ -311,7 +311,7 @@
       settingTypeId = #{row.settingTypeId,jdbcType=INTEGER},
       fieldDesc = #{row.fieldDesc,jdbcType=VARCHAR},
       dataType = #{row.dataType,jdbcType=VARCHAR},
-      queryTypeId = #{row.queryTypeId,jdbcType=INTEGER},
+      queryType = #{row.queryType,jdbcType=INTEGER},
       dictionaryCode = #{row.dictionaryCode,jdbcType=VARCHAR},
       status = #{row.status,jdbcType=INTEGER},
       disOrder = #{row.disOrder,jdbcType=INTEGER},
@@ -348,8 +348,8 @@
       <if test="dataType != null">
         dataType = #{dataType,jdbcType=VARCHAR},
       </if>
-      <if test="queryTypeId != null">
-        queryTypeId = #{queryTypeId,jdbcType=INTEGER},
+      <if test="queryType != null">
+        queryType = #{queryType,jdbcType=INTEGER},
       </if>
       <if test="dictionaryCode != null">
         dictionaryCode = #{dictionaryCode,jdbcType=VARCHAR},
@@ -387,7 +387,7 @@
       settingTypeId = #{settingTypeId,jdbcType=INTEGER},
       fieldDesc = #{fieldDesc,jdbcType=VARCHAR},
       dataType = #{dataType,jdbcType=VARCHAR},
-      queryTypeId = #{queryTypeId,jdbcType=INTEGER},
+      queryType = #{queryType,jdbcType=INTEGER},
       dictionaryCode = #{dictionaryCode,jdbcType=VARCHAR},
       status = #{status,jdbcType=INTEGER},
       disOrder = #{disOrder,jdbcType=INTEGER},

BIN
src/main/resources/static/excel/13f3796d-b782-4f90-95e8-70faa1340764.xlsx


BIN
src/main/resources/static/excel/7a745e46-8e09-4c51-8760-5436bf79034c.xlsx


BIN
src/main/resources/static/excel/ade5577b-2cfc-4504-b56a-df6bb01f4694.xlsx


BIN
src/main/resources/static/static.zip


+ 1 - 1
target/classes/application.yml

@@ -130,7 +130,7 @@ appconfig:
           url: jdbc:oracle:thin:@//183.56.239.71:1521/edu_gdyfvccm
           driver-class-name: oracle.jdbc.OracleDriver
   oauthconfig:
-    oauthUrl: http://localhost:8077/
+    oauthUrl: http://user.api.uat.pcep.cloud/
     client_id: 2d4a5b3c-dc6c-4231-914c-ca1a4d3a134b
     client_secret: e2afdc026c4e745714d2f3b2a2e393686c11f66f
 

BIN
target/classes/com/bowintek/practice/controller/OAuthController.class


+ 1 - 1
target/classes/generatorConfig.xml

@@ -120,6 +120,6 @@
             <columnOverride column="StandardMajorID" javaType="java.lang.Integer" jdbcType="INTEGER" />
             <table schema="" tableName="Sys_Log"><property name="useActualColumnNames" value="true"/></table>
         </table>-->
-        <table schema="" tableName="sr_saerchTemp"><property name="useActualColumnNames" value="true"/></table>
+        <table schema="" tableName="sr_subjectfield"><property name="useActualColumnNames" value="true"/></table>
     </context>
 </generatorConfiguration>

+ 3 - 2
vue/src/views/query/index.vue

@@ -18,10 +18,10 @@
           @expand="treeOnExpand"
           @select="treeOnSelect">
           <template
-            #title="{ title, key, subId, fieldCode, fieldId, fieldName, fieldAlias, dataType, subjectName, queryTypeId, dictionaryCode }">
+            #title="{ title, key, subId, fieldCode, fieldId, fieldName, fieldAlias, dataType, subjectName, queryType, dictionaryCode }">
             <div v-if="(fieldAlias)" class="query-index-tree-item"
                  draggable="true"
-                 @dragstart="onDragStart($event,{subId, fieldCode, fieldId, fieldName, fieldAlias, dataType, subjectName, queryType:queryTypeId, dictionaryCode})"
+                 @dragstart="onDragStart($event,{subId, fieldCode, fieldId, fieldName, fieldAlias, dataType, subjectName, queryType, dictionaryCode})"
             >{{ title }}
             </div>
             <div v-else class="query-index-tree-item">{{ title }}</div>
@@ -318,6 +318,7 @@ export default defineComponent({
       if (selected && selectedNodes.node.parent != undefined) {
         formState.value.temp.subId = selectedNodes.node.subId;
         formState.value.temp.tagId = subjectTrees.value.expandedKeys[0];
+        subjectTrees.value.selectedKeys=[selectedNodes.node.subId];
       }
     }
     const getTemp = async function (tempId) {

+ 2 - 2
vue/src/views/subject/detail.vue

@@ -100,8 +100,8 @@ export default defineComponent({
           record.isSearchField == "1" ? "是" : "否"
       },
       {
-        title: '查询类型', dataIndex: 'queryTypeId', key: 'queryTypeId', align: "center", customRender: ({record}) =>
-          queryTypeList.value.filter(x => x.value == record.queryTypeId)[0]?.name
+        title: '查询类型', dataIndex: 'queryType', key: 'queryType', align: "center", customRender: ({record}) =>
+          queryTypeList.value.filter(x => x.value == record.queryType)[0]?.name
       },
       {title: '取数字典编码', dataIndex: 'dictionaryCode', key: 'dictionaryCode', align: "center"},
       {title: '显示排序', dataIndex: 'disOrder', key: 'disOrder', align: "center"},

+ 2 - 2
vue/src/views/subject/edit.vue

@@ -222,8 +222,8 @@ export default defineComponent({
           record.isSearchField == "1" ? "是" : "否"
       },
       {
-        title: '查询类型', dataIndex: 'queryTypeId', key: 'queryTypeId', align: "center", customRender: ({record}) =>
-          queryTypeList.value.filter(x => x.value == record.queryTypeId)[0]?.name
+        title: '查询类型', dataIndex: 'queryType', key: 'queryType', align: "center", customRender: ({record}) =>
+          queryTypeList.value.filter(x => x.value == record.queryType)[0]?.name
       },
       {title: '取数字典编码', dataIndex: 'dictionaryCode', key: 'dictionaryCode', align: "center"},
       {title: '显示排序', dataIndex: 'disOrder', key: 'disOrder', align: "center"},

+ 6 - 6
vue/src/views/subject/fieldedit.vue

@@ -53,16 +53,16 @@
       </a-row>
       <a-row type="flex">
         <a-col :span="7">
-          <a-form-item label="查询类型" name="queryTypeId" :label-col="{span:7}"
-                       :rules="[{ required: true, message: '请选择配置类型!' }]">
-            <a-select ref="select" v-model:value="dataModel.queryTypeId"
+          <a-form-item label="查询类型" name="queryType" :label-col="{span:7}"
+                       :rules="[{ required: true, message: '请选择查询类型!' }]">
+            <a-select ref="select" v-model:value="dataModel.queryType"
                       :options="queryTypeList" :field-names="{label:'name',value:'value'}" :allow-clear="true">
             </a-select>
           </a-form-item>
         </a-col>
-        <a-col :span="7" v-if="dataModel.queryTypeId==4">
+        <a-col :span="7" v-if="dataModel.queryType==4">
           <a-form-item label="取数字典编码" name="dictionaryCode" :label-col="{span:7}"
-                       :rules="[{ required: true, message: '请选择数据类型!' }]">
+                       :rules="[{ required: true, message: '请选择取数字典编码!' }]">
             <a-input v-model:value="dataModel.dictionaryCode" placeholder="">
             </a-input>
           </a-form-item>
@@ -187,7 +187,7 @@ export default defineComponent({
       settingTypeId: "",
       fieldDesc: "",
       dataType: null,
-      queryTypeId: "",
+      queryType: "",
       isSearchField: 1,
       dictionaryCode: '',
       isForeignKey: 0,

+ 1 - 1
vue/src/views/subject/model.ts

@@ -16,7 +16,7 @@ export interface Subjectfield {
   settingTypeId: string,
   fieldDesc: string,
   dataType: number | null,
-  queryTypeId: string,
+  queryType: string,
   isSearchField: number,
   dictionaryCode: string,
   isForeignKey: number,