ソースを参照

预测数据查询页面曲线颜色BUG修改

xusl 10 ヶ月 前
コミット
6893bd55d6

+ 100 - 3
ipp-ap/src/views/curvecolors.js

@@ -1,8 +1,105 @@
 export default {
-  //实际功率
+  // 实际功率
   sj: '#FF4136',
-  //短期
+  // 短期
   dq: '#0066CC',
-  //超短期
+  // 超短期
   cdq: '#FFD700',
+  // 可用功率
+  kygl: '#2ECC40',
+  // 理论功率
+  llgl: '#F012BE',
+  // 测风测光法理论
+  cfgf: '#85144b',
+  // 样板机法理论
+  ybjf: '#39CCCC',
+  // 测风测光法可用
+  kycfgf: '#921AFF',
+  // 样板机法可用
+  kyybjf: '#cf20e2',
+  // 机头风速理论
+  lljtfsf: '#4F9D9D',
+  // 机头风速可用
+  kyjtfsf: '#B87070',
+  // 总辐射
+  zfs: '#8A2BE2',
+  // 散辐射
+  sfs: '#FF8C00',
+  // 直辐射
+  zhfs: '#0000E3',
+  // 斜辐射
+  xfs: '#73BF00',
+  // nwp辐射
+  nwpfs: '#FF6666',
+  // nwp直辐射
+  nwpzhfs: '#6699FF',
+  // nwp散辐射
+  nwpsfs: '#FF95CA',
+  // 轮毂高度风速
+  lggdfs: '#FF95CA',
+  ws10: '#8A2BE2',
+  ws30: '#FF8C00',
+  ws50: '#0000E3',
+  ws60: '#85144b',
+  ws70: '#A8FF24',
+  ws80: '#FF6666',
+  ws90: '#6699FF',
+  ws100: '#FF95CA',
+  ws110: '#FFBB77',
+  ws120: '#98FB98',
+  wsHubHeight: '#0066CC',
+  nwp10: '#00FFFF',
+  nwp20: '#FFC0CB',
+  nwp30: '#2894FF',
+  nwp40: '#EE82EE',
+  nwp50: '#9393FF',
+  nwp60: '#4B0082',
+  nwp70: '#FF44FF',
+  nwp80: '#f1d4d4',
+  nwp90: '#C07AB8',
+  nwp100: '#4F9D9D',
+  nwp110: '#483D8B',
+  nwp120: '#6495ED',
+  nwp130: '#708090',
+  nwp140: '#00BFFF',
+  nwp150: '#5F9EA0',
+  nwp160: '#2F4F4F',
+  nwp170: '#B87070',
+  nwp180: '#00FA9A',
+  nwp190: '#2E8B57',
+  nwp200: '#32CD32',
+
+  dq1: '#ee00ff',
+  dq2: '#2ECC40',
+  dq3: 'rgba(240,18,190,0.41)',
+  dq4: '#85144b',
+  dq5: '#39CCCC',
+  cdq1: '#8A2BE2',
+  cdq2: '#FF8C00',
+  cdq3: '#0000E3',
+  cdq4: '#73BF00',
+  cdq5: '#FF6666',
+  line11: '#6699FF',
+  line12: '#FF95CA',
+  line13: '#98FB98',
+  line14: '#0066CC',
+  line15: '#FFBB77',
+  line16: '#921AFF',
+
+  line17: '#FF00D7',
+  line18: '#2E40CC',
+  line19: '#F0BE12',
+  line20: '#854B14',
+  line21: '#CC39CC',
+  line22: '#8AE22B',
+  line23: '#FF008C',
+  line24: '#00E300',
+  line25: '#7300BF',
+  line26: '#66FF66',
+  line27: '#66FF99',
+  line28: '#FFCA95',
+  line29: '#9898FB',
+  line30: '#00CC66',
+  line31: '#FF77BB',
+  line32: '#92FF1A'
 }

+ 13 - 3
ipp-ap/src/views/idp/data/forecastpowerdata/index.vue

@@ -142,12 +142,17 @@ import {tableOption} from '@/const/crud/forecastpowerultrashortterm'
 import {mapGetters} from 'vuex'
 import * as echarts from 'echarts';
 import {getManufactorByStationCode} from '@/api/forecastmanufactor'
