فهرست منبع

新增预测数据对比页面

wanghc 3 سال پیش
والد
کامیت
e1477a352e
14فایلهای تغییر یافته به همراه431 افزوده شده و 706 حذف شده
  1. 1 1
      ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/ForecastPowerShortTermHisRepository.java
  2. 1 0
      ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/ForecastPowerUltraShortTermHisRepository.java
  3. 2 0
      ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/InverterInfoRepository.java
  4. 2 0
      ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/WeatherStationInfoRepository.java
  5. 2 0
      ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/WindTowerInfoRepository.java
  6. 2 0
      ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/WindTurbineInfoRepository.java
  7. 7 0
      ipfcst-console/src/main/frontend/router/modules/dataquery.js
  8. 40 0
      ipfcst-console/src/main/frontend/utils/index.js
  9. 40 560
      ipfcst-console/src/main/frontend/views/dataquery/forecastPowerUltraShortTerm16/charts/index.vue
  10. 193 124
      ipfcst-console/src/main/frontend/views/dataquery/forecastPowerUltraShortTerm16/index.vue
  11. 21 0
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/PowerStationStatusDataController.java
  12. 84 7
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/PowerStationStatusDataService.java
  13. 32 14
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/ReceiveAllTypeService.java
  14. 4 0
      ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/service/E63UploadFileService.java

+ 1 - 1
ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/ForecastPowerShortTermHisRepository.java

@@ -66,5 +66,5 @@ public interface ForecastPowerShortTermHisRepository extends BaseRepository<Fore
      * @param stationCode
      * @return 结果集
      */
-    List<ForecastPowerShortTermHis> findByForecastTimeBetweenAndStationCode(Long startTime, Long endTime, String stationCode);
+    List<ForecastPowerShortTermHis> findByForecastTimeBetweenAndStationCodeAndForecastHowLongAgo(Long startTime, Long endTime, String stationCode,Integer how);
 }

+ 1 - 0
ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/ForecastPowerUltraShortTermHisRepository.java

@@ -72,5 +72,6 @@ public interface ForecastPowerUltraShortTermHisRepository extends BaseRepository
      * @return 结果集
      */
     List<ForecastPowerUltraShortTermHis> findByForecastTimeBetweenAndStationCode(Long startTime, Long endTime, String stationCode);
+    List<ForecastPowerUltraShortTermHis> findByForecastTimeBetweenAndStationCodeAndForecastHowLongAgo(Long startTime, Long endTime, String stationCode,Integer how);
 
 }

+ 2 - 0
ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/InverterInfoRepository.java

@@ -22,4 +22,6 @@ public interface InverterInfoRepository extends BaseRepository<InverterInfo, Int
     InverterInfo findByName(String name);
 
     List<InverterInfo> findAllByStationCode(String stationCode);
+
+    List<InverterInfo> findByEquipmentNo(String equipmentNo);
 }

+ 2 - 0
ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/WeatherStationInfoRepository.java

@@ -19,4 +19,6 @@ public interface WeatherStationInfoRepository extends BaseRepository<WeatherStat
     List<WeatherStationInfo> findAllByOrderByIdAsc();
 
     WeatherStationInfo findByName(String name);
+
+    List<WeatherStationInfo> findByEquipmentNo(String equipmentNo);
 }

+ 2 - 0
ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/WindTowerInfoRepository.java

@@ -19,4 +19,6 @@ public interface WindTowerInfoRepository extends BaseRepository<WindTowerInfo, I
     List<WindTowerInfo> findAllByOrderByIdAsc();
 
     WindTowerInfo findByName(String name);
+
+    List<WindTowerInfo> findByEquipmentNo(String equipmentNo);
 }

+ 2 - 0
ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/WindTurbineInfoRepository.java

@@ -19,4 +19,6 @@ public interface WindTurbineInfoRepository extends BaseRepository<WindTurbineInf
     List<WindTurbineInfo> findAllByOrderByIdAsc();
 
     WindTurbineInfo findByName(String name);
+
+    List<WindTurbineInfo> findByEquipmentNo(String equipmentNo);
 }

+ 7 - 0
ipfcst-console/src/main/frontend/router/modules/dataquery.js

