Ver Fonte

增加测风塔轮毂对比

xusl há 9 meses atrás
pai
commit
9751e3eacb

+ 78 - 4
ipp-ap/src/views/idp/data/forecastpowerdata/index.vue

@@ -251,8 +251,8 @@ export default {
           value: 15,
           label: '15'
         }],
-      cdqQueryPoint: 1,
-      dqQueryPoint: 1,
+      cdqQueryPoint: 0,
+      dqQueryPoint: 0,
       searchForm: {},
       tableData: [],
 
@@ -289,7 +289,7 @@ export default {
     // this.draw()
   },
   methods: {
-    draw(timeaxis, realpower, shortPower, ultraShortPower, cap) {
+    draw(timeaxis, realpower, shortPower, ultraShortPower, cap,nwp,cft) {
       this.arrays = []
       this.arrays.push({
         name: '实际功率',
@@ -421,6 +421,80 @@ export default {
         series: this.arrays
       };
 
+
+      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.line24,
+            borderColor: 'rgba(201,209,210,0.2)',
+            borderWidth: 12
+          }
+        },
+        data: cft
+      })
+      // option.legend.data.push('中心侧NWP')
+
+
       this.chart.setOption(option, true)
     },
     getManufactor(val) {
@@ -449,7 +523,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)
+          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)
         });
       })
     },

+ 96 - 1
ipp-idp/src/main/java/com/jiayue/ipp/idp/service/impl/PowerStationStatusDataServiceImpl.java

@@ -29,13 +29,22 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
     private final ForecastManufactorService forecastManufactorService;
     private final ForecastPowerShortTermHisService forecastPowerShortTermHisService;
 
-    public PowerStationStatusDataServiceImpl(ForecastPowerShortTermHisService forecastPowerShortTermHisService, ForecastPowerUltraShortTermHisService forecastPowerUltraShortTermHisService, ForecastPowerUltraShortTermService forecastPowerUltraShortTermService, ForecastPowerShortTermService forecastPowerShortTermService, ElectricFieldServiceImpl electricFieldService, ForecastManufactorService forecastManufactorService) {
+    private final WindTowerStatusDataService windTowerStatusDataService;
+
+    private final SysParameterService sysParameterService;
+
+    private final NwpService nwpService;
+
+    public PowerStationStatusDataServiceImpl(ForecastPowerShortTermHisService forecastPowerShortTermHisService, ForecastPowerUltraShortTermHisService forecastPowerUltraShortTermHisService, ForecastPowerUltraShortTermService forecastPowerUltraShortTermService, ForecastPowerShortTermService forecastPowerShortTermService, ElectricFieldServiceImpl electricFieldService, ForecastManufactorService forecastManufactorService, WindTowerStatusDataService windTowerStatusDataService, SysParameterService sysParameterService, NwpService nwpService) {
         this.forecastPowerUltraShortTermHisService = forecastPowerUltraShortTermHisService;
         this.forecastPowerUltraShortTermService = forecastPowerUltraShortTermService;
         this.forecastPowerShortTermService = forecastPowerShortTermService;
         this.electricFieldService = electricFieldService;
         this.forecastManufactorService = forecastManufactorService;
         this.forecastPowerShortTermHisService = forecastPowerShortTermHisService;
+        this.windTowerStatusDataService = windTowerStatusDataService;
+        this.sysParameterService = sysParameterService;
+        this.nwpService = nwpService;
     }
 
     @Override
@@ -265,9 +274,55 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
             }
         }
 
+        // 获取云端nwp
+        Map<Long, String> nwpMap = new HashMap<>();
+        QueryWrapper<Nwp> nwpWrapper = new QueryWrapper<>();
+        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());
+            }
+            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());
+        }
 
         List<String> timeList = new ArrayList<>();
         List<String> sjList = new ArrayList();
+        List<String> nwpList = new ArrayList();
+        List<String> cftList = new ArrayList();
         List<Map> dqList = new ArrayList();
         dqList.add(tempDqMap);
         List<Map> cdqList = new ArrayList();
@@ -293,6 +348,7 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
             } else {
                 sjList.add(null);
             }
+
             // 封装时间轴list
             String time = format.format(tempDateTime);
             timeList.add(time);
@@ -311,16 +367,55 @@ 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) {
+                    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","");
+            }
+            // 封装cftlist
+            if (cftMap.get(tempDateTime) != null) {
+                if (Double.parseDouble(cftMap.get(tempDateTime))==-99) {
+                    cftList.add(null);
+                    map1.put("CFTWS","");
+                }
+                else{
+                    cftList.add(cftMap.get(tempDateTime).toString());
+                    map1.put("CFTWS",cftMap.get(tempDateTime).toString());
+                }
+            } 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);
+
+        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("time", timeList);
         map.put("fromHead", headList);
         map.put("tableList", tableList);