Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/resources/mapping/cquery/WellInfoCQuery.xml
周壕 10 kuukautta sitten
vanhempi
commit
df8dd54e4a

+ 38 - 2
src/main/java/com/bowintek/practice/controller/system/LogController.java

@@ -3,14 +3,22 @@ package com.bowintek.practice.controller.system;
 import com.bowintek.practice.filter.exception.BaseException;
 import com.bowintek.practice.filter.exception.BaseResponse;
 import com.bowintek.practice.filter.exception.RespGenerstor;
+import com.bowintek.practice.model.SrSubject;
 import com.bowintek.practice.services.service.AccountService;
 import com.bowintek.practice.services.service.system.LogService;
+import com.bowintek.practice.util.DateUtils;
+import com.bowintek.practice.util.ExcelHelper;
+import com.bowintek.practice.vo.SubjectVo;
 import com.bowintek.practice.vo.system.LogModel;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Date;
+import java.util.List;
 
 @RestController
 @RequestMapping("/api/system/log")
@@ -20,10 +28,14 @@ public class LogController {
     private LogService logService;
     @Autowired
     private AccountService accountService;
+    @Autowired
+    private DateUtils dateUtils;
 
     @GetMapping("/getList")
-    public BaseResponse<PageInfo<LogModel>> getList(@RequestParam("page") int page, @RequestParam("rows") int rows, @RequestParam(required = false) String loginID
-            , @RequestParam(required = false) String userName, @RequestParam(required = false) Date startDate, @RequestParam(required = false) Date endDate) {
+    public BaseResponse<PageInfo<LogModel>> getList(@RequestParam("page") int page, @RequestParam("rows") int rows,
+                                                    @RequestParam(required = false) String loginID
+            , @RequestParam(required = false) String userName, @RequestParam(required = false) Date startDate,
+                                                    @RequestParam(required = false) Date endDate) {
 
         return RespGenerstor.success(logService.getList(page, rows, loginID, userName,startDate,endDate));
     }
@@ -33,4 +45,28 @@ public class LogController {
         logService.save(data.getPageName(),data.getPageUrl(),data.getActionName(), accountService.getLoginUserID());
         return RespGenerstor.success(true);
     }
+    @ResponseBody
+    @GetMapping("/exportLog")
+    public void exportSubject(HttpServletResponse response,
+                              @RequestParam(required = false) String loginID
+            , @RequestParam(required = false) String userName, @RequestParam(required = false) Date startDate,
+                              @RequestParam(required = false) Date endDate) throws Exception {
+        List<LogModel> dataList = logService.getList(1, 9999,  loginID, userName,startDate,endDate).getList();
+
+        ExcelHelper excelHelper = new ExcelHelper();
+        ExcelHelper.ExcelData data = excelHelper.new ExcelData();
+        data.setTitles(Arrays.asList(new String[]{"登录账号", "姓名", "操作页面", "操作时间"}));
+
+        List<List<Object>> rowData = new ArrayList();
+        for (LogModel item : dataList) {
+            List<Object> row = new ArrayList();
+            row.add(item.getLoginID());
+            row.add(item.getUserName());
+            row.add(item.getPageName());
+            row.add(dateUtils.dateToStr(item.getLogTime()));
+            rowData.add(row);
+        }
+        data.setRows(rowData);
+        excelHelper.exportExcel(response, data);
+    }
 }

+ 1 - 0
src/main/java/com/bowintek/practice/util/ExcelHelper.java

@@ -334,6 +334,7 @@ public class ExcelHelper {
         XSSFCellStyle defaultStyle = wb.createCellStyle();
         //dataStyle.setAlignment(HorizontalAlignment.CENTER);
         //dataStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+
         defaultStyle.setFont(dataFont);
         setBorder(defaultStyle, BorderStyle.THIN, new XSSFColor(new java.awt.Color(188, 188, 188), new DefaultIndexedColorMap()));
 

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

@@ -52,9 +52,8 @@
         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,
-        well_stt.well_coordinates_x x,
-        well_stt.well_coordinates_y y
+        fact_mon.oil_prod_mon,fact_mon.gas_prod_mon,fact_mon.gas_prod_year,fact_mon.oil_prod_year
+        ,fact_mon.water_prod_mon,fact_mon.water_prod_year
         from by_dwr.fact_dwr_well_basic_information well
         left join (
         select daily.* from by_dwr.fact_dwr_pc_pro_well_vol_d daily
@@ -68,7 +67,6 @@
         select well_id, max(prod_date) prod_date from by_dwr.fact_dwr_pc_pro_well_vol_m group by well_id
         ) maxmon on mon.well_id=maxmon.well_id and mon.prod_date=maxmon.prod_date
         )fact_mon on well.well_id= fact_mon.well_id
-        left join by_dwr.fact_dwr_well_structure well_stt on well.well_id = well_stt.well_id
         where 1=1
         <if test="well_common_name!='' and well_common_name!=null">
             and well.well_common_name like Concat('%',#{well_common_name},'%')
@@ -156,9 +154,11 @@
         select *
         from by_dwr.fact_dwr_wl_ach_borehole_inter bi
         where bi.well_id = #{well_id}
+        order by zone_no
     </select>
     <select id="selectTestHistoryList" 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
         from by_dm.dws_dm_test_history th
         where th.well_id = #{well_id}
     </select>
@@ -171,7 +171,7 @@
     <select id="getLastTestHistory" resultType="java.util.HashMap">
         select
             TO_CHAR(testing_date , 'YYYY-MM-dd') testing_date,
-            well_id, well_common_name, testing_name, anal_coy, construction_description, description
+            well_id, well_common_name, testing_name, anal_coy, construction_description
         from by_dm.dws_dm_test_history th
         where th.well_id = #{well_id}
         order by th.testing_date desc limit 1

BIN
target/classes/com/bowintek/practice/controller/system/LogController.class


BIN
target/classes/com/bowintek/practice/util/ExcelHelper.class


BIN
vue/public/favicon.ico


+ 8 - 1
vue/src/views/system/log/index.vue

@@ -27,6 +27,12 @@
           <a-button style="margin: 0 8px" @click="() => {formRef.resetFields();loadData()}">重置</a-button>
         </a-col>
       </a-row>
+      <a-row class="edit-operation">
+        <a-col :span="24" style="text-align: right">
+          <BExportExcel :title="'导出'" :filename="'日志信息'" :url="'system/log/exportLog'"
+                        :params="{...formState}"></BExportExcel>
+        </a-col>
+      </a-row>
     </a-form>
     <div class="search-result-list">
       <a-table :columns="columns" :data-source="dataList" :scroll="{ x:'100%', y: 500 }" :pagination="pagination"
@@ -49,10 +55,11 @@ import {getList} from '@/api/system/log';
 import {useRoute} from 'vue-router';
 import dayjs from 'dayjs';
 import {getPaginationTotalTitle} from "@/utils/common";
+import BExportExcel from "@/components/basic/excel/exportExcel/exportExcel.vue";
 
 export default defineComponent({
   name: 'LogList',
-  components: {DownOutlined, UpOutlined},
+  components: {DownOutlined, UpOutlined,BExportExcel},
   setup() {
     const route = useRoute();
     const expand = ref(false);

+ 0 - 2
vue/src/views/wellinfo/columns.ts

@@ -1,6 +1,4 @@
 export const boreholeInterColumns=[
-  {title: '井筒id', dataIndex: 'wellbore_id', key: 'wellbore_id', width: 120},
-  {title: '层位id', dataIndex: 'zone_id', key: 'zone_id', width: 120},
   {title: '层号(序号)', dataIndex: 'zone_no', key: 'zone_no', width: 120},
   {title: '裸眼井解释成果类型', dataIndex: 'borehole_inter_type_name', key: 'borehole_inter_type_name', width: 120},
   {title: '起始深度', dataIndex: 'start_depth', key: 'start_depth', width: 120},

+ 27 - 32
vue/src/views/wellinfo/detail.vue

@@ -44,32 +44,14 @@
           <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>
-          。
+            ,油嘴<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
+            ,日产油量<span>{{ dataModel.oil_prod_daily??0 }}</span>t/d
+            ,含水<span>{{ dataModel.water_cut??0 }}</span>%
+            ,动液面<span>{{ dataModel.start_pump_liq_level??0 }}</span>m
+            ,截止目前累产油<span>{{ dataModel.oil_prod_cum??0}}</span>吨。
         </p>
       </div>
     </a-card>
@@ -151,14 +133,27 @@
           <a-descriptions-item label="井筒生命阶段:">{{ dataModel.phase }}</a-descriptions-item>
           <a-descriptions-item label="通用井筒名:">{{ dataModel.wellbore_common_name }}</a-descriptions-item>
           <a-descriptions-item label="目的层:">{{ dataModel.target_formation }}</a-descriptions-item>
-          <a-descriptions-item label="审定测量深度:">{{ dataModel.authorized_md }}</a-descriptions-item>
-          <a-descriptions-item label="审定真垂直深度:">{{ dataModel.authorized_tvd }}</a-descriptions-item>
+          <a-descriptions-item label="审定测量深度:">
+            {{ dataModel.authorized_md }}
+            <template v-if="dataModel.authorized_md">m</template>
+          </a-descriptions-item>
+          <a-descriptions-item label="审定真垂直深度:">{{ dataModel.authorized_tvd }}
+            <template v-if="dataModel.authorized_tvd">m</template>
+          </a-descriptions-item>
 
-          <a-descriptions-item label="井底测量深度:">{{ dataModel.bh_md }}</a-descriptions-item>
+          <a-descriptions-item label="井底测量深度:">{{ dataModel.bh_md }}
+            <template v-if="dataModel.bh_md">m</template>
+          </a-descriptions-item>
           <a-descriptions-item label="井底位置描述信息:" :span="2">{{ dataModel.geo_description_bh }}</a-descriptions-item>
-          <a-descriptions-item label="井底真垂直深度:">{{ dataModel.bh_tvd }}</a-descriptions-item>
-          <a-descriptions-item label="相对于参考面的造斜点深度:">{{ dataModel.ko_md }}</a-descriptions-item>
-          <a-descriptions-item label="实际造斜点真垂直深度:">{{ dataModel.ko_tvd }}</a-descriptions-item>
+          <a-descriptions-item label="井底真垂直深度:">{{ dataModel.bh_tvd }}
+            <template v-if="dataModel.bh_tvd">m</template>
+          </a-descriptions-item>
+          <a-descriptions-item label="相对于参考面的造斜点深度:">{{ dataModel.ko_md }}
+            <template v-if="dataModel.ko_md">m</template>
+          </a-descriptions-item>
+          <a-descriptions-item label="实际造斜点真垂直深度:">{{ dataModel.ko_tvd }}
+            <template v-if="dataModel.ko_tvd">m</template>
+          </a-descriptions-item>
           <a-descriptions-item label="地质单元:">{{ dataModel.project_name }}</a-descriptions-item>
           <a-descriptions-item label="单元类型:">{{ dataModel.project_type }}</a-descriptions-item>
           <a-descriptions-item label="单元等级:">{{ dataModel.project_level }}</a-descriptions-item>

+ 86 - 30
vue/src/views/wellinfo/index.vue

@@ -111,12 +111,15 @@
             <a-col :span="24" style="text-align: right">
               <a-checkbox-group v-model:value="showColumnType" @change="onCheckboxChange">
                 <a-row>
-                  <a-col :span="12">
+                  <a-col :span="8">
                     <a-checkbox value="oil">显示产油</a-checkbox>
                   </a-col>
-                  <a-col :span="12">
+                  <a-col :span="8">
                     <a-checkbox value="gas">显示产气</a-checkbox>
                   </a-col>
+                  <a-col :span="8">
+                    <a-checkbox value="water">显示产水</a-checkbox>
+                  </a-col>
                 </a-row>
               </a-checkbox-group>
               <a-radio-group v-model:value="viewModel" style="text-align: left">
@@ -149,6 +152,11 @@
                   <ChartCell :timeType="('month')" :dataType="('gas')" :wellId="record.well_id"></ChartCell>
                 </div>
               </template>
+              <template v-if="column.dataIndex === 'water'">
+                <div style="height:25px">
+                  <ChartCell :timeType="('month')" :dataType="('water')" :wellId="record.well_id"></ChartCell>
+                </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
@@ -192,24 +200,25 @@
                   <tr v-if="showColumnType.includes('oil')">
                     <th>最近月产油量:</th>
                     <td>
-                      {{item.oil_prod_mon == null ? "" : (item.oil_prod_mon + "t")}}
+                      {{ item.oil_prod_mon == null ? "" : (item.oil_prod_mon + "t") }}
                     </td>
                     <td colspan="2" rowspan="2">
                       <div style="height:25px">
-                        <ChartCell :timeType="('month')" :dataType="('oil')" :wellId="item.well_id" :lineColor="('#E63038')"></ChartCell>
+                        <ChartCell :timeType="('month')" :dataType="('oil')" :wellId="item.well_id"
+                                   :lineColor="('#E63038')"></ChartCell>
                       </div>
                     </td>
                   </tr>
                   <tr v-if="showColumnType.includes('oil')">
                     <th>累产油量:</th>
                     <td>
-                      {{item.oil_prod_year == null ? "" : (item.oil_prod_year + "t")}}
+                      {{ item.oil_prod_year == null ? "" : (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 ? "" : (item.gas_prod_mon + "m³") }}
                     </td>
                     <td colspan="2" rowspan="2">
                       <div style="height:25px">
@@ -220,7 +229,24 @@
                   <tr v-if="showColumnType.includes('gas')">
                     <th>累产气量:</th>
                     <td>
-                      {{item.gas_prod_year == null ? "" : (item.gas_prod_year + "m³")}}
+                      {{ item.gas_prod_year == null ? "" : (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") }}
+                    </td>
+                    <td colspan="2" rowspan="2">
+                      <div style="height:25px">
+                        <ChartCell :timeType="('month')" :dataType="('water')" :wellId="item.well_id"></ChartCell>
+                      </div>
+                    </td>
+                  </tr>
+                  <tr v-if="showColumnType.includes('water')">
+                    <th>累注水量:</th>
+                    <td>
+                      {{ item.water_prod_year == null ? "" : (item.water_prod_year + "10kt") }}
                     </td>
                   </tr>
                 </table>
@@ -287,10 +313,10 @@ export default defineComponent({
     const showQuery = ref(false);
     const selectedRowKeys = ref([]);
     const activeTab = ref("1");
-    const colspan =ref(8);
+    const colspan = ref(8);
     const showTree = ref(true);
     const isShowDoc = ref(false);
-    const showColumnType = ref(['oil', 'gas']);
+    const showColumnType = ref(['oil', 'gas', 'water']);
     const data = ref([{children: [], label: '', value: ''}]);
     const viewModel = ref("list");
     const tabsViewStore = useTabsViewStore();
@@ -339,7 +365,12 @@ export default defineComponent({
     }
     const gasHeader = () => {
       return {
-        style: {'border-top': '2px solid #0c6be2'},
+        style: {'border-top': '2px solid #009900'},
+      }
+    }
+    const waterHeader = () => {
+      return {
+        style: {'border-top': '2px solid #4472C4'},
       }
     }
     const filterColumns = ref([]);
@@ -398,7 +429,7 @@ export default defineComponent({
         customHeaderCell: oilHeader
       },
       {
-        title: '累产油量(t)',
+        title: '累产油量(10kt)',
         dataIndex: 'oil_prod_year',
         key: 'oil_prod_year',
         width: 120,
@@ -406,20 +437,35 @@ export default defineComponent({
       },
       {title: '累产油量趋势', dataIndex: 'oil', key: 'oil', width: 100, customHeaderCell: oilHeader},
       {
-        title: '最近月产气量(m³)',
+        title: '最近月产气量(10^4m³)',
         dataIndex: 'gas_prod_mon',
         key: 'gas_prod_mon',
-        width: 130,
+        width: 170,
         customHeaderCell: gasHeader
       },
       {
-        title: '累产气量(m³)',
+        title: '累产气量(10^8m³)',
         dataIndex: 'gas_prod_year',
         key: 'gas_prod_year',
-        width: 120,
+        width: 150,
         customHeaderCell: gasHeader
       },
       {title: '累产气量趋势', dataIndex: 'gas', key: 'gas', width: 100, customHeaderCell: gasHeader},
+      {
+        title: '最近注水量(t)',
+        dataIndex: 'water_prod_mon',
+        key: 'water_prod_mon',
+        width: 110,
+        customHeaderCell: waterHeader
+      },
+      {
+        title: '累注水量(10kt)',
+        dataIndex: 'water_prod_year',
+        key: 'water_prod_year',
+        width: 150,
+        customHeaderCell: waterHeader
+      },
+      {title: '累注水量趋势', dataIndex: 'water', key: 'water', width: 100, customHeaderCell: waterHeader},
       {title: '操作列', dataIndex: 'operation', key: 'operation', align: 'center', width: 120}
     ];
     filterColumns.value = columns as any;
@@ -438,18 +484,25 @@ export default defineComponent({
               return false
             }
           }
+          if (!showColumnType.value.includes("water")) {
+            if (["water_prod_mon", "water_prod_year", "water"].includes(item.dataIndex)) {
+              return false
+            }
+          }
           return true
         })
         filterColumns.value = filterValue as any;
       }
     );
 
-    const onCheckboxChange = () => {
+    const preCheckValues =ref( Object.assign(showColumnType.value));
+    const onCheckboxChange = (checkValues: []) => {
       setTimeout(() => {
         let tbody = document.getElementsByClassName("ant-table-body")[0];
         if (tbody) {
-          tbody.scrollLeft = tbody.scrollWidth;
+          tbody.scrollLeft = preCheckValues.value.length > checkValues.length ? 0 : tbody.scrollWidth;
         }
+        preCheckValues.value =checkValues;
       }, 300)
     }
     const getTdColor = (water_cut) => {
@@ -471,20 +524,20 @@ export default defineComponent({
       current: formState.page,
       pageSize: formState.rows,
       showSizeChanger: true,
-      pageSizeOptions:viewModel.value=="list"?['10', '20', '30', '40', '50']:['12', '24', '36', '48', '60'],
+      pageSizeOptions: viewModel.value == "list" ? ['10', '20', '30', '40', '50'] : ['12', '24', '36', '48', '60'],
       showTotal: total => getPaginationTotalTitle(total)
     }));
 
     watch(() => viewModel.value,
       () => {
-        pagination.value.current=1;
-        formState.page=1;
-        if(viewModel.value=="list"){
-          formState.rows=10;
-          pagination.value.pageSize=10;
-        }else{
-          formState.rows=12;
-          pagination.value.pageSize=12;
+        pagination.value.current = 1;
+        formState.page = 1;
+        if (viewModel.value == "list") {
+          formState.rows = 10;
+          pagination.value.pageSize = 10;
+        } else {
+          formState.rows = 12;
+          pagination.value.pageSize = 12;
         }
         loadData();
       });
@@ -605,7 +658,7 @@ export default defineComponent({
     }
     const treeOnSelect = function (selected, selectedNodes, node) {
       console.log(selected, selectedNodes, node);
-      if (selectedNodes.node.parent != undefined||activeTab.value == "1") {
+      if (selectedNodes.node.parent != undefined || activeTab.value == "1") {
         if (activeTab.value == "1") {
           formState.org_id_a1 = selected.length > 0 ? selectedNodes.node.key : '';
         } else {
@@ -628,7 +681,7 @@ export default defineComponent({
       formRef, viewModel, handleTableChange, detail,
       formState, isShowDoc, showDoc, docList, resetFields, showColumnType, filterColumns,
       labelCol, getTdColor, downFile,
-      tabChange, onCheckboxChange, treeRef,colspan,
+      tabChange, onCheckboxChange, treeRef, colspan,
       treeOnExpand,
       subjectTrees,
       getSubjectTree, searchTree,
@@ -733,7 +786,8 @@ export default defineComponent({
 }
 
 .well-card-table {
-  width:100%;
+  width: 100%;
+
   th {
     width: 25%;
     text-align: left;
@@ -765,10 +819,12 @@ export default defineComponent({
     margin-top: 5px;
   }
 }
-.ant-card-index:hover{
+
+.ant-card-index:hover {
   box-shadow: 3px 2px 10px #999;
   opacity: 0.8;
 }
+
 .color_level1, .ant-table-tbody > tr > td.color_level1:hover {
 }