浏览代码

调度端多

xusl 1 年之前
父节点
当前提交
f573b8de3c

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

@@ -50,7 +50,7 @@ public interface ForecastPowerShortTermOneHisRepository extends BaseRepository<F
 	 * @param endTime   结束时间
 	 */
 	@Modifying
-	@Query(value = "delete from ForecastPowerShortTermHis t where t.genDate >= CURRENT_DATE and t.forecastTime >=?1 and t.forecastTime<=?2")
+	@Query(value = "delete from ForecastPowerShortTermOneHis t where t.genDate >= CURRENT_DATE and t.forecastTime >=?1 and t.forecastTime<=?2")
 	void deleteToday(Long startTime, Long endTime);
 
 	/**

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

@@ -24,7 +24,7 @@ public interface ForecastPowerUltraShortTermOneHisRepository extends BaseReposit
 	 * @param endTime   结束时间
 	 */
 	@Modifying
-	@Query(value = "delete from ForecastPowerUltraShortTermHis t where t.forecastTime >= ?1 and t.forecastTime<= ?2 and t.genDate = ?3 ")
+	@Query(value = "delete from ForecastPowerUltraShortTermOneHis t where t.forecastTime >= ?1 and t.forecastTime<= ?2 and t.genDate = ?3 ")
 	void deleteNowMoment(Long startTime, Long endTime, Date nowMomentTime);
 
 	/**

+ 49 - 0
ipfcst/ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/job/MakeCdqOneUploadLineJob.java

@@ -0,0 +1,49 @@
+package com.jiayue.ipfcst.fileupload.job;
+
+import com.jiayue.ipfcst.common.core.util.DateMomentUtil;
+import com.jiayue.ipfcst.common.data.entity.ForecastPowerUltraShortTermOneHis;
+import com.jiayue.ipfcst.common.data.job.BaseJob;
+import com.jiayue.ipfcst.console.service.ForecastPowerUltraShortTermOneService;
+import com.jiayue.ipfcst.console.service.SysParameterService;
+import lombok.extern.slf4j.Slf4j;
+import org.quartz.JobDataMap;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.Date;
+import java.util.List;
+
+@Slf4j
+public class MakeCdqOneUploadLineJob extends BaseJob {
+
+  @Autowired
+  private ForecastPowerUltraShortTermOneService forecastPowerUltraShortTermOneService;
+  @Autowired
+  private SysParameterService sysParameterService;
+
+  @Override
+  public boolean execute(JobDataMap jobDataMap) {
+    log.info("开始执行风电上报超短期数据生成定时任务");
+    // 获取当前系统时间
+    Date systemDate = new Date();
+    // 超短期默认天数
+    int cdqPoint = sysParameterService.getTranSysParameter("FILE_CDQ_POINT", "16");
+    // 超短期提前N分钟生成文件
+    int cdqUpMin = sysParameterService.getTranSysParameter("CDQ_UP_MIN", "0");
+
+
+    Long startTime;
+
+    try {
+      startTime = DateMomentUtil.getMomentTime(systemDate.getTime() + 15 * 60 * 1000 + cdqUpMin * 1000 * 60, 1, 15 * 60 * 1000L);
+    } catch (Exception e) {
+      log.error("数据超短期文件生成时刻步长错误", e);
+      startTime = DateMomentUtil.getDayStartTime(systemDate.getTime());
+    }
+    Long endTime = startTime + cdqPoint * 15 * 60 * 1000 - 1000;
+
+    List<ForecastPowerUltraShortTermOneHis> forecastPowerUltraShortTerm = forecastPowerUltraShortTermOneService.getForecastPowerUltraShortTerm(startTime, endTime);
+    log.info("执行首页上报超短期数据生成定时任务结束,生成记录数:"+forecastPowerUltraShortTerm.size());
+    return true;
+  }
+
+}

+ 39 - 0
ipfcst/ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/job/MakeDqOneUploadLineJob.java

@@ -0,0 +1,39 @@
+package com.jiayue.ipfcst.fileupload.job;
+
+import com.jiayue.ipfcst.common.core.util.DateMomentUtil;
+import com.jiayue.ipfcst.common.data.entity.ForecastPowerShortTermOneHis;
+import com.jiayue.ipfcst.common.data.job.BaseJob;
+import com.jiayue.ipfcst.console.service.ForecastPowerShortTermOneService;
+import com.jiayue.ipfcst.console.service.SysParameterService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.time.DateUtils;
+import org.quartz.JobDataMap;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.Date;
+import java.util.List;
+
+@Slf4j
+public class MakeDqOneUploadLineJob extends BaseJob {
+  @Autowired
+  private ForecastPowerShortTermOneService forecastPowerShortTermOneService;
+  @Autowired
+  private SysParameterService sysParameterService;
+  @Override
+  public boolean execute(JobDataMap jobDataMap) {
+    log.info("开始执行风电上报短期数据生成定时任务");
+
+    // 获取当前系统时间
+    Date systemDate = new Date();
+
+    // 短期默认天数
+    int dqDays = sysParameterService.getTranSysParameter("FILE_FORECAST_DAYS","0");
+
+    // 开始时间
+    Long startTime = DateMomentUtil.getDayStartTime(DateUtils.addDays(systemDate, 1).getTime());
+    Long endTime = DateMomentUtil.getDayLastTime(DateUtils.addDays(systemDate, dqDays).getTime()) - 1000;
+    List<ForecastPowerShortTermOneHis> forecastPowerShortTerm = this.forecastPowerShortTermOneService.getForecastPowerShortTerm(startTime, endTime);
+    log.info("执行首页上报短期数据生成定时任务结束,生成记录数:"+forecastPowerShortTerm.size());
+    return true;
+  }
+}

+ 5 - 2
ipfcst/ipfcst-console/src/main/resources/sql/t_init_job_class.sql

@@ -238,8 +238,11 @@ INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_T
 INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '新疆备调下午短期', 'com.jiayue.ipfcst.fileupload.job.UploadFileE401Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '新疆备调下午短期') ;
 
 
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '首页短期曲线', 'com.jiayue.ipfcst.fileupload.job.MakeDqUploadLineJob', 'dataCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '首页短期曲线') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '首页超短期曲线', 'com.jiayue.ipfcst.fileupload.job.MakeCdqUploadLineJob', 'dataCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '首页超短期曲线') ;
+INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '光伏短期曲线', 'com.jiayue.ipfcst.fileupload.job.MakeDqUploadLineJob', 'dataCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '光伏短期曲线') ;
+INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '光伏超短期曲线', 'com.jiayue.ipfcst.fileupload.job.MakeCdqUploadLineJob', 'dataCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '光伏超短期曲线') ;
+
+INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '风电短期曲线', 'com.jiayue.ipfcst.fileupload.job.MakeDqOneUploadLineJob', 'dataCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '风电短期曲线') ;
+INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '风电超短期曲线', 'com.jiayue.ipfcst.fileupload.job.MakeCdqOneUploadLineJob', 'dataCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '风电超短期曲线') ;
 
 INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '黑龙江新电量预测', 'com.jiayue.ipfcst.fileupload.job.UploadFileE201Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '黑龙江新电量预测') ;
 

+ 8 - 1
ipfcst/ipfcst-reportquery/src/main/frontend/router/modules/realTimeQuery.js

@@ -68,7 +68,14 @@ const realTimeQueryRouter = {
       path: 'forecastPowerShortTerm16',
       component: () => import('@/views/realTimeQuery/forecastPowerUltraShortTerm16'),
       name: 'forecastPowerShortTerm16',
-      meta: { title: '超短期16时刻查询', noCache: true },
+      meta: { title: '光伏超短期16时刻查询', noCache: true },
+      sign: 'currency'
+    },
+    {
+      path: 'forecastPowerShortTerm16One',
+      component: () => import('@/views/realTimeQuery/forecastPowerUltraShortTerm16One'),
+      name: 'forecastPowerShortTerm16One',
+      meta: { title: '风电超短期16时刻查询', noCache: true },
       sign: 'currency'
     },
     {

+ 749 - 0
ipfcst/ipfcst-reportquery/src/main/frontend/views/realTimeQuery/forecastPowerUltraShortTerm16One/charts/index.vue

@@ -0,0 +1,749 @@
+<template>
+  <div style="width: 100%;height: 100%" >
+    <div id="charts"></div>
+  </div>
+</template>
+
+<script>
+  import resize from '../../../../components/Charts/mixins/resize'
+  import echarts from 'echarts'
+  import cc from '../../../curvecolors'
+  export default {
+    mixins: [resize],
+    watch: {
+      drawData:{
+        handler(newValue, oldValue) {
+          this.draw(newValue.times, newValue.realDatas,newValue.value,newValue.capacity)
+        },
+        deep: true
+      },
+      resizeKey:function(newQuestion, oldQuestion){
+        if(this.chart !=null){
+          this.chart.resize();
+        }
+      }
+    },
+    props: {
+      drawData:{
+        type:Object,
+      },
+      resizeKey:{
+        type:Number
+      }
+    },
+    data() {
+      return {
+        lineColor:'',
+        chart: null,
+      }
+    },
+    mounted() {
+      if(sessionStorage.getItem('styleSwitch') === 'blue'){
+        this.lineColor = 'white'
+      }else{
+        this.lineColor = '#3b3b3b'
+      }
+    },
+    beforeDestroy() {
+      if (!this.chart) {
+        return
+      }
+      this.chart.dispose()
+      this.chart = null
+    },
+    methods: {
+      draw(timeaxis,realpower,value,capacity) {
+        this.chart = echarts.init(document.getElementById('charts'))
+        this.chart.setOption({
+          backgroundColor: 'transparent',
+          title: {
+            top: 20,
+            text: '超短期预测实时时刻查询',
+            textStyle: {
+              fontWeight: 'normal',
+              fontSize: 16,
+              color: this.lineColor
+            },
+            left: '1%'
+          },
+          tooltip: {
+            trigger: 'axis',
+            axisPointer: {
+              lineStyle: {
+                color: '#57617B'
+              }
+            }
+          },
+          legend: {
+            top: 20,
+            icon: 'rect',
+            itemWidth: 14,
+            itemHeight: 5,
+            itemGap: 13,
+            data: ['实际功率','第1时刻','第2时刻','第3时刻','第4时刻','第5时刻','第6时刻','第7时刻','第8时刻','第9时刻','第10时刻','第11时刻','第12时刻','第13时刻','第14时刻','第15时刻','第16时刻'],
+            right: '4%',
+            textStyle: {
+              fontSize: 12,
+              color: this.lineColor
+            }
+          },
+          dataZoom: [{
+            show: true,
+            realtime: true,
+            start: 0,
+            end: 100,
+            left:"15%",
+            right:"15%",
+            textStyle:{
+              color: this.lineColor
+            }
+          }, {
+            type: 'inside'
+          }],
+          grid: {
+            top: 100,
+            left: '2%',
+            right: '2%',
+            bottom: '10%',
+            containLabel: true
+          },
+          xAxis: [{
+            type: 'category',
+            boundaryGap: false,
+            axisLine: {
+              lineStyle: {
+                color: this.lineColor
+              }
+            },
+            data: timeaxis
+          }],
+          yAxis: [{
+            type: 'value',
+            name: '(MW)',
+            max:capacity,
+            axisTick: {
+              show: false
+            },
+            axisLine: {
+              lineStyle: {
+                color: this.lineColor
+              }
+            },
+            axisLabel: {
+              margin: 10,
+              textStyle: {
+                fontSize: 14
+              }
+            },
+            splitLine: {
+              lineStyle: {
+                color: '#57617B'
+              }
+            }
+          }],
+          series: [{
+            name: '实际功率',
+            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.sj,
+                borderColor: 'rgba(50,194,219,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: {
+
+                  color: cc.line12,
+                  borderColor: 'rgba(50,194,219,0.2)',
+                  borderWidth: 12
+                }
+              },
+              data: value.value12
+            },
+            {
+              name: '第13时刻',
+              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.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)',
+                  borderWidth: 12
+                }
+              },
+              data: value.value14
+            },
+            {
+              name: '第15时刻',
+              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.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)',
+                  borderWidth: 12
+                }
+              },
+              data: value.value16
+            }]
+        })
+      },
+
+    }
+  }
+</script>
+<style scoped>
+  #charts{
+    width: 100%;
+    height:calc(80vh - 50px);
+  }
+</style>

+ 372 - 0
ipfcst/ipfcst-reportquery/src/main/frontend/views/realTimeQuery/forecastPowerUltraShortTerm16One/index.vue

@@ -0,0 +1,372 @@
+<template>
+  <div class="chart-container">
+    <div class="filter">
+      <div class="startTime">
+        <span class="timeText">时间</span>
+        <el-date-picker
+          v-model="startTime"
+          :clearable="false"
+          type="date"
+          value-format="timestamp"
+          placeholder="选择日期">
+        </el-date-picker>
+      </div>
+      <div class="timeQuery">
+        <el-button  size="small" :loading="loading"  @click="dateQuery">查询</el-button>
+      </div>
+      <div class="toolbar" v-show="this.showToolBar"> <vxe-toolbar ref="fstToolBar" custom >
+        <template v-slot:buttons>
+          <vxe-button class="downloadButton" style="border:none;"  @click="exportData"><i class="vxe-icon--download" ></i></vxe-button>
+        </template>
+      </vxe-toolbar></div>
+    </div>
+
+    <div class="content">
+      <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"
+              border
+              export-config
+              :loading="loading"
+              @sort-change="sortChangeEvent"
+              :custom-config="{storage: true, checkMethod: checkColumnMethod}"
+              :auto-resize="true"
+              highlight-hover-row
+              :header-cell-style="styleStr"
+              max-height="90%"
+              :cell-style="styleTableStr"
+              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="realValue" title="实际功率" min-width="60"></vxe-table-column>
+              <vxe-table-column field="value1" title="第1个时刻" min-width="60" ></vxe-table-column>
+              <vxe-table-column field="value2" title="第2个时刻" min-width="60"></vxe-table-column>
+              <vxe-table-column field="value3" title="第3个时刻" min-width="60"></vxe-table-column>
+              <vxe-table-column field="value4" title="第4个时刻" min-width="60"></vxe-table-column>
+              <vxe-table-column field="value5" title="第5个时刻" min-width="60"></vxe-table-column>
+              <vxe-table-column field="value6" title="第6个时刻" min-width="60"></vxe-table-column>
+              <vxe-table-column field="value7" title="第7个时刻" min-width="60"></vxe-table-column>
+              <vxe-table-column field="value8" title="第8个时刻" min-width="60"></vxe-table-column>
+              <vxe-table-column field="value9" title="第9个时刻" min-width="60"></vxe-table-column>
+              <vxe-table-column field="value10" title="第10个时刻" min-width="60"></vxe-table-column>
+              <vxe-table-column field="value11" title="第11个时刻" min-width="60"></vxe-table-column>
+              <vxe-table-column field="value12" title="第12个时刻" min-width="60"></vxe-table-column>
+              <vxe-table-column field="value13" title="第13个时刻" min-width="60"></vxe-table-column>
+              <vxe-table-column field="value14" title="第14个时刻" min-width="60"></vxe-table-column>
+              <vxe-table-column field="value15" title="第15个时刻" min-width="60"></vxe-table-column>
+              <vxe-table-column field="value16" title="第16个时刻" min-width="60"></vxe-table-column>
+            </vxe-table>
+            <div class="rtPageturning">
+              <vxe-pager
+                background
+                :loading="loading"
+                :current-page.sync="currentPage"
+                :page-size.sync="pageSize"
+                :total="tableData.length"
+                @page-change="handlePageChange"
+                :layouts="['PrevJump', 'PrevPage', 'JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']">
+              </vxe-pager>
+            </div>
+          </div>
+          <!-- <Table height="100%" width="100%" :queryTime=this.queryTime @sendLoading="getLoadingFormTable"></Table>-->
+        </el-tab-pane>
+      </el-tabs>
+    </div>
+  </div>
+</template>
+
+<script>
+  import Chart from './charts'
+  import resize from '../../../components/Charts/mixins/resize'
+  import moment from "moment";
+  export default {
+    name: 'nwp',
+    components: { Chart},
+    mixins: [resize],
+    data(){
+      return{
+        styleStr:{},
+        styleTableStr:{},
+        outer:'outer',
+        chart: null,
+        queryStartTime:'',
+        queryEndTime:'',
+        startTime:new Date(new Date().toLocaleDateString()).getTime(),
+        loading:true,
+        drawLoading:true,
+        tableLoading:true,
+        resizeKey:1,
+        activeName: 'first',
+        drawData:{datas:[],times:[]},
+        tableData:[],
+        total:0,
+        sortOrder:'asc',
+        pageSize: 10,
+        currentPage: 1,
+        showToolBar:false
+        /*menuKey:1,
+        isRenderingTime : new Date().getTime()*/
+
+      }
+    },
+    created () {
+      if(sessionStorage.getItem('styleSwitch') === 'blue'){
+        this.styleStr = {background:'black',color:'white',border:'white'}
+        this.styleTableStr = {background:'black',color:'white'}
+      }
+      this.$nextTick(() => {
+        // 手动将表格和工具栏进行关联
+        this.$refs.fstRef.connect(this.$refs.fstToolBar)
+      })
+    },
+    mounted() {
+      this.init()
+    },
+    methods:{
+      init(){
+        this.queryStartTime = this.startTime
+        this.loading = true
+        this.getDraw(this.queryStartTime)
+        // this.getTable()
+
+      },
+      getDraw(startTime){
+        this.drawLoading = true
+        this.$axios.get('/findByForecastRealTimeUltraShortTerm16One/'+startTime).then((res) => {
+          const value = res.data.value
+          this.tableData = []
+          for(let i = 1;i< res.data.realDatas.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]
+            this.tableData.push(temp)
+          }
+          // for(let i = 1;i<res.data.realDatas;i++) {
+          //
+          // }
+          this.loading = false
+          this.drawData = res.data
+          this.drawLoading = false
+          if(!this.drawLoading && !this.tableLoading){
+            this.loading = false
+          }
+        }).catch((error) => {
+          this.drawLoading = false
+          if(!this.drawLoading && !this.tableLoading){
+            this.loading = false
+          }
+          this.$message.error('查询实时预测短期echarts出错' + error)
+        })
+      },
+      handlePageChange ({ currentPage, pageSize }) {
+        this.currentPage = currentPage
+        this.pageSize = pageSize
+        this.startTime = this.queryStartTime
+        // this.endTime = this.queryEndTime
+        // this.loading = true
+        // this.getTable();
+      },
+      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"){
+          return "云端模型"
+        }
+        if(cellValue == 'E2'){
+          return "物理模型"
+        }
+        if(cellValue == 'E3'){
+          return "统计模型"
+        }
+        if(cellValue == 'E4'){
+          return "补录数据"
+        }
+        if(cellValue == 'E5'){
+          return "差值模型"
+        }
+      },
+      dateMoment({ cellValue, row, column }) {
+        return moment(cellValue).format('YYYY-MM-DD HH:mm:ss')
+      },
+      sortChangeEvent ({ column, property, order }) {
+        if(order == null){
+          order = 'asc'
+        }
+        this.currentPage = 1
+        this.sortOrder = order
+        this.loading = true
+        // this.getTable()
+      },
+
+      checkColumnMethod ({ column }) {
+        if (column.property === 'preTime') {
+          return false
+        }
+        return true
+      },
+      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
+        // this.queryEndTime = this.endTime
+        this.getDraw(this.queryStartTime)
+        // this.getTable()
+      },
+      Byresize(tab){
+        if(tab.name =='first'){
+          this.resizeKey++
+          this.showToolBar = false
+        }else{
+          this.showToolBar = true
+        }
+      },
+      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;*/
+    /*color:white;*/
+  /*}*/
+
+  /*input{*/
+    /*background:transparent;*/
+    /*border:none;*/
+    /*color:white;*/
+  /*}*/
+
+  /*.timeText{*/
+    /*opacity:0.69;*/
+    /*padding-right:7px;*/
+    /*font-size:14px;*/
+  /*}*/
+
+  /*.startTime{*/
+    /*display:inline-block;*/
+  /*}*/
+
+  /*.endTime{*/
+    /*display:inline-block;*/
+    /*padding-left:42px;*/
+  /*}*/
+
+
+  /*.timeQuery{*/
+    /*background:transparent;*/
+  /*}*/
+
+  /*.el-button{*/
+    /*background:transparent;*/
+    /*color:white;*/
+  /*}*/
+  /*.filter{*/
+    /*width: 100%;background-color: transparent;height: 10%*/
+  /*}*/
+  /*.filter >>> input{*/
+    /*background:transparent;*/
+    /*border:none;*/
+    /*color:white;*/
+  /*}*/
+  /*.content{*/
+    /*width: 100%;*/
+    /*background-color: transparent;*/
+    /*height: 90%;*/
+    /*padding-left: 5px;*/
+    /*padding-right: 5px;*/
+  /*}*/
+  /*.content >>> .el-tabs__item{*/
+    /*color: white;*/
+  /*}*/
+  /*.content >>> .el-tabs__item.is-active {*/
+    /*color: #409EFF;*/
+  /*}*/
+
+
+  /*.tableContent{*/
+    /*width: 100%;*/
+    /*height:calc(80vh - 50px);*/
+  /*}*/
+  /*.tableContent >>> td{*/
+    /*border:1px solid #ffffff;*/
+  /*}*/
+
+  /*.rtPageturning >>> button,*/
+  /*.rtPageturning >>> span,*/
+  /*.rtPageturning >>> input,*/
+  /*.rtPageturning >>> .vxe-pager--btn-wrapper li{*/
+    /*background-color: transparent !important;*/
+    /*color: #ffffff !important;*/
+    /*border: 1px solid #ffffff;*/
+  /*}*/
+  /*.rtPageturning >>> span{*/
+    /*border:none*/
+  /*}*/
+  /*.rtPageturning >>> .vxe-pager--wrapper .vxe-pager--btn-wrapper li:not(.disabled).is--active {*/
+    /*background-color: #9f9fa0 !important;*/
+  /*}*/
+  /*.toolbar{*/
+    /*position:absolute;right:0px;*/
+  /*}*/
+  /*.toolbar >>> .vxe-button.type--button.is--circle {*/
+    /*padding: 0 .5em;*/
+    /*min-width: 34px;*/
+    /*border-radius: 10%;*/
+    /*border: none;*/
+    /*background: transparent;*/
+    /*color: white;*/
+  /*}*/
+</style>
+

