Quellcode durchsuchen

1.告警测试相关调整
2.检修计划测试相关调整
3.站端准确率测试相关调整
4.上报数据测试相关调整

fanxiaoyu vor 6 Monaten
Ursprung
Commit
32df97aee6

+ 9 - 5
cpp-admin/src/main/java/com/cpp/web/controller/reportData/ReportDataController.java

@@ -54,7 +54,7 @@ public class ReportDataController {
      * @return
      */
     @GetMapping("/getData")
-    public R getData(String stationCode, String fileType, Long startTime, Long endTime) {
+    public R getData(String stationCode, String fileType, Long startTime, Long endTime,String status) {
 
         Map<String,Object> map = new HashMap<>();
 
@@ -65,7 +65,7 @@ public class ReportDataController {
         if (null == fileType)
             fileType = "";
 
-        resultList.addAll(getAllFileName(fileType, startTime, endTime, stationCode));
+        resultList.addAll(getAllFileName(fileType, startTime, endTime, stationCode,status));
 
         // 定义比较器
         Comparator<ParsingLog> timestampComparator = new Comparator<ParsingLog>() {
@@ -105,13 +105,13 @@ public class ReportDataController {
         return correctTimestampStr;
     }
 
-    public List<ParsingLog> getAllFileName(String fileType, Long startTime, Long endTime, String stationCode) {
+    public List<ParsingLog> getAllFileName(String fileType, Long startTime, Long endTime, String stationCode,String status) {
         List<ParsingLog> resultList = new ArrayList<>();
         String rCdqKey = iSysConfigService.selectConfigByKey("sync_regulation");
         // 获取应上报文件名
 //        List<String> shouldFileName = reportDataService.shouldFileName(fileType, startTime, endTime, rCdqKey);
         Map<String, List<String>> map = reportDataService.getFileResults(fileType, startTime, endTime, stationCode);
-        List<ParsingLog> parsingLogList = parsingLogService.findByTimeBetweenAndFileTypeAndStationCode(new Date(startTime), new Date(endTime), fileType, stationCode);
+        List<ParsingLog> parsingLogList = parsingLogService.findByTimeBetweenAndFileTypeAndStationCode(new Date(startTime - 15 * 60 * 1000L), new Date(endTime + 15 * 60 * 1000L), fileType, stationCode);
         if ("".equals(rCdqKey) || "true".equals(rCdqKey)) {
             map.remove("rcdq");
         }
@@ -141,8 +141,12 @@ public class ReportDataController {
                 }
             }
         }
+        if (null!=status){
+            return resultList.stream().filter(f -> f.getParsingFileStatus().equals(status)).collect(Collectors.toList());
+        }else {
+            return resultList;
+        }
 
-        return resultList;
 
     }
 

+ 1 - 1
cpp-admin/src/main/java/com/cpp/web/service/accuracy/impl/AccuracyPassRateServiceImpl.java

@@ -32,7 +32,7 @@ public class AccuracyPassRateServiceImpl extends ServiceImpl<AccuracyPassRateMap
     private ISysDictDataService dictDataService;
     @Override
     public List<AccuracyPassRate> findByTimeBetweenAndForecastTypeAndDataSourcesAndAgoAndForecastModelAndStationCode(Date startTime, Date endTime, ForecastTypeEnum forecastType, DataSourcesEnum dataSources, Integer ago, String forecastModel, String stationCode) {
-        QueryWrapper<AccuracyPassRate> wrapper = new QueryWrapper<>();
+            QueryWrapper<AccuracyPassRate> wrapper = new QueryWrapper<>();
         if (stationCode != null && !stationCode.equals("")) {
             wrapper.eq("station_code", stationCode);
         }

+ 1 - 1
cpp-admin/src/main/java/com/cpp/web/service/alarm/impl/AbnormalAlarmServiceImpl.java

@@ -48,7 +48,7 @@ public class AbnormalAlarmServiceImpl extends ServiceImpl<AbnormalAlarmMapper, A
             wrapper.eq("alarm_type", alarmType);
         }
 
-        if (stationCode != null && !stationCode.equals("")) {
+        if (!"all".equals(stationCode) && stationCode != null && !stationCode.equals("")) {
             wrapper.eq("station_code", stationCode);
         }
         return wrapper;

+ 9 - 1
cpp-ui/src/views/abnormalAlarm/index.vue

@@ -11,6 +11,7 @@
             start-placeholder="开始日期"
             end-placeholder="结束日期"
             :default-time="['00:00:00', '23:45:00']" popper-class="cpp-popper"
+            :picker-options="pickerOptions"
           />
         </el-form-item>
         <el-form-item label="场站名称">
@@ -133,7 +134,13 @@ export default {
       searchForm: {},
       tableData: [],
       loading: false,
-      alarmNum: 0
+      alarmNum: 0,
+      // 日期使用
+      pickerOptions: {
+        disabledDate: (time) => {
+          return time.getTime() >=  new Date(new Date().toLocaleDateString()).getTime() + 60 * 60 * 24 * 1000 - 1
+        }
+      },
     }
   },
   created() {
@@ -210,6 +217,7 @@ export default {
     async getStationCode() {
       await this.$axios({url: '/electricfield/all', method: 'get'}).then(response => {
         this.stationList = response.data
+        this.stationList.push({value: 'all', label: '全部'})
         if (this.stationList.length > 0) {
           this.stationCode = this.stationList[0].value
           this.dataQuery()

+ 33 - 2
cpp-ui/src/views/statistics/reportData/index.vue

@@ -11,10 +11,11 @@
           end-placeholder="结束日期"
           :default-time="['00:00:00', '23:59:59']"
           popper-class="cpp-popper"
+          :picker-options="pickerOptions"
         />
       </el-form-item>
       <el-form-item label="场站名称">
-        <el-select v-model="stationCode" placeholder="请选择" style="width: 255px" popper-class="cpp-popper">
+        <el-select v-model="stationCode" placeholder="请选择" style="width: 255px" popper-class="cpp-popper" @change="changeFileType">
           <el-option
             v-for="item in stationList"
             :key="item.value"
@@ -33,6 +34,16 @@
           </el-option>
         </el-select>
       </el-form-item>
+      <el-form-item label="上报状态">
+        <el-select v-model="reportStatus" placeholder="请选择" style="width: 255px" popper-class="cpp-popper" clearable>
+          <el-option
+            v-for="item in reportStatusList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value">
+          </el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" size="mini" style="margin-left: 5px" icon="el-icon-search"
                    @click="queryByStationCode">查询
@@ -96,7 +107,23 @@ export default {
       electricFieldTypeEnum: '',
       allFileTypeList: [],
       solarList:[],
-      windList:[]
+      windList:[],
+      pickerOptions: {
+        disabledDate: (time) => {
+          return time.getTime() > new Date(new Date().toLocaleDateString()).getTime()+24 * 60 * 60 * 1000 -1
+        }
+      },
+      reportStatus: '',
+      reportStatusList: [
+        {
+          value: "成功",
+          label: "成功"
+        },
+        {
+          value: "失败",
+          label: "失败"
+        },
+      ]
     }
   },
   created() {
@@ -134,6 +161,9 @@ export default {
       const s = (date.getSeconds() < 10 ? '0' : '') + date.getSeconds()
       return Y + M + D + h + m + s
     },
+    changeFileType(){
+      this.queryByStationCode()
+    },
     getStationCode() {
       this.$axios({url: '/electricfield/all', method: 'get'}).then(response => {
         this.stationList = response.data
@@ -156,6 +186,7 @@ export default {
         "fileType": this.fileTypeName,
         "startTime": startTime,
         "endTime": endTime,
+        "status": this.reportStatus
       }
       this.$axios.get('/reportData/getData', {params: param}).then(response => {
         this.tableData = response.data.data

+ 20 - 17
cpp-ui/src/views/statistics/stationAccuracy/index.vue

@@ -12,6 +12,7 @@
             end-placeholder="结束日期"
             :default-time="['00:00:00', '23:45:00']"
             popper-class="cpp-popper"
+            :picker-options="pickerOptions"
           />
         </el-form-item>
         <el-form-item label="场站名称">
@@ -56,7 +57,7 @@
         style="color: #FF0000">{{ this.forecastTypeInfo }}</span>]-[预测<span
         style="color: #FF0000">{{ this.forecastTypeInfo == '短期' ? 'D+' : 'T+' }}{{ this.agoInfo }}</span>]-结果统计
       </div>
-      <el-row :gutter="20">
+      <el-row :gutter="20" style="">
         <el-col :span="8">
           <vxe-table
             align="center"
@@ -67,7 +68,7 @@
             resizable
             highlight-current-row
             show-overflow
-            height="790"
+            height="700"
             :data="tableData.slice((currentPage-1)*pageSize,currentPage*pageSize)"
             :cell-class-name="cellClassName"
           >
@@ -92,12 +93,12 @@
           </vxe-pager>
 
         </el-col>
-        <el-col :span="16">
+        <el-col :span="16" style="margin-top: -47px">
           <el-row>
-            <div style="float:left;width: 100%;height: 413px" id="zqlCharts"></div>
+            <div style="float:left;width: 100%;height: 410px" id="zqlCharts"></div>
           </el-row>
           <el-row>
-            <div style="float:left;width: 100%;height: 413px" id="pcCharts"></div>
+            <div style="float:left;width: 100%;height: 410px" id="pcCharts"></div>
 
           </el-row>
 
@@ -132,7 +133,7 @@ export default {
       pcChart: null,
       zqlChart: null,
       activeName: 'first',
-      dateTime: [new Date(new Date().toLocaleDateString()).getTime() - 10 * 60 * 60 * 24 * 1000, new Date(new Date().toLocaleDateString()).getTime()],
+      dateTime: [new Date(new Date().toLocaleDateString()).getTime() - 15 * 60 * 60 * 24 * 1000, new Date(new Date().toLocaleDateString()).getTime() - 60 * 60 * 24 * 1000],
       total: 0,
       sortOrder: 'asc',
       pageSize: 10,
@@ -160,6 +161,11 @@ export default {
       forecastTypeInfo: "",
       agoInfo: "",
       stationCodeInfo: "",
+      pickerOptions: {
+        disabledDate: (time) => {
+          return time.getTime() > new Date(new Date().toLocaleDateString()).getTime() -1
+        }
+      },
     }
   },
   created() {
@@ -220,8 +226,8 @@ export default {
         this.$message.warning("开始时间不能大于结束时间")
         return
       }
-      if (endTime - startTime > 60 * 60 * 24 * 1000 * 15) {
-        this.$message.warning("查询数据不能超过15天!")
+      if (endTime - startTime > 60 * 60 * 24 * 1000 * 30) {
+        this.$message.warning("查询数据不能超过30天!")
         return
       }
       let queryParams = {
@@ -233,10 +239,8 @@ export default {
         "forecastModel": '',
         "ago": this.ago
       }
-
       this.loading = true
       this.$axios.get('/accuracyPassRate/getByTimeBetweenAndForecastTypeAndDataSourcesAndForecastModelAndStationCode', {params: queryParams}).then(response => {
-
         this.agoInfo = this.points().filter(s => s.value == this.ago)[0].label
         this.forecastTypeInfo = this.forecastTypeList.filter(s => s.value == this.forecastType)[0].label
         this.stationCodeInfo = this.stationList.filter(s => s.value == this.stationCode)[0].label
@@ -246,13 +250,12 @@ export default {
         let times = []
         let pcDatas = []
         let zqlDatas = []
-
+        console.log(this.tableData)
         this.tableData.forEach(t => {
           times.push(t.time)
           zqlDatas.push(t.accuracy.replace("%", ""))
-          pcDatas.push(t.deviationSum.replace("%", ""))
+          pcDatas.push(t.deviationSum == null ? "" : t.deviationSum.replace("%", ""))
         })
-
         this.pcDraw(times, pcDatas)
         this.zqlDraw(times, zqlDatas)
         this.loading = false
@@ -322,8 +325,8 @@ export default {
         }],
         grid: {
           top: 100,
-          left: '2%',
-          right: '2%',
+          left: '3%',
+          right: '3%',
           bottom: '10%',
           containLabel: true
         },
@@ -466,8 +469,8 @@ export default {
         }],
         grid: {
           top: 100,
-          left: '2%',
-          right: '2%',
+          left: '3%',
+          right: '3%',
           bottom: '10%',
           containLabel: true
         },