Pārlūkot izejas kodu

1.修改短期,超短期样式
2.client定时任务优化

wangtao 3 gadi atpakaļ
vecāks
revīzija
9fb2674f67

+ 0 - 10
client.yml

@@ -1,10 +0,0 @@
-#青海client小程序使用jar包外配置文件
-remote:
-  ip: 192.168.1.202
-  port: 22
-  user: root
-  pwd: Syjy*3377
-  path: /home/syjy/ipfcstV3/downLoadFile/
-v3cloud:
-  filelogUrl: https://117.78.19.70:9010/client/getDownLoadFile/
-  fileDownUrl: https://117.78.19.70:9010/client/getFileById?id=

+ 13 - 0
focus-client.yml

@@ -0,0 +1,13 @@
+#青海client小程序使用jar包外配置文件
+remote:
+  ip: 192.168.1.208
+  port: 22
+  user: root
+  pwd: Syjy*3377
+  path: /home/syjy/ipfcstV3/downLoadFile/
+  dcUrl: http://cloud.jiayuepowertech.com:9001/qinghaiComeBackApi/datas
+v3cloud:
+  filelogUrl: https://117.78.19.70:9010/client/getDownLoadFileAll/
+  fileDownUrl: https://117.78.19.70:9010/client/getFileById?id=
+local:
+  downFilePath: /Users/wangtao/Documents/temp/client/

+ 16 - 3
ipfcst-client/src/main/java/com/jiayue/client/job/DownloadFileJob.java

@@ -35,18 +35,19 @@ public class DownloadFileJob {
     public QueryDataService queryDataService;
     //获取下载到文件,从临时目录移动到目标目录
     public static List<String> filedownLoadList = new ArrayList<String>();
+    public static List<String> isDownFileId = new ArrayList<String>();
     public static Properties properties = new Properties();
 
     static {
         YamlPropertiesFactoryBean yaml = new YamlPropertiesFactoryBean();
-        yaml.setResources(new PathResource("./client.yml"));
+        yaml.setResources(new PathResource("./focus-client.yml"));
         properties = yaml.getObject();
     }
 
     /**
      * 每天凌晨2点执行
      */
-    @Scheduled(cron = "0 09 10 * * ?")
+    @Scheduled(cron = "0 0/2 * * * ?")
     public void download() {
         log.info("上午文件下载定时任务开始");
         List<Map<String, Object>> stations = queryDataService.getStations();
@@ -60,13 +61,19 @@ public class DownloadFileJob {
             if (code.equals("0") && data.length() > 0) {
                 JSONArray array = JSONUtil.parseArray(data);
                 List<FileCreateLog> list = array.toList(FileCreateLog.class);
-                String path = FileUtil.judeDirExists("/Users/wangtao/Documents/temp/client");
+                String path = FileUtil.judeDirExists(properties.getProperty("local.downFilePath"));
 
                 try {
                     for (FileCreateLog fileCreateLog : list) {
+                        if (isDownFileId.contains(fileCreateLog.getId())) {
+                            log.info("文件:{}已下载。", fileCreateLog.getFileName());
+                            continue;
+                        }
+                        log.info("开始下载文件:{}。", fileCreateLog.getFileName());
                         String url = properties.getProperty("v3cloud.fileDownUrl") + fileCreateLog.getId();// "https://117.78.19.70:9010/client/getFileById?id=" + fileCreateLog.getId();
                         Long size = HttpUtil.downloadFile(url, path + File.separatorChar + fileCreateLog.getFileName());
                         if (size > 0) {
+                            isDownFileId.add(fileCreateLog.getId());
                             log.info("成功下载文件:{}", path + File.separatorChar + fileCreateLog.getFileName());
                             filedownLoadList.add(path + File.separatorChar + fileCreateLog.getFileName());
                         }
@@ -76,6 +83,7 @@ public class DownloadFileJob {
                 } finally {
                     //把下载的文件挪到功率预测服务器文件夹
                     if (filedownLoadList.size() > 0) {
+                        log.info("开始移动下载文件到功率预测,共:{} 个文件。", filedownLoadList.size());
                         for (String fpath : filedownLoadList) {
                             try {
                                 Scpclient scpclient = Scpclient.getInstance(properties.getProperty("remote.ip"),
@@ -83,10 +91,15 @@ public class DownloadFileJob {
                                         properties.getProperty("remote.pwd"));
 
                                 scpclient.putFile(fpath, properties.getProperty("remote.path") + stationCode + "/new/");
+                                log.info("移动文件:{} 到远程服务器 {} 成功", fpath, properties.getProperty("remote.path") + stationCode + "/new/");
                             } catch (Exception e) {
                                 log.error("移动文件到功率预测服务器失败:{}", e);
                             }
                         }
+                        log.info("所有文件移动完成,清空文件临时filedownLoadList");
+                        filedownLoadList.clear();
+                    } else {
+                        log.info("没有新文件下载,不需要移动到远程功率预测服务器。");
                     }
                 }
             }

+ 40 - 4
ipfcst-client/src/main/java/com/jiayue/client/job/SendDataToDcJob.java

@@ -6,6 +6,10 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+
 /**
  * 青海集中功率预测向数据中心回传数据:
  * 1.实际功率 短期 超短期 气象站 测风塔 风机 等数据
@@ -17,18 +21,50 @@ public class SendDataToDcJob {
 
     @Autowired
     public SendDataService sendDataService;
+    public static SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
 
     /**
      * 每天凌晨2点执行
      */
     @Scheduled(cron = "0 0/5 * * * ?")
     public void sendJob() {
-        log.info("时间 【" + System.currentTimeMillis() + "】 向数据中心发送青海集中功率预测前一天的实际功率等数据。");
-        String startTime = "2021-09-25 00:00:00";
-        String endTime = "2021-09-26 00:00:00";
+        log.info("时间 【" + System.currentTimeMillis() + "】 向数据中心发送青海集中功率预测前一天的实际功率等数据。数据范围:【{}--{}】", getDayStartTime(), getDayLastTime());
+        sendDataService.send(getDayStartTime(), getDayLastTime(), "all");
+    }
 
-        sendDataService.send(startTime, endTime, "all");
 
+    /**
+     * 获取当前时间所在天的0点0分
+     *
+     * @return 0点0分的毫秒
+     */
+    public static String getDayStartTime() {
+        Calendar date = Calendar.getInstance();
+        date.setTime(new Date());
+        date.set(Calendar.HOUR_OF_DAY, 0);
+        date.set(Calendar.MINUTE, 0);
+        date.set(Calendar.SECOND, 0);
+        date.set(Calendar.MILLISECOND, 0);
+        date.add(Calendar.DAY_OF_MONTH, -1);
+        String dateString = formatter.format(date.getTime());
+        return dateString;
     }
 
+    /**
+     * 获取当前时间所在天的23点59分59秒
+     *
+     * @return 23点59分59秒的毫秒
+     */
+    public static String getDayLastTime() {
+        Calendar date = Calendar.getInstance();
+        date.setTime(new Date());
+        date.set(Calendar.HOUR_OF_DAY, 23);
+        date.set(Calendar.MINUTE, 59);
+        date.set(Calendar.SECOND, 59);
+        date.set(Calendar.MILLISECOND, 999);
+        date.add(Calendar.DAY_OF_MONTH, -1);
+        String dateString = formatter.format(date.getTime());
+        return dateString;
+    }
 }

+ 13 - 5
ipfcst-client/src/main/java/com/jiayue/client/service/SendDataService.java

@@ -6,12 +6,11 @@ import cn.hutool.json.JSONUtil;
 import com.jiayue.client.util.MD5Util;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
+import org.springframework.core.io.PathResource;
 import org.springframework.stereotype.Repository;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @Repository
 @Slf4j
@@ -21,6 +20,14 @@ public class SendDataService {
     //青海回传数据通用签名key
     private final static String qinghaiKey = "Syjy*3377";
 
+    public static Properties properties = new Properties();
+
+    static {
+        YamlPropertiesFactoryBean yaml = new YamlPropertiesFactoryBean();
+        yaml.setResources(new PathResource("./focus-client.yml"));
+        properties = yaml.getObject();
+    }
+
     /**
      * 向数据中心
      *
@@ -29,6 +36,7 @@ public class SendDataService {
      * @param flag
      */
     public void send(String startTime, String endTime, String flag) {
+
         try {
             List<Map<String, Object>> stations = queryDataService.getStations();
             for (Map<String, Object> station : stations) {
@@ -302,7 +310,7 @@ public class SendDataService {
 
         String reqStr = JSONUtil.toJsonStr(resultMap);
         log.info("回传数据给数据中心,请求报文:{}", reqStr);
-        String resp = HttpUtil.post("http://localhost:9001/qinghaiComeBackApi/datas", reqStr);
+        String resp = HttpUtil.post(properties.getProperty("remote.dcUrl"), reqStr);
         if (resp.length() > 0) {
             if (!"0".equals(JSONUtil.parseObj(resp).get("code"))) {
                 new Exception("回传数据给数据中心错误:" + resp);

+ 53 - 41
ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/ForecastPowerUltraShortTermHisRepository.java

@@ -17,48 +17,60 @@ import java.util.List;
  */
 public interface ForecastPowerUltraShortTermHisRepository extends BaseRepository<ForecastPowerUltraShortTermHis, Integer> {
 
-	/**
-	 * 根据时间段删除当前时刻生成的超短期历史期数据
-	 *
-	 * @param startTime 开始时间
-	 * @param endTime   结束时间
-	 */
-	@Modifying
-	@Query(value = "delete from ForecastPowerUltraShortTermHis t where t.forecastTime >= ?1 and t.forecastTime<= ?2 and t.genDate = ?3 and t.stationCode= ?4")
-	void deleteNowMoment(Long startTime, Long endTime, Date nowMomentTime,String stationCode);
+    /**
+     * 根据时间段删除当前时刻生成的超短期历史期数据
+     *
+     * @param startTime 开始时间
+     * @param endTime   结束时间
+     */
+    @Modifying
+    @Query(value = "delete from ForecastPowerUltraShortTermHis t where t.forecastTime >= ?1 and t.forecastTime<= ?2 and t.genDate = ?3 and t.stationCode= ?4")
+    void deleteNowMoment(Long startTime, Long endTime, Date nowMomentTime, String stationCode);
 
-	/**
-	 * 根据提前多久,开始结束时间查询历史超短期 yh
-	 *
-	 * @param startTime 开始时间
-	 * @param endTime   结束时间
-	 * @param ago       提前多久预测
-	 * @return 结果集
-	 */
-	List<ForecastPowerUltraShortTermHis> findByForecastTimeBetweenAndForecastHowLongAgo(Long startTime, Long endTime, Integer ago);
-	/**
-	 * 根据提前多久,时间查询历史超短期 yh
-	 *
-	 * @param queryTime 时间
-	 * @param ago       提前多久预测
-	 * @return 结果集
-	 */
-	ForecastPowerUltraShortTermHis findByForecastTimeAndForecastHowLongAgo(Long queryTime, Integer ago);
-	/**
-	 * 根据预测时间查询历史超短期 yh
-	 *
-	 * @param queryTime 时间
+    /**
+     * 根据提前多久,开始结束时间查询历史超短期 yh
+     *
+     * @param startTime 开始时间
+     * @param endTime   结束时间
+     * @param ago       提前多久预测
+     * @return 结果集
+     */
+    List<ForecastPowerUltraShortTermHis> findByForecastTimeBetweenAndForecastHowLongAgo(Long startTime, Long endTime, Integer ago);
 
-	 * @return 结果集
-	 */
-	List<ForecastPowerUltraShortTermHis> findByForecastTime(Long queryTime);
-	/**
-	 * 根据提前多久,开始结束时间查询历史超短期 yh
-	 *
-	 * @param startTime 开始时间
-	 * @param endTime   结束时间
-	 * @return 结果集
-	 */
-	List<ForecastPowerUltraShortTermHis> findByForecastTimeBetween(Long startTime, Long endTime);
+    /**
+     * 根据提前多久,时间查询历史超短期 yh
+     *
+     * @param queryTime 时间
+     * @param ago       提前多久预测
+     * @return 结果集
+     */
+    ForecastPowerUltraShortTermHis findByForecastTimeAndForecastHowLongAgo(Long queryTime, Integer ago);
+
+    /**
+     * 根据预测时间查询历史超短期 yh
+     *
+     * @param queryTime 时间
+     * @return 结果集
+     */
+    List<ForecastPowerUltraShortTermHis> findByForecastTime(Long queryTime);
+
+    /**
+     * 根据提前多久,开始结束时间查询历史超短期 yh
+     *
+     * @param startTime 开始时间
+     * @param endTime   结束时间
+     * @return 结果集
+     */
+    List<ForecastPowerUltraShortTermHis> findByForecastTimeBetween(Long startTime, Long endTime);
+
+    /**
+     * 根据提前多久,开始结束时间查询历史超短期 yh
+     *
+     * @param startTime   开始时间
+     * @param endTime     结束时间
+     * @param stationCode 场站编码
+     * @return 结果集
+     */
+    List<ForecastPowerUltraShortTermHis> findByForecastTimeBetweenAndStationCode(Long startTime, Long endTime, String stationCode);
 
 }

+ 11 - 4
ipfcst-console/src/main/frontend/router/modules/dataquery.js

@@ -16,25 +16,25 @@ const dataqueryRouter = {
       path: 'inverterStatusData',
       component: () => import('@/views/dataquery/inverterStatusData'),
       name: 'inverterStatusData',
-      meta: { title: '逆变器数据', noCache: true }
+      meta: {title: '逆变器数据', noCache: true}
     },
     {
       path: 'windTurbineStatusData',
       component: () => import('@/views/dataquery/windTurbineStatusData'),
       name: 'windTurbineStatusData',
-      meta: { title: '风机数据', noCache: true }
+      meta: {title: '风机数据', noCache: true}
     },
     {
       path: 'weatherStationStatusData',
       component: () => import('@/views/dataquery/weatherStationStatusData'),
       name: 'weatherStationStatusData',
-      meta: { title: '气象站数据', noCache: true }
+      meta: {title: '气象站数据', noCache: true}
     },
     {
       path: 'windTowerStatusData',
       component: () => import('@/views/dataquery/windTowerStatusData'),
       name: 'windTowerStatusData',
-      meta: { title: '测风塔数据', noCache: true }
+      meta: {title: '测风塔数据', noCache: true}
     },
     {
       path: 'realTimeDQ',
@@ -56,6 +56,13 @@ const dataqueryRouter = {
       name: 'historyDq',
       meta: {title: '历史短期查询', noCache: true},
       sign: 'currency'
+    },
+    {
+      path: 'historyCdq',
+      component: () => import('@/views/dataquery/forecastPowerUltraShortTerm16/index'),
+      name: 'historyCdq',
+      meta: {title: '历史超短期查询', noCache: true},
+      sign: 'currency'
     }
   ]
 }

+ 20 - 56
ipfcst-console/src/main/frontend/views/dataquery/forecastPowerShortHisTerm/index.vue

@@ -1,8 +1,9 @@
 <template>
   <div class="chart-container">
+    <br/>
     <div class="filter">
-      <div class="startTime">
-        <span class="timeText">起始时间</span>
+      <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"
@@ -11,8 +12,8 @@
           placeholder="选择日期">
         </el-date-picker>
       </div>
-      <div class="endTime">
-        <span class="timeText">截止时间</span>
+      <div class="endTime" style="display: inline-block">
+        <span class="timeText" style="font-weight: bold;font-size: 14px">&#12288;截止时间:</span>
         <el-date-picker
           v-model="endTime"
           :clearable="false"
@@ -21,8 +22,11 @@
           placeholder="选择日期">
         </el-date-picker>
       </div>
-      <div>
-        <span style="font-weight: bold;font-size: 14px">场站名称:</span>
+    </div>
+    <br/>
+    <div>
+      <div style="display: inline-block">
+        <span style="font-weight: bold;font-size: 14px">&#12288;场站名称:</span>
         <el-select style="width:250px" clearable v-model="stationCode" size="small">
           <el-option
             v-for="item in stationList"
@@ -34,13 +38,13 @@
           </el-option>
         </el-select>
       </div>
-      <div class="timeQuery">
-        <el-button size="small" :loading="loading" @click="dateQuery">查询</el-button>
+      <div class="timeQuery" style="display: inline-block">
+        <el-button size="small" :loading="loading" @click="dateQuery">&#12288;查询</el-button>
       </div>
     </div>
-
+    <br/>
     <div class="content">
-      <el-tabs type="card" v-model="activeName" @tab-click="Byresize">
+      <el-tabs type="card" v-model="activeName">
 
         <el-tab-pane label="表格" name="first">
           <div class="tableContent">
@@ -55,9 +59,7 @@
               :custom-config="{storage: true, checkMethod: checkColumnMethod}"
               :auto-resize="true"
               highlight-hover-row
-              :header-cell-style="{background:'black',color:'white',border:'white'}"
               max-height="90%"
-              :cell-style="{background:'black',color:'white'}"
               align="center"
               :data="tableData">
               <vxe-table-column field="forecastTime" title="预测时间" :formatter="dateFormat" width="180" sortable
@@ -145,6 +147,7 @@ export default {
       this.loading = false
     },
     getTable() {
+
       this.tableLoading = true
       this.$axios.get('/forecastPowerShortTermHis/' + this.queryStartTime + '/' + this.queryEndTime + '/' + this.stationCode + '/' + this.currentPage + '/' + this.pageSize + '?sortOrder=' + this.sortOrder).then((res) => {
         this.tableData = res.data.content
@@ -241,6 +244,11 @@ export default {
       }
       this.queryStartTime = this.startTime
       this.queryEndTime = this.endTime
+      if (this.stationCode == '') {
+        this.$message.error("场站编码不能为空")
+        this.loading = false
+        return
+      }
       this.getTable()
     },
 
@@ -248,48 +256,4 @@ export default {
 }
 </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;
-}
-
-
-</style>
 

+ 24 - 55
ipfcst-console/src/main/frontend/views/dataquery/forecastPowerShortTerm/index.vue

@@ -1,8 +1,9 @@
 <template>
   <div class="chart-container">
+    <br/>
     <div class="filter">
-      <div class="startTime">
-        <span class="timeText">起始时间</span>
+      <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"
@@ -11,8 +12,8 @@
           placeholder="选择日期">
         </el-date-picker>
       </div>
-      <div class="endTime">
-        <span class="timeText">截止时间</span>
+      <div class="endTime" style="display: inline-block">
+        <span class="timeText" style="font-weight: bold;font-size: 14px">&#12288;截止时间:</span>
         <el-date-picker
           v-model="endTime"
           :clearable="false"
@@ -21,8 +22,12 @@
           placeholder="选择日期">
         </el-date-picker>
       </div>
-      <div>
-        <span style="font-weight: bold;font-size: 14px">场站名称:</span>
+    </div>
+    <br/>
+    <div>
+
+      <div style="display: inline-block">
+        <span style="font-weight: bold;font-size: 14px">&#12288;场站名称:</span>
         <el-select style="width:250px" clearable v-model="stationCode" size="small">
           <el-option
             v-for="item in stationList"
@@ -34,11 +39,11 @@
           </el-option>
         </el-select>
       </div>
-      <div class="timeQuery">
-        <el-button size="small" :loading="loading" @click="dateQuery">查询</el-button>
+      <div class="timeQuery" style="display: inline-block">
+        <el-button size="small" :loading="loading" @click="dateQuery">&#12288;查询</el-button>
       </div>
     </div>
-
+    <br/>
     <div class="content">
       <el-tabs type="card" v-model="activeName" @tab-click="Byresize">
         <el-tab-pane label="图表" name="first">
@@ -58,9 +63,7 @@
               :custom-config="{storage: true, checkMethod: checkColumnMethod}"
               :auto-resize="true"
               highlight-hover-row
-              :header-cell-style="{background:'black',color:'white',border:'white'}"
               max-height="90%"
-              :cell-style="{background:'black',color:'white'}"
               align="center"
               :data="tableData">
               <vxe-table-column field="forecastTime" title="预测时间" :formatter="dateFormat" width="180" sortable
@@ -148,6 +151,11 @@ export default {
       this.loading = false
     },
     getDraw(startTime, endTime, stationCode) {
+      if (this.stationCode == '') {
+        this.$message.error("场站编码不能为空")
+        this.loading = false
+        return
+      }
       this.drawLoading = true
       this.$axios.get('/forecastPowerShortTerm/' + startTime + '/' + endTime + '/' + stationCode).then((res) => {
         this.drawData = res.data
@@ -164,6 +172,11 @@ export default {
       })
     },
     getTable() {
+      if (this.stationCode == '') {
+        this.$message.error("场站编码不能为空")
+        this.loading = false
+        return
+      }
       this.tableLoading = true
       this.$axios.get('/forecastPowerShortTerm/' + this.queryStartTime + '/' + this.queryEndTime + '/' + this.stationCode + '/' + this.currentPage + '/' + this.pageSize + '?sortOrder=' + this.sortOrder).then((res) => {
         this.tableData = res.data.content
@@ -276,48 +289,4 @@ export default {
 }
 </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;
-}
-
-
-</style>
 

+ 744 - 0
ipfcst-console/src/main/frontend/views/dataquery/forecastPowerUltraShortTerm16/charts/index.vue

@@ -0,0 +1,744 @@
+<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 '../../../../components/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 {
+      chart: null,
+    }
+  },
+  mounted() {
+  },
+  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: '#F1F1F3'
+          },
+          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: '#F1F1F3'
+          }
+        },
+        dataZoom: [{
+          show: true,
+          realtime: true,
+          start: 0,
+          end: 100,
+          left: "15%",
+          right: "15%",
+          textStyle: {
+            color: "#ffffff"
+          }
+        }, {
+          type: 'inside'
+        }],
+        grid: {
+          top: 100,
+          left: '2%',
+          right: '2%',
+          bottom: '10%',
+          containLabel: true
+        },
+        xAxis: [{
+          type: 'category',
+          boundaryGap: false,
+          axisLine: {
+            lineStyle: {
+              color: '#ffffff'
+            }
+          },
+          data: timeaxis
+        }],
+        yAxis: [{
+          type: 'value',
+          name: '(MW)',
+          max: capacity,
+          axisTick: {
+            show: false
+          },
+          axisLine: {
+            lineStyle: {
+              color: '#ffffff'
+            }
+          },
+          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>

+ 248 - 0
ipfcst-console/src/main/frontend/views/dataquery/forecastPowerUltraShortTerm16/index.vue

@@ -0,0 +1,248 @@
+<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"
+          type="date"
+          value-format="timestamp"
+          placeholder="选择日期">
+        </el-date-picker>
+      </div>
+      <div style="display: inline-block">
+        <span style="font-weight: bold;font-size: 14px">&#12288;场站名称:</span>
+        <el-select style="width:250px" clearable v-model="stationCode" size="small">
+          <el-option
+            v-for="item in stationList"
+            :key="item.stationCode"
+            :label="item.name"
+            :value="item.stationCode">
+            <span style="float: left">{{ item.name }}</span>
+            <span style="float: right; color: #8492a6;font-size: 13px">{{ item.stationCode }}</span>
+          </el-option>
+        </el-select>
+      </div>
+      <div class="timeQuery" style="display: inline-block">
+        <el-button size="small" :loading="loading" @click="dateQuery">&#12288;查询</el-button>
+      </div>
+
+    </div>
+    <br/>
+    <div class="content">
+      <el-tabs type="card" v-model="activeName">
+        <el-tab-pane label="表格" name="first">
+          <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
+              max-height="90%"
+              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 {
+      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,
+      stationCode: '',
+      stationList: [],
+
+    }
+  },
+  created() {
+    this.$nextTick(() => {
+      // 手动将表格和工具栏进行关联
+      this.$refs.fstRef.connect(this.$refs.fstToolBar)
+    })
+  },
+  mounted() {
+    this.init()
+    this.getStationList()
+  },
+  methods: {
+    init() {
+      this.queryStartTime = this.startTime
+      this.loading = true
+    },
+    getStationList() {
+      this.$axios.get('/electricField/getElectricField').then((res) => {
+        this.stationList = res.data
+      }).catch((error) => {
+        this.$message.error('获取场站下拉框出错' + error)
+      })
+      this.loading = false
+    },
+    getDraw(startTime, stationCode) {
+      this.drawLoading = true
+      this.$axios.get('/findByForecastRealTimeUltraShortTerm16/' + startTime + '/' + stationCode).then((res) => {
+        const value = res.data.value
+        this.tableData = []
+        for (let i = 1; i < res.data.value.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)
+        }
+
+        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)
+      })
+      this.loading = false
+    },
+    handlePageChange({currentPage, pageSize}) {
+      this.currentPage = currentPage
+      this.pageSize = pageSize
+      this.startTime = this.queryStartTime
+    },
+    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
+      this.queryStartTime = this.startTime
+      if (this.stationCode == '') {
+        this.$message.error("场站编码不能为空")
+        this.loading = false
+        return
+      }
+      this.getDraw(this.queryStartTime, this.stationCode)
+    }
+  }
+}
+</script>
+

+ 19 - 52
ipfcst-console/src/main/frontend/views/dataquery/nwp/index.vue

@@ -1,8 +1,9 @@
 <template>
   <div class="chart-container">
+    <br/>
     <div class="filter">
-      <div class="startTime">
-        <span class="timeText">起始时间</span>
+      <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"
@@ -11,8 +12,8 @@
           placeholder="选择日期">
         </el-date-picker>
       </div>
-      <div class="endTime">
-        <span class="timeText">截止时间</span>
+      <div class="endTime" style="display: inline-block">
+        <span class="timeText" style="font-weight: bold;font-size: 14px">&#12288;截止时间</span>
         <el-date-picker
           v-model="endTime"
           :clearable="false"
@@ -21,7 +22,10 @@
           placeholder="选择日期">
         </el-date-picker>
       </div>
-      <div>
+    </div>
+    <br/>
+    <div class="filter">
+      <div style="display: inline-block">
         <span style="font-weight: bold;font-size: 14px">场站名称:</span>
         <el-select style="width:250px" clearable v-model="stationCode" size="small">
           <el-option
@@ -34,13 +38,11 @@
           </el-option>
         </el-select>
       </div>
-      <div class="timeQuery">
-        <el-button size="small" :loading="loading" @click="dateQuery">查询</el-button>
+      <div class="timeQuery" style="display: inline-block">
+        <el-button size="small" :loading="loading" @click="dateQuery">&#12288;查询</el-button>
       </div>
 
-      <div class="toolbar" v-show="this.showToolBar">
-        <vxe-toolbar ref="nwpToolBar" custom></vxe-toolbar>
-      </div>
+
     </div>
 
     <div class="content">
@@ -61,9 +63,8 @@
               :custom-config="{storage: true, checkMethod: checkColumnMethod}"
               :auto-resize="true"
               highlight-hover-row
-              :header-cell-style="{background:'black',color:'white',border:'white'}"
               max-height="90%"
-              :cell-style="{background:'black',color:'white'}"
+              :cell-style="{background:'white',color:'black',border:'black'}"
               align="center"
               :columns="tableColumn"
               :data="tableData">
@@ -250,6 +251,12 @@ export default {
       }
       this.queryStartTime = this.startTime
       this.queryEndTime = this.endTime
+      if (this.stationCode == '') {
+        this.$message.error("场站编码不能为空")
+        this.loading = false
+        return
+      }
+
       this.getDraw(this.queryStartTime, this.queryEndTime, this.stationCode)
       this.getTable()
     },
@@ -267,46 +274,6 @@ export default {
 </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;
-}
 
 </style>
 

+ 72 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/ForecastPowerUltraShortTermHisController.java

@@ -0,0 +1,72 @@
+package com.jiayue.ipfcst.console.controller;
+
+import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
+import com.jiayue.ipfcst.console.service.ForecastPowerUltraShortTermService;
+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 ForecastPowerUltraShortTermHisController {
+  private final ForecastPowerUltraShortTermService forecastPowerUltraShortTermService;
+
+  @Autowired
+  public ForecastPowerUltraShortTermHisController(ForecastPowerUltraShortTermService forecastPowerUltraShortTermService) {
+    this.forecastPowerUltraShortTermService = forecastPowerUltraShortTermService;
+  }
+
+  /**
+   * 按时间查询历史预测超短期 yh
+   *
+   * @param startTime 开始时间
+   * @param endTime   结束时间
+   * @return 结果集
+   */
+  @GetMapping(value = "/forecastUltraPowerShortTermHis/{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 = forecastPowerUltraShortTermService.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 = "/findByForecastRealTimeUltraShortTerm16/{startTime}/{stationCode}")
+  public ResponseVO findByForecastRealTimeUltraShortTerm16(@PathVariable("startTime") Long startTime, @PathVariable("stationCode") String stationCode) {
+    Map<String, Object> map = new HashMap<>();
+    try {
+      map = forecastPowerUltraShortTermService.findByForecastRealTimeUltraShortTerm16(startTime, stationCode);
+      return ResponseVO.success(map);
+    } catch (Exception e) {
+      e.printStackTrace();
+      return ResponseVO.fail(e.toString());
+    }
+  }
+
+
+}

+ 143 - 51
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/ForecastPowerUltraShortTermService.java

@@ -22,6 +22,7 @@ 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;
 
@@ -57,8 +58,8 @@ public class ForecastPowerUltraShortTermService extends BaseService {
    * @param endTime   结束时间
    */
   @Transactional(propagation = Propagation.REQUIRED)
-  public void buildForecastPowerUltraShortTerm(@NotNull final Long startTime, @NotNull final Long endTime,String stationCode) {
-    this.getForecastPowerUltraShortTerm(startTime, endTime,stationCode);
+  public void buildForecastPowerUltraShortTerm(@NotNull final Long startTime, @NotNull final Long endTime, String stationCode) {
+    this.getForecastPowerUltraShortTerm(startTime, endTime, stationCode);
   }
 
   /**
@@ -71,40 +72,40 @@ public class ForecastPowerUltraShortTermService extends BaseService {
   @SuppressWarnings("WeakerAccess")
   @Transactional(propagation = Propagation.REQUIRED)
   public List<ForecastPowerUltraShortTermHis> getForecastPowerUltraShortTerm(@NotNull final Long startTime, @NotNull final Long endTime, @NotNull final String stationCode) {
-    log.info(stationCode+"开始获取超短期实时预测功率" + DateFormatUtils.format(startTime, "yyyy-MM-dd HH:mm:ss") + " 至 " + DateFormatUtils.format(endTime, "yyyy-MM-dd HH:mm:ss"));
+    log.info(stationCode + "开始获取超短期实时预测功率" + DateFormatUtils.format(startTime, "yyyy-MM-dd HH:mm:ss") + " 至 " + DateFormatUtils.format(endTime, "yyyy-MM-dd HH:mm:ss"));
     // 查询场站信息
     ElectricField electricFieldInfo = electricFieldService.getSingleStation(stationCode);
     // 查询预测时间点对应的开机容量
     Map<Long, BigDecimal> openCapacityMap = null;
     try {
-      openCapacityMap = super.queryOpenCapacity(startTime, endTime, electricFieldInfo.getCapacity(),stationCode);
+      openCapacityMap = super.queryOpenCapacity(startTime, endTime, electricFieldInfo.getCapacity(), stationCode);
     } catch (BusinessException e) {
-      log.error(stationCode+"超短期数据生成获取开机容量出错:" + CommonUtil.printStackTraceToString(e));
+      log.error(stationCode + "超短期数据生成获取开机容量出错:" + CommonUtil.printStackTraceToString(e));
     }
     Long monentTime = 0L;
     try {
       monentTime = DateMomentUtil.getMomentTime(new Date().getTime(), 1, 15 * 60 * 1000L);
     } catch (Exception e) {
-      log.error(stationCode+"获取当前时刻错误",e);
+      log.error(stationCode + "获取当前时刻错误", e);
     }
 
     List<ForecastPowerUltraShortTerm> forecastPowerUltraShortTermList = new ArrayList<>();
-    List<ForecastPowerUltraShortTerm> tempList = this.forecastPowerUltraShortTermRepository.findByForecastTimeBetweenAndStationCode(startTime, endTime,stationCode);
-    for (ForecastPowerUltraShortTerm f:tempList){
-      if (Integer.parseInt(DateFormatUtils.format(f.getForecastTime(),"mm"))%15==0){
+    List<ForecastPowerUltraShortTerm> tempList = this.forecastPowerUltraShortTermRepository.findByForecastTimeBetweenAndStationCode(startTime, endTime, stationCode);
+    for (ForecastPowerUltraShortTerm f : tempList) {
+      if (Integer.parseInt(DateFormatUtils.format(f.getForecastTime(), "mm")) % 15 == 0) {
         forecastPowerUltraShortTermList.add(f);
       }
     }
 
     Long momentTime = 15 * 60 * 1000L; // 15分钟一个时刻
     Integer moments = Math.toIntExact((endTime - startTime) / momentTime + 1);
-    log.info(stationCode+"所需时间moments个数:"+moments);
-    log.info(stationCode+"获取所需记录数:" + forecastPowerUltraShortTermList.size());
+    log.info(stationCode + "所需时间moments个数:" + moments);
+    log.info(stationCode + "获取所需记录数:" + forecastPowerUltraShortTermList.size());
     if (moments > forecastPowerUltraShortTermList.size()) {
       Map<Long, List<ForecastPowerUltraShortTerm>> forecastPowerShortTermsMap = forecastPowerUltraShortTermList.stream().collect(Collectors.groupingBy(ForecastPowerUltraShortTerm::getForecastTime));
       for (Long tempTime = startTime; tempTime <= endTime; tempTime = tempTime + momentTime) {
         if (forecastPowerShortTermsMap.get(tempTime) == null) {
-          log.info(stationCode+"文件超短期缺点:"+tempTime+" forecastPowerShortTermsMap里个数:"+forecastPowerShortTermsMap.size());
+          log.info(stationCode + "文件超短期缺点:" + tempTime + " forecastPowerShortTermsMap里个数:" + forecastPowerShortTermsMap.size());
           BigDecimal tempValue;
           if (ElectricFieldTypeEnum.E1.equals(electricFieldInfo.getElectricFieldTypeEnum())) {
             if (DateTimeUtil.checkInSunriseAndSunset(startTime, electricFieldInfo.getLongitude().doubleValue(), electricFieldInfo.getLatitude().doubleValue())) {
@@ -122,8 +123,8 @@ public class ForecastPowerUltraShortTermService extends BaseService {
           forecastPowerUltraShortTerm.setForecastTime(tempTime);
           forecastPowerUltraShortTerm.setFpValue(tempValue);
           forecastPowerUltraShortTerm.setPredictionModelEnum(PredictionModelEnum.E4);
-          forecastPowerUltraShortTerm.setCoefficientValue(new BigDecimal(-0.99).setScale(2,BigDecimal.ROUND_HALF_UP));
-          forecastPowerUltraShortTerm.setDifferenceValue(new BigDecimal(-0.99).setScale(2,BigDecimal.ROUND_HALF_UP));
+          forecastPowerUltraShortTerm.setCoefficientValue(new BigDecimal(-0.99).setScale(2, BigDecimal.ROUND_HALF_UP));
+          forecastPowerUltraShortTerm.setDifferenceValue(new BigDecimal(-0.99).setScale(2, BigDecimal.ROUND_HALF_UP));
           forecastPowerUltraShortTerm.setStationCode(stationCode);
           // 保存超短期实时预测记录
           this.forecastPowerUltraShortTermRepository.save(forecastPowerUltraShortTerm);
@@ -131,7 +132,7 @@ public class ForecastPowerUltraShortTermService extends BaseService {
         }
       }
     }
-    log.info(stationCode+"生成超短期实时预测功率记录数:" + forecastPowerUltraShortTermList.size());
+    log.info(stationCode + "生成超短期实时预测功率记录数:" + forecastPowerUltraShortTermList.size());
     // 按预测时刻升序
     forecastPowerUltraShortTermList.sort(Comparator.comparing(ForecastPowerUltraShortTerm::getForecastTime));
 
@@ -164,7 +165,7 @@ public class ForecastPowerUltraShortTermService extends BaseService {
 //    List<ForecastPowerUltraShortTermHis> forecastPowerUltraShortTermHiss = forecastPowerUltraShortTermHiss1.stream().filter(t -> t.getForecastHowLongAgo() <=16).collect(Collectors.toList());
     // 获取实际功率替换超短期点位参数
     Integer replacePoint = 0;
-    String realpower_replace_cdq = sysParameterService.getSysParameter("realpower_replace_cdq", "0",stationCode);
+    String realpower_replace_cdq = sysParameterService.getSysParameter("realpower_replace_cdq", "0", stationCode);
     replacePoint = Integer.valueOf(realpower_replace_cdq);
     if (replacePoint <= forecastPowerUltraShortTermHiss.size() && replacePoint > 0) {
       Long pre5Time = 0l;
@@ -173,10 +174,10 @@ public class ForecastPowerUltraShortTermService extends BaseService {
         // 获取前5分钟时刻
         pre5Time = DateMomentUtil.getMomentTime(systemDate.getTime() - 5 * 60 * 1000, 1, 5 * 60 * 1000L);
       } catch (Exception e) {
-        log.error(stationCode+"超短期数据用实际功率替换生成时刻步长错误", e);
+        log.error(stationCode + "超短期数据用实际功率替换生成时刻步长错误", e);
         pre5Time = DateMomentUtil.getDayStartTime(systemDate.getTime());
       }
-      List<PowerStationStatusData> realPowerList = powerStationStatusDataRepository.findByTimeBetweenAndStationCode(new Date(pre5Time), new Date(pre5Time + 5 * 60 * 1000 - 1000),stationCode);
+      List<PowerStationStatusData> realPowerList = powerStationStatusDataRepository.findByTimeBetweenAndStationCode(new Date(pre5Time), new Date(pre5Time + 5 * 60 * 1000 - 1000), stationCode);
       if (realPowerList.size() > 0) {
         // 按时间降序排列
         realPowerList.sort(Comparator.comparing(PowerStationStatusData::getTime).reversed());
@@ -190,17 +191,17 @@ public class ForecastPowerUltraShortTermService extends BaseService {
       }
     }
 
-    String lowerPredictionLimit = super.getSysParameter("LowerPredictionLimit", "0",stationCode);
+    String lowerPredictionLimit = super.getSysParameter("LowerPredictionLimit", "0", stationCode);
     BigDecimal lpl = new BigDecimal(lowerPredictionLimit);
 
-    forecastPowerUltraShortTermHiss.forEach(s->{
-      if(s.getAbleValue().compareTo(lpl)==-1){
+    forecastPowerUltraShortTermHiss.forEach(s -> {
+      if (s.getAbleValue().compareTo(lpl) == -1) {
         s.setAbleValue(lpl);
       }
     });
 
     // 删除当前时刻标记时间生成的超短期历史记录
-    this.forecastPowerUltraShortTermHisRepository.deleteNowMoment(startTime, endTime, new Date(monentTime),stationCode);
+    this.forecastPowerUltraShortTermHisRepository.deleteNowMoment(startTime, endTime, new Date(monentTime), stationCode);
     // 保存超短期历史记录
     this.forecastPowerUltraShortTermHisRepository.saveAll(forecastPowerUltraShortTermHiss);
     return forecastPowerUltraShortTermHiss;
@@ -216,34 +217,33 @@ public class ForecastPowerUltraShortTermService extends BaseService {
     try {
       electricFieldList = super.getMultipleStation();
     } catch (BusinessException e) {
-      log.error("生成超短期实时获取多场站失败",e);
+      log.error("生成超短期实时获取多场站失败", e);
     }
 
-    if (electricFieldList.isEmpty()){
+    if (electricFieldList.isEmpty()) {
       log.error("没有找到场站,不能执行超短期实时数据生成");
-    }
-    else{
-      for (ElectricField electricField:electricFieldList){
+    } else {
+      for (ElectricField electricField : electricFieldList) {
         String stationCode = electricField.getStationCode();
         // 根据场站类型执行相应超短期预测
         try {
-          String cdqUpMin = super.getSysParameter("CDQ_UP_MIN", "0",stationCode);
-          Long currentTime = System.currentTimeMillis()+ Integer.parseInt(cdqUpMin) * 1000 * 60;
-          String llcdq_point = sysParameterService.getSysParameter("FILE_LLCDQ_POINT", "16",stationCode);
+          String cdqUpMin = super.getSysParameter("CDQ_UP_MIN", "0", stationCode);
+          Long currentTime = System.currentTimeMillis() + Integer.parseInt(cdqUpMin) * 1000 * 60;
+          String llcdq_point = sysParameterService.getSysParameter("FILE_LLCDQ_POINT", "16", stationCode);
           Integer forecastPoints = Integer.parseInt(llcdq_point);
           Integer forecastMinutes = forecastPoints * 15;
 
           // 超短期提前N分钟生成文件
           Long startTime = DateMomentUtil.getMomentTime(currentTime, 1, 15 * 60 * 1000L);
           // 结束时间增加15分钟为了防止文件先生成,实时表中最后一个时间点没有点位的问题
-          Long endTime = DateUtils.addMinutes(new Date(startTime), forecastMinutes).getTime()+1000 * 60 * 15L;
+          Long endTime = DateUtils.addMinutes(new Date(startTime), forecastMinutes).getTime() + 1000 * 60 * 15L;
           // 查询该时间段内的短期预测功率
-          List<ForecastPowerShortTerm> forecastPowerShortTermList = this.forecastPowerShortTermRepository.findByForecastTimeBetweenAndStationCode(startTime, endTime,stationCode);
+          List<ForecastPowerShortTerm> forecastPowerShortTermList = this.forecastPowerShortTermRepository.findByForecastTimeBetweenAndStationCode(startTime, endTime, stationCode);
           Map<Long, List<ForecastPowerShortTerm>> forecastPowerShortTermsMap =
             forecastPowerShortTermList.stream().collect(Collectors.groupingBy(ForecastPowerShortTerm::getForecastTime));
           Map<Long, BigDecimal> openCapacityMap = null;
           try {
-            openCapacityMap = super.queryOpenCapacity(startTime, endTime, electricField.getCapacity(),stationCode);
+            openCapacityMap = super.queryOpenCapacity(startTime, endTime, electricField.getCapacity(), stationCode);
           } catch (BusinessException e) {
             log.error("预测数据生成获取开机容量出错:" + CommonUtil.printStackTraceToString(e));
           }
@@ -256,7 +256,7 @@ public class ForecastPowerUltraShortTermService extends BaseService {
               if (ElectricFieldTypeEnum.E1.compareTo(electricField.getElectricFieldTypeEnum()) == 0) {
                 forecastPowerShortTerms = forecastPowerShortTermService.generateSolarPowerShortTerm(tempTime, openCapacityMap.get(tempTime), electricField);
               } else {
-                forecastPowerShortTerms = forecastPowerShortTermService.generateWindPowerShortTerm(tempTime, openCapacityMap.get(tempTime),stationCode);
+                forecastPowerShortTerms = forecastPowerShortTermService.generateWindPowerShortTerm(tempTime, openCapacityMap.get(tempTime), stationCode);
               }
               addForecastPowerShortTermList.add(forecastPowerShortTerms);
             }
@@ -271,10 +271,10 @@ public class ForecastPowerUltraShortTermService extends BaseService {
 
           if (ElectricFieldTypeEnum.E1.compareTo(electricField.getElectricFieldTypeEnum()) == 0) {
             // 光伏电站
-            this.executeForecastForlight(forecastPowerShortTermList, electricField.getCapacity(),stationCode);
+            this.executeForecastForlight(forecastPowerShortTermList, electricField.getCapacity(), stationCode);
           } else if (ElectricFieldTypeEnum.E2.compareTo(electricField.getElectricFieldTypeEnum()) == 0) {
             // 风力电场
-            this.executeForecastForWind(forecastPowerShortTermList, electricField.getCapacity(),stationCode);
+            this.executeForecastForWind(forecastPowerShortTermList, electricField.getCapacity(), stationCode);
           } else {
             log.error("场站类型非法!");
           }
@@ -293,28 +293,28 @@ public class ForecastPowerUltraShortTermService extends BaseService {
    * @param forecastPowerShortTermList 短期预测结果集
    * @param capacity                   装机容量
    */
-  private List<ForecastPowerUltraShortTerm> executeForecastForWind(final List<ForecastPowerShortTerm> forecastPowerShortTermList, final BigDecimal capacity,String stationCode) {
+  private List<ForecastPowerUltraShortTerm> executeForecastForWind(final List<ForecastPowerShortTerm> forecastPowerShortTermList, final BigDecimal capacity, String stationCode) {
     List<ForecastPowerUltraShortTerm> forecastPowerUltraShortTermList = new ArrayList<>();
     ForecastPowerUltraShortTerm forecastPowerUltraShortTerm;
     //获取系统参数cdqjsfs,超短期计算方式,0为默认乘系数的方式,1为根据可用功率计算的方式
-    String cdqjsfs = electricFieldService.getSysParameter("cdqjsfs", "1",stationCode);
+    String cdqjsfs = electricFieldService.getSysParameter("cdqjsfs", "1", stationCode);
     log.info("参数cdqjsfs值为:" + cdqjsfs + ",超短期计算方式,0为默认乘系数的方式,1为根据可用功率计算的方式。");
-    BigDecimal stPower, ustPower,ustPowers;
+    BigDecimal stPower, ustPower, ustPowers;
     // 判断查询可用功率结果是否为空,如果不为空根据平均可用功率与短期预测结果的偏差值进行计算超短期结果,否则超短期=短期*随机系数
     // 查询当前时间点标记时间前10分钟的可用功率
     ForecastPowerShortTerm currentForecastPowerShortTerm = forecastPowerShortTermList.get(0);
     Date currentTime = new Date(currentForecastPowerShortTerm.getForecastTime());
     Date startTime = DateUtils.addMinutes(currentTime, -10);
     Date endTime = DateUtils.addMinutes(currentTime, 1);
-    List<PowerStationStatusData> powerStationStatusDataList = this.powerStationStatusDataRepository.findByTimeBetweenAndStationCode(startTime, endTime,stationCode);
+    List<PowerStationStatusData> powerStationStatusDataList = this.powerStationStatusDataRepository.findByTimeBetweenAndStationCode(startTime, endTime, stationCode);
     List<PowerStationStatusData> filterList = powerStationStatusDataList.stream().filter(t -> t.getAbleValue().compareTo(new BigDecimal("-1")) == 1).collect(Collectors.toList());
-    String coe = super.getSysParameter("CDQ_COE", "1.05",stationCode);
+    String coe = super.getSysParameter("CDQ_COE", "1.05", stationCode);
 
     Long monentTime = 0L;
     try {
       monentTime = DateMomentUtil.getMomentTime(new Date().getTime(), 1, 15 * 60 * 1000L);
     } catch (Exception e) {
-      log.error("获取当前时刻错误",e);
+      log.error("获取当前时刻错误", e);
     }
     if (filterList.size() > 0) {
       BigDecimal sumAbleValue = filterList.stream().map(PowerStationStatusData::getAbleValue)
@@ -338,9 +338,9 @@ public class ForecastPowerUltraShortTermService extends BaseService {
           forecastPowerUltraShortTerm.setPredictionModelEnum(PredictionModelEnum.E4);
         } else {
           BigDecimal xzjdq = deviationValue.add(stPower).setScale(2, BigDecimal.ROUND_HALF_UP);
-          String cdqjsfsZbxz = electricFieldService.getSysParameter("cdqjsfsZbxz", "0.4",stationCode);
+          String cdqjsfsZbxz = electricFieldService.getSysParameter("cdqjsfsZbxz", "0.4", stationCode);
           log.debug("参数cdqjsfsZbxz值为:" + cdqjsfsZbxz + ",超短期计算方式,可用和短期的差值加短期占比。");
-          String cdqjsfsZbdq = electricFieldService.getSysParameter("cdqjsfsZbdq", "0.6",stationCode);
+          String cdqjsfsZbdq = electricFieldService.getSysParameter("cdqjsfsZbdq", "0.6", stationCode);
           log.debug("参数cdqjsfsZbdq值为:" + cdqjsfsZbdq + ",超短期计算方式,短期占比。");
           ustPower = xzjdq.multiply(new BigDecimal(cdqjsfsZbxz)).setScale(2, BigDecimal.ROUND_HALF_UP).add(stPower.multiply(new BigDecimal(cdqjsfsZbdq)).setScale(2, BigDecimal.ROUND_HALF_UP));
           if (ustPower.doubleValue() > capacity.doubleValue()) {
@@ -349,11 +349,11 @@ public class ForecastPowerUltraShortTermService extends BaseService {
           } else if (ustPower.doubleValue() < 0) {
             // 如果超短期结果小于0,则超短期结果为0
             forecastPowerUltraShortTerm.setFpValue(BigDecimal.ZERO);
-          }else{
-            if(cdqjsfs.equals("1")){
+          } else {
+            if (cdqjsfs.equals("1")) {
               forecastPowerUltraShortTerm.setFpValue(ustPower);
               forecastPowerUltraShortTerm.setPredictionModelEnum(PredictionModelEnum.E5);
-            }else{
+            } else {
               forecastPowerUltraShortTerm.setFpValue(ustPowers);
               forecastPowerUltraShortTerm.setPredictionModelEnum(PredictionModelEnum.E9);
             }
@@ -375,7 +375,7 @@ public class ForecastPowerUltraShortTermService extends BaseService {
         forecastPowerUltraShortTerm.setForecastTime(forecastPowerShortTermList.get(i).getForecastTime());
         forecastPowerUltraShortTerm.setPredictionModelEnum(PredictionModelEnum.E9);
         forecastPowerUltraShortTerm.setCoefficientValue(ustPower);
-        forecastPowerUltraShortTerm.setDifferenceValue(new BigDecimal(-0.99).setScale(2,BigDecimal.ROUND_HALF_UP));
+        forecastPowerUltraShortTerm.setDifferenceValue(new BigDecimal(-0.99).setScale(2, BigDecimal.ROUND_HALF_UP));
         forecastPowerUltraShortTerm.setFpValue(ustPower);
         forecastPowerUltraShortTerm.setGenDate(new Date(monentTime));
         forecastPowerUltraShortTerm.setStationCode(stationCode);
@@ -383,15 +383,107 @@ public class ForecastPowerUltraShortTermService extends BaseService {
       }
     }
     // 保存超短期预测结果
-    this.forecastPowerUltraShortTermRepository.deleteByForecastTimeBetweenAndStationCode(forecastPowerShortTermList.get(1).getForecastTime(), forecastPowerShortTermList.get(forecastPowerShortTermList.size() - 1).getForecastTime(),stationCode);
+    this.forecastPowerUltraShortTermRepository.deleteByForecastTimeBetweenAndStationCode(forecastPowerShortTermList.get(1).getForecastTime(), forecastPowerShortTermList.get(forecastPowerShortTermList.size() - 1).getForecastTime(), stationCode);
     this.forecastPowerUltraShortTermRepository.saveAll(forecastPowerUltraShortTermList);
 
     return forecastPowerUltraShortTermList;
   }
 
-  private void executeForecastForlight(final List<ForecastPowerShortTerm> forecastPowerShortTermList, final BigDecimal capacity,String stationCode) {
+  private void executeForecastForlight(final List<ForecastPowerShortTerm> forecastPowerShortTermList, final BigDecimal capacity, String stationCode) {
     // 暂时光超短期预测方法=风超短期预测方法
-    this.executeForecastForWind(forecastPowerShortTermList, capacity,stationCode);
+    this.executeForecastForWind(forecastPowerShortTermList, capacity, stationCode);
+  }
+
+
+  /**
+   * 根据提前多久,开始结束时间查询历史超短期 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<ForecastPowerUltraShortTermHis> list = forecastPowerUltraShortTermHisRepository.findByForecastTimeBetweenAndForecastHowLongAgo(startTime, endTime, ago);
+    list.sort(Comparator.comparing(ForecastPowerUltraShortTermHis::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<ForecastPowerUltraShortTermHis> 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;
+
   }
 
+  /**
+   * 超短期查询16个点数据 tl
+   *
+   * @param startTime 开始时间
+   * @return 结果集
+   */
+  @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
+  public Map<String, Object> findByForecastRealTimeUltraShortTerm16(Long startTime, String stationCode) {
+    Long endTime = startTime + 60 * 60 * 1000 * 24;
+//    List<Map<String,Object>> valueList16 = new ArrayList<>();
+    //取出16点数据存入集合中
+    Map<String, Object> realPowerMap = new HashMap<>();
+    List<ForecastPowerUltraShortTermHis> forecastPowerUltraShortTermHisList = forecastPowerUltraShortTermHisRepository.findByForecastTimeBetweenAndStationCode(startTime, endTime, stationCode);
+    for (int p = 1; p <= 16; p++) {
+
+      int finalP = p;
+      List<ForecastPowerUltraShortTermHis> filterList = forecastPowerUltraShortTermHisList.stream().filter(t -> t.getForecastHowLongAgo() == finalP).collect(Collectors.toList());
+
+      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<ForecastPowerUltraShortTermHis> 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);
+    Map<String, Object> map = new HashMap<>();
+    ElectricField electricField = electricFieldService.getSingleStation(stationCode);
+    map.put("value", realPowerMap);
+    map.put("capacity", electricField.getCapacity());
+    return map;
+
+  }
 }