浏览代码

解析记录增加场站为空查询条件

fanxiaoyu 8 月之前
父节点
当前提交
b82f0fc056

+ 5 - 2
cpp-admin/src/main/java/com/cpp/web/service/datafactory/impl/ParsingLogServiceImpl.java

@@ -48,7 +48,10 @@ public class ParsingLogServiceImpl extends ServiceImpl<ParsingLogMapper, Parsing
     @Override
     public QueryWrapper<ParsingLog> getByStationCodeAndCreateTimeAndFileType(String stationCode, Date startTime, Date endTime, String fileType,String dataSources,String parsingDescribe,String parsingFileStatus) {
         QueryWrapper<ParsingLog> wrapper = new QueryWrapper<>();
-        if (stationCode != null && !"".equals(stationCode)){
+
+        if ("未知".equals(stationCode)){
+            wrapper.isNull("station_code");
+        }else if (stationCode != null && !"".equals(stationCode)){
             wrapper.eq("station_code", stationCode);
         }
         if (null != startTime && !"".equals(startTime) && null != endTime && !"".equals(endTime)){
@@ -64,7 +67,7 @@ public class ParsingLogServiceImpl extends ServiceImpl<ParsingLogMapper, Parsing
             wrapper.eq("parsing_describe","");
         }
         if ("notNull".equals(parsingDescribe)){
-            wrapper.isNotNull("parsing_describe");
+            wrapper.ne("parsing_describe","");
         }
         if (null != parsingFileStatus && !"".equals(parsingFileStatus) && "成功".equals(parsingFileStatus)){
             wrapper.eq("parsing_file_status",parsingFileStatus);

+ 3 - 0
cpp-admin/src/main/java/com/cpp/web/service/reprtdata/impl/ReportDataServiceImpl.java

@@ -87,6 +87,9 @@ public class ReportDataServiceImpl implements ReportDataService {
      */
     public List<String> getMin(Long startTime, Long endTime, String fileType) {
         List<String> list = new ArrayList<>();
+        if ("cdq".equals(fileType)){
+            startTime = startTime + 15 * 60 * 1000L;
+        }
         LocalDateTime start = LocalDateTime.ofInstant(Instant.ofEpochMilli(startTime), ZoneId.systemDefault());
         LocalDateTime end = LocalDateTime.ofInstant(Instant.ofEpochMilli(endTime), ZoneId.systemDefault());
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd_HHmm");

+ 88 - 70
cpp-ui/src/views/statistics/analyzeRecords/index.vue

@@ -14,7 +14,8 @@
         />
       </el-form-item>
       <el-form-item label="场站名称">
-        <el-select v-model="stationCode" placeholder="请选择" style="width: 150px" popper-class="cpp-popper">
+        <el-select v-model="stationCode" placeholder="请选择" style="width: 150px" popper-class="cpp-popper"
+                   @change="changeStationCode">
           <el-option
             v-for="item in stationList"
             :key="item.value"
@@ -119,8 +120,8 @@ export default {
       dataSourcesList: [],
       fileDescribeList: [
         {
-          value:'null',
-          label:'空'
+          value: 'null',
+          label: '空'
         },
         {
           value: 'notNull',
@@ -147,6 +148,63 @@ export default {
       tableData: [],
       loading: false,
       electricFieldTypeEnum: '',
+      windFileTypeList: [{
+        value: 'dq',
+        label: '短期'
+      }, {
+        value: 'rdq',
+        label: '调控后短期'
+      }, {
+        value: 'cdq',
+        label: '超短期'
+      }, {
+        value: 'rcdq',
+        label: '调控后超短期'
+      }, {
+        value: 'nwp',
+        label: 'Nwp'
+      }, {
+        value: 'cft',
+        label: '测风塔'
+      }, {
+        value: 'fj',
+        label: '风机'
+      }, {
+        value: 'rp',
+        label: '实发功率'
+      }, {
+        value: 'status',
+        label: '运行信息'
+      }],
+      photovoltaicFileTypeList: [{
+        value: 'dq',
+        label: '短期'
+      }, {
+        value: 'rdq',
+        label: '调控后短期'
+      }, {
+        value: 'cdq',
+        label: '超短期'
+      }, {
+        value: 'rcdq',
+        label: '调控后超短期'
+      }, {
+        value: 'nwp',
+        label: 'Nwp'
+      }, {
+        value: 'qxz',
+        label: '气象站'
+      }, {
+        value: 'nbq',
+        label: '逆变器'
+      }, {
+        value: 'rp',
+        label: '实发功率'
+      }, {
+        value: 'status',
+        label: '运行信息'
+      }],
+      allFileTypeList: []
     }
   },
   created() {
@@ -157,6 +215,9 @@ export default {
   },
   computed: {},
   methods: {
+    changeStationCode() {
+      this.getElectricFieldTypeEnum()
+    },
     handlePageChange({currentPage, pageSize}) {
       this.currentPage = currentPage
       this.pageSize = pageSize
@@ -176,7 +237,7 @@ export default {
       const s = (date.getSeconds() < 10 ? '0' : '') + date.getSeconds()
       return Y + M + D + h + m + s
     },
-    getDataSourcesEnum(){
+    getDataSourcesEnum() {
       this.$axios.get("/enumSelect/dataSourcesEnum").then(response => {
         this.dataSourcesList = response.data
       })
@@ -184,6 +245,7 @@ export default {
     getStationCode() {
       this.$axios({url: '/electricfield/all', method: 'get'}).then(response => {
         this.stationList = response.data
+        this.stationList.push({value: '未知', label: '未知'})
         if (this.stationList.length > 0) {
           this.stationCode = this.stationList[0].value
           this.getElectricFieldTypeEnum()
@@ -195,69 +257,25 @@ export default {
       const param = {
         "stationCode": this.stationCode,
       }
-      this.$axios.get('reportData/getElectricFieldTypeEnum', {params: param}).then(response => {
-        this.electricFieldTypeEnum = response.data
-        if (this.electricFieldTypeEnum === 'E1') {
-          this.fileType = [{
-            value: 'dq',
-            label: '短期'
-          }, {
-            value: 'rdq',
-            label: '调控后短期'
-          }, {
-            value: 'cdq',
-            label: '超短期'
-          }, {
-            value: 'rcdq',
-            label: '调控后超短期'
-          }, {
-            value: 'nwp',
-            label: 'Nwp'
-          }, {
-            value: 'qxz',
-            label: '气象站'
-          }, {
-            value: 'nbq',
-            label: '逆变器'
-          }, {
-            value: 'rp',
-            label: '实发功率'
-          }, {
-            value: 'status',
-            label: '运行信息'
-          }]
-        } else {
-          this.fileType = [{
-            value: 'dq',
-            label: '短期'
-          }, {
-            value: 'rdq',
-            label: '调控后短期'
-          }, {
-            value: 'cdq',
-            label: '超短期'
-          }, {
-            value: 'rcdq',
-            label: '调控后超短期'
-          }, {
-            value: 'nwp',
-            label: 'Nwp'
-          }, {
-            value: 'cft',
-            label: '测风塔'
-          }, {
-            value: 'fj',
-            label: '风机'
-          }, {
-            value: 'rp',
-            label: '实发功率'
-          }, {
-            value: 'status',
-            label: '运行信息'
-          }]
-        }
-        this.fileTypeName = this.fileType[0].value
-        this.queryByStationCode()
+      if (this.stationCode != '未知'){
+        this.$axios.get('reportData/getElectricFieldTypeEnum', {params: param}).then(response => {
+          this.electricFieldTypeEnum = response.data
+          if (this.electricFieldTypeEnum === 'E1') {
+            this.fileType = this.photovoltaicFileTypeList
+          } else {
+            this.fileType = this.windFileTypeList
+          }
+          this.fileTypeName = this.fileType[0].value
+          this.queryByStationCode()
+          this.getAllFileType()
+        })
+      }else {
+        this.fileType = this.allFileTypeList
+      }
+    },
+    getAllFileType(){
+      this.$axios.get('enumSelect/fileTypeEnum').then(response =>{
+        this.allFileTypeList = response.data
       })
     },
     queryByStationCode() {
@@ -300,9 +318,9 @@ export default {
       }
     },
     changeFileName(row) {
-      for (let i = 0; i < this.fileType.length; i++) {
-        if (row.cellValue === this.fileType[i].value) {
-          return this.fileType[i].label
+      for (let i = 0; i < this.allFileTypeList.length; i++) {
+        if (row.cellValue === this.allFileTypeList[i].value) {
+          return this.allFileTypeList[i].label
         }
       }
     },