فهرست منبع

井筒-优化

xiaoqiao 10 ماه پیش
والد
کامیت
80aa3958e5

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

@@ -80,10 +80,8 @@ public class WellInfoController {
 
         HashMap<String, Object> wellInfo = wellInfoService.getWellInfo(well_id);
         List<HashMap<String, Object>> boreholeInterList = wellInfoService.selectBoreholeInterList(well_id);
-        List<HashMap<String, Object>> testHistoryList = wellInfoService.selectTestHistoryList(well_id);
         List<HashMap<String, Object>> testHistorySummary = wellInfoService.selectTestHistorySummary(well_id);
         HashMap<String, Object> lastTestHistory = wellInfoService.getLastTestHistory(well_id);
-        List<HashMap<String, Object>> analyticalAssaysList = wellInfoService.selectAnalyticalAssaysList(well_id);
         List<HashMap<String, Object>> analyticalAssaysSummary = wellInfoService.selectAnalyticalAssaysSummary(well_id);
         List<HashMap<String, Object>> historyAssignmentList = wellInfoService.selectHistoryAssignmentList(well_id);
         List<HashMap<String, Object>> historyAssignmentSummary = wellInfoService.selectHistoryAssignmentSummary(well_id);
@@ -93,10 +91,10 @@ public class WellInfoController {
         HashMap<String, Object> result = new HashMap<>();
         result.put("dataModel", wellInfo);
         result.put("boreholeInterList", boreholeInterList);//业务解释列表
-        result.put("testHistoryList", testHistoryList);//测试历史列表
+        //result.put("testHistoryList", testHistoryList);//测试历史列表
         result.put("testHistorySummary", testHistorySummary);//测试历史汇总
         result.put("lastTestHistory", lastTestHistory);//最后一次测试历史
-        result.put("analyticalAssaysList", analyticalAssaysList);//分析化验列表
+        //result.put("analyticalAssaysList", analyticalAssaysList);//分析化验列表
         result.put("analyticalAssaysSummary", analyticalAssaysSummary);//分析化验汇总
         result.put("historyAssignmentList", historyAssignmentList);//作业简史列表
         result.put("historyAssignmentSummary", historyAssignmentSummary);//作业简史汇总
@@ -104,6 +102,24 @@ public class WellInfoController {
         result.put("dataIndexList", dataIndexList);
         return RespGenerstor.success(result);
     }
+    @ResponseBody
+    @GetMapping("/getTestHistoryList")
+    public BaseResponse<PageInfo<HashMap<String, Object>>> getTestHistoryList(@RequestParam("page") int page, @RequestParam("rows") int rows,
+                                                                             String well_id) throws Exception {
+
+        PageInfo<HashMap<String, Object>> result = wellInfoService.selectTestHistoryList(page, rows, well_id);
+
+        return RespGenerstor.success(result);
+    }
+    @ResponseBody
+    @GetMapping("/getAnalyticalAssaysList")
+    public BaseResponse<PageInfo<HashMap<String, Object>>> getAnalyticalAssaysList(@RequestParam("page") int page, @RequestParam("rows") int rows,
+                                                                              String well_id) throws Exception {
+
+        PageInfo<HashMap<String, Object>> result = wellInfoService.selectAnalyticalAssaysList(page, rows, well_id);
+
+        return RespGenerstor.success(result);
+    }
 
     @ResponseBody
     @PostMapping("/saveExpendSetting")

+ 10 - 5
src/main/java/com/bowintek/practice/services/impl/WellInfoServiceImpl.java

@@ -76,8 +76,11 @@ public class WellInfoServiceImpl implements WellInfoService {
 
     @Override
     @SwitchDataSource(DBTypeEnum.POSTGRE)
-    public List<HashMap<String, Object>> selectTestHistoryList(String well_id) {
-        return wellInfoCQuery.selectTestHistoryList(well_id);
+    public  PageInfo<HashMap<String, Object>> selectTestHistoryList(Integer page, Integer rows,String well_id) {
+        PageHelper.startPage(page, rows);
+        List<HashMap<String, Object>> dataList =  wellInfoCQuery.selectTestHistoryList(well_id);
+        PageInfo<HashMap<String, Object>> result = new PageInfo(dataList);
+        return result;
     }
 
     @Override
@@ -92,10 +95,12 @@ public class WellInfoServiceImpl implements WellInfoService {
         return wellInfoCQuery.getLastTestHistory(well_id);
     }
 
-    @Override
     @SwitchDataSource(DBTypeEnum.POSTGRE)
-    public List<HashMap<String, Object>> selectAnalyticalAssaysList(String well_id) {
-        return wellInfoCQuery.selectAnalyticalAssaysList(well_id);
+    public  PageInfo<HashMap<String, Object>> selectAnalyticalAssaysList(Integer page, Integer rows,String well_id) {
+        PageHelper.startPage(page, rows);
+        List<HashMap<String, Object>> dataList =  wellInfoCQuery.selectAnalyticalAssaysList(well_id);
+        PageInfo<HashMap<String, Object>> result = new PageInfo(dataList);
+        return result;
     }
 
     @Override

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

@@ -13,10 +13,10 @@ public interface WellInfoService {
     PageInfo< HashMap<String, Object>> getList(Integer page, Integer rows, WellInfoParams params);
     PageInfo<HashMap<String, Object>> getMapList(Integer page, Integer rows, WellInfoParams params);
     List<HashMap<String,Object>> selectBoreholeInterList(String well_id);
-    List<HashMap<String,Object>> selectTestHistoryList(String well_id);
+    PageInfo<HashMap<String, Object>> selectTestHistoryList(Integer page, Integer rows,String well_id);
     List<HashMap<String, Object>> selectTestHistorySummary(String well_id);
     HashMap<String, Object> getLastTestHistory(String well_id);
-    List<HashMap<String,Object>> selectAnalyticalAssaysList(String well_id);
+    PageInfo<HashMap<String, Object>> selectAnalyticalAssaysList(Integer page, Integer rows,String well_id);
     List<HashMap<String,Object>> selectAnalyticalAssaysSummary(String well_id);
     List<HashMap<String,Object>> selectHistoryAssignmentList(String well_id);
     List<HashMap<String,Object>> selectHistoryAssignmentSummary(String well_id);

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

@@ -244,7 +244,6 @@
         from by_dm.dws_dm_test_history th
         where th.well_id = #{well_id}
         order by testing_date desc
-        limit 100
     </select>
     <select id="selectTestHistorySummary" resultType="java.util.HashMap">
         select testing_name, count(1) as testing_num
@@ -263,7 +262,6 @@
         from by_dm.dws_dm_analytical_assays_new aa
         where aa.well_id = #{well_id}
         order by item_code
-        limit 100
     </select>
     <select id="selectAnalyticalAssaysSummary" resultType="java.util.HashMap">
         SELECT item_code,

+ 16 - 0
vue/src/utils/common.ts

@@ -215,3 +215,19 @@ export const getPaginationTotalTitle = (total:number)=>{
   return `共 ${total} 条`;
 }
 
+export function numberToCurrencyNo(value) {
+  if (!value) return 0
+  // 获取整数部分
+  const intPart = Math.trunc(value)
+  // 整数部分处理,增加,
+  const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
+  // 预定义小数部分
+  let floatPart = ''
+  // 将数值截取为小数部分和整数部分
+  const valueArray = value.toString().split('.')
+  if (valueArray.length === 2) { // 有小数部分
+    floatPart = valueArray[1].toString() // 取得小数部分
+    return intPartFormat + '.' + floatPart
+  }
+  return intPartFormat + floatPart
+}

+ 74 - 13
vue/src/views/wellinfo/detail.vue

@@ -30,21 +30,21 @@
 
         <p>
           <template v-if="dataModel.prod_horizon">
-            投产于<span>{{ dataModel.start_prod_date }}</span>
+            投产于<span>{{ dataModel.start_prod_date }}</span>
           </template>
           <template v-if="dataModel.prod_horizon">
-            生产层位<span>{{ dataModel.prod_horizon }}</span>
+            生产层位<span>{{ dataModel.prod_horizon }}</span>层位。
           </template>
           <template v-if="dataModel.recent_testing_date">
-            层位 <span>{{ dataModel.recent_testing_date }}</span>
+            <span>{{ dataModel.recent_testing_date }}</span>
           </template>
           <template v-if="dataModel.recent_testing_name">
-            进行最近一次<span>{{ dataModel.recent_testing_name }}</span>测试
+            进行最近一次<span>{{ dataModel.recent_testing_name }}</span>测试
           </template>
           <template v-if="dataModel.recent_prod_date">
-            最近一次产油时间<span>{{ dataModel.recent_prod_date }}</span>
+            最近一次产油时间<span>{{ dataModel.recent_prod_date }}</span>
           </template>
-          油嘴<span>{{ dataModel.oil_nozzle ?? 0 }}</span>mm
+          油嘴<span>{{ dataModel.oil_nozzle ?? 0 }}</span>mm
           ,油压<span>{{ dataModel.tubing_pres ?? 0 }}</span>MPa
           ,套压<span>{{ dataModel.casing_pres ?? 0 }}</span>MPa
           ,日产液量<span>{{ dataModel.fluid_prod_daily ?? 0 }}</span>t/d
@@ -231,14 +231,15 @@
       <div v-if="cardSettings.cardTest.expand">
         <p class="info-body">本井共实施
           <template v-for="it in testHistorySummary">
-            <span>{{ it.testing_num }}</span>次{{ it.testing_name }}
+            <span>{{ it.testing_num }}</span>次{{ it.testing_name }},
           </template>
           <span>{{ lastTestHistory.testing_date }}</span>进行最近一次<span>{{ lastTestHistory.testing_name }}</span>,
           <span>{{ lastTestHistory.construction_description }}</span>
         </p>
         <br/>
         <a-table :columns="testHistoryColumns" :data-source="testHistoryList" :scroll="{ x:'100%', y: 500 }"
-                 :pagination="false"
+                 :pagination="testHistoryPage"
+                 @change="handleTestHistoryChange"
                  bordered>
         </a-table>
       </div>
@@ -263,7 +264,8 @@
         </p>
         <br>
         <a-table :columns="analyticalAssaysColumns" :data-source="analyticalAssaysList" :scroll="{ x:'100%', y: 500 }"
-                 :pagination="false"
+                 :pagination="analyticalAssaysPage"
+                 @change="handleAnalyticalAssaysChange"
                  bordered>
         </a-table>
       </div>
@@ -347,6 +349,8 @@ import ChartProdDynmics from '@/components/basic/chart/chart-prod-dynamics.vue'
 import ChartMap from '@/components/basic/chart/chart-map.vue'
 import filePreview from '@/components/basic/file-preview/index.vue'
 import {download} from "@/utils/downloadFile";
+import {getPaginationTotalTitle} from "@/utils/common";
+import type {TableProps} from "ant-design-vue";
 
 export default defineComponent({
   name: 'wellinfoDetail',
@@ -369,6 +373,62 @@ export default defineComponent({
     })
     const wellId = ref(history.state.params?.id);
 
+    const testHistoryPage = ref({
+      total: 0,
+      current: 1,
+      pageSize: 10,
+      showSizeChanger: true,
+      showTotal: total => getPaginationTotalTitle(total)
+    });
+
+    const handleTestHistoryChange: TableProps['onChange'] = (
+      pag: { pageSize: number; current: number },
+    ) => {
+      testHistoryPage.value.current = pag.current;
+      testHistoryPage.value.pageSize = pag.pageSize;
+      loadTestHistoryData();
+    };
+
+    function loadTestHistoryData() {
+      let id = history.state.params?.id ?? wellData.dataModel.well_id;
+      get('wellInfo/getTestHistoryList', {
+        page: testHistoryPage.value.current,
+        rows: testHistoryPage.value.pageSize,
+        well_id: id
+      }).then(result => {
+        wellData.testHistoryList = result.list;
+        testHistoryPage.value.total = result.total;
+      })
+    }
+
+    const analyticalAssaysPage = ref({
+      total: 0,
+      current: 1,
+      pageSize: 10,
+      showSizeChanger: true,
+      showTotal: total => getPaginationTotalTitle(total)
+    });
+
+    const handleAnalyticalAssaysChange: TableProps['onChange'] = (
+      pag: { pageSize: number; current: number },
+    ) => {
+      analyticalAssaysPage.value.current = pag.current;
+      analyticalAssaysPage.value.pageSize = pag.pageSize;
+      loadAnalyticalAssaysData();
+    };
+
+    function loadAnalyticalAssaysData() {
+      let id = history.state.params?.id ?? wellData.dataModel.well_id;
+      get('wellInfo/getAnalyticalAssaysList', {
+        page: analyticalAssaysPage.value.current,
+        rows: analyticalAssaysPage.value.pageSize,
+        well_id: id
+      }).then(result => {
+        wellData.analyticalAssaysList = rowSpan(result.list);
+        analyticalAssaysPage.value.total = result.total;
+      })
+    }
+
     const fileOptions = reactive({
       docKey: '',
       businessType: [] as any[],
@@ -411,13 +471,14 @@ export default defineComponent({
       if (id == undefined) {
         return;
       }
+      loadTestHistoryData();
+      loadAnalyticalAssaysData();
+
       get('wellInfo/getWellInfo', {well_id: id}).then(data => {
         wellData.dataModel = data.dataModel;
         wellData.boreholeInterList = data.boreholeInterList;
-        wellData.testHistoryList = data.testHistoryList;
         wellData.testHistorySummary = data.testHistorySummary;
         wellData.lastTestHistory = data.lastTestHistory ?? {};
-        wellData.analyticalAssaysList = rowSpan(data.analyticalAssaysList);
         wellData.analyticalAssaysSummary = data.analyticalAssaysSummary;
         wellData.historyAssignmentList = data.historyAssignmentList;
         wellData.historyAssignmentSummary = data.historyAssignmentSummary;
@@ -476,8 +537,8 @@ export default defineComponent({
     return {
       ...toRefs(wellData),
       loadData, cardSettings,
-      onClose, ...columns,
-      dayjs, wellId, fileOptions, downFile, onBusTypeChange
+      onClose, ...columns,analyticalAssaysPage,handleAnalyticalAssaysChange,
+      dayjs, wellId, fileOptions, downFile, onBusTypeChange, handleTestHistoryChange, testHistoryPage
     };
   },
   created() {

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

@@ -234,7 +234,7 @@
                   <tr v-if="showColumnType.includes('oil')">
                     <th>最近月产油量:</th>
                     <td>
-                      {{ item.oil_prod_mon == null ? "" : (item.oil_prod_mon + "t") }}
+                      {{ item.oil_prod_mon == null ? "" : (numberToCurrencyNo(item.oil_prod_mon) + "t") }}
                     </td>
                     <td colspan="2" rowspan="2">
                       <div style="height:25px">
@@ -246,13 +246,13 @@
                   <tr v-if="showColumnType.includes('oil')">
                     <th>累产油量:</th>
                     <td>
-                      {{ item.oil_prod_year == null ? "" : (item.oil_prod_year + "t") }}
+                      {{ item.oil_prod_year == null ? "" : (numberToCurrencyNo(item.oil_prod_year) + "t") }}
                     </td>
                   </tr>
                   <tr v-if="showColumnType.includes('gas')">
                     <th>最近月产气量:</th>
                     <td>
-                      {{ item.gas_prod_mon == null ? "" : (item.gas_prod_mon + "m³") }}
+                      {{ item.gas_prod_mon == null ? "" : (numberToCurrencyNo(item.gas_prod_mon) + "m³") }}
                     </td>
                     <td colspan="2" rowspan="2">
                       <div style="height:25px">
@@ -263,13 +263,13 @@
                   <tr v-if="showColumnType.includes('gas')">
                     <th>累产气量:</th>
                     <td>
-                      {{ item.gas_prod_year == null ? "" : (item.gas_prod_year + "m³") }}
+                      {{ item.gas_prod_year == null ? "" : (numberToCurrencyNo(item.gas_prod_year) + "m³") }}
                     </td>
                   </tr>
                   <tr v-if="showColumnType.includes('water')">
                     <th>最近注水量:</th>
                     <td>
-                      {{ item.water_prod_mon == null ? "" : (item.water_prod_mon + "t") }}
+                      {{ item.water_prod_mon == null ? "" : (numberToCurrencyNo(item.water_prod_mon) + "t") }}
                     </td>
                     <td colspan="2" rowspan="2">
                       <div style="height:25px">
@@ -280,7 +280,7 @@
                   <tr v-if="showColumnType.includes('water')">
                     <th>累注水量:</th>
                     <td>
-                      {{ item.water_prod_year == null ? "" : (item.water_prod_year + "10kt") }}
+                      {{ item.water_prod_year == null ? "" : (numberToCurrencyNo(item.water_prod_year) + "10kt") }}
                     </td>
                   </tr>
                 </table>
@@ -356,6 +356,7 @@ import ChartMap from '@/components/basic/chart/chart-map.vue'
 import {download} from "@/utils/downloadFile";
 import {columns, filterColumns, formState, getTdColor} from './table'
 import filePreview from '@/components/basic/file-preview/index.vue'
+import {numberToCurrencyNo} from "@/utils/common";
 
 export default defineComponent({
   name: 'wellinfoindex',
@@ -664,7 +665,7 @@ export default defineComponent({
       treeOnExpand,
       subjectTrees, fileOptions, onBusTypeChange,
       getSubjectTree, searchTree,
-      treeOnSelect, pagination, getSettingColoumns,wellPurposeTree,wellTypeTree,
+      treeOnSelect, pagination, getSettingColoumns,wellPurposeTree,wellTypeTree,numberToCurrencyNo,
       handleResizeColumn: (w, col) => {
         col.width = w;
       }

+ 15 - 7
vue/src/views/wellinfo/table.ts

@@ -2,6 +2,7 @@ import type {TableColumnsType} from "ant-design-vue";
 import dayjs from "dayjs";
 import type {GetComponentProps} from "ant-design-vue/lib/vc-table/interface";
 import {reactive, ref} from "vue";
+import {numberToCurrencyNo} from "@/utils/common";
 
 
 const state = reactive({
@@ -207,7 +208,8 @@ export const columns: TableColumnsType = [
       record.oil_prod_begin_date == null ? "" : (dayjs(record.oil_prod_begin_date).format('YYYY-MM-DD'))
   },
   {title: '状态', dataIndex: 'well_state', key: 'well_state',resizable: true, width: 120, customHeaderCell: onHeaderCell},
-  {title: '设计井深(m)', dataIndex: 'budgeted_md', key: 'tempNo', width: 120, resizable: true,customHeaderCell: onHeaderCell},
+  {title: '设计井深(m)', dataIndex: 'budgeted_md', key: 'budgeted_md', width: 120, resizable: true,customHeaderCell: onHeaderCell,
+    customRender: ({record}) =>numberToCurrencyNo(record.budgeted_md)},
   {
     title: '含水率',
     dataIndex: 'water_cut',
@@ -226,14 +228,16 @@ export const columns: TableColumnsType = [
     dataIndex: 'oil_prod_mon',
     key: 'oil_prod_mon',
     width: 120,resizable: true,
-    customHeaderCell: oilDragHeader
+    customHeaderCell: oilDragHeader,
+    customRender: ({record}) =>numberToCurrencyNo(record.oil_prod_mon)
   },
   {
     title: '累产油量(10kt)',
     dataIndex: 'oil_prod_year',
     key: 'oil_prod_year',
     width: 120,resizable: true,
-    customHeaderCell: oilHeader
+    customHeaderCell: oilHeader,
+    customRender: ({record}) =>numberToCurrencyNo(record.oil_prod_year)
   },
   {title: '累产油量趋势', dataIndex: 'oil', key: 'oil', width: 100, customHeaderCell: oilHeader},
   {
@@ -241,14 +245,16 @@ export const columns: TableColumnsType = [
     dataIndex: 'gas_prod_mon',
     key: 'gas_prod_mon',
     width: 170,resizable: true,
-    customHeaderCell: gasDragHeader
+    customHeaderCell: gasDragHeader,
+    customRender: ({record}) =>numberToCurrencyNo(record.gas_prod_mon)
   },
   {
     title: '累产气量(10^8m³)',
     dataIndex: 'gas_prod_year',
     key: 'gas_prod_year',
     width: 150,resizable: true,
-    customHeaderCell: gasHeader
+    customHeaderCell: gasHeader,
+    customRender: ({record}) =>numberToCurrencyNo(record.gas_prod_year)
   },
   {title: '累产气量趋势', dataIndex: 'gas', key: 'gas', width: 100, customHeaderCell: gasHeader},
   {
@@ -256,14 +262,16 @@ export const columns: TableColumnsType = [
     dataIndex: 'water_prod_mon',
     key: 'water_prod_mon',
     width: 110,resizable: true,
-    customHeaderCell: waterDragHeader
+    customHeaderCell: waterDragHeader,
+    customRender: ({record}) =>numberToCurrencyNo(record.water_prod_mon)
   },
   {
     title: '累注水量(10kt)',
     dataIndex: 'water_prod_year',
     key: 'water_prod_year',
     width: 150,resizable: true,
-    customHeaderCell: waterHeader
+    customHeaderCell: waterHeader,
+    customRender: ({record}) =>numberToCurrencyNo(record.water_prod_year)
   },
   {title: '累注水量趋势', dataIndex: 'water', key: 'water', width: 100, customHeaderCell: waterHeader},
   {title: '操作列', dataIndex: 'operation', key: 'operation', align: 'center', width: 120}