Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master'

周壕 před 1 rokem
rodič
revize
60251177da

+ 15 - 7
src/main/resources/mapping/cquery/WellInfoCQuery.xml

@@ -8,12 +8,12 @@
                fact_daily.oil_prod_daily,
                fact_daily.water_cut,
                fact_daily.oil_prod_cum,
-               fact_intr.start_prod_date,
+               TO_CHAR(fact_intr.start_prod_date , 'YYYY-MM-dd') start_prod_date,
                fact_intr.prod_horizon,
-               fact_intr.recent_testing_date,
+               TO_CHAR(fact_intr.recent_testing_date , 'YYYY-MM-dd') recent_testing_date,
                fact_intr.recent_testing_name,
                fact_intr.construction_description,
-               fact_intr.recent_prod_date,
+               TO_CHAR(fact_intr.recent_prod_date , 'YYYY-MM-dd') recent_prod_date,
                fact_intr.oil_nozzle,
                fact_intr.tubing_pres,
                fact_intr.casing_pres,
@@ -48,7 +48,10 @@
     <select id="getWellInfoList" parameterType="com.bowintek.practice.vo.query.WellInfoParams"
             resultType="java.util.HashMap">
         select
-        well.*,fact_daily.oil_prod_begin_date,fact_daily.oil_prod_recent_date,fact_daily.current_state,fact_daily.water_cut,
+        well.*,
+        TO_CHAR(fact_daily.oil_prod_begin_date , 'YYYY-MM-dd') oil_prod_begin_date,
+        TO_CHAR(fact_daily.oil_prod_recent_date , 'YYYY-MM-dd') oil_prod_recent_date,
+               fact_daily.current_state,fact_daily.water_cut,
         fact_mon.oil_prod_mon,fact_mon.gas_prod_mon,fact_mon.gas_prod_year,fact_mon.oil_prod_year
         from by_dwr.fact_dwr_well_basic_information well
         left join (
@@ -163,7 +166,9 @@
         group by th.testing_name
     </select>
     <select id="getLastTestHistory" resultType="java.util.HashMap">
-        select *
+        select
+            TO_CHAR(testing_date , 'YYYY-MM-dd') testing_date,
+            well_id, well_common_name, testing_name, anal_coy, construction_description, description
         from by_dm.dws_dm_test_history th
         where th.well_id = #{well_id}
         order by th.testing_date desc limit 1
@@ -188,7 +193,8 @@
         GROUP BY item_code;
     </select>
     <select id="selectHistoryAssignmentList" resultType="java.util.HashMap">
-        select *
+        select   well_common_name, well_id, wellbore_id, event_id, test_id, TO_CHAR(start_time , 'YYYY-MM-dd') start_time,TO_CHAR(end_time , 'YYYY-MM-dd') end_time , constr_description, remarks, well_production_sections, formation_name, top_md, btm_md, thickness, layer_no,
+                 working_type, test_processes_name, worksummary, construct_no, work_team, pump_depth
         from by_dwr.fact_dwr_brief_history_assignment ha
         where ha.well_id = #{well_id}
     </select>
@@ -199,7 +205,9 @@
         group by bha.test_processes_name
     </select>
     <select id="getLastHistoryAssignment" resultType="java.util.HashMap">
-        select *
+        select
+            well_common_name, well_id, wellbore_id, event_id, test_id, TO_CHAR(start_time , 'YYYY-MM-dd') start_time,TO_CHAR(end_time , 'YYYY-MM-dd') end_time , constr_description, remarks, well_production_sections, formation_name, top_md, btm_md, thickness, layer_no,
+               working_type, test_processes_name, worksummary, construct_no, work_team, pump_depth
         from by_dwr.fact_dwr_brief_history_assignment bha
         where bha.well_id = #{well_id}
         order by bha.start_time desc limit 1

+ 113 - 33
vue/src/views/wellinfo/detail.vue

@@ -3,7 +3,9 @@
   <div>
     <a-card :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
       <template #title>
-        <div slot="title" style="width:100%" @click="cardSettings.cardSummary.expand=!cardSettings.cardSummary.expand">井史简介</div>
+        <div slot="title" style="width:100%" @click="cardSettings.cardSummary.expand=!cardSettings.cardSummary.expand">
+          井史简介
+        </div>
       </template>
       <template #extra>
         <UpSquareOutlined v-if="cardSettings.cardSummary.expand" @click="cardSettings.cardSummary.expand=false"
@@ -14,28 +16,67 @@
       <div v-if="cardSettings.cardSummary.expand" class="info-body">
         <p>井名<span>{{ dataModel.well_common_name }}</span>构造位置<span>{{
             dataModel.structure_pos
-          }}</span>,于<span>{{ dataModel.spud_date }}</span>开钻,<span>{{ dataModel.end_drilling_date }}</span>完钻,采取<span>{{
-            dataModel.completion_method
-          }}</span>方式完井。
+          }}</span>
+          <template v-if="dataModel.spud_date">
+          ,于<span>{{ dataModel.spud_date }}</span>开钻
+          </template>
+          <template v-if="dataModel.end_drilling_date">
+          ,<span>{{ dataModel.end_drilling_date }}</span>完钻
+          </template>
+          <template v-if="dataModel.completion_method">
+            ,采取<span>{{dataModel.completion_method}}</span>方式完井。
+          </template>
         </p>
 