@@ -13,6 +13,13 @@ const dataqueryRouter = {
   },
   children: [
     {
+      path: 'forecastPowerUltraShortTerm16',
+      component: () => import('@/views/dataquery/forecastPowerUltraShortTerm16/index'),
+      name: 'forecastPowerUltraShortTerm16',
+      meta: {title: '预测数据对比', noCache: true},
+      sign: 'currency'
+    },
+    {
       path: 'realPowerQuery',
       component: () => import('@/views/dataquery/realPowerQuery'),
       name: 'inverterStatusData',

+ 40 - 0
ipfcst-console/src/main/frontend/utils/index.js

@@ -105,3 +105,43 @@ export function param2Obj(url) {
       '"}'
   )
 }
+/**
+ * @param {Function} func
+ * @param {number} wait
+ * @param {boolean} immediate
+ * @return {*}
+ */
+export function debounce(func, wait, immediate) {
+  let timeout, args, context, timestamp, result
+
+  const later = function() {
+    // 据上一次触发时间间隔
+    const last = +new Date() - timestamp
+
+    // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait
+    if (last < wait && last > 0) {
+      timeout = setTimeout(later, wait - last)
+    } else {
+      timeout = null
+      // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
+      if (!immediate) {
+        result = func.apply(context, args)
+        if (!timeout) context = args = null
+      }
+    }
+  }
+
+  return function(...args) {
+    context = this
+    timestamp = +new Date()
+    const callNow = immediate && !timeout
+    // 如果延时不存在,重新设定延时
+    if (!timeout) timeout = setTimeout(later, wait)
+    if (callNow) {
+      result = func.apply(context, args)
+      context = args = null
+    }
+
+    return result
+  }
+}

+ 40 - 560
ipfcst-console/src/main/frontend/views/dataquery/forecastPowerUltraShortTerm16/charts/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div style="width: 100%;height: 100%">
-    <div id="charts"></div>
+    <div id="rpcharts"></div>
   </div>
 </template>
 
@@ -14,7 +14,7 @@ export default {
   watch: {
     drawData: {
       handler(newValue, oldValue) {
-        this.draw(newValue.times, newValue.realDatas, newValue.value, newValue.capacity)
+        this.draw(newValue.time,newValue.sj,newValue.cdq,newValue.dq,newValue.cap)
       },
       deep: true
     },
@@ -47,17 +47,20 @@ export default {
     this.chart = null
   },
   methods: {
-    draw(timeaxis, realpower, value, capacity) {
-      this.chart = echarts.init(document.getElementById('charts'))
-      this.chart.setOption({
+    draw(timeaxis, sj,cdq,dq,cap) {
+      console.log(sj)
+      console.log(cdq)
+      console.log(dq)
+      this.chart = echarts.init(document.getElementById('rpcharts'))
+      var option = {
         backgroundColor: 'transparent',
         title: {
           top: 20,
-          text: '超短期预测实时时刻查询',
+          text: '预测数据对比',
           textStyle: {
             fontWeight: 'normal',
             fontSize: 16,
-            color: '#F1F1F3'
+            color: '#000000'
           },
           left: '1%'
         },
@@ -65,7 +68,7 @@ export default {
           trigger: 'axis',
           axisPointer: {
             lineStyle: {
-              color: '#57617B'
+              color: '#000000'
             }
           }
         },
@@ -75,11 +78,11 @@ export default {
           itemWidth: 14,
           itemHeight: 5,
           itemGap: 13,
-          data: ['实际功率', '第1时刻', '第2时刻', '第3时刻', '第4时刻', '第5时刻', '第6时刻', '第7时刻', '第8时刻', '第9时刻', '第10时刻', '第11时刻', '第12时刻', '第13时刻', '第14时刻', '第15时刻', '第16时刻'],
+          data: ['实际功率'],
           right: '4%',
           textStyle: {
             fontSize: 12,
-            color: '#F1F1F3'
+            color: '#000000'
           }
         },
         dataZoom: [{
@@ -90,7 +93,7 @@ export default {
           left: "15%",
           right: "15%",
           textStyle: {
-            color: "#ffffff"
+            color: "#000000"
           }
         }, {
           type: 'inside'
@@ -107,7 +110,7 @@ export default {
           boundaryGap: false,
           axisLine: {
             lineStyle: {
-              color: '#ffffff'
+              color: "#000000"
             }
           },
           data: timeaxis
@@ -115,13 +118,12 @@ export default {
         yAxis: [{
           type: 'value',
           name: '(MW)',
-          max: capacity,
           axisTick: {
             show: false
           },
           axisLine: {
             lineStyle: {
-              color: '#ffffff'
+              color: '#000000'
             }
           },
           axisLabel: {
@@ -139,532 +141,57 @@ export default {
         series: [{
           name: '实际功率',
           type: 'line',
-          smooth: true,
+          smooth: false,
           symbol: 'circle',
           symbolSize: 5,
           showSymbol: false,
+          connectNulls:true,
           lineStyle: {
             normal: {
               width: 2
             }
           },
-          // areaStyle: {
-          //   normal: {
-          //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
-          //       offset: 0,
-          //       color: 'rgba(50,194,219, 0.3)'
-          //     }, {
-          //       offset: 0.8,
-          //       color: 'rgba(219, 50, 51, 0)'
-          //     }], false),
-          //     shadowColor: 'rgba(0, 0, 0, 0.1)',
-          //     shadowBlur: 10
-          //   }
-          // },
           itemStyle: {
             normal: {
 
               color: cc.sj,
-              borderColor: 'rgba(50,194,219,0.2)',
+              borderColor: 'rgba(219,50,51,0.2)',
               borderWidth: 12
             }
           },
-          data: realpower
-        },
-          {
-            name: '第1时刻',
-            type: 'line',
-            smooth: true,
-            symbol: 'circle',
-            symbolSize: 5,
-            showSymbol: false,
-            lineStyle: {
-              normal: {
-                width: 2
-              }
-            },
-            // areaStyle: {
-            //   normal: {
-            //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
-            //       offset: 0,
-            //       color: 'rgba(50,194,219, 0.3)'
-            //     }, {
-            //       offset: 0.8,
-            //       color: 'rgba(219, 50, 51, 0)'
-            //     }], false),
-            //     shadowColor: 'rgba(0, 0, 0, 0.1)',
-            //     shadowBlur: 10
-            //   }
-            // },
-            itemStyle: {
-              normal: {
-
-                color: cc.line1,
-                borderColor: 'rgba(50,194,219,0.2)',
-                borderWidth: 12
-              }
-            },
-            data: value.value1
-          },
-          {
-            name: '第2时刻',
-            type: 'line',
-            smooth: true,
-            symbol: 'circle',
-            symbolSize: 5,
-            showSymbol: false,
-            lineStyle: {
-              normal: {
-                width: 2
-              }
-            },
-            // areaStyle: {
-            //   normal: {
-            //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
-            //       offset: 0,
-            //       color: 'rgba(50,194,219, 0.3)'
-            //     }, {
-            //       offset: 0.8,
-            //       color: 'rgba(219, 50, 51, 0)'
-            //     }], false),
-            //     shadowColor: 'rgba(0, 0, 0, 0.1)',
-            //     shadowBlur: 10
-            //   }
-            // },
-            itemStyle: {
-              normal: {
-
-                color: cc.line2,
-                borderColor: 'rgba(50,194,219,0.2)',
-                borderWidth: 12
-              }
-            },
-            data: value.value2
-          },
-          {
-            name: '第3时刻',
-            type: 'line',
-            smooth: true,
-            symbol: 'circle',
-            symbolSize: 5,
-            showSymbol: false,
-            lineStyle: {
-              normal: {
-                width: 2
-              }
-            },
-            // areaStyle: {
-            //   normal: {
-            //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
-            //       offset: 0,
-            //       color: 'rgba(50,194,219, 0.3)'
-            //     }, {
-            //       offset: 0.8,
-            //       color: 'rgba(219, 50, 51, 0)'
-            //     }], false),
-            //     shadowColor: 'rgba(0, 0, 0, 0.1)',
-            //     shadowBlur: 10
-            //   }
-            // },
-            itemStyle: {
-              normal: {
-
-                color: cc.line3,
-                borderColor: 'rgba(50,194,219,0.2)',
-                borderWidth: 12
-              }
-            },
-            data: value.value3
-          },
-          {
-            name: '第4时刻',
-            type: 'line',
-            smooth: true,
-            symbol: 'circle',
-            symbolSize: 5,
-            showSymbol: false,
-            lineStyle: {
-              normal: {
-                width: 2
-              }
-            },
-            // areaStyle: {
-            //   normal: {
-            //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
-            //       offset: 0,
-            //       color: 'rgba(50,194,219, 0.3)'
-            //     }, {
-            //       offset: 0.8,
-            //       color: 'rgba(219, 50, 51, 0)'
-            //     }], false),
-            //     shadowColor: 'rgba(0, 0, 0, 0.1)',
-            //     shadowBlur: 10
-            //   }
-            // },
-            itemStyle: {
-              normal: {
-
-                color: cc.line4,
-                borderColor: 'rgba(50,194,219,0.2)',
-                borderWidth: 12
-              }
-            },
-            data: value.value4
-          },
-          {
-            name: '第5时刻',
-            type: 'line',
-            smooth: true,
-            symbol: 'circle',
-            symbolSize: 5,
-            showSymbol: false,
-            lineStyle: {
-              normal: {
-                width: 2
-              }
-            },
-            // areaStyle: {
-            //   normal: {
-            //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
-            //       offset: 0,
-            //       color: 'rgba(50,194,219, 0.3)'
-            //     }, {
-            //       offset: 0.8,
-            //       color: 'rgba(219, 50, 51, 0)'
-            //     }], false),
-            //     shadowColor: 'rgba(0, 0, 0, 0.1)',
-            //     shadowBlur: 10
-            //   }
-            // },
-            itemStyle: {
-              normal: {
-
-                color: cc.line5,
-                borderColor: 'rgba(50,194,219,0.2)',
-                borderWidth: 12
-              }
-            },
-            data: value.value5
-          },
-          {
-            name: '第6时刻',
-            type: 'line',
-            smooth: true,
-            symbol: 'circle',
-            symbolSize: 5,
-            showSymbol: false,
-            lineStyle: {
-              normal: {
-                width: 2
-              }
-            },
-            // areaStyle: {
-            //   normal: {
-            //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
-            //       offset: 0,
-            //       color: 'rgba(50,194,219, 0.3)'
-            //     }, {
-            //       offset: 0.8,
-            //       color: 'rgba(219, 50, 51, 0)'
-            //     }], false),
-            //     shadowColor: 'rgba(0, 0, 0, 0.1)',
-            //     shadowBlur: 10
-            //   }
-            // },
-            itemStyle: {
-              normal: {
-
-                color: cc.line6,
-                borderColor: 'rgba(50,194,219,0.2)',
-                borderWidth: 12
-              }
-            },
-            data: value.value6
-          },
-          {
-            name: '第7时刻',
-            type: 'line',
-            smooth: true,
-            symbol: 'circle',
-            symbolSize: 5,
-            showSymbol: false,
-            lineStyle: {
-              normal: {
-                width: 2
-              }
-            },
-            // areaStyle: {
-            //   normal: {
-            //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
-            //       offset: 0,
-            //       color: 'rgba(50,194,219, 0.3)'
-            //     }, {
-            //       offset: 0.8,
-            //       color: 'rgba(219, 50, 51, 0)'
-            //     }], false),
-            //     shadowColor: 'rgba(0, 0, 0, 0.1)',
-            //     shadowBlur: 10
-            //   }
-            // },
-            itemStyle: {
-              normal: {
-
-                color: cc.line7,
-                borderColor: 'rgba(50,194,219,0.2)',
-                borderWidth: 12
-              }
-            },
-            data: value.value7
-          },
-          {
-            name: '第8时刻',
-            type: 'line',
-            smooth: true,
-            symbol: 'circle',
-            symbolSize: 5,
-            showSymbol: false,
-            lineStyle: {
-              normal: {
-                width: 2
-              }
-            },
-            // areaStyle: {
-            //   normal: {
-            //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
-            //       offset: 0,
-            //       color: 'rgba(50,194,219, 0.3)'
-            //     }, {
-            //       offset: 0.8,
-            //       color: 'rgba(219, 50, 51, 0)'
-            //     }], false),
-            //     shadowColor: 'rgba(0, 0, 0, 0.1)',
-            //     shadowBlur: 10
-            //   }
-            // },
-            itemStyle: {
-              normal: {
-
-                color: cc.line8,
-                borderColor: 'rgba(50,194,219,0.2)',
-                borderWidth: 12
-              }
-            },
-            data: value.value8
-          },
-          {
-            name: '第9时刻',
-            type: 'line',
-            smooth: true,
-            symbol: 'circle',
-            symbolSize: 5,
-            showSymbol: false,
-            lineStyle: {
-              normal: {
-                width: 2
-              }
-            },
-            // areaStyle: {
-            //   normal: {
-            //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
-            //       offset: 0,
-            //       color: 'rgba(50,194,219, 0.3)'
-            //     }, {
-            //       offset: 0.8,
-            //       color: 'rgba(219, 50, 51, 0)'
-            //     }], false),
-            //     shadowColor: 'rgba(0, 0, 0, 0.1)',
-            //     shadowBlur: 10
-            //   }
-            // },
-            itemStyle: {
-              normal: {
-
-                color: cc.line9,
-                borderColor: 'rgba(50,194,219,0.2)',
-                borderWidth: 12
-              }
-            },
-            data: value.value9
-          },
-          {
-            name: '第10时刻',
-            type: 'line',
-            smooth: true,
-            symbol: 'circle',
-            symbolSize: 5,
-            showSymbol: false,
-            lineStyle: {
-              normal: {
-                width: 2
-              }
-            },
-            // areaStyle: {
-            //   normal: {
-            //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
-            //       offset: 0,
-            //       color: 'rgba(50,194,219, 0.3)'
-            //     }, {
-            //       offset: 0.8,
-            //       color: 'rgba(219, 50, 51, 0)'
-            //     }], false),
-            //     shadowColor: 'rgba(0, 0, 0, 0.1)',
-            //     shadowBlur: 10
-            //   }
-            // },
-            itemStyle: {
-              normal: {
-
-                color: cc.line10,
-                borderColor: 'rgba(50,194,219,0.2)',
-                borderWidth: 12
-              }
-            },
-            data: value.value10
-          },
-          {
-            name: '第11时刻',
-            type: 'line',
-            smooth: true,
-            symbol: 'circle',
-            symbolSize: 5,
-            showSymbol: false,
-            lineStyle: {
-              normal: {
-                width: 2
-              }
-            },
-            // areaStyle: {
-            //   normal: {
-            //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
-            //       offset: 0,
-            //       color: 'rgba(50,194,219, 0.3)'
-            //     }, {
-            //       offset: 0.8,
-            //       color: 'rgba(219, 50, 51, 0)'
-            //     }], false),
-            //     shadowColor: 'rgba(0, 0, 0, 0.1)',
-            //     shadowBlur: 10
-            //   }
-            // },
-            itemStyle: {
-              normal: {
-
-                color: cc.line11,
-                borderColor: 'rgba(50,194,219,0.2)',
-                borderWidth: 12
-              }
-            },
-            data: value.value11
-          },
-          {
-            name: '第12时刻',
-            type: 'line',
-            smooth: true,
-            symbol: 'circle',
-            symbolSize: 5,
-            showSymbol: false,
-            lineStyle: {
-              normal: {
-                width: 2
-              }
-            },
-            // areaStyle: {
-            //   normal: {
-            //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
-            //       offset: 0,
-            //       color: 'rgba(50,194,219, 0.3)'
-            //     }, {
-            //       offset: 0.8,
-            //       color: 'rgba(219, 50, 51, 0)'
-            //     }], false),
-            //     shadowColor: 'rgba(0, 0, 0, 0.1)',
-            //     shadowBlur: 10
-            //   }
-            // },
-            itemStyle: {
-              normal: {
+          data: sj
+        }]
+      }
 
-                color: cc.line12,
-                borderColor: 'rgba(50,194,219,0.2)',
-                borderWidth: 12
-              }
-            },
-            data: value.value12
-          },
-          {
-            name: '第13时刻',
+      option.yAxis[0].max = cap
+         option.legend.data = ['实际功率','超短期','短期']
+        option.series.push({
+            name: '超短期',
             type: 'line',
             smooth: true,
             symbol: 'circle',
             symbolSize: 5,
             showSymbol: false,
+          connectNulls:true,
             lineStyle: {
               normal: {
                 width: 2
               }
             },
-            // areaStyle: {
-            //   normal: {
-            //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
-            //       offset: 0,
-            //       color: 'rgba(50,194,219, 0.3)'
-            //     }, {
-            //       offset: 0.8,
-            //       color: 'rgba(219, 50, 51, 0)'
-            //     }], false),
-            //     shadowColor: 'rgba(0, 0, 0, 0.1)',
-            //     shadowBlur: 10
-            //   }
-            // },
-            itemStyle: {
-              normal: {
 
-                color: cc.line13,
-                borderColor: 'rgba(50,194,219,0.2)',
-                borderWidth: 12
-              }
-            },
-            data: value.value13
-          },
-          {
-            name: '第14时刻',
-            type: 'line',
-            smooth: true,
-            symbol: 'circle',
-            symbolSize: 5,
-            showSymbol: false,
-            lineStyle: {
-              normal: {
-                width: 2
-              }
-            },
-            // areaStyle: {
-            //   normal: {
-            //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
-            //       offset: 0,
-            //       color: 'rgba(50,194,219, 0.3)'
-            //     }, {
-            //       offset: 0.8,
-            //       color: 'rgba(219, 50, 51, 0)'
-            //     }], false),
-            //     shadowColor: 'rgba(0, 0, 0, 0.1)',
-            //     shadowBlur: 10
-            //   }
-            // },
             itemStyle: {
               normal: {
-
-                color: cc.line14,
-                borderColor: 'rgba(50,194,219,0.2)',
+                color: cc.cdq,
+                borderColor: 'rgba(219,50,51,0.2)',
                 borderWidth: 12
               }
             },
-            data: value.value14
-          },
-          {
-            name: '第15时刻',
+            data: cdq
+          },{
+            name: '短期',
             type: 'line',
             smooth: true,
+          connectNulls:true,
             symbol: 'circle',
             symbolSize: 5,
             showSymbol: false,
@@ -673,71 +200,24 @@ export default {
                 width: 2
               }
             },
-            // areaStyle: {
-            //   normal: {
-            //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
-            //       offset: 0,
-            //       color: 'rgba(50,194,219, 0.3)'
-            //     }, {
-            //       offset: 0.8,
-            //       color: 'rgba(219, 50, 51, 0)'
-            //     }], false),
-            //     shadowColor: 'rgba(0, 0, 0, 0.1)',
-            //     shadowBlur: 10
-            //   }
-            // },
-            itemStyle: {
-              normal: {
 
-                color: cc.line15,
-                borderColor: 'rgba(50,194,219,0.2)',
-                borderWidth: 12
-              }
-            },
-            data: value.value15
-          },
-          {
-            name: '第16时刻',
-            type: 'line',
-            smooth: true,
-            symbol: 'circle',
-            symbolSize: 5,
-            showSymbol: false,
-            lineStyle: {
-              normal: {
-                width: 2
-              }
-            },
-            // areaStyle: {
-            //   normal: {
-            //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
-            //       offset: 0,
-            //       color: 'rgba(50,194,219, 0.3)'
-            //     }, {
-            //       offset: 0.8,
-            //       color: 'rgba(219, 50, 51, 0)'
-            //     }], false),
-            //     shadowColor: 'rgba(0, 0, 0, 0.1)',
-            //     shadowBlur: 10
-            //   }
-            // },
             itemStyle: {
               normal: {
-                color: cc.line16,
-                borderColor: 'rgba(50,194,219,0.2)',
+                color: cc.dq,
+                borderColor: 'rgba(219,50,51,0.2)',
                 borderWidth: 12
               }
             },
-            data: value.value16
-          }]
-      })
+            data: dq
+          }
+        )
+      this.chart.setOption(option,true)
     },
-
   }
 }
 </script>
 <style scoped>
-#charts {
+#rpcharts {
   width: 100%;
   height: calc(80vh - 50px);
 }

+ 193 - 124
ipfcst-console/src/main/frontend/views/dataquery/forecastPowerUltraShortTerm16/index.vue

@@ -1,20 +1,9 @@
 <template>
   <div class="chart-container">
-    <br/>
     <div class="filter">
-      <div class="startTime" style="display: inline-block">
-        <span class="timeText" style="font-weight: bold;font-size: 14px">&#12288;时间:</span>
-        <el-date-picker
-          v-model="startTime"
-          :clearable="false"
-          placeholder="选择日期"
-          type="date"
-          value-format="timestamp">
-        </el-date-picker>
-      </div>
-      <div style="display: inline-block">
-        <span style="font-weight: bold;font-size: 14px">&#12288;场站名称:</span>
-        <el-select v-model="stationCode" clearable size="small" style="width:250px">
+      <div class="startTime">
+        <span style="font-weight: bold;font-size: 14px">场站名称:</span>
+        <el-select style="width:250px" clearable v-model="stationCode" size="small">
           <el-option
             v-for="item in stationList"
             :key="item.stationCode"
@@ -24,59 +13,65 @@
             <span style="float: right; color: #8492a6;font-size: 13px">{{ item.stationCode }}</span>
           </el-option>
         </el-select>
+        <span style="font-weight: bold;font-size: 14px">起始时间:</span>
+        <el-date-picker
+          v-model="startTime"
+          :clearable="false"
+          type="datetime"
+          value-format="timestamp"
+          placeholder="选择日期">
+        </el-date-picker>
+        <span style="font-weight: bold;font-size: 14px">截止时间:</span>
+        <el-date-picker
+          v-model="endTime"
+          :clearable="false"
+          type="datetime"
+          value-format="timestamp"
+          placeholder="选择日期">
+        </el-date-picker>
+        <el-button :loading=loading size="small" @click="dateQuery">查询</el-button>
       </div>
-      <div class="timeQuery" style="display: inline-block">
-        <el-button :loading="loading" size="small" @click="dateQuery">&#12288;查询</el-button>
-      </div>
-
+      <div class="toolbar" v-show="this.showToolBar"> <vxe-toolbar ref="fstToolBar" custom >
+        <template v-slot:buttons>
+          <vxe-button style="background:transparent;border:none"  @click="exportData"><i class="vxe-icon--download" style="color: white"></i></vxe-button>
+        </template>
+      </vxe-toolbar></div>
     </div>
-    <br/>
+
     <div class="content">
-      <el-tabs v-model="activeName" type="card">
-        <el-tab-pane label="表格" name="first">
+      <el-tabs type="card" v-model="activeName" @tab-click="Byresize">
+        <el-tab-pane label="图表" name="first">
+          <chart :drawData = this.drawData :resizeKey=this.resizeKey  />
+        </el-tab-pane>
+        <el-tab-pane label="表格" name="second">
           <div class="tableContent">
             <vxe-table
               id="fstTable"
               ref="fstRef"
-              :auto-resize="true"
-              :custom-config="{storage: true, checkMethod: checkColumnMethod}"
-              :data="tableData.slice((currentPage-1)*pageSize,currentPage*pageSize)"
-              :loading="loading"
-              align="center"
               border
               export-config
+              :loading="loading"
+              @sort-change="sortChangeEvent"
+              :custom-config="{storage: true, checkMethod: checkColumnMethod}"
+              :auto-resize="true"
               highlight-hover-row
               max-height="90%"
-              @sort-change="sortChangeEvent">
-              <vxe-table-column :formatter="dateFormat" field="times" min-width="150" sortable title="预测时间"
-                                width="180"></vxe-table-column>
-              <vxe-table-column field="realValue" min-width="60" title="实际功率"></vxe-table-column>
-              <vxe-table-column field="value1" min-width="60" title="第1个时刻"></vxe-table-column>
-              <vxe-table-column field="value2" min-width="60" title="第2个时刻"></vxe-table-column>
-              <vxe-table-column field="value3" min-width="60" title="第3个时刻"></vxe-table-column>
-              <vxe-table-column field="value4" min-width="60" title="第4个时刻"></vxe-table-column>
-              <vxe-table-column field="value5" min-width="60" title="第5个时刻"></vxe-table-column>
-              <vxe-table-column field="value6" min-width="60" title="第6个时刻"></vxe-table-column>
-              <vxe-table-column field="value7" min-width="60" title="第7个时刻"></vxe-table-column>
-              <vxe-table-column field="value8" min-width="60" title="第8个时刻"></vxe-table-column>
-              <vxe-table-column field="value9" min-width="60" title="第9个时刻"></vxe-table-column>
-              <vxe-table-column field="value10" min-width="60" title="第10个时刻"></vxe-table-column>
-              <vxe-table-column field="value11" min-width="60" title="第11个时刻"></vxe-table-column>
-              <vxe-table-column field="value12" min-width="60" title="第12个时刻"></vxe-table-column>
-              <vxe-table-column field="value13" min-width="60" title="第13个时刻"></vxe-table-column>
-              <vxe-table-column field="value14" min-width="60" title="第14个时刻"></vxe-table-column>
-              <vxe-table-column field="value15" min-width="60" title="第15个时刻"></vxe-table-column>
-              <vxe-table-column field="value16" min-width="60" title="第16个时刻"></vxe-table-column>
+              align="center"
+              :data="tableData.slice((currentPage-1)*pageSize,currentPage*pageSize)">
+              <vxe-table-column  field="times" title="预测时间" :formatter="dateFormat" width="180" sortable min-width="150"></vxe-table-column>
+              <vxe-table-column field="value1" title="实际功率" min-width="60"></vxe-table-column>
+              <vxe-table-column field="value2" title="超短期" min-width="60" ></vxe-table-column>
+              <vxe-table-column field="value3" title="短期" min-width="60"></vxe-table-column>
             </vxe-table>
             <div class="rtPageturning">
               <vxe-pager
-                :current-page.sync="currentPage"
-                :layouts="['PrevJump', 'PrevPage', 'JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']"
+                background
                 :loading="loading"
+                :current-page.sync="currentPage"
                 :page-size.sync="pageSize"
                 :total="tableData.length"
-                background
-                @page-change="handlePageChange">
+                @page-change="handlePageChange"
+                :layouts="['PrevJump', 'PrevPage', 'JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']">
               </vxe-pager>
             </div>
           </div>
@@ -90,137 +85,127 @@
 <script>
 import Chart from './charts'
 import resize from '../../../components/Charts/mixins/resize'
-import moment from "moment";
-
+import moment from "moment"
 export default {
   name: 'nwp',
-  components: {Chart},
+  components: { Chart},
   mixins: [resize],
-  data() {
-    return {
-      outer: 'outer',
+  data(){
+    return{
+      outer:'outer',
       chart: null,
-      queryStartTime: '',
-      queryEndTime: '',
-      startTime: new Date(new Date().toLocaleDateString()).getTime(),
-      loading: true,
-      drawLoading: true,
-      tableLoading: true,
-      resizeKey: 1,
+      queryStartTime:'',
+      queryEndTime:'',
+      stationCode: '',
+      stationList: [],
+      startTime:new Date(new Date().toLocaleDateString()).getTime(),
+      endTime:new Date(new Date().toLocaleDateString()).getTime()+ 60 * 60 * 24 * 1000 - 1,
+      loading:true,
+      drawLoading:true,
+      tableLoading:true,
+      resizeKey:1,
       activeName: 'first',
-      drawData: {datas: [], times: []},
-      tableData: [],
-      total: 0,
-      sortOrder: 'asc',
+      drawData:{datas:[],times:[]},
+      tableData:[],
+      total:0,
+      sortOrder:'asc',
       pageSize: 10,
       currentPage: 1,
-      stationCode: '',
-      stationList: [],
+      showToolBar:false
+      /*menuKey:1,
+      isRenderingTime : new Date().getTime()*/
 
     }
   },
-  created() {
+  created () {
     this.$nextTick(() => {
       // 手动将表格和工具栏进行关联
       this.$refs.fstRef.connect(this.$refs.fstToolBar)
     })
   },
   mounted() {
-    this.init()
     this.getStationList()
+    this.loading = false
   },
-  methods: {
-    init() {
-      this.queryStartTime = this.startTime
-      this.loading = true
-    },
+  methods:{
     getStationList() {
       this.$axios.get('/electricField/getElectricField').then((res) => {
         this.stationList = res.data
       }).catch((error) => {
         this.$message.error('获取场站下拉框出错' + error)
       })
-      this.loading = false
     },
-    getDraw(startTime, stationCode) {
+    /*init(){
+      this.queryStartTime = this.startTime
+      this.loading = true
+      this.getDraw(this.queryStartTime,this.endTime,this.stationCode)
+      // this.getTable()
+
+    },*/
+    getDraw(startTime,endTime,stationCode){
       this.drawLoading = true
-      this.$axios.get('/findByForecastRealTimeUltraShortTerm16/' + startTime + '/' + stationCode).then((res) => {
-        const value = res.data.value
+
+      this.$axios.get('/ForecastDataComparison/'+startTime+'/'+endTime+'/'+stationCode).then((res) => {
+        const value = res.data
         this.tableData = []
-        for (let i = 1; i < res.data.realDatas.length; i++) {
+        console.log(res.data.time.length)
+        for(let i = 0;i< res.data.time.length;i++){
           const temp = {}
-          temp.times = res.data.times[i]
-          temp.realValue = res.data.realDatas[i]
-          temp.value1 = value.value1[i]
-          temp.value2 = value.value2[i]
-          temp.value3 = value.value3[i]
-          temp.value4 = value.value4[i]
-          temp.value5 = value.value5[i]
-          temp.value6 = value.value6[i]
-          temp.value7 = value.value7[i]
-          temp.value8 = value.value8[i]
-          temp.value9 = value.value9[i]
-          temp.value10 = value.value10[i]
-          temp.value11 = value.value11[i]
-          temp.value12 = value.value12[i]
-          temp.value13 = value.value13[i]
-          temp.value14 = value.value14[i]
-          temp.value15 = value.value15[i]
-          temp.value16 = value.value16[i]
+          const a = this.dateMoment(value.time[i])
+          temp.times = value.time[i]
+          temp.value1 = value.sj[i]
+          temp.value2 = value.cdq[i]
+          temp.value3 = value.dq[i]
           this.tableData.push(temp)
         }
-
+        console.log(this.tableData)
         this.loading = false
         this.drawData = res.data
         this.drawLoading = false
-        if (!this.drawLoading && !this.tableLoading) {
+        if(!this.drawLoading && !this.tableLoading){
           this.loading = false
         }
       }).catch((error) => {
         this.drawLoading = false
-        if (!this.drawLoading && !this.tableLoading) {
+        if(!this.drawLoading && !this.tableLoading){
           this.loading = false
         }
         this.$message.error('查询实时预测短期echarts出错' + error)
       })
-      this.loading = false
     },
-    handlePageChange({currentPage, pageSize}) {
+    handlePageChange ({ currentPage, pageSize }) {
       this.currentPage = currentPage
-      if (this.pageSize != pageSize) {
-        this.currentPage = 1
-      }
       this.pageSize = pageSize
       this.startTime = this.queryStartTime
     },
-    dateFormat({cellValue, row, column}) {
+    dateFormat({ cellValue, row, column }) {
       return this.$XEUtils.toDateString(cellValue, 'yyyy-MM-dd HH:mm:ss')
     },
     dateFormatForTitle(cellValue) {
       return this.$XEUtils.toDateString(cellValue, 'yyyy-MM-dd')
     },
-    enumToWord({cellValue, row, column}) {
-      if (cellValue == "E1") {
+    enumToWord({ cellValue, row, column }) {
+      if(cellValue == "E1"){
         return "云端模型"
       }
-      if (cellValue == 'E2') {
+      if(cellValue == 'E2'){
         return "物理模型"
       }
-      if (cellValue == 'E3') {
+      if(cellValue == 'E3'){
         return "统计模型"
       }
-      if (cellValue == 'E4') {
+      if(cellValue == 'E4'){
         return "补录数据"
       }
-      if (cellValue == 'E5') {
+      if(cellValue == 'E5'){
         return "差值模型"
       }
     },
-    dateMoment({cellValue, row, column}) {
+    dateMoment({ cellValue, row, column }) {
       return moment(cellValue).format('YYYY-MM-DD HH:mm:ss')
     },
-    sortChangeEvent({column, property, order}) {
-      if (order == null) {
+    sortChangeEvent ({ column, property, order }) {
+      if(order == null){
         order = 'asc'
       }
       this.currentPage = 1
@@ -229,23 +214,107 @@ export default {
       // this.getTable()
     },
 
-    checkColumnMethod({column}) {
+    checkColumnMethod ({ column }) {
       if (column.property === 'preTime') {
         return false
       }
       return true
     },
-    dateQuery() {
+    dateQuery(){
       this.loading = true
+      // if(this.endTime<=this.startTime){
+      //   this.$message.error("开始时间不能小于结束时间")
+      //   this.startTime = this.queryStartTime
+      //   this.endTime = this.queryEndTime
+      //   this.loading = false
+      //   return
+      // }
       this.queryStartTime = this.startTime
-      if (this.stationCode == '') {
-        this.$message.error("场站编码不能为空")
-        this.loading = false
-        return
+      // this.queryEndTime = this.endTime
+      this.getDraw(this.queryStartTime,this.endTime,this.stationCode)
+      // this.getTable()
+    },
+    Byresize(tab){
+      if(tab.name =='first'){
+        this.resizeKey++
+        this.showToolBar = false
+      }else{
+        this.showToolBar = true
       }
-      this.getDraw(this.queryStartTime, this.stationCode)
+    },
+    exportData(){
+      const data = this.tableData
+      this.$refs.fstRef.exportData({
+        filename: this.dateFormatForTitle(this.startTime)+' 超短期16时刻数据',
+        type: 'csv',
+        isHeader: true,
+        isFooter: true,
+        data
+      })
     }
   }
 }
 </script>
 
+<style scoped>
+.chart-container{
+  position:relative;
+  width:100%;
+  height:calc(100vh - 50px);
+}
+
+.filter{
+  position:relative;
+  display:flex;
+  padding:20px 0 10px 15px;
+  font-size:12px;
+  line-height:11px;
+}
+
+
+
+.timeText{
+  opacity:0.69;
+  padding-right:7px;
+  font-size:14px;
+}
+
+.startTime{
+  display:inline-block;
+}
+
+.endTime{
+  display:inline-block;
+  padding-left:42px;
+}
+
+.content{
+  width: 100%;
+  height: 90%;
+  padding-left: 5px;
+  padding-right: 5px;
+}
+.content >>> .el-tabs__item.is-active {
+  color: #409EFF;
+}
+
+
+.tableContent{
+  width: 100%;
+  height:calc(80vh - 50px);
+}
+.tableContent >>> td{
+  border:1px solid #ffffff;
+}
+
+.toolbar{
+  position:absolute;right:0px;
+}
+.toolbar >>> .vxe-button.type--button.is--circle {
+  padding: 0 .5em;
+  min-width: 34px;
+  border-radius: 10%;
+  border: none;
+}
+</style>
+

+ 21 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/PowerStationStatusDataController.java

@@ -115,4 +115,25 @@ public class PowerStationStatusDataController {
 
 return null;
   }
+
+  /**
+   * 预测数据查询
+   * @param startTime 开始时间
+   * @param endTime 结束时间
+   * @param stationCode 场站编号
+   * @return
+   */
+  @GetMapping(value = "/ForecastDataComparison/{startTime}/{endTime}/{stationCode}")
+  public ResponseVO ForecastDataComparison(@PathVariable("startTime") Long startTime,
+                                           @PathVariable("endTime") Long endTime,
+                                           @PathVariable("stationCode") String stationCode){
+    try {
+      Map<String, Object> map=  powerStationStatusDataService.findForecastDataComparison(startTime,endTime,stationCode);
+      return ResponseVO.success(map);
+    }catch (Exception e){
+      e.printStackTrace();
+      log.error("预测数据对比图查询失败");
+      return ResponseVO.fail(e.toString());
+    }
+  }
 }

+ 84 - 7
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/PowerStationStatusDataService.java

@@ -1,11 +1,8 @@
 package com.jiayue.ipfcst.console.service;
 
 import com.jiayue.ipfcst.common.core.exception.BusinessException;
-import com.jiayue.ipfcst.common.data.entity.ElectricField;
-import com.jiayue.ipfcst.common.data.entity.PowerStationStatusData;
-import com.jiayue.ipfcst.common.data.entity.SysParameter;
-import com.jiayue.ipfcst.common.data.repository.PowerStationStatusDataRepository;
-import com.jiayue.ipfcst.common.data.repository.SysParameterRepository;
+import com.jiayue.ipfcst.common.data.entity.*;
+import com.jiayue.ipfcst.common.data.repository.*;
 import com.jiayue.ipfcst.common.data.service.BaseService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
@@ -31,11 +28,16 @@ public class PowerStationStatusDataService extends BaseService {
 
   private final PowerStationStatusDataRepository powerStationStatusDataRepository;
   private final SysParameterRepository sysParameterRepository;
-
+  private final ForecastPowerShortTermHisRepository forecastPowerShortTermHisRepository;
+  private final ElectricFieldService electricFieldService;
+  private final ForecastPowerUltraShortTermHisRepository forecastPowerUltraShortTermHisRepository;
   @Autowired
-  public PowerStationStatusDataService(PowerStationStatusDataRepository powerStationStatusDataRepository, SysParameterRepository sysParameterRepository) {
+  public PowerStationStatusDataService(PowerStationStatusDataRepository powerStationStatusDataRepository, SysParameterRepository sysParameterRepository, ForecastPowerShortTermHisRepository forecastPowerShortTermHisRepository, ElectricFieldService electricFieldService, ForecastPowerUltraShortTermHisRepository forecastPowerUltraShortTermHisRepository) {
     this.powerStationStatusDataRepository = powerStationStatusDataRepository;
     this.sysParameterRepository = sysParameterRepository;
+    this.forecastPowerShortTermHisRepository = forecastPowerShortTermHisRepository;
+    this.electricFieldService = electricFieldService;
+    this.forecastPowerUltraShortTermHisRepository = forecastPowerUltraShortTermHisRepository;
   }
 
   /**
@@ -392,5 +394,80 @@ public class PowerStationStatusDataService extends BaseService {
 
     return map;
   }
+
+  @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
+  public Map<String, Object> findForecastDataComparison(Long startTime, Long endTime, String stationCode) {
+    List<PowerStationStatusData> powerStationStatusDataList = powerStationStatusDataRepository.findByTimeBetweenAndStationCode(new Date(startTime),new Date(endTime),stationCode);
+    List<ForecastPowerShortTermHis> forecastPowerShortTermHisList = forecastPowerShortTermHisRepository.findByForecastTimeBetweenAndStationCodeAndForecastHowLongAgo(startTime,endTime,stationCode, 1);
+    List<ForecastPowerUltraShortTermHis> forecastPowerUltraShortTermList =forecastPowerUltraShortTermHisRepository.findByForecastTimeBetweenAndStationCodeAndForecastHowLongAgo(startTime,endTime,stationCode,1);
+    Map<String, Object> map = new HashMap<>();
+    Map<Long, BigDecimal> cdqMap = new HashMap<>();
+    for (ForecastPowerUltraShortTermHis forecastPowerUltraShortTermHis : forecastPowerUltraShortTermList) {
+      cdqMap.put(forecastPowerUltraShortTermHis.getForecastTime(), forecastPowerUltraShortTermHis.getAbleValue());
+    }
+    Map<Long, BigDecimal> dqMap = new HashMap<>();
+    for (ForecastPowerShortTermHis forecastPowerShortTermHis : forecastPowerShortTermHisList) {
+      dqMap.put(forecastPowerShortTermHis.getForecastTime(), forecastPowerShortTermHis.getAbleValue());
+    }
+    Map<Long, BigDecimal> sjMap = new HashMap<>();
+    for (PowerStationStatusData powerStationStatusData : powerStationStatusDataList) {
+      sjMap.put(powerStationStatusData.getTime().getTime(), powerStationStatusData.getAbleValue());
+    }
+    List<BigDecimal> dq = new ArrayList();
+    List<BigDecimal> cdq = new ArrayList();
+    List<BigDecimal> sj = new ArrayList();
+    List<String> time = new ArrayList();
+    for (long tempDateTime = startTime; tempDateTime < endTime; tempDateTime = tempDateTime + 15 * 60 * 1000) {
+      BigDecimal cdqValue=null;
+      BigDecimal dqValue = null;
+      BigDecimal sjValue= null;
+      if(cdqMap.get(tempDateTime) != null){
+        cdqValue = cdqMap.get(tempDateTime);
+      }else if (cdqMap.get(tempDateTime - 1 * 6000) != null ){
+        cdqValue = cdqMap.get(tempDateTime - 1 * 6000);
+      }else if (cdqMap.get(tempDateTime - 2 * 6000) != null ){
+        cdqValue = cdqMap.get(tempDateTime - 2 * 6000);
+      }else if (cdqMap.get(tempDateTime - 3 * 6000) != null ){
+        cdqValue = cdqMap.get(tempDateTime - 3 * 6000);
+      }else if (cdqMap.get(tempDateTime - 4 * 6000) != null ){
+        cdqValue = cdqMap.get(tempDateTime - 4 * 6000);
+      }
+      if(dqMap.get(tempDateTime) != null){
+        dqValue = dqMap.get(tempDateTime);
+      }else if (dqMap.get(tempDateTime - 1 * 6000) != null ){
+        dqValue = dqMap.get(tempDateTime - 1 * 6000);
+      }else if (dqMap.get(tempDateTime - 2 * 6000) != null ){
+        dqValue = dqMap.get(tempDateTime - 2 * 6000);
+      }else if (dqMap.get(tempDateTime - 3 * 6000) != null ){
+        dqValue = dqMap.get(tempDateTime - 3 * 6000);
+      }else if (dqMap.get(tempDateTime - 4 * 6000) != null ){
+        dqValue = dqMap.get(tempDateTime - 4 * 6000);
+      }
+      if(sjMap.get(tempDateTime) != null){
+        sjValue = sjMap.get(tempDateTime);
+      }else if (sjMap.get(tempDateTime - 1 * 6000) != null ){
+        sjValue = sjMap.get(tempDateTime - 1 * 6000);
+      }else if (sjMap.get(tempDateTime - 2 * 6000) != null ){
+        sjValue = sjMap.get(tempDateTime - 2 * 6000);
+      }else if (sjMap.get(tempDateTime - 3 * 6000) != null ){
+        sjValue = sjMap.get(tempDateTime - 3 * 6000);
+      }else if (sjMap.get(tempDateTime - 4 * 6000) != null ){
+        sjValue = sjMap.get(tempDateTime - 4 * 6000);
+      }
+      SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+      dq.add(dqValue);
+      cdq.add(cdqValue);
+      sj.add(sjValue);
+      time.add(simpleDateFormat.format(tempDateTime));
+
+    }
+    map.put("dq",dq);
+    map.put("cdq",cdq);
+    map.put("sj",sj);
+    map.put("time",time);
+    ElectricField  electricField = electricFieldService.findByStationCode(stationCode);
+    map.put("cap",electricField.getCapacity().toString());
+    return  map;
+  }
 }
 

+ 32 - 14
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/ReceiveAllTypeService.java

@@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.TypeReference;
 import com.jiayue.ipfcst.common.core.util.DateTimeUtil;
-import com.jiayue.ipfcst.common.core.util.JsonBeanUtil;
 import com.jiayue.ipfcst.common.data.constant.enums.AlarmTypeEnum;
 import com.jiayue.ipfcst.common.data.constant.enums.EquipmentTypeEnum;
 import com.jiayue.ipfcst.common.data.entity.*;
@@ -69,6 +68,15 @@ public class ReceiveAllTypeService extends BaseService {
   PowerStationDataPackerContainer powerStationDataPackerContainer;
   @Autowired
   SysAlarmService sysAlarmService;
+  @Autowired
+  InverterInfoRepository inverterInfoRepository;
+  @Autowired
+  WindTowerInfoRepository windTowerInfoRepository;
+  @Autowired
+  WindTurbineInfoRepository windTurbineInfoRepository;
+  @Autowired
+  WeatherStationInfoRepository weatherStationInfoRepository;
+
   @Value("${receive.ip}")
   private String ip;
   @Value("${receive.port}")
@@ -204,7 +212,6 @@ public class ReceiveAllTypeService extends BaseService {
             long timestamp = Long.parseLong(time);
             //通过接收到的id找出编号
             map.put("stationCode",electricFieldId);
-            map.put("equipmentId", equipmentId);
             map.put("time", simpleDateFormat.format(timestamp));
             for (DataPoint dataPoint : dataPointList) {
               for (int j = 0; j < sensorIds.size(); j++) {
@@ -234,6 +241,7 @@ public class ReceiveAllTypeService extends BaseService {
             String ap = map.get(Active);
             switch(equipmentType.getCode()){
               case 2:
+                List<InverterInfo> inverterInfo = inverterInfoRepository.findByEquipmentNo(equipmentId);
                 //逆变器
                 if (ap != null && map.get("electricalCurrent") != null) {
                   //有功
@@ -250,19 +258,26 @@ public class ReceiveAllTypeService extends BaseService {
                   }
 
                 }
-                redisUtils.hmset("nbq-" + electricFieldId + "-" + equipmentId, map);
+                map.put("equipmentId", inverterInfo.get(0).getId().toString());
+                redisUtils.hmset("nbq-" + electricFieldId + "-" +  inverterInfo.get(0).getId(), map);
                 InverterStatusData inverterStatusData = JSON.parseObject(JSON.toJSONString(map), InverterStatusData.class);
                 inverterStatusDataRepository.save(inverterStatusData);
                 log.info(map.get("time")+"nbq-" + electricFieldId + "-" + equipmentId+"已存入");
                 break;
               case 3:
-                redisUtils.hmset("fj-" + electricFieldId + "-" + equipmentId, map);
+                //测风塔
+                List<WindTowerInfo> windTowerInfo = windTowerInfoRepository.findByEquipmentNo(equipmentId);
+                map.put("equipmentId", windTowerInfo.get(0).getId().toString());
+                redisUtils.hmset("fj-" + electricFieldId + "-" + windTowerInfo.get(0).getId(), map);
                 WindTurbineStatusData windTurbineStatusData = JSON.parseObject(JSON.toJSONString(map), WindTurbineStatusData.class);
                 windTurbineStatusDataRepository.save(windTurbineStatusData);
                 log.info("fj-" + electricFieldId + "-" + equipmentId+"已存入");
                 break;
               case 4:
-                redisUtils.hmset("cft-" + electricFieldId + "-" + equipmentId, map);
+                List<WindTurbineInfo> windTurbineInfo = windTurbineInfoRepository.findByEquipmentNo(equipmentId);
+                //风机
+                map.put("equipmentId", windTurbineInfo.get(0).getId().toString());
+                redisUtils.hmset("cft-" + electricFieldId + "-" + windTurbineInfo.get(0).getId(), map);
                 WindTowerStatusData windTowerStatusData = JSON.parseObject(JSON.toJSONString(map), WindTowerStatusData.class);
                 windTowerStatusDataRepository.save(windTowerStatusData);
                 log.info("cft-" + electricFieldId + "-" + equipmentId+"已存入");
@@ -314,12 +329,13 @@ public class ReceiveAllTypeService extends BaseService {
       String errorInfo = "发送http请求数据异常";
       log.info(errorInfo);
       log.info("所用线程"+Thread.currentThread().getName());
-      log.info("停止请求数据");
+      //log.info("停止请求数据");
       // 进行告警
       String describe = "";
-      String solution = "停止请求数据";
+      //String solution = "停止请求数据";
+      String solution = "";
       sysAlarmService.saveSysAlarm(AlarmTypeEnum.E5, errorInfo, describe, errorInfo, solution);
-      Thread.currentThread().stop();
+      //Thread.currentThread().stop();
     }
     return body;
   }
@@ -410,15 +426,16 @@ public class ReceiveAllTypeService extends BaseService {
       HttpEntity responseEntity = response.getEntity();
       body = EntityUtils.toString(responseEntity, StandardCharsets.UTF_8);
     }catch (RuntimeException | IOException e){
-      String errorInfo = "发送http请求气象站检修状态数据异常";
+      String errorInfo = "发送http请求数据异常";
       log.info(errorInfo);
       log.info("所用线程"+Thread.currentThread().getName());
-      log.info("停止请求象站检修状态数据");
+      //log.info("停止请求数据");
       // 进行告警
       String describe = "";
-      String solution = "停止请求象站检修状态数据";
+      //String solution = "停止请求数据";
+      String solution = "";
       sysAlarmService.saveSysAlarm(AlarmTypeEnum.E5, errorInfo, describe, errorInfo, solution);
-      Thread.currentThread().stop();
+      //Thread.currentThread().stop();
     }
     return body;
   }
@@ -456,7 +473,6 @@ public class ReceiveAllTypeService extends BaseService {
             long timestamp = Long.parseLong(time);
             //通过接收到的id找出编号
             map.put("stationCode",stationCode);
-            map.put("equipmentId", equipmentId);
             map.put("time", simpleDateFormat.format(timestamp));
             for (DataPoint dataPoint : dataPointList) {
               for (int j = 0; j < sensorIds.size(); j++) {
@@ -502,7 +518,9 @@ public class ReceiveAllTypeService extends BaseService {
                 break;
             }
             //气象站
-            redisUtils.hmset("qxz-" + stationCode + "-" + equipmentId, map);
+            List<WeatherStationInfo> weatherStationInfo = weatherStationInfoRepository.findByEquipmentNo(equipmentId);
+            map.put("equipmentId", weatherStationInfo.get(0).getId().toString());
+            redisUtils.hmset("qxz-" + stationCode + "-" + weatherStationInfo.get(0).getId(), map);
             WeatherStationStatusData weatherStationStatusData = JSON.parseObject(JSON.toJSONString(map), WeatherStationStatusData.class);
             weatherStationStatusDataRepository.save(weatherStationStatusData);
             log.info(map.get("time")+"qxz-" + stationCode + "-" + equipmentId+"已存入");

+ 4 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/service/E63UploadFileService.java

@@ -1158,6 +1158,9 @@ public class E63UploadFileService extends BaseUploadFileService {
               // 将有效的reids内容存入list
               InverterStatusData inverterStatusData = JSON.parseObject(JSON.toJSONString(nbqMap), InverterStatusData.class);
               redisList.add(inverterStatusData);
+              log.info(String.valueOf(Arrays.toString(redisList.toArray())));
+            }else{
+
             }
           }
         }
@@ -1183,6 +1186,7 @@ public class E63UploadFileService extends BaseUploadFileService {
           map.put("sample", inverterInfo.getSample() ? "1" : "0");
           //是否组串
           map.put("IsString", inverterInfo.getGroupSeries() ? "1" : "0");
+          log.info("inverterInfo.getId()==="+inverterInfo.getId());
           List<InverterStatusData> redisFilterList = redisList.stream().filter(s -> s.getId().equals(inverterInfo.getId())).collect(Collectors.toList());
           InverterStatusData redisValue = redisFilterList.get(0);
           // 状态