+import cc from '../../../curvecolors'
 
 export default {
   name: 'forecastpowerultrashortterm',
   data() {
     return {
-      cdqPoint: [{
+      cdqPoint: [
+        {
+          value: 0,
+          label: '0(实时超短期)'
+        }, {
         value: 1,
         label: '1'
       }, {
@@ -298,6 +303,8 @@ export default {
         }
       });
       let _this = this
+
+      let tempDqLineColor = 1
       for (let item in shortPower[0]) {
         _this.arrays.push({
           name: item + '短期',
@@ -307,11 +314,13 @@ export default {
           symbolSize: 5,
           data: shortPower[0][item],
           itemStyle: {
-            color: 'blue'
+            color: cc["dq"+tempDqLineColor]
           }
         });
+        tempDqLineColor=tempDqLineColor+1
       }
 
+      let tempCdqLineColor = 1
       for (let item in ultraShortPower[0]) {
         _this.arrays.push({
           name: item + '超短期',
@@ -321,9 +330,10 @@ export default {
           symbolSize: 5,
           data: ultraShortPower[0][item],
           itemStyle: {
-            color: 'yellow'
+            color: cc["cdq"+tempCdqLineColor]
           }
         });
+        tempCdqLineColor = tempCdqLineColor+1
       }
 
       this.chart = echarts.init(document.getElementById('echarts'))

+ 73 - 31
ipp-idp/src/main/java/com/jiayue/ipp/idp/service/impl/PowerStationStatusDataServiceImpl.java

@@ -23,13 +23,15 @@ import java.util.stream.Collectors;
 @Service
 public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationStatusDataMapper, PowerStationStatusData> implements PowerStationStatusDataService {
     private final ForecastPowerUltraShortTermHisService forecastPowerUltraShortTermHisService;
+    private final ForecastPowerUltraShortTermService forecastPowerUltraShortTermService;
     private final ForecastPowerShortTermService forecastPowerShortTermService;
     private final ElectricFieldServiceImpl electricFieldService;
     private final ForecastManufactorService forecastManufactorService;
     private final ForecastPowerShortTermHisService forecastPowerShortTermHisService;
 
-    public PowerStationStatusDataServiceImpl(ForecastPowerShortTermHisService forecastPowerShortTermHisService,ForecastPowerUltraShortTermHisService forecastPowerUltraShortTermHisService, ForecastPowerShortTermService forecastPowerShortTermService, ElectricFieldServiceImpl electricFieldService, ForecastManufactorService forecastManufactorService) {
+    public PowerStationStatusDataServiceImpl(ForecastPowerShortTermHisService forecastPowerShortTermHisService, ForecastPowerUltraShortTermHisService forecastPowerUltraShortTermHisService, ForecastPowerUltraShortTermService forecastPowerUltraShortTermService, ForecastPowerShortTermService forecastPowerShortTermService, ElectricFieldServiceImpl electricFieldService, ForecastManufactorService forecastManufactorService) {
         this.forecastPowerUltraShortTermHisService = forecastPowerUltraShortTermHisService;
+        this.forecastPowerUltraShortTermService = forecastPowerUltraShortTermService;
         this.forecastPowerShortTermService = forecastPowerShortTermService;
         this.electricFieldService = electricFieldService;
         this.forecastManufactorService = forecastManufactorService;
@@ -186,44 +188,84 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
            }
        }
 
-        // 获取超短期数据
-        List<ForecastPowerUltraShortTermHis> forecastPowerUltraShortTermHisList = forecastPowerUltraShortTermHisService.findByForecastTimeBetweenAndForecastHowLongAgoAndStationCode(startTime.getTime(), endTime.getTime(), cdqPoint, stationCode);
-        // 按厂家过滤出数据
         Map<String,List> tempCdqMap = new HashMap<>();
         Map<String,List> tableCdqMap = new HashMap<>();
-        for (int i=0;i<fm.length;i++){
-            int finalI = i;
-            List<ForecastPowerUltraShortTermHis> result = forecastPowerUltraShortTermHisList.stream().filter(c -> c.getForecastManufactor().equals(fm[finalI])).collect(Collectors.toList());
-            Map<Long, String> cdqMap = new HashMap<>();
-            for (ForecastPowerUltraShortTermHis forecastPowerUltraShortTermHis : result) {
-                cdqMap.put(forecastPowerUltraShortTermHis.getForecastTime().getTime(), forecastPowerUltraShortTermHis.getAbleValue().toString());
-            }
-            List tempcdqList = new ArrayList();
-            for (Long tempDateTime = startDateTime; tempDateTime < endDateTime; tempDateTime = tempDateTime + 15 * 60 * 1000) {
-                if (cdqMap.get(tempDateTime) != null) {
-                    tempcdqList.add(cdqMap.get(tempDateTime).toString());
-                } else {
-                    tempcdqList.add(null);
+        if(cdqPoint>0){
+            // 获取超短期数据
+            List<ForecastPowerUltraShortTermHis> forecastPowerUltraShortTermHisList = forecastPowerUltraShortTermHisService.findByForecastTimeBetweenAndForecastHowLongAgoAndStationCode(startTime.getTime(), endTime.getTime(), cdqPoint, stationCode);
+            // 按厂家过滤出数据
+            for (int i=0;i<fm.length;i++){
+                int finalI = i;
+                List<ForecastPowerUltraShortTermHis> result = forecastPowerUltraShortTermHisList.stream().filter(c -> c.getForecastManufactor().equals(fm[finalI])).collect(Collectors.toList());
+                Map<Long, String> cdqMap = new HashMap<>();
+                for (ForecastPowerUltraShortTermHis forecastPowerUltraShortTermHis : result) {
+                    cdqMap.put(forecastPowerUltraShortTermHis.getForecastTime().getTime(), forecastPowerUltraShortTermHis.getAbleValue().toString());
                 }
-            }
-            String manufactorName = "";
-            for (ForecastManufactor forecastManufactor1:forecastManufactorList){
-                if (fm[finalI].equals(forecastManufactor1.getSign())){
-                    manufactorName = forecastManufactor1.getName();
-                    break;
+                List tempcdqList = new ArrayList();
+                for (Long tempDateTime = startDateTime; tempDateTime < endDateTime; tempDateTime = tempDateTime + 15 * 60 * 1000) {
+                    if (cdqMap.get(tempDateTime) != null) {
+                        tempcdqList.add(cdqMap.get(tempDateTime).toString());
+                    } else {
+                        tempcdqList.add(null);
+                    }
                 }
+                String manufactorName = "";
+                for (ForecastManufactor forecastManufactor1:forecastManufactorList){
+                    if (fm[finalI].equals(forecastManufactor1.getSign())){
+                        manufactorName = forecastManufactor1.getName();
+                        break;
+                    }
+                }
+                if ("".equals(manufactorName)){
+                    manufactorName = fm[finalI];
+                }
+                tempCdqMap.put(manufactorName,tempcdqList);
+                tableCdqMap.put(fm[finalI],tempcdqList);
+                Map<String,String> cdqHeadMap = new HashMap<>();
+                cdqHeadMap.put("field", fm[finalI]+"CDQ");
+                cdqHeadMap.put("label", manufactorName+"超短期");
+                headList.add(cdqHeadMap);
             }
-            if ("".equals(manufactorName)){
-                manufactorName = fm[finalI];
+        }
+        else{
+            // 获取超短期实时数据
+            List<ForecastPowerUltraShortTerm> forecastPowerUltraShortTermList = forecastPowerUltraShortTermService.findByStationCodeAndStartTimeAndEndTime(stationCode,startTime, endTime);
+            // 按厂家过滤出数据
+            for (int i=0;i<fm.length;i++){
+                int finalI = i;
+                List<ForecastPowerUltraShortTerm> result = forecastPowerUltraShortTermList.stream().filter(c -> c.getForecastManufactor().equals(fm[finalI])).collect(Collectors.toList());
+                Map<Long, String> cdqMap = new HashMap<>();
+                for (ForecastPowerUltraShortTerm forecastPowerUltraShortTerm : result) {
+                    cdqMap.put(forecastPowerUltraShortTerm.getForecastTime().getTime(), forecastPowerUltraShortTerm.getFpValue().toString());
+                }
+                List tempcdqList = new ArrayList();
+                for (Long tempDateTime = startDateTime; tempDateTime < endDateTime; tempDateTime = tempDateTime + 15 * 60 * 1000) {
+                    if (cdqMap.get(tempDateTime) != null) {
+                        tempcdqList.add(cdqMap.get(tempDateTime).toString());
+                    } else {
+                        tempcdqList.add(null);
+                    }
+                }
+                String manufactorName = "";
+                for (ForecastManufactor forecastManufactor1:forecastManufactorList){
+                    if (fm[finalI].equals(forecastManufactor1.getSign())){
+                        manufactorName = forecastManufactor1.getName();
+                        break;
+                    }
+                }
+                if ("".equals(manufactorName)){
+                    manufactorName = fm[finalI];
+                }
+                tempCdqMap.put(manufactorName,tempcdqList);
+                tableCdqMap.put(fm[finalI],tempcdqList);
+                Map<String,String> cdqHeadMap = new HashMap<>();
+                cdqHeadMap.put("field", fm[finalI]+"CDQ");
+                cdqHeadMap.put("label", manufactorName+"超短期");
+                headList.add(cdqHeadMap);
             }
-            tempCdqMap.put(manufactorName,tempcdqList);
-            tableCdqMap.put(fm[finalI],tempcdqList);
-            Map<String,String> cdqHeadMap = new HashMap<>();
-            cdqHeadMap.put("field", fm[finalI]+"CDQ");
-            cdqHeadMap.put("label", manufactorName+"超短期");
-            headList.add(cdqHeadMap);
         }
 
+
         List<String> timeList = new ArrayList<>();
         List<String> sjList = new ArrayList();
         List<Map> dqList = new ArrayList();