-        <p>投产于<span>{{ dataModel.start_prod_date }}</span>,生产层位<span>{{ dataModel.prod_horizon }}</span>层位
-          <span>{{ dataModel.recent_testing_date }}</span>进行最近一次<span>{{ dataModel.recent_testing_name }}</span>测试,最近一次产油时间<span>{{
-              dataModel.recent_prod_date
-            }}</span>,油嘴<span>{{ dataModel.oil_nozzle }}</span>mm,
-          油压<span>{{ dataModel.tubing_pres }}</span>MPa,套压<span>{{
-            dataModel.casing_pres
-          }}</span>MPa,日产液量<span>{{ dataModel.fluid_prod_daily }}</span>t/d,日产油量<span>{{
-            dataModel.oil_prod_daily
-          }}</span>t/d,含水<span>{{ dataModel.water_cut }}</span>%,动液面<span>{{ dataModel.start_pump_liq_level }}</span>m,截止目前累产油<span>{{
-            dataModel.oil_prod_cum
-          }}</span>吨。
+        <p>
+          <template v-if="dataModel.prod_horizon">
+            投产于<span>{{ dataModel.start_prod_date }}</span>
+          </template>
+          <template v-if="dataModel.prod_horizon">
+            ,生产层位<span>{{ dataModel.prod_horizon }}</span>
+          </template>
+          <template v-if="dataModel.recent_testing_date">
+            层位 <span>{{ dataModel.recent_testing_date }}</span>
+          </template>
+          <template v-if="dataModel.recent_testing_name">
+            进行最近一次<span>{{ dataModel.recent_testing_name }}</span>测试
+          </template>
+          <template v-if="dataModel.recent_prod_date">
+            ,最近一次产油时间<span>{{ dataModel.recent_prod_date }}</span>
+          </template>
+          <template v-if="dataModel.oil_nozzle">
+            ,油嘴<span>{{ dataModel.oil_nozzle }}</span>mm
+          </template>
+          <template v-if="dataModel.tubing_pres">
+            ,油压<span>{{ dataModel.tubing_pres }}</span>MPa
+          </template>
+          <template v-if="dataModel.casing_pres">
+            ,套压<span>{{ dataModel.casing_pres }}</span>MPa
+          </template>
+          <template v-if="dataModel.fluid_prod_daily">
+            ,日产液量<span>{{ dataModel.fluid_prod_daily }}</span>t/d
+          </template>
+          <template v-if="dataModel.oil_prod_daily">
+            ,日产油量<span>{{ dataModel.oil_prod_daily }}</span>t/d
+          </template>
+          <template v-if="dataModel.water_cut">
+            ,含水<span>{{ dataModel.water_cut }}</span>%
+          </template>
+          <template v-if="dataModel.start_pump_liq_level">
+            ,动液面<span>{{ dataModel.start_pump_liq_level }}</span>m
+          </template>
+          <template v-if="dataModel.oil_prod_cum">,截止目前累产油<span>{{
+              dataModel.oil_prod_cum
+            }}</span>吨
+          </template>
+          。
         </p>
       </div>
     </a-card>
-    <a-card  :bordered="false"  :headStyle="cardSettings.cardHeadStyle" class="card-detail">
+    <a-card :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
       <template #title>
-        <div slot="title" style="width:100%" @click="cardSettings.cardChat.expand=!cardSettings.cardChat.expand">生产动态</div>
+        <div slot="title" style="width:100%" @click="cardSettings.cardChat.expand=!cardSettings.cardChat.expand">生产动态
+        </div>
       </template>
       <template #extra>
         <UpSquareOutlined v-if="cardSettings.cardChat.expand" @click="cardSettings.cardChat.expand=false"
@@ -49,7 +90,9 @@
     </a-card>
     <a-card :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
       <template #title>
-        <div slot="title" style="width:100%" @click="cardSettings.cardBaseInfo.expand=!cardSettings.cardBaseInfo.expand">基本信息</div>
+        <div slot="title" style="width:100%"
+             @click="cardSettings.cardBaseInfo.expand=!cardSettings.cardBaseInfo.expand">基本信息
+        </div>
       </template>
       <template #extra>
         <UpSquareOutlined v-if="cardSettings.cardBaseInfo.expand" @click="cardSettings.cardBaseInfo.expand=false"
@@ -68,14 +111,28 @@
           <a-descriptions-item label="井型:">{{ dataModel.well_type }}</a-descriptions-item>
           <a-descriptions-item label="开钻日期:">{{ dataModel.spud_date }}</a-descriptions-item>
           <a-descriptions-item label="完钻日期:">{{ dataModel.end_drilling_date }}</a-descriptions-item>
-          <a-descriptions-item label="设计井深:">{{ dataModel.budgeted_md }}m</a-descriptions-item>
+          <a-descriptions-item label="设计井深:">{{
+              dataModel.budgeted_md == null ? "" : (dataModel.budgeted_md + "m")
+            }}
+          </a-descriptions-item>
           <a-descriptions-item label="完钻层位:">{{ dataModel.completion_formation }}</a-descriptions-item>
           <a-descriptions-item label="完井方式:">{{ dataModel.completion_method }}</a-descriptions-item>
           <a-descriptions-item label="生产井段:">{{ dataModel.well_production_sections }}</a-descriptions-item>
-          <a-descriptions-item label="T₇⁴顶深:">{{ dataModel.t74_top_depth }}m</a-descriptions-item>
-          <a-descriptions-item label="造斜点:">{{ dataModel.ko_azimuth }}m</a-descriptions-item>
-          <a-descriptions-item label="水平位移:">{{ dataModel.ko_horizontal_dislocation }}m</a-descriptions-item>
-          <a-descriptions-item label="方位角:">{{ dataModel.azimuth_angle }}°</a-descriptions-item>
+          <a-descriptions-item label="T₇⁴顶深:">{{
+              dataModel.t74_top_depth == null ? "" : (dataModel.t74_top_depth + "m")
+            }}
+          </a-descriptions-item>
+          <a-descriptions-item label="造斜点:">{{
+              dataModel.ko_azimuth == null ? "" : (dataModel.ko_azimuth + "m")
+            }}
+          </a-descriptions-item>
+          <a-descriptions-item label="水平位移:">
+            {{ dataModel.ko_horizontal_dislocation == null ? "" : (dataModel.ko_horizontal_dislocation + "m") }}
+          </a-descriptions-item>
+          <a-descriptions-item label="方位角:">{{
+              dataModel.azimuth_angle == null ? "" : (dataModel.azimuth_angle + "°")
+            }}
+          </a-descriptions-item>
           <a-descriptions-item label="井位坐标X:">{{ dataModel.well_coordinates_x }}</a-descriptions-item>
           <a-descriptions-item label="井位坐标y:">{{ dataModel.well_coordinates_y }}</a-descriptions-item>
         </a-descriptions>
@@ -123,7 +180,9 @@
     </a-card>
     <a-card :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
       <template #title>
-        <div slot="title" style="width:100%" @click="cardSettings.cardExplain.expand=!cardSettings.cardExplain.expand">业务解释</div>
+        <div slot="title" style="width:100%" @click="cardSettings.cardExplain.expand=!cardSettings.cardExplain.expand">
+          业务解释
+        </div>
       </template>
       <template #extra>
         <UpSquareOutlined v-if="cardSettings.cardExplain.expand" @click="cardSettings.cardExplain.expand=false"
@@ -140,7 +199,8 @@
     </a-card>
     <a-card :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
       <template #title>
-        <div slot="title" style="width:100%" @click="cardSettings.cardFile.expand=!cardSettings.cardFile.expand">相关文档</div>
+        <div slot="title" style="width:100%" @click="cardSettings.cardFile.expand=!cardSettings.cardFile.expand">相关文档
+        </div>
       </template>
       <template #extra>
         <UpSquareOutlined v-if="cardSettings.cardFile.expand" @click="cardSettings.cardFile.expand=false"
@@ -160,9 +220,10 @@
         </a-table>
       </div>
     </a-card>
-    <a-card  :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
+    <a-card :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
       <template #title>
-        <div slot="title" style="width:100%" @click="cardSettings.cardTest.expand=!cardSettings.cardTest.expand">测试历史</div>
+        <div slot="title" style="width:100%" @click="cardSettings.cardTest.expand=!cardSettings.cardTest.expand">测试历史
+        </div>
       </template>
       <template #extra>
         <UpSquareOutlined v-if="cardSettings.cardTest.expand" @click="cardSettings.cardTest.expand=false"
@@ -187,7 +248,9 @@
     </a-card>
     <a-card :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
       <template #title>
-        <div slot="title" style="width:100%" @click="cardSettings.cardAnalysis.expand=!cardSettings.cardAnalysis.expand">分析化验</div>
+        <div slot="title" style="width:100%"
+             @click="cardSettings.cardAnalysis.expand=!cardSettings.cardAnalysis.expand">分析化验
+        </div>
       </template>
       <template #extra>
         <UpSquareOutlined v-if="cardSettings.cardAnalysis.expand" @click="cardSettings.cardAnalysis.expand=false"
@@ -210,7 +273,9 @@
     </a-card>
     <a-card :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
       <template #title>
-        <div slot="title" style="width:100%" @click="cardSettings.cardWork.expand=!cardSettings.cardWork.expand">作业简史(业务过程)</div>
+        <div slot="title" style="width:100%" @click="cardSettings.cardWork.expand=!cardSettings.cardWork.expand">
+          作业简史(业务过程)
+        </div>
       </template>
       <template #extra>
         <UpSquareOutlined v-if="cardSettings.cardWork.expand" @click="cardSettings.cardWork.expand=false"
@@ -237,7 +302,8 @@
     </a-card>
     <a-card :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
       <template #title>
-        <div slot="title" style="width:100%" @click="cardSettings.cardGIS.expand=!cardSettings.cardGIS.expand">GIS地图</div>
+        <div slot="title" style="width:100%" @click="cardSettings.cardGIS.expand=!cardSettings.cardGIS.expand">GIS地图
+        </div>
       </template>
       <template #extra>
         <UpSquareOutlined v-if="cardSettings.cardGIS.expand" @click="cardSettings.cardGIS.expand=false"
@@ -316,12 +382,12 @@ export default defineComponent({
         wellData.boreholeInterList = data.boreholeInterList;
         wellData.testHistoryList = data.testHistoryList;
         wellData.testHistorySummary = data.testHistorySummary;
-        wellData.lastTestHistory = data.lastTestHistory??{};
+        wellData.lastTestHistory = data.lastTestHistory ?? {};
         wellData.analyticalAssaysList = data.analyticalAssaysList;
         wellData.analyticalAssaysSummary = data.analyticalAssaysSummary;
         wellData.historyAssignmentList = data.historyAssignmentList;
         wellData.historyAssignmentSummary = data.historyAssignmentSummary;
-        wellData.lastHistoryAssignment = data.lastHistoryAssignment??{};
+        wellData.lastHistoryAssignment = data.lastHistoryAssignment ?? {};
         wellData.dataIndexList = data.dataIndexList;
         wellData.historyAssignmentCount = wellData.historyAssignmentSummary.reduce((total, it: any) => total + it.testing_num, 0);
       })
@@ -353,7 +419,7 @@ export default defineComponent({
 });
 </script>
 
-<style lang="less" scoped>
+<style lang="less">
 .card-detail {
   width: 100%;
   margin-top: 10px;
@@ -361,6 +427,20 @@ export default defineComponent({
   a {
     color: #1890ff;
   }
+  .ant-card-head-title{
+    font-weight: bold;
+    color:#1f37dd;
+  }
+  .ant-card-head {
+    padding: 0px 10px;
+    height: 35px;
+    cursor:pointer;
+  }
+
+  .ant-card-head-wrapper {
+    height: 35px;
+    margin-top: 5px;
+  }
 }
 
 .info-body {

+ 53 - 14
vue/src/views/wellinfo/index.vue

@@ -19,6 +19,7 @@
       </div>
       <div class="query-index-tree-box">
         <a-tree
+          ref="treeRef"
           :show-line="true" blockNode="true"
           :tree-data="subjectTrees.data"
           v-model:expandedKeys="subjectTrees.expandedKeys"
@@ -26,7 +27,9 @@
           :replace-fields="replaceFields"
           :autoExpandParent="subjectTrees.autoExpandParent"
           @expand="treeOnExpand" @select="treeOnSelect">
-          <template #switcherIcon="{ switcherCls }"><caret-down-outlined style="font-size:20px;" :class="switcherCls" /></template>
+          <template #switcherIcon="{ switcherCls }">
+            <caret-down-outlined style="font-size:20px;" :class="switcherCls"/>
+          </template>
           <template #title="{ label,value,children }">
                     <span v-if="label!=null&&label.indexOf(subjectTrees.searchStr) > -1">
                       {{ label.substr(0, label.indexOf(subjectTrees.searchStr)) }}
@@ -106,7 +109,7 @@
           </a-row>
           <a-row class="edit-operation">
             <a-col :span="24" style="text-align: right">
-              <a-checkbox-group v-model:value="showColumnType">
+              <a-checkbox-group v-model:value="showColumnType" @change="onCheckboxChange">
                 <a-row>
                   <a-col :span="12">
                     <a-checkbox value="oil">显示产油</a-checkbox>
@@ -147,7 +150,10 @@
                 </div>
               </template>
               <template v-if="column.key === 'well_common_name'">
-                <a-button type="link" size="small" @click="detail(record.well_id)">{{ record.well_common_name }}</a-button>
+                <a-button type="link" size="small" @click="detail(record.well_id)">{{
+                    record.well_common_name
+                  }}
+                </a-button>
               </template>
               <template v-if="column.key === 'operation'">
                 <a-button type="link" size="small" @click="showDoc(record.well_id)">相关文档</a-button>
@@ -158,7 +164,7 @@
         <div class="query-index-table" v-else>
           <a-row :gutter="[24,8]">
             <a-col :span="8" v-for="item in data">
-              <a-card :title="'井名:'+item.well_common_name" bodyStyle="padding: 10px;">
+              <a-card :title="'井名:'+item.well_common_name" class="ant-card-index" bodyStyle="padding: 10px;">
                 <template #extra>
                   <a-button type="link" @click="detail(item.well_id)">查看详情</a-button>
                   <a-button type="link" @click="showDoc(item.well_id)">相关文档</a-button>
@@ -184,7 +190,7 @@
                     <td>{{ item.oil_prod_recent_date }}</td>
                   </tr>
                   <tr>
-                    <th>月产油量:</th>
+                    <th>最近月产油量:</th>
                     <td>{{ item.oil_prod_mon }}t</td>
                     <td colspan="2" rowspan="2">
                       <div style="height:25px">
@@ -197,7 +203,7 @@
                     <td>{{ item.oil_prod_year }}t</td>
                   </tr>
                   <tr>
-                    <th>月产气量:</th>
+                    <th>最近月产气量:</th>
                     <td>{{ item.gas_prod_mon }}m³</td>
                     <td colspan="2" rowspan="2">
                       <div style="height:25px">
@@ -275,7 +281,7 @@ export default defineComponent({
     const activeTab = ref("1");
     const showTree = ref(true);
     const isShowDoc = ref(false);
-    const showColumnType = ref(['oil','gas']);
+    const showColumnType = ref(['oil', 'gas']);
     const data = ref([{children: [], label: '', value: ''}]);
     const viewModel = ref("list");
     const tabsViewStore = useTabsViewStore();
@@ -428,6 +434,14 @@ export default defineComponent({
         filterColumns.value = filterValue as any;
       }
     );
+    const onCheckboxChange = () => {
+      setTimeout(() => {
+        let v = document.getElementsByClassName("ant-table-body")[0];
+        if (v) {
+          v.scrollLeft = v.scrollWidth;
+        }
+      }, 300)
+    }
     const getTdColor = (water_cut) => {
       if (water_cut == null || water_cut <= 2) {
         return "";
@@ -486,6 +500,7 @@ export default defineComponent({
     const onQuery = () => {
       loadData();
     }
+    const treeRef = ref();
     const subjectTrees = ref({
       data: [],
       organizationTree: [],
@@ -516,6 +531,9 @@ export default defineComponent({
     getSubjectData();
 
     const searchTree = () => {
+      if (subjectTrees.value.searchStr == "") {
+        return;
+      }
       const expanded = dataList
         .map((item: any) => {
           if (item.label != null && item.label.indexOf(subjectTrees.value.searchStr) > -1) {
@@ -526,6 +544,7 @@ export default defineComponent({
         .filter((item, i, self) => item && self.indexOf(item) === i);
       subjectTrees.value.expandedKeys = expanded as string[];
       subjectTrees.value.autoExpandParent = true;
+      // (treeRef.value as any).scrollTo({key:expanded[0]});
     }
     const dataList: any[] = [];
     const generateList = (data: any[]) => {
@@ -582,8 +601,8 @@ export default defineComponent({
       expand, onQuery, loadData, onRangeChange, showQuery, wellTypeList, replaceFields,
       formRef, viewModel, handleTableChange, detail,
       formState, isShowDoc, showDoc, docList, resetFields, showColumnType, filterColumns,
-      labelCol, getTdColor,downFile,
-      tabChange,
+      labelCol, getTdColor, downFile,
+      tabChange, onCheckboxChange, treeRef,
       treeOnExpand,
       subjectTrees,
       getSubjectTree, searchTree,
@@ -690,27 +709,47 @@ export default defineComponent({
 .well-card-table {
   th {
     width: 25%;
-    text-align: right;
+    text-align: left;
+    font-size: 12px;
   }
 
   td {
     width: 25%;
     text-align: left;
+    font-size: 12px;
+  }
+}
+
+.ant-card-index {
+
+  .ant-card-head-title{
+    font-weight: bold;
+    color:#1f37dd;
+  }
+  .ant-card-head {
+    padding: 0px 10px;
+    height: 35px;
+    background-color: #F9FCFF;
+  }
+
+  .ant-card-head-wrapper {
+    height: 35px;
+    margin-top: 5px;
   }
 }
 
-.color_level1, .ant-table-tbody>tr>td.color_level1:hover {
+.color_level1, .ant-table-tbody > tr > td.color_level1:hover {
 }
 
-.color_level2, .ant-table-tbody>tr>td.color_level2:hover {
+.color_level2, .ant-table-tbody > tr > td.color_level2:hover {
   background-color: #EAF4FF !important;
 }
 
-.color_level3, .ant-table-tbody>tr>td.color_level3:hover {
+.color_level3, .ant-table-tbody > tr > td.color_level3:hover {
   background-color: #D5EAFF !important;
 }
 
-.color_level4, .ant-table-tbody>tr>td.color_level4:hover {
+.color_level4, .ant-table-tbody > tr > td.color_level4:hover {
   background-color: #B7DBFF !important;
 }
 </style>