+ 71 - 0
ipfcst/ipfcst-reportquery/src/main/java/com/jiayue/ipfcst/controller/ForecastPowerUltraShortTermOneHisController.java

@@ -0,0 +1,71 @@
+package com.jiayue.ipfcst.controller;
+
+import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
+import com.jiayue.ipfcst.service.ForecastPowerUltraShortTermHisService;
+import com.jiayue.ipfcst.service.ForecastPowerUltraShortTermOneHisService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 超短期预测历史信息restful接口
+ *
+ * @author yh
+ * @version 1.0
+ * @since 2019/8/7 10:12
+ */
+@RestController
+@Slf4j
+public class ForecastPowerUltraShortTermOneHisController {
+  private final ForecastPowerUltraShortTermOneHisService forecastPowerUltraShortTermOneHisService;
+  @Autowired
+  public ForecastPowerUltraShortTermOneHisController(ForecastPowerUltraShortTermHisService forecastPowerUltraShortTermHisService, ForecastPowerUltraShortTermOneHisService forecastPowerUltraShortTermOneHisService){
+    this.forecastPowerUltraShortTermOneHisService = forecastPowerUltraShortTermOneHisService;
+  }
+
+  /**
+   * 按时间查询历史预测超短期 yh
+   * @param startTime 开始时间
+   * @param endTime 结束时间
+   * @return 结果集
+   */
+  @GetMapping(value = "/forecastUltraPowerShortTermOneHis/{startTime}/{endTime}/{ago}")
+  public ResponseVO findByForecastTimeBetween(@PathVariable("startTime") Long startTime,
+                                              @PathVariable("endTime") Long endTime,
+                                              @PathVariable("endTime") Integer ago){
+    Map<String,Object> map = new HashMap<>();
+    try{
+      map = forecastPowerUltraShortTermOneHisService.findByForecastTimeBetweenAndForecastHowLongAgoOrderByForecastTime(startTime,endTime,ago);
+      return ResponseVO.success(map);
+    }catch(Exception e){
+      e.printStackTrace();
+      return ResponseVO.fail(e.toString());
+    }
+  }
+
+
+  /**
+   * 查询超短期16个点的信息 tl
+   * @param startTime 开始时间
+   * @return 结果集
+   */
+  @GetMapping(value = "/findByForecastRealTimeUltraShortTerm16One/{startTime}")
+  public ResponseVO findByForecastRealTimeUltraShortTerm16One(@PathVariable("startTime") Long startTime){
+    Map<String,Object> map = new HashMap<>();
+    try{
+      map = forecastPowerUltraShortTermOneHisService.findByForecastRealTimeUltraShortTerm16(startTime);
+      return ResponseVO.success(map);
+    }catch(Exception e){
+      e.printStackTrace();
+      return ResponseVO.fail(e.toString());
+    }
+  }
+
+
+
+}

+ 177 - 0
ipfcst/ipfcst-reportquery/src/main/java/com/jiayue/ipfcst/service/ForecastPowerUltraShortTermOneHisService.java

@@ -0,0 +1,177 @@
+package com.jiayue.ipfcst.service;
+
+import com.jiayue.ipfcst.common.core.exception.BusinessException;
+import com.jiayue.ipfcst.common.data.entity.ElectricField;
+import com.jiayue.ipfcst.common.data.entity.ForecastPowerUltraShortTermHis;
+import com.jiayue.ipfcst.common.data.entity.ForecastPowerUltraShortTermOneHis;
+import com.jiayue.ipfcst.common.data.repository.ForecastPowerUltraShortTermHisRepository;
+import com.jiayue.ipfcst.common.data.repository.ForecastPowerUltraShortTermOneHisRepository;
+import com.jiayue.ipfcst.common.data.service.BaseService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * 历史预测超短期业务层
+ *
+ * @author yh
+ * @version 1.0
+ * @since 2019/8/5 16:02
+ */
+@Service
+public class ForecastPowerUltraShortTermOneHisService extends BaseService {
+  private final ForecastPowerUltraShortTermOneHisRepository forecastPowerUltraShortTermOneHisRepository;
+
+  private final PowerStationStatusDataService powerStationStatusDataService;
+  private final ElectricFieldService electricFieldService;
+
+  @Autowired
+  public ForecastPowerUltraShortTermOneHisService(ForecastPowerUltraShortTermHisRepository forecastPowerUltraShortTermHisRepository, ForecastPowerUltraShortTermOneHisRepository forecastPowerUltraShortTermOneHisRepository, PowerStationStatusDataService powerStationStatusDataService, ElectricFieldService electricFieldService){
+    this.forecastPowerUltraShortTermOneHisRepository = forecastPowerUltraShortTermOneHisRepository;
+    this.powerStationStatusDataService = powerStationStatusDataService;
+    this.electricFieldService = electricFieldService;
+  }
+
+  /**
+   * 根据提前多久,开始结束时间查询历史超短期 yh
+   * @param startTime 开始时间
+   * @param endTime 结束时间
+   * @param ago 提前多久预测
+   * @return 结果集
+   */
+  @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
+  public Map<String,Object> findByForecastTimeBetweenAndForecastHowLongAgoOrderByForecastTime(Long startTime,Long endTime,Integer ago){
+    Map<String,Object> map = new HashMap<>();
+    List<ForecastPowerUltraShortTermOneHis> list = forecastPowerUltraShortTermOneHisRepository.findByForecastTimeBetweenAndForecastHowLongAgo(startTime,endTime,ago);
+    list.sort(Comparator.comparing(ForecastPowerUltraShortTermOneHis::getForecastTime));
+    long timeStep = 900000L;
+    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+    List<String> times = new ArrayList<>();
+    List<Float> datas =new ArrayList<>();
+    if(startTime%timeStep !=0){
+      startTime = startTime -(startTime%timeStep)+timeStep;
+    }
+    if(list !=null && list.size()>0){
+      for(Long i= startTime;i<endTime;i=i+timeStep){
+        long finalI = i;
+        List<ForecastPowerUltraShortTermOneHis> filterList  = list.stream().filter(t->t.getForecastTime() ==finalI).collect(Collectors.toList());
+        if(filterList!=null&&filterList.size()>0){
+          datas.add(filterList.get(0).getAbleValue().floatValue());
+        }else{
+          datas.add(null);
+        }
+
+        times.add(sdf.format(new Date(finalI)) );
+      }
+    }
+    map.put("times",times);
+    map.put("datas",datas);
+
+    return map;
+
+  }
+
+  /**
+   * 根据提前多久,开始结束时间查询历史超短期 yh
+   * @param startTime 开始时间
+   * @param endTime 结束时间
+   * @param ago 提前多久预测
+   * @return 结果集
+   */
+  @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
+  public Map<String,Object> findByForecastTimeBetweenAndForecastHowLongAgoOrderByForecastTimeForDB(Long startTime,Long endTime,Integer ago,Long timeStep){
+    Map<String,Object> map = new HashMap<>();
+    List<ForecastPowerUltraShortTermOneHis> list = forecastPowerUltraShortTermOneHisRepository.findByForecastTimeBetweenAndForecastHowLongAgo(startTime,endTime,ago);
+    list.sort(Comparator.comparing(ForecastPowerUltraShortTermOneHis::getForecastTime));
+    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+    List<String> times = new ArrayList<>();
+    List<Float> datas =new ArrayList<>();
+    if(startTime%timeStep !=0){
+      startTime = startTime -(startTime%timeStep)+timeStep;
+    }
+    for(Long i= startTime;i<endTime;i=i+timeStep){
+      if(list !=null && list.size()>0){
+        long finalI = i;
+        List<ForecastPowerUltraShortTermOneHis> filterList  = list.stream().filter(t->t.getForecastTime() ==finalI).collect(Collectors.toList());
+        if(filterList!=null&&filterList.size()>0){
+          datas.add(filterList.get(0).getAbleValue().floatValue());
+        }else{
+          datas.add(null);
+        }
+
+      }else {
+        datas.add(null);
+      }
+      times.add(sdf.format(new Date(i)) );
+
+
+    }
+
+    map.put("times",times);
+    map.put("datas",datas);
+
+    return map;
+
+  }
+
+  /**
+   * 超短期查询16个点数据 tl
+   * @param startTime 开始时间
+   * @return 结果集
+   */
+  @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
+  public Map<String,Object> findByForecastRealTimeUltraShortTerm16(Long startTime)throws BusinessException {
+    Long endTime = startTime + 60*60*1000*24;
+//    List<Map<String,Object>> valueList16 = new ArrayList<>();
+    //取出16点数据存入集合中
+    Map<String,Object> realPowerMap = new HashMap<>();
+    List<ForecastPowerUltraShortTermOneHis> forecastPowerUltraShortTermHisList = forecastPowerUltraShortTermOneHisRepository.findByForecastTimeBetween(startTime, endTime);
+    for(int p = 1;p<=16;p++){
+
+      int finalP = p;
+      List<ForecastPowerUltraShortTermOneHis> filterList  = forecastPowerUltraShortTermHisList.stream().filter(t->t.getForecastHowLongAgo() == finalP).collect(Collectors.toList());
+
+//      List<ForecastPowerUltraShortTermHis> forecastPowerUltraShortTermHisList = forecastPowerUltraShortTermHisRepository.findByForecastTimeBetweenAndForecastHowLongAgo(startTime, endTime, p);
+
+      SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+      long timeStep = 900000L;
+      if (startTime % timeStep != 0) {
+        startTime = startTime - (startTime % timeStep);
+      }
+      List<Float> ableDatas = new ArrayList<>();
+      List<String> times = new ArrayList<>();
+
+      for (long i = startTime; i < endTime; i = i + 900000L) {
+        long finalI = i;
+        List<ForecastPowerUltraShortTermOneHis> p1 = filterList.stream().filter(t -> t.getForecastTime() == finalI).collect(Collectors.toList());
+        if (p1 != null && p1.size() > 0) {
+
+          if (p1.get(0).getAbleValue().compareTo(new BigDecimal(-99)) == 0) {
+            ableDatas.add(0f);
+          } else {
+            ableDatas.add(p1.get(0).getAbleValue().floatValue());
+          }
+        } else {
+          ableDatas.add(null);
+        }
+      }
+      realPowerMap.put("value"+p,ableDatas);
+    }
+
+    Map<String, Object> map = powerStationStatusDataService.findByTimeBetweenForContrast(new Date(startTime), new Date(endTime),900000l);
+
+    ElectricField electricField = electricFieldService.get();
+    map.put("value",realPowerMap);
+    map.put("capacity",electricField.getCapacity());
+    return map;
+
+  }
+
+
+}