Browse Source

井筒-优化

xiaoqiao 1 year ago
parent
commit
5019e0289a

+ 7 - 9
doc/待更新脚本

@@ -1,10 +1,8 @@
-create table wl_user_expend_setting
-(
-   expendID             varchar(50) not null,
-   userID               varchar(50) comment '用户ID',
-   well_id              varchar(50) comment '井ID',
-   setting_json         varchar(500) comment '配置信息setting_json',
-   primary key (expendID)
-);
+ INSERT INTO sys_function_code (FunctionCode, FunctionName, ParentFunctionCode, OrderNo) VALUES ('T0104', '领域检索', 'T01', 2);
 
-alter table wl_user_expend_setting comment '井筒全息信息页折叠配置';
+ INSERT INTO sys_menu (MenuNo, OrderNo, MenuName, Icon, ViewPath, Url, ParentMenuNo, Description, IsTopMenu, IsVisible, IsLeaf, FunctionCode, RecordStatus, ShortcutIcon)
+ VALUES ('T0104', 3, '领域检索', 'SearchOutlined', 'views/domain', '/domain', 'T01', null, 0, 1, 1, 'T0104', 1, null);
+ INSERT INTO sys_menu (MenuNo, OrderNo, MenuName, Icon, ViewPath, Url, ParentMenuNo, Description, IsTopMenu, IsVisible, IsLeaf, FunctionCode, RecordStatus, ShortcutIcon)
+ VALUES ('T010401', 1, '领域检索', null, 'views/domain', '/domain/index', 'T0104', null, 0, 0, 1, 'T0104', 1, null);
+ INSERT INTO sys_menu (MenuNo, OrderNo, MenuName, Icon, ViewPath, Url, ParentMenuNo, Description, IsTopMenu, IsVisible, IsLeaf, FunctionCode, RecordStatus, ShortcutIcon)
+ VALUES ('T010402', 2, '领域检索结果', null, 'views/domainResult', '/domain/result', 'T0104', null, 0, 0, 1, 'T0104', 1, null);

+ 9 - 0
src/main/java/com/bowintek/practice/controller/WellInfoController.java

@@ -134,6 +134,15 @@ public class WellInfoController {
         return RespGenerstor.success(wellInfoService.getConstructUnitTree());
     }
 
+    @GetMapping("/getWellPurposeTree")
+    public BaseResponse getWellPurposeTree() {
+        return RespGenerstor.success(wellInfoService.getWellPurposeTree());
+    }
+    @GetMapping("/getWellTypeTree")
+    public BaseResponse getWellTypeTree() {
+        return RespGenerstor.success(wellInfoService.getWellTypeTree());
+    }
+
     @GetMapping("/downFile")
     public void downFile(HttpServletResponse response, Integer isShow, String filePath, String fileName) throws IOException {
         Map<String, String> getParams = new HashMap<>();

+ 12 - 0
src/main/java/com/bowintek/practice/mapper/cquery/WellInfoCQuery.java

@@ -118,4 +118,16 @@ public interface WellInfoCQuery {
      * @return
      */
     List<HashMap<String,Object>> selectOilgasUnitList();
+
+    /**
+     * 井别层级列表
+     * @return
+     */
+    List<HashMap<String,Object>> selectWellPurposeList();
+
+    /**
+     * 井型层级列表
+     * @return
+     */
+    List<HashMap<String,Object>> selectWellTypeList();
 }

+ 39 - 0
src/main/java/com/bowintek/practice/services/impl/WellInfoServiceImpl.java

@@ -191,4 +191,43 @@ public class WellInfoServiceImpl implements WellInfoService {
         });
         return constructUnitTree;
     }
+
+    @Override
+    @SwitchDataSource(DBTypeEnum.POSTGRE)
+    public List<HashMap<String, Object>> getWellPurposeTree() {
+        List<HashMap<String, Object>> wellPurposeList = wellInfoCQuery.selectWellPurposeList();
+        List<HashMap<String, Object>> wellPurposeTree = new ArrayList<>();
+        Map<Object, List<HashMap<String, Object>>> groupedMap = wellPurposeList.stream()
+                .collect(Collectors.groupingBy(s -> s.get("project_id_1")));
+
+        groupedMap.values().forEach(gm -> {
+            HashMap<String, Object> child = new HashMap<>();
+            child.put("value", gm.get(0).get("project_name_1"));
+            child.put("label", gm.get(0).get("project_name_1"));
+            wellPurposeTree.add(child);
+            if (gm.get(0).keySet().contains("project_id_2")) {
+                this.fillChildren(2, 4, child, gm);
+            }
+        });
+        return wellPurposeTree;
+    }
+    @Override
+    @SwitchDataSource(DBTypeEnum.POSTGRE)
+    public List<HashMap<String, Object>> getWellTypeTree() {
+        List<HashMap<String, Object>> wellTypeList = wellInfoCQuery.selectWellTypeList();
+        List<HashMap<String, Object>> wellTypeTree = new ArrayList<>();
+        Map<Object, List<HashMap<String, Object>>> groupedMap = wellTypeList.stream()
+                .collect(Collectors.groupingBy(s -> s.get("project_id_1")));
+
+        groupedMap.values().forEach(gm -> {
+            HashMap<String, Object> child = new HashMap<>();
+            child.put("value", gm.get(0).get("project_name_1"));
+            child.put("label", gm.get(0).get("project_name_1"));
+            wellTypeTree.add(child);
+            if (gm.get(0).keySet().contains("project_id_2")) {
+                this.fillChildren(2, 4, child, gm);
+            }
+        });
+        return wellTypeTree;
+    }
 }

+ 2 - 0
src/main/java/com/bowintek/practice/services/service/WellInfoService.java

@@ -25,4 +25,6 @@ public interface WellInfoService {
     int saveExpendSetting(WlUserExpendSetting model);
     WlUserExpendSetting getExpendSetting(String userId ,String wellId);
     List<HashMap<String, Object>> getConstructUnitTree();
+    List<HashMap<String, Object>> getWellPurposeTree();
+    List<HashMap<String, Object>> getWellTypeTree();
 }

+ 29 - 1
src/main/resources/mapping/cquery/WellInfoCQuery.xml

@@ -236,7 +236,7 @@
             bi.unify_task_id,
             bi.source
         from by_dwr.fact_dwr_wl_ach_borehole_inter bi
-        where bi.well_id = 'HBe6JDZ9rt'
+        where bi.well_id = #{well_id}
         order by zone_no asc
     </select>
     <select id="selectTestHistoryList" resultType="java.util.HashMap">
@@ -344,4 +344,32 @@
                  left join BY_DIM.dim_oilgas_unit_desc desc7 on lv.project_id_7 = desc7.id
         where lv.is_effect = 1
     </select>
+    <select id="selectWellPurposeList" resultType="java.util.HashMap">
+        select lv.well_purpose1_id as project_id_1,lv.well_purpose2_id as project_id_2,lv.well_purpose3_id as project_id_3,
+               lv.well_purpose4_id as project_id_4,
+               desc1.name as project_name_1,
+               desc2.name as project_name_2,
+               desc3.name as project_name_3,
+               desc4.name as project_name_4
+        from BY_DIM.dim_well_purpose_level lv
+                 left join BY_DIM.dim_well_purpose_desc desc1 on lv.well_purpose1_id = desc1.id
+                 left join BY_DIM.dim_well_purpose_desc desc2 on lv.well_purpose2_id = desc2.id
+                 left join BY_DIM.dim_well_purpose_desc desc3 on lv.well_purpose3_id = desc3.id
+                 left join BY_DIM.dim_well_purpose_desc desc4 on lv.well_purpose4_id = desc4.id
+        where lv.is_effect = 1
+    </select>
+    <select id="selectWellTypeList" resultType="java.util.HashMap">
+        select lv.well_type1_id as project_id_1,lv.well_type2_id as project_id_2,lv.well_type3_id as project_id_3,
+               lv.well_type4_id as project_id_4,
+               desc1.name as project_name_1,
+               desc2.name as project_name_2,
+               desc3.name as project_name_3,
+               desc4.name as project_name_4
+        from BY_DIM.dim_well_type_level lv
+                 left join BY_DIM.dim_well_type_desc desc1 on lv.well_type1_id = desc1.id
+                 left join BY_DIM.dim_well_type_desc desc2 on lv.well_type2_id = desc2.id
+                 left join BY_DIM.dim_well_type_desc desc3 on lv.well_type3_id = desc3.id
+                 left join BY_DIM.dim_well_type_desc desc4 on lv.well_type4_id = desc4.id
+        where lv.is_effect = 1
+    </select>
 </mapper>

BIN
vue/src/assets/images/add.png


BIN
vue/src/assets/images/sub.png


+ 2 - 3
vue/src/components/basic/chart/chart-prod-dynamics.vue

@@ -52,7 +52,7 @@
     </a-form>
     <div class="echarts-total">
       <template v-for="(it) in getTotals()">
-        <span style="color: #2f54eb; font-weight: bold;">{{it.name}}</span>&nbsp;:&nbsp;{{it.total.toFixed(3)}}{{it.unit}} &nbsp;&nbsp;&nbsp;&nbsp;
+        <span style="color: #2f54eb; font-weight: bold;">{{it.name}}</span>&nbsp;:&nbsp;{{it.total!=null? parseFloat( it.total).toFixed(3):0}}{{it.unit}} &nbsp;&nbsp;&nbsp;&nbsp;
       </template>
     </div>
     <div class="echart" :id="('chart-'+id)" :style="getChartStyle()"></div>
@@ -90,7 +90,6 @@
       const wellId = computed(() => {
         return props.wellId ? props.wellId : null
       });
-
       const formRef = ref<FormInstance>();
       const formState = reactive({
         days:[null, null],
@@ -268,7 +267,7 @@
           yDatas[i].forEach(it=>{ total+=it*1; });
           totals.push({
             name:showList[i].label,
-            total : total.toFixed(2),
+            total : total?.toFixed(2),
             unit : this.getTypeUnit(showList[i].label)
           });
         }

+ 2 - 0
vue/src/router/asyncModules/sale.ts

@@ -9,4 +9,6 @@ export default {
   'views/subjectdetail': () => import( '@/views/subject/detail.vue'),
   'views/wellinfo': () => import( '@/views/wellinfo/index.vue'),
   'views/wellinfoDetail': () => import( '@/views/wellinfo/detail.vue'),
+  'views/domain': () => import( '@/views/domainES/index.vue'),
+  'views/domainResult': () => import( '@/views/domainES/result.vue'),
 }

+ 137 - 0
vue/src/views/domainES/index.vue

@@ -0,0 +1,137 @@
+<template>
+  <div class="card-search">
+    <a-form
+      ref="formRef"
+      name="advanced_search"
+      class="ant-advanced-search-form"
+      :model="formState"
+      @finish="onQuery"
+    >
+      <a-divider orientation="left"><b style="color:#4E61D0">1.输入检索控制条件</b></a-divider>
+      <a-row :gutter="24">
+        <a-col :span="22">
+          <div class="col-title">组织单位:</div>
+          <a-input v-model:value="formState.subjectName" style="width: 200px"></a-input>
+        </a-col>
+        <a-col :span="24">
+          <div class="col-title">
+          作业区/项目部:
+           </div>
+          <a-input v-model:value="formState.tabCode" style="width: 200px"></a-input>
+        </a-col>
+        <a-col :span="24">
+          <div class="col-title">
+          井名:
+           </div>
+          <a-input v-model:value="formState.tabName" style="width: 200px"></a-input>
+        </a-col>
+        <a-col :span="24">
+          <div class="col-title">
+          地层名称:
+           </div>
+          <a-input v-model:value="formState.tabName" style="width: 200px"></a-input>
+        </a-col>
+      </a-row>
+      <a-divider orientation="left"><b style="color:#4E61D0">2.输入检索内容条件</b></a-divider>
+      <a-row :gutter="24">
+        <a-col :span="24" class="query-row">
+          <div class="operTexts">&nbsp;</div>
+          <a-select v-model:value="formState.tabName" :options="fieldList" class="operTexts"></a-select>
+          <a-input v-model:value="formState.subjectName" style="width: 200px"></a-input>
+          <img src="~@/assets/images/add.png" @click="addQuery"/>
+        </a-col>
+        <a-col :span="24" class="query-row" v-for="(it,index) in queryList">
+          <a-select v-model:value="it.oper" :options="operTexts" class="operTexts"></a-select>
+          <a-select v-model:value="it.field" :options="fieldList" class="operTexts"></a-select>
+          <a-input v-model:value="it.key" style="width: 200px"></a-input>
+          <img src="~@/assets/images/sub.png" @click="onDelete(index)"/>
+        </a-col>
+
+      </a-row>
+      <a-row>
+        <a-col :span="4" style="text-align: right">
+          <a-button type="primary" html-type="submit" @click="onQuery">查询</a-button>
+          <a-button style="margin: 0 8px" @click="() => {formRef.resetFields();}">重置</a-button>
+        </a-col>
+      </a-row>
+    </a-form>
+  </div>
+</template>
+
+
+<script lang="ts">
+import {reactive, defineComponent, ref} from 'vue';
+import {useRoute, useRouter} from "vue-router";
+import {DownOutlined, UpOutlined} from "@ant-design/icons-vue";
+import type {FormInstance, SelectProps} from "ant-design-vue";
+
+export default defineComponent({
+  name: 'domainESIndex',
+  components: {DownOutlined, UpOutlined},
+  setup() {
+
+    const route = useRoute();
+    const router = useRouter();
+    const formRef = ref<FormInstance>();
+    const formState = reactive({
+      page: 1, rows: 10, subjectName: '', tabName: '', tabCode: null, total: 0
+    });
+    const queryList= ref<any>([]);
+
+    const operTexts = [
+      {value: '=', label: '等于'},
+      {value: 'like', label: '包含'},
+      {value: 'null', label: '为空'},
+      {value: 'not null', label: '不为空'}
+    ] as SelectProps['options'];
+
+    const fieldList = [
+      {value: '', label: '不限'},
+      {value: 'wellId', label: '井号'},
+      {value: 'wellName', label: '井名'}
+    ] as SelectProps['options'];
+
+    const onQuery = () => {
+      console.log("");
+    }
+    function addQuery(){
+      queryList.value.push({});
+    }
+    function onDelete(index) {
+      queryList.value.splice(index, 1);
+    }
+    return {
+      router, route, formState, formRef, onQuery, operTexts, fieldList,addQuery,queryList,onDelete
+    };
+  },
+  created() {
+  },
+  activated() {
+  }
+});
+</script>
+
+<style lang="less">
+.ant-row {
+
+  .ant-col {
+    margin: 10px 0px;
+
+    .col-title {
+      width: 120px;
+      text-align: left;
+      float: left;
+    }
+  }
+  .query-row{
+    display: flex;
+
+    img{
+      margin-left:5px;
+    }
+  }
+}
+.operTexts{
+  width:80px;
+}
+</style>

+ 13 - 0
vue/src/views/domainES/result.vue

@@ -0,0 +1,13 @@
+<template>
+
+</template>
+
+<script>
+export default {
+  name: "result.vue"
+}
+</script>
+
+<style scoped>
+
+</style>

+ 26 - 7
vue/src/views/wellinfo/index.vue

@@ -58,16 +58,26 @@
             </a-col>
             <a-col :span="6">
               <a-form-item name="well_type" label="井型:">
-                <a-select ref="select" v-model:value="formState.well_type"
-                          :options="wellTypeList" :field-names="{label:'name',value:'value'}" :allow-clear="true">
-                </a-select>
+                <a-tree-select
+                  v-model:value="formState.well_type"
+                  show-search
+                  allow-clear
+                  tree-line
+                  :tree-data="wellTypeTree"
+                  tree-node-filter-prop="label">
+                </a-tree-select>
               </a-form-item>
             </a-col>
             <a-col :span="6">
               <a-form-item name="well_type" label="井别:">
-                <a-select ref="select" v-model:value="formState.well_purpose"
-                          :options="wellPurposeList" :field-names="{label:'name',value:'value'}" :allow-clear="true">
-                </a-select>
+                <a-tree-select
+                  v-model:value="formState.well_purpose"
+                  show-search
+                  allow-clear
+                  tree-line
+                  :tree-data="wellPurposeTree"
+                  tree-node-filter-prop="label">
+                </a-tree-select>
               </a-form-item>
             </a-col>
             <a-col :span="6" style="text-align: left">
@@ -380,6 +390,15 @@ export default defineComponent({
       businessType: [] as any[],
       selectBusinessType: [] as any[]
     })
+    const wellPurposeTree =ref([]);
+    get('wellInfo/getWellPurposeTree', {}).then(data => {
+      wellPurposeTree.value = data;
+    });
+
+    const wellTypeTree =ref([]);
+    get('wellInfo/getWellTypeTree', {}).then(data => {
+      wellTypeTree.value = data;
+    });
 
     function onBusTypeChange(checked, it) {
       if (checked) {
@@ -645,7 +664,7 @@ export default defineComponent({
       treeOnExpand,
       subjectTrees, fileOptions, onBusTypeChange,
       getSubjectTree, searchTree,
-      treeOnSelect, pagination, getSettingColoumns,
+      treeOnSelect, pagination, getSettingColoumns,wellPurposeTree,wellTypeTree,
       handleResizeColumn: (w, col) => {
         col.width = w;
       }