Jelajahi Sumber

井筒-优化

xiaoqiao 9 bulan lalu
induk
melakukan
0fba579960

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

@@ -160,8 +160,8 @@ public class WellInfoController {
     }
 
     @PostMapping("/getOrgProjectList")
-    public BaseResponse getOrgProjectList(List<String> orgList,List<String> unitList) {
-        return RespGenerstor.success(wellInfoService.selectOrgProjectList(orgList, unitList));
+    public BaseResponse getOrgProjectList(@RequestBody WellInfoParams params) {
+        return RespGenerstor.success(wellInfoService.selectOrgProjectList(params.getOrgList(), params.getUnitList()));
     }
 
     @GetMapping("/downFile")

+ 7 - 4
src/main/java/com/bowintek/practice/services/impl/WellInfoServiceImpl.java

@@ -161,13 +161,17 @@ public class WellInfoServiceImpl implements WellInfoService {
     }
 
     private void fillChildren(int level, int maxLevel, HashMap<String, Object> parent, List<HashMap<String, Object>> unitList) {
+        this.fillChildren(level, maxLevel, parent, unitList,"project_id_");
+    }
+
+    private void fillChildren(int level, int maxLevel, HashMap<String, Object> parent, List<HashMap<String, Object>> unitList,String key){
         Map<Object, List<HashMap<String, Object>>> groupedMap = unitList.stream()
                 .collect(Collectors.groupingBy(s -> s.get("project_id_" + level)));
         List<HashMap<String, Object>> children = new ArrayList<>();
         parent.put("children", children);
         groupedMap.values().forEach(gm -> {
             HashMap<String, Object> child = new HashMap<>();
-            child.put("value", gm.get(0).get("project_id_" + level));
+            child.put("value", gm.get(0).get(key + level));
             child.put("label", gm.get(0).get("project_name_" + level));
             children.add(child);
             if (level + 1 <= maxLevel && gm.get(0).keySet().contains("project_id_" + (level + 1))) {
@@ -175,7 +179,6 @@ public class WellInfoServiceImpl implements WellInfoService {
             }
         });
     }
-
     @Override
     @SwitchDataSource(DBTypeEnum.POSTGRE)
     public List<HashMap<String, Object>> getConstructUnitTree() {
@@ -211,7 +214,7 @@ public class WellInfoServiceImpl implements WellInfoService {
             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);
+                this.fillChildren(2, 4, child, gm,"project_name_");
             }
         });
         return wellPurposeTree;
@@ -230,7 +233,7 @@ public class WellInfoServiceImpl implements WellInfoService {
             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);
+                this.fillChildren(2, 4, child, gm,"project_name_");
             }
         });
         return wellTypeTree;

+ 2 - 2
src/main/resources/mapping/cquery/FactWellCQuery.xml

@@ -60,7 +60,7 @@
                     COALESCE(wm.gas_prod_cum, 0)/100000000 gas_prod_mon,
                     COALESCE(wm.oil_prod_cum, 0)/10000 oil_prod_mon,
                     COALESCE(wm.water_prod_cum, 0)/10000 water_prod_mon,
-                    COALESCE(wm.liquid_prod_cum, 0)/10000 fluid_prod_mon,
+                    COALESCE(wm.fluid_prod_mon, 0)/10000 fluid_prod_mon,
                     COALESCE(wm.water_cut, 0) water_cut,
                     COALESCE(wm.inj_vol_cum, 0)/10000 inj_vol_cum
                 FROM by_dwr.fact_dwr_pc_pro_well_vol_d wm
@@ -114,7 +114,7 @@
                     COALESCE(wm.gas_prod_year, 0) gas_prod_year,
                     COALESCE(wm.oil_prod_year, 0)/10000 oil_prod_year,
                     COALESCE(wm.water_prod_year, 0)/10000 water_prod_year,
-                    COALESCE(wm.liquid_prod_year, 0)/10000 fluid_prod_year,
+                    COALESCE(wm.fluid_prod_year, 0)/10000 fluid_prod_year,
                     COALESCE(wm.water_cut_ratio_y, 0) water_cut_ratio_y,
                     COALESCE(wm.inj_vol_year, 0)/10000 inj_vol_year
                 FROM by_dwr.fact_dwr_pc_pro_well_vol_m wm

+ 2 - 2
src/main/resources/mapping/cquery/WellInfoCQuery.xml

@@ -373,9 +373,9 @@
     <select id="selectOrgProjectList" resultType="java.util.HashMap">
         select *from by_dim.dim_org_project dop where 1=1
 
-        <if test="projectList!=null and projectList.size>0">
+        <if test="unitList!=null and unitList.size>0">
             and dop.project_id in
-            <foreach collection="projectList" item="id" index="index" open="(" close=")" separator=",">
+            <foreach collection="unitList" item="id" index="index" open="(" close=")" separator=",">
                 #{id}
             </foreach>
         </if>

+ 4 - 4
vue/src/views/wellinfo/detail.vue

@@ -229,7 +229,7 @@
                             :style="cardSettings.buttonStyle"/>
       </template>
       <div v-if="cardSettings.cardTest.expand">
-        <p class="info-body">本井共实施
+        <p v-if="testHistoryList.length>0" class="info-body">本井共实施
           <template v-for="it in testHistorySummary">
             <span>{{ it.testing_num }}</span>次{{ it.testing_name }},
           </template>
@@ -283,15 +283,15 @@
                             :style="cardSettings.buttonStyle"/>
       </template>
       <div v-if="cardSettings.cardWork.expand">
-        <p class="info-body">
+        <p class="info-body" v-if="historyAssignmentList.length>0">
           井实施井下作业施工<span>{{ historyAssignmentCount }}</span>次,其中:
           <template v-for="it in historyAssignmentSummary">
             {{ it.test_processes_name }}<span>{{ it.testing_num }}</span>次、
           </template>
-          <span>{{ lastHistoryAssignment.start_time }}{{ lastHistoryAssignment.test_processes_name }}</span>
+          <span v-if="lastHistoryAssignment.test_processes_name">{{ lastHistoryAssignment.start_time }}{{ lastHistoryAssignment.test_processes_name }}</span>
           <span>{{
               lastHistoryAssignment.test_processes_name
-            }}</span>井段<span>{{ lastHistoryAssignment.well_production_sections }}</span></p>
+            }}</span><span v-if="lastHistoryAssignment.well_production_sections">井段{{ lastHistoryAssignment.well_production_sections }}</span></p>
         <br/>
         <a-table :columns="historyAssignmentColumns" :data-source="historyAssignmentList" :scroll="{ x:'100%', y: 500 }"
                  :pagination="false"

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

@@ -101,7 +101,9 @@
                   multiple
                   tree-line
                   :tree-data="subjectTrees.organizationTree"
-                  tree-node-filter-prop="label">
+                  tree-node-filter-prop="label"
+                  @change="onOrgTreeChange"
+                >
                 </a-tree-select>
               </a-form-item>
             </a-col>
@@ -391,12 +393,12 @@ export default defineComponent({
       businessType: [] as any[],
       selectBusinessType: [] as any[]
     })
-    const wellPurposeTree =ref([]);
+    const wellPurposeTree = ref([]);
     get('wellInfo/getWellPurposeTree', {}).then(data => {
       wellPurposeTree.value = data;
     });
 
-    const wellTypeTree =ref([]);
+    const wellTypeTree = ref([]);
     get('wellInfo/getWellTypeTree', {}).then(data => {
       wellTypeTree.value = data;
     });
@@ -645,9 +647,18 @@ export default defineComponent({
         loadData();
       }
     }
-    function filterUnitTree(treeData){
+    const orgUnitList :any= ref([]);
+
+    function filterUnitTree(treeData) {
       return treeData;
     }
+
+    function onOrgTreeChange() {
+      postData('wellInfo/getOrgProjectList', {orgList: formState.orgList}).then(data => {
+        orgUnitList.value = data;
+      })
+    }
+
     const showDoc = (id) => {
       get('wellInfo/getWellDocumentList', {wellId: id}).then(data => {
         docList.value = data;
@@ -662,13 +673,13 @@ export default defineComponent({
       route, selectedRowKeys, loading, activeTab, showTree, onSelectChange, data,
       expand, onQuery, loadData, onRangeChange, showQuery, wellTypeList, wellPurposeList, replaceFields,
       formRef, viewModel, handleTableChange, detail,
-      formState, isShowDoc, showDoc, docKey, docList, resetFields, showColumnType, filterColumns,filterUnitTree,
+      formState, isShowDoc, showDoc, docKey, docList, resetFields, showColumnType, filterColumns, filterUnitTree,
       labelCol, getTdColor, downFile,
       tabChange, onCheckboxChange, treeRef, colspan,
       treeOnExpand,
-      subjectTrees, fileOptions, onBusTypeChange,
+      subjectTrees, fileOptions, onBusTypeChange, onOrgTreeChange,
       getSubjectTree, searchTree,
-      treeOnSelect, pagination, getSettingColoumns,wellPurposeTree,wellTypeTree,numberToCurrencyNo,
+      treeOnSelect, pagination, getSettingColoumns, wellPurposeTree, wellTypeTree, numberToCurrencyNo,
       handleResizeColumn: (w, col) => {
         col.width = w;
       }