Browse Source

站端准确率查询增加参数控制标准线功能

fanxiaoyu 7 tháng trước cách đây
mục cha
commit
5581bba7c5

+ 13 - 2
cpp-admin/src/main/java/com/cpp/web/controller/accuracy/AccuracyPassRateController.java

@@ -1,6 +1,7 @@
 package com.cpp.web.controller.accuracy;
 
 import com.cpp.common.core.domain.R;
+import com.cpp.system.service.ISysConfigService;
 import com.cpp.web.domain.accuracy.AccuracyPassRate;
 import com.cpp.web.domain.enums.DataSourcesEnum;
 import com.cpp.web.domain.enums.ForecastTypeEnum;
@@ -24,12 +25,22 @@ import java.util.*;
 public class AccuracyPassRateController {
     private final AccuracyPassRateService accuracyPassRateService;
 
-   private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+    private final ISysConfigService sysConfigService;
+
+
+    private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
 
     @GetMapping("/getByTimeBetweenAndForecastTypeAndDataSourcesAndForecastModelAndStationCode")
     public R getByTimeBetweenAndForecastTypeAndDataSourcesAndForecastModelAndStationCode(Long startTime, Long endTime, ForecastTypeEnum forecastType, DataSourcesEnum dataSources, Integer ago, String forecastModel, String stationCode) {
+        // 获取短期超短期标准线
+        String standLine = sysConfigService.selectConfigByKey("standardLine");
+        String[] lineNum = standLine.split(",");
+        Map<String,Object> map = new HashMap<>();
         List<AccuracyPassRate> accuracyPassRateList = accuracyPassRateService.findByTimeBetweenAndForecastTypeAndDataSourcesAndAgoAndForecastModelAndStationCode(new Date(startTime), new Date(endTime), forecastType, dataSources, ago, forecastModel, stationCode);
-        return R.ok(accuracyPassRateList);
+        map.put("tableData",accuracyPassRateList);
+        map.put("dq",lineNum[0]);
+        map.put("cdq",lineNum[1]);
+        return R.ok(map);
     }
     @GetMapping("/getBySingleMonthBetweenAndForecastTypeAndStationCode")
     public R getBySingleMonthBetweenAndForecastTypeAndStationCode(Long startTime, Long endTime, ForecastTypeEnum forecastType, DataSourcesEnum dataSources, String stationCode, String stationName, String uploadDataSources) {

+ 13 - 7
cpp-ui/src/views/statistics/stationAccuracy/index.vue

@@ -245,8 +245,8 @@ export default {
         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
-        this.tableData = response.data
-        this.total = response.data.length
+        this.tableData = response.data.tableData
+        this.total = response.data.tableData.length
 
         let times = []
         let pcDatas = []
@@ -256,8 +256,13 @@ export default {
           zqlDatas.push(t.accuracy.replace("%", ""))
           pcDatas.push(t.deviationSum == null ? "" : t.deviationSum.replace("%", ""))
         })
+        if (this.forecastType === 'dq'){
+          this.zqlDraw(times, pcDatas,response.data.dq)
+        }else {
+          this.zqlDraw(times, pcDatas,response.data.cdq)
+        }
+        // this.zqlDraw(times, zqlDatas,this.forecastType)
         this.pcDraw(times, pcDatas)
-        this.zqlDraw(times, zqlDatas,this.forecastType)
         this.loading = false
       }).catch(() => {
         this.loading = false
@@ -272,7 +277,7 @@ export default {
         }
       })
     },
-    zqlDraw(times, datas,forecastType) {
+    zqlDraw(times, datas,standLine) {
       this.zqlChart = echarts.init(document.getElementById('zqlCharts'), "dark", {renderer: 'svg'})
       let option = {
         backgroundColor: 'transparent',
@@ -359,7 +364,8 @@ export default {
         }],
 
       }
-      if (forecastType === 'cdq'){
+      // if (forecastType === 'cdq'){
+      if(standLine != "" || standLine != undefined) {
         option.series=[
           {
             name: '准确率(%)',
@@ -384,9 +390,9 @@ export default {
               data: [{
                 label: {
                   position: 'start',
-                  formatter: "合格(75%)"
+                  formatter: "合格("+Number(standLine)+")"
                 },
-                yAxis: 75
+                yAxis: Number(standLine)
               }]
             },
             itemStyle: {