Преглед изворни кода

增加气象站总辐射对比

xusl пре 11 месеци
родитељ
комит
1c8439c1a8

+ 2 - 1
ipp-ap/src/const/crud/weatherstationstatusdata.js

@@ -1,3 +1,4 @@
+import moment11 from 'moment'
 export const tableOption = {
   "border": true,
   "index": true,
@@ -29,7 +30,7 @@ export const tableOption = {
       "prop": "time",
       formatter: (row, column, cellValue, index) => {
         const date = new Date(cellValue);
-        return date.toLocaleString(); // 转换为本地时间并显示
+        return moment11(date).format('YYYY-MM-DD HH:mm:ss'); // 转换为本地时间并显示
       }
     }
     , {

+ 145 - 67
ipp-ap/src/views/idp/data/forecastpowerdata/index.vue

@@ -265,6 +265,7 @@ export default {
       startTime: new Date(new Date().toLocaleDateString()).getTime(),
       endTime: new Date(new Date().toLocaleDateString()).getTime() + 60 * 60 * 24 * 1000 - 1,
       stationCode: '',
+      stationType:'',
       stationList: [],
       forecastManufactor: '',
       forecastManufactorList: [],
@@ -289,7 +290,7 @@ export default {
     // this.draw()
   },
   methods: {
-    draw(timeaxis, realpower, shortPower, ultraShortPower, cap,nwp,cft) {
+    draw(timeaxis, realpower, shortPower, ultraShortPower, cap,nwp,hjsj,values) {
       this.arrays = []
       this.arrays.push({
         name: '实际功率',
@@ -421,77 +422,154 @@ export default {
         series: this.arrays
       };
 
+      if (values[0].electricFieldTypeEnum=='1'){
+        // 光伏
+        option.yAxis.push({
+          type: 'value',
+          name: '(W/㎡)',
+          min: 0,
+          axisTick: {
+            show: false
+          },
+          axisLine: {
+            lineStyle: {
+              color: '#ffe599'
+            }
+          },
+          axisLabel: {
+            margin: 10,
+            textStyle: {
+              fontSize: 14
+            }
+          },
+          splitLine: {
+            lineStyle: {
+              color: '#57617B'
+            }
+          }
+        })
 
-      option.yAxis.push({
-        type: 'value',
-        name: '(m/s)',
-        min: 0,
-        axisTick: {
-          show: false
-        },
-        axisLine: {
+        option.series.push({
+          yAxisIndex: 1,
+          name: '中心侧NWP总辐射',
+          type: 'line',
+          smooth: true,
+          symbol: 'circle',
+          symbolSize: 5,
+          showSymbol: false,
           lineStyle: {
-            color: '#4fe512'
-          }
-        },
-        axisLabel: {
-          margin: 10,
-          textStyle: {
-            fontSize: 14
-          }
-        },
-        splitLine: {
+            normal: {
+              width: 2
+            }
+          },
+          itemStyle: {
+            normal: {
+              color: cc.lggdfs,
+              borderColor: 'rgba(201,209,210,0.2)',
+              borderWidth: 12
+            }
+          },
+          data: nwp
+        })
+
+        option.series.push({
+          yAxisIndex: 1,
+          name: '气象站总辐射',
+          type: 'line',
+          smooth: true,
+          symbol: 'circle',
+          symbolSize: 5,
+          showSymbol: false,
           lineStyle: {
-            color: '#666633'
+            normal: {
+              width: 2
+            }
+          },
+          itemStyle: {
+            normal: {
+              color: cc.line15,
+              borderColor: 'rgba(201,209,210,0.2)',
+              borderWidth: 12
+            }
+          },
+          data: hjsj
+        })
+      }
+      else{
+        // 风电
+        option.yAxis.push({
+          type: 'value',
+          name: '(m/s)',
+          min: 0,
+          axisTick: {
+            show: false
+          },
+          axisLine: {
+            lineStyle: {
+              color: '#4fe512'
+            }
+          },
+          axisLabel: {
+            margin: 10,
+            textStyle: {
+              fontSize: 14
+            }
+          },
+          splitLine: {
+            lineStyle: {
+              color: '#666633'
+            }
           }
-        }
-      })
+        })
+
+        option.series.push({
+          yAxisIndex: 1,
+          name: '中心侧NWP轮毂风速',
+          type: 'line',
+          smooth: true,
+          symbol: 'circle',
+          symbolSize: 5,
+          showSymbol: false,
+          lineStyle: {
+            normal: {
+              width: 2
+            }
+          },
+          itemStyle: {
+            normal: {
+              color: cc.lggdfs,
+              borderColor: 'rgba(201,209,210,0.2)',
+              borderWidth: 12
+            }
+          },
+          data: nwp
+        })
+
+        option.series.push({
+          yAxisIndex: 1,
+          name: '测风塔轮毂风速',
+          type: 'line',
+          smooth: true,
+          symbol: 'circle',
+          symbolSize: 5,
+          showSymbol: false,
+          lineStyle: {
+            normal: {
+              width: 2
+            }
+          },
+          itemStyle: {
+            normal: {
+              color: cc.line15,
+              borderColor: 'rgba(201,209,210,0.2)',
+              borderWidth: 12
+            }
+          },
+          data: hjsj
+        })
+      }
 
-      option.series.push({
-        yAxisIndex: 1,
-        name: '中心侧NWP轮毂风速',
-        type: 'line',
-        smooth: true,
-        symbol: 'circle',
-        symbolSize: 5,
-        showSymbol: false,
-        lineStyle: {
-          normal: {
-            width: 2
-          }
-        },
-        itemStyle: {
-          normal: {
-            color: cc.lggdfs,
-            borderColor: 'rgba(201,209,210,0.2)',
-            borderWidth: 12
-          }
-        },
-        data: nwp
-      })
 
-      option.series.push({
-        yAxisIndex: 1,
-        name: '测风塔轮毂风速',
-        type: 'line',
-        smooth: true,
-        symbol: 'circle',
-        symbolSize: 5,
-        showSymbol: false,
-        lineStyle: {
-          normal: {
-            width: 2
-          }
-        },
-        itemStyle: {
-          normal: {
-            color: cc.line15,
-            borderColor: 'rgba(201,209,210,0.2)',
-            borderWidth: 12
-          }
-        },
-        data: cft
-      })
       // option.legend.data.push('中心侧NWP')
 
 
@@ -523,7 +601,7 @@ export default {
           this.fromHead = response.data.data.fromHead
           this.tableData = response.data.data.tableList
           this.total = response.data.data.tableList.length
-          this.draw(response.data.data.time, response.data.data.sj, response.data.data.dq, response.data.data.cdq, values[0].capacity,response.data.data.nwp,response.data.data.cft)
+          this.draw(response.data.data.time, response.data.data.sj, response.data.data.dq, response.data.data.cdq, values[0].capacity,response.data.data.nwp,response.data.data.hjsj,values)
         });
       })
     },

+ 130 - 67
ipp-idp/src/main/java/com/jiayue/ipp/idp/service/impl/PowerStationStatusDataServiceImpl.java

@@ -33,9 +33,11 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
 
     private final SysParameterService sysParameterService;
 
+    private final WeatherStationStatusDataService weatherStationStatusDataService;
+
     private final NwpService nwpService;
 
-    public PowerStationStatusDataServiceImpl(ForecastPowerShortTermHisService forecastPowerShortTermHisService, ForecastPowerUltraShortTermHisService forecastPowerUltraShortTermHisService, ForecastPowerUltraShortTermService forecastPowerUltraShortTermService, ForecastPowerShortTermService forecastPowerShortTermService, ElectricFieldServiceImpl electricFieldService, ForecastManufactorService forecastManufactorService, WindTowerStatusDataService windTowerStatusDataService, SysParameterService sysParameterService, NwpService nwpService) {
+    public PowerStationStatusDataServiceImpl(ForecastPowerShortTermHisService forecastPowerShortTermHisService, ForecastPowerUltraShortTermHisService forecastPowerUltraShortTermHisService, ForecastPowerUltraShortTermService forecastPowerUltraShortTermService, ForecastPowerShortTermService forecastPowerShortTermService, ElectricFieldServiceImpl electricFieldService, ForecastManufactorService forecastManufactorService, WindTowerStatusDataService windTowerStatusDataService, SysParameterService sysParameterService, WeatherStationStatusDataService weatherStationStatusDataService, NwpService nwpService) {
         this.forecastPowerUltraShortTermHisService = forecastPowerUltraShortTermHisService;
         this.forecastPowerUltraShortTermService = forecastPowerUltraShortTermService;
         this.forecastPowerShortTermService = forecastPowerShortTermService;
@@ -44,6 +46,7 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
         this.forecastPowerShortTermHisService = forecastPowerShortTermHisService;
         this.windTowerStatusDataService = windTowerStatusDataService;
         this.sysParameterService = sysParameterService;
+        this.weatherStationStatusDataService = weatherStationStatusDataService;
         this.nwpService = nwpService;
     }
 
@@ -124,8 +127,6 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
        if(dqPoint>0){
            // 获取短期数据
            List<ForecastPowerShortTermHis> forecastPowerShortTermHisList = forecastPowerShortTermHisService.findByForecastTimeBetweenAndForecastHowLongAgoAndStationCode(startTime.getTime(), endTime.getTime(),dqPoint,stationCode);
-
-
            for (int i=0;i<fm.length;i++){
                int finalI = i;
                List<ForecastPowerShortTermHis> result = forecastPowerShortTermHisList.stream().filter(c -> c.getForecastManufactor().equals(fm[finalI])).collect(Collectors.toList());
@@ -280,49 +281,64 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
         nwpWrapper.between("pre_time", startTime, endTime);
         nwpWrapper.eq("station_code",stationCode);
         List<Nwp> nwpDataList = nwpService.list(nwpWrapper);
-        int nwpHubHeight = Integer.parseInt(sysParameterService.getSysParameterAndStationCode("NWP_HubHeight", "100", stationCode));
-        for (Nwp nwp : nwpDataList) {
-            // 获取nwp轮毂风速
-            if (nwpHubHeight==170){
-                nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs170().toString());
-            }
-            else if (nwpHubHeight==100){
-                nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs100().toString());
-            }
-            else if (nwpHubHeight==90){
-                nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs90().toString());
-            }
-            else if (nwpHubHeight==80){
-                nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs80().toString());
+        // 保存环境数据map
+        Map<Long, String> hjsjMap = new HashMap<>();
+        if ("1".equals(electricField.getElectricFieldTypeEnum())){
+            for (Nwp nwp : nwpDataList) {
+                nwpMap.put(nwp.getPreTime().getTime(), nwp.getSwr().toString());
             }
-            else if (nwpHubHeight==70){
-                nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs70().toString());
-            }
-            else if (nwpHubHeight==50){
-                nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs50().toString());
-            }
-            else if (nwpHubHeight==30){
-                nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs30().toString());
-            }
-            else if (nwpHubHeight==10){
-                nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs10().toString());
+            QueryWrapper<WeatherStationStatusData> qxzWrapper = new QueryWrapper<>();
+            qxzWrapper.between("time", startTime, endTime);
+            qxzWrapper.eq("station_code",stationCode);
+            List<WeatherStationStatusData> qxzDataList = weatherStationStatusDataService.list(qxzWrapper);
+            for (WeatherStationStatusData weatherStationStatusData : qxzDataList) {
+                hjsjMap.put(weatherStationStatusData.getTime().getTime(), weatherStationStatusData.getGlobalR().toString());
             }
         }
+        else{
+            int nwpHubHeight = Integer.parseInt(sysParameterService.getSysParameterAndStationCode("NWP_HubHeight", "100", stationCode));
+            for (Nwp nwp : nwpDataList) {
+                // 获取nwp轮毂风速
+                if (nwpHubHeight==170){
+                    nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs170().toString());
+                }
+                else if (nwpHubHeight==100){
+                    nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs100().toString());
+                }
+                else if (nwpHubHeight==90){
+                    nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs90().toString());
+                }
+                else if (nwpHubHeight==80){
+                    nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs80().toString());
+                }
+                else if (nwpHubHeight==70){
+                    nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs70().toString());
+                }
+                else if (nwpHubHeight==50){
+                    nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs50().toString());
+                }
+                else if (nwpHubHeight==30){
+                    nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs30().toString());
+                }
+                else if (nwpHubHeight==10){
+                    nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs10().toString());
+                }
+            }
 
-        // 获取测风塔轮毂风速
-        Map<Long, String> cftMap = new HashMap<>();
-        QueryWrapper<WindTowerStatusData> cftWrapper = new QueryWrapper<>();
-        cftWrapper.between("time", startTime, endTime);
-        cftWrapper.eq("station_code",stationCode);
-        List<WindTowerStatusData> cftDataList = windTowerStatusDataService.list(cftWrapper);
-        for (WindTowerStatusData windTowerStatusData : cftDataList) {
-            cftMap.put(windTowerStatusData.getTime().getTime(), windTowerStatusData.getWsInstHubHeight().toString());
+            // 获取测风塔轮毂风速
+            QueryWrapper<WindTowerStatusData> cftWrapper = new QueryWrapper<>();
+            cftWrapper.between("time", startTime, endTime);
+            cftWrapper.eq("station_code",stationCode);
+            List<WindTowerStatusData> cftDataList = windTowerStatusDataService.list(cftWrapper);
+            for (WindTowerStatusData windTowerStatusData : cftDataList) {
+                hjsjMap.put(windTowerStatusData.getTime().getTime(), windTowerStatusData.getWsInstHubHeight().toString());
+            }
         }
 
         List<String> timeList = new ArrayList<>();
         List<String> sjList = new ArrayList();
         List<String> nwpList = new ArrayList();
-        List<String> cftList = new ArrayList();
+        List<String> hjsjList = new ArrayList();
         List<Map> dqList = new ArrayList();
         dqList.add(tempDqMap);
         List<Map> cdqList = new ArrayList();
@@ -367,55 +383,102 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
                 List tempcdqList = entry.getValue();
                 map1.put(entry.getKey()+"CDQ",tempcdqList.get(i));
             }
-            // 封装nwplist
-            if (nwpMap.get(tempDateTime) != null) {
-                if (Double.parseDouble(nwpMap.get(tempDateTime))==-99) {
+
+            if ("1".equals(electricField.getElectricFieldTypeEnum())){
+                // 封装nwplist
+                if (nwpMap.get(tempDateTime) != null) {
+                    if (Double.parseDouble(nwpMap.get(tempDateTime))==-99) {
+                        nwpList.add(null);
+                        // 中心侧nwp总辐射
+                        map1.put("ZXCNWPZFS","");
+                    }
+                    else{
+                        nwpList.add(nwpMap.get(tempDateTime).toString());
+                        map1.put("ZXCNWPZFS",nwpMap.get(tempDateTime).toString());
+                    }
+                } else {
                     nwpList.add(null);
-                    map1.put("ZXCNWPWS","");
+                    map1.put("ZXCNWPZFS","");
                 }
-                else{
-                    nwpList.add(nwpMap.get(tempDateTime).toString());
-                    map1.put("ZXCNWPWS",nwpMap.get(tempDateTime).toString());
+                // 封装qxzlist
+                if (hjsjMap.get(tempDateTime) != null) {
+                    if (Double.parseDouble(hjsjMap.get(tempDateTime))==-99) {
+                        hjsjList.add(null);
+                        map1.put("QXZZFS","");
+                    }
+                    else{
+                        hjsjList.add(hjsjMap.get(tempDateTime).toString());
+                        map1.put("QXZZFS",hjsjMap.get(tempDateTime).toString());
+                    }
+                } else {
+                    hjsjList.add(null);
+                    map1.put("QXZZFS","");
                 }
-            } else {
-                nwpList.add(null);
-                map1.put("ZXCNWPWS","");
             }
-            // 封装cftlist
-            if (cftMap.get(tempDateTime) != null) {
-                if (Double.parseDouble(cftMap.get(tempDateTime))==-99) {
-                    cftList.add(null);
-                    map1.put("CFTWS","");
+            else{
+                // 封装nwplist
+                if (nwpMap.get(tempDateTime) != null) {
+                    if (Double.parseDouble(nwpMap.get(tempDateTime))==-99) {
+                        nwpList.add(null);
+                        map1.put("ZXCNWPWS","");
+                    }
+                    else{
+                        nwpList.add(nwpMap.get(tempDateTime).toString());
+                        map1.put("ZXCNWPWS",nwpMap.get(tempDateTime).toString());
+                    }
+                } else {
+                    nwpList.add(null);
+                    map1.put("ZXCNWPWS","");
                 }
-                else{
-                    cftList.add(cftMap.get(tempDateTime).toString());
-                    map1.put("CFTWS",cftMap.get(tempDateTime).toString());
+                // 封装cftlist
+                if (hjsjMap.get(tempDateTime) != null) {
+                    if (Double.parseDouble(hjsjMap.get(tempDateTime))==-99) {
+                        hjsjList.add(null);
+                        map1.put("CFTWS","");
+                    }
+                    else{
+                        hjsjList.add(hjsjMap.get(tempDateTime).toString());
+                        map1.put("CFTWS",hjsjMap.get(tempDateTime).toString());
+                    }
+                } else {
+                    hjsjList.add(null);
+                    map1.put("CFTWS","");
                 }
-            } else {
-                cftList.add(null);
-                map1.put("CFTWS","");
             }
 
             i++;
             tableList.add(map1);
         }
 
-        Map<String,String> nwpHeadMap = new HashMap<>();
-        nwpHeadMap.put("field", "ZXCNWPWS");
-        nwpHeadMap.put("label", "中心侧NWP轮毂风速");
-        headList.add(nwpHeadMap);
+        if ("1".equals(electricField.getElectricFieldTypeEnum())){
+            Map<String,String> nwpHeadMap = new HashMap<>();
+            nwpHeadMap.put("field", "ZXCNWPZFS");
+            nwpHeadMap.put("label", "中心侧NWP总辐射");
+            headList.add(nwpHeadMap);
 
-        Map<String,String> cftHeadMap = new HashMap<>();
-        cftHeadMap.put("field", "CFTWS");
-        cftHeadMap.put("label", "测风塔轮毂风速");
-        headList.add(cftHeadMap);
+            Map<String,String> cftHeadMap = new HashMap<>();
+            cftHeadMap.put("field", "QXZZFS");
+            cftHeadMap.put("label", "气象站总辐射");
+            headList.add(cftHeadMap);
+        }
+        else{
+            Map<String,String> nwpHeadMap = new HashMap<>();
+            nwpHeadMap.put("field", "ZXCNWPWS");
+            nwpHeadMap.put("label", "中心侧NWP轮毂风速");
+            headList.add(nwpHeadMap);
+
+            Map<String,String> cftHeadMap = new HashMap<>();
+            cftHeadMap.put("field", "CFTWS");
+            cftHeadMap.put("label", "测风塔轮毂风速");
+            headList.add(cftHeadMap);
+        }
 
         Map<String, List> map = new HashMap<>();
         map.put("dq", dqList);
         map.put("cdq", cdqList);
         map.put("sj", sjList);
         map.put("nwp", nwpList);
-        map.put("cft", cftList);
+        map.put("hjsj", hjsjList);
         map.put("time", timeList);
         map.put("fromHead", headList);
         map.put("tableList", tableList);