Kaynağa Gözat

Merge branch 'master' of http://git.jiayuepowertech.com:9022/xusl/focus

xusl 3 yıl önce
ebeveyn
işleme
0bb503a270
18 değiştirilmiş dosya ile 156 ekleme ve 1866 silme
  1. 2 2
      ipfcst-client/src/main/java/com/jiayue/client/controller/ConsoleController.java
  2. 39 42
      ipfcst-client/src/main/java/com/jiayue/client/job/DownloadFileJob.java
  3. 14 16
      ipfcst-client/src/main/java/com/jiayue/client/job/SendDataToDcJob.java
  4. 13 6
      ipfcst-client/src/main/java/com/jiayue/client/service/QueryDataService.java
  5. 41 41
      ipfcst-client/src/main/java/com/jiayue/client/service/SendDataService.java
  6. 13 0
      ipfcst-client/src/main/java/com/jiayue/client/util/Constants.java
  7. 1 7
      ipfcst-client/src/main/java/com/jiayue/client/util/MD5Util.java
  8. 4 7
      ipfcst-client/src/main/java/com/jiayue/client/util/Scpclient.java
  9. 0 28
      ipfcst-console/src/main/frontend/router/modules/console.js
  10. 0 361
      ipfcst-console/src/main/frontend/views/console/dataLimitation/index.vue
  11. 0 274
      ipfcst-console/src/main/frontend/views/console/dataLimitationLog/index.vue
  12. 0 566
      ipfcst-console/src/main/frontend/views/console/manualInterventionData/index.vue
  13. 0 492
      ipfcst-console/src/main/frontend/views/console/manualInterventionQuery/index.vue
  14. 2 2
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/ForecastPowerShortTermController.java
  15. 1 1
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/ForecastPowerShortTermHisController.java
  16. 2 2
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/ForecastPowerUltraShortTermHisController.java
  17. 2 4
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/NwpController.java
  18. 22 15
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/ReceiveDataService.java

+ 2 - 2
ipfcst-client/src/main/java/com/jiayue/client/controller/ConsoleController.java

@@ -5,7 +5,7 @@ import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.RequestMapping;
 
-import java.util.HashMap;
+import java.util.Map;
 
 /**
  * 青海集中功率预测首页
@@ -14,7 +14,7 @@ import java.util.HashMap;
 @Slf4j
 public class ConsoleController {
     @RequestMapping("/common")
-    public String common(HashMap<String, Object> map, Model model) {
+    public String common(Map<String, Object> map, Model model) {
         model.addAttribute("say", "欢迎欢迎,热烈欢迎");
         map.put("hello", "欢迎进入HTML页面");
         return "index";

+ 39 - 42
ipfcst-client/src/main/java/com/jiayue/client/job/DownloadFileJob.java

@@ -30,11 +30,7 @@ import java.util.Properties;
 @Slf4j
 public class DownloadFileJob {
 
-    public final QueryDataService queryDataService;
-    //获取下载到文件,从临时目录移动到目标目录
-    public static List<String> filedownLoadList = new ArrayList<>();
-    public static List<String> isDownFileId = new ArrayList<>();
-    public static Properties properties;
+    protected final static Properties properties;
 
     static {
         YamlPropertiesFactoryBean yaml = new YamlPropertiesFactoryBean();
@@ -42,6 +38,11 @@ public class DownloadFileJob {
         properties = yaml.getObject();
     }
 
+    public final QueryDataService queryDataService;
+    //获取下载到文件,从临时目录移动到目标目录
+    public final List<String> filedownLoadList = new ArrayList<>();
+    public final List<String> isDownFileId = new ArrayList<>();
+
     public DownloadFileJob(QueryDataService queryDataService) {
         this.queryDataService = queryDataService;
     }
@@ -54,57 +55,53 @@ public class DownloadFileJob {
         log.info("上午文件下载定时任务开始");
         List<Map<String, Object>> stations = queryDataService.getStations();
         for (Map<String, Object> station : stations) {
-            String stationCode = Convert.toStr(station.get("C_STATION_CODE"));
-            log.info("开始执行定时任务:http下载场站:{} 的文件。", stationCode);
-            String body = HttpRequest.get(properties.getProperty("v3cloud.filelogUrl") + stationCode).execute().body();
-            JSONObject json = JSONUtil.parseObj(body);
-            String code = json.get("code").toString();
-            String data = json.get("data").toString();
-            if (code.equals("0") && data.length() > 0) {
-                JSONArray array = JSONUtil.parseArray(data);
-                List<FileCreateLog> list = array.toList(FileCreateLog.class);
-                String path = FileUtil.judeDirExists(properties.getProperty("local.downFilePath"));
-
-                try {
+            try {
+                String stationCode = Convert.toStr(station.get("C_STATION_CODE"));
+                log.info("开始执行定时任务:http下载场站:{} 的文件。", stationCode);
+                String body = HttpRequest.get(properties.getProperty("v3cloud.filelogUrl") + stationCode).execute().body();
+                JSONObject json = JSONUtil.parseObj(body);
+                String code = json.get("code").toString();
+                String data = json.get("data").toString();
+                if (code.equals("0") && data.length() > 0) {
+                    JSONArray array = JSONUtil.parseArray(data);
+                    List<FileCreateLog> list = array.toList(FileCreateLog.class);
+                    String path = FileUtil.judeDirExists(properties.getProperty("local.downFilePath"));
                     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();
-                        String targetPath = path + File.separatorChar +stationCode+File.separatorChar +"new"+File.separatorChar+ fileCreateLog.getFileName();
-                        long size = HttpUtil.downloadFile(url,targetPath);
+                        String url = properties.getProperty("v3cloud.fileDownUrl") + fileCreateLog.getId();
+                        String targetPath = path + File.separatorChar + stationCode + File.separatorChar + "new" + File.separatorChar + fileCreateLog.getFileName();
+
+                        long size = HttpUtil.downloadFile(url, targetPath);
                         if (size > 0) {
                             isDownFileId.add(fileCreateLog.getId());
-                            log.info("成功下载文件:{}", targetPath);
+                            log.debug("成功下载文件:{}", targetPath);
                             filedownLoadList.add(targetPath);
                         }
                     }
-                } catch (Exception e) {
-                    log.error("文件下载失败:{}", e);
-                } finally {
-                    //把下载的文件挪到功率预测服务器文件夹
-                    if (filedownLoadList.size() > 0) {
-                        log.info("开始移动下载文件到功率预测,共:{} 个文件。", filedownLoadList.size());
-                        for (String fpath : filedownLoadList) {
-                            try {
-                                Scpclient scpclient = Scpclient.getInstance(properties.getProperty("remote.ip"),
-                                        Convert.toInt(properties.getProperty("remote.port")), properties.getProperty("remote.user"),
-                                        properties.getProperty("remote.pwd"));
+                }
+                if (!filedownLoadList.isEmpty()) {
+                    log.debug("开始移动下载文件到功率预测,共:{} 个文件。", filedownLoadList.size());
+                    for (String filePath : filedownLoadList) {
+
+                        Scpclient scpclient = Scpclient.getInstance(properties.getProperty("remote.ip"),
+                                Convert.toInt(properties.getProperty("remote.port")), properties.getProperty("remote.user"),
+                                properties.getProperty("remote.pwd"));
+
+                        scpclient.putFile(filePath, properties.getProperty("remote.path") + stationCode + "/new/");
+                        log.info("移动文件:{} 到远程服务器 {} 成功", filePath, properties.getProperty("remote.path") + stationCode + "/new/");
 
-                                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("没有新文件下载,不需要移动到远程功率预测服务器。");
                     }
+                    log.debug("所有文件移动完成,清空文件临时filedownLoadList");
+                    filedownLoadList.clear();
+                } else {
+                    log.info("没有新文件下载,不需要移动到远程功率预测服务器。");
                 }
+            } catch (Exception e) {
+                log.error("文件下载失败:{}", e);
             }
         }
 

+ 14 - 16
ipfcst-client/src/main/java/com/jiayue/client/job/SendDataToDcJob.java

@@ -18,30 +18,19 @@ import java.util.Date;
 @Slf4j
 public class SendDataToDcJob {
 
+    public final SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
     public final SendDataService sendDataService;
-    public static SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
     public SendDataToDcJob(SendDataService sendDataService) {
         this.sendDataService = sendDataService;
     }
 
-
-    /**
-     * 每天凌晨2点执行
-     */
-    @Scheduled(cron = "0 0/5 * * * ?")
-    public void sendJob() {
-        log.info("时间 【" + System.currentTimeMillis() + "】 向数据中心发送青海集中功率预测前一天的实际功率等数据。数据范围:【{}--{}】", getDayStartTime(), getDayLastTime());
-        sendDataService.send(getDayStartTime(), getDayLastTime(), "all");
-    }
-
-
     /**
      * 获取当前时间所在天的0点0分
      *
      * @return 0点0分的毫秒
      */
-    public static String getDayStartTime() {
+    public String getDayStartTime() {
         Calendar date = Calendar.getInstance();
         date.setTime(new Date());
         date.set(Calendar.HOUR_OF_DAY, 0);
@@ -49,7 +38,7 @@ public class SendDataToDcJob {
         date.set(Calendar.SECOND, 0);
         date.set(Calendar.MILLISECOND, 0);
         date.add(Calendar.DAY_OF_MONTH, -1);
-        return formatter.format(date.getTime());
+        return this.formatter.format(date.getTime());
     }
 
     /**
@@ -57,7 +46,7 @@ public class SendDataToDcJob {
      *
      * @return 23点59分59秒的毫秒
      */
-    public static String getDayLastTime() {
+    public String getDayLastTime() {
         Calendar date = Calendar.getInstance();
         date.setTime(new Date());
         date.set(Calendar.HOUR_OF_DAY, 23);
@@ -65,6 +54,15 @@ public class SendDataToDcJob {
         date.set(Calendar.SECOND, 59);
         date.set(Calendar.MILLISECOND, 999);
         date.add(Calendar.DAY_OF_MONTH, -1);
-        return formatter.format(date.getTime());
+        return this.formatter.format(date.getTime());
+    }
+
+    /**
+     * 每天凌晨2点执行
+     */
+    @Scheduled(cron = "0 0/5 * * * ?")
+    public void sendJob() {
+        log.info("时间 【" + System.currentTimeMillis() + "】 向数据中心发送青海集中功率预测前一天的实际功率等数据。数据范围:【{}--{}】", getDayStartTime(), getDayLastTime());
+        sendDataService.send(getDayStartTime(), getDayLastTime(), "all");
     }
 }

+ 13 - 6
ipfcst-client/src/main/java/com/jiayue/client/service/QueryDataService.java

@@ -13,6 +13,7 @@ import java.util.Map;
 @Repository
 @Slf4j
 public class QueryDataService {
+    private final static String WHITH_AND_SQL_STR = "'and '";
     private final JdbcTemplate jdbcTemplate;
 
     public QueryDataService(JdbcTemplate jdbcTemplate) {
@@ -53,7 +54,7 @@ public class QueryDataService {
     public List<Map<String, Object>> getRps(String startTime, String endTime, String stationCode) {
         String rpsSql = "SELECT C_TIME,C_STATION_CODE,C_REAL_VALUE " +
                 "from t_power_station_status_data where C_STATION_CODE='" + stationCode +
-                "' and C_TIME between '" + startTime + "'and '" + endTime + "'";
+                "' and C_TIME between '" + startTime + WHITH_AND_SQL_STR + endTime + "'";
         log.info("实际功率回传数据查询sql:{}", rpsSql);
         return jdbcTemplate.queryForList(rpsSql);
     }
@@ -70,7 +71,7 @@ public class QueryDataService {
         String dqsSql = "SELECT C_FORECAST_TIME,C_STATION_CODE,C_ABLE_VALUE " +
                 "from t_forecast_power_short_term_his where C_STATION_CODE='" + stationCode +
                 "' and C_FORECAST_TIME between '" + changStrTimeToLongTime(startTime) +
-                "'and '" + changStrTimeToLongTime(endTime) + "'";
+                WHITH_AND_SQL_STR + changStrTimeToLongTime(endTime) + "'";
         log.info("短期回传数据查询sql:{}", dqsSql);
         return jdbcTemplate.queryForList(dqsSql);
     }
@@ -87,7 +88,7 @@ public class QueryDataService {
         String cdqsSql = "SELECT C_FORECAST_TIME,C_STATION_CODE,C_ABLE_VALUE " +
                 "from t_forecast_power_ultra_short_term_his where C_STATION_CODE='" + stationCode +
                 "' and C_FORECAST_TIME between '" + changStrTimeToLongTime(startTime) +
-                "'and '" + changStrTimeToLongTime(endTime) + "'";
+                WHITH_AND_SQL_STR + changStrTimeToLongTime(endTime) + "'";
         log.info("超短期回传数据查询sql:{}", cdqsSql);
         return jdbcTemplate.queryForList(cdqsSql);
     }
@@ -102,7 +103,9 @@ public class QueryDataService {
      */
     public List<Map<String, Object>> getWeatherds(String startTime, String endTime, String equirpmentNo) {
         String wedSql = "SELECT C_TIME,C_EQUIPMENT_ID,C_GLOBALR,C_AIRT " +
-                "from t_weather_station_status_data where C_EQUIPMENT_ID='" + equirpmentNo + "' and C_TIME between '" + startTime + "'and '" + endTime + "'";
+                "from t_weather_station_status_data where C_EQUIPMENT_ID='" + equirpmentNo
+                + "' and C_TIME between '" + startTime
+                + WHITH_AND_SQL_STR + endTime + "'";
         log.info("超短期回传数据查询sql:{}", wedSql);
         return jdbcTemplate.queryForList(wedSql);
     }
@@ -117,7 +120,9 @@ public class QueryDataService {
      */
     public List<Map<String, Object>> getCfts(String startTime, String endTime, String equirpmentNo) {
         String cftsSql = "SELECT C_TIME,C_EQUIPMENT_ID,C_WS_INST_HUB_HEIGHT,C_WD_INST_HUB_HEIGHT " +
-                "from t_wind_tower_status_data where C_EQUIPMENT_ID='" + equirpmentNo + "' and C_TIME between '" + startTime + "'and '" + endTime + "'";
+                "from t_wind_tower_status_data where C_EQUIPMENT_ID='" + equirpmentNo
+                + "' and C_TIME between '" + startTime
+                + WHITH_AND_SQL_STR + endTime + "'";
         log.info("测风塔回传数据查询sql:{}", cftsSql);
 
         return jdbcTemplate.queryForList(cftsSql);
@@ -133,7 +138,9 @@ public class QueryDataService {
      */
     public List<Map<String, Object>> getFjs(String startTime, String endTime, String equirpmentNo) {
         String fjsSql = "SELECT C_TIME,C_EQUIPMENT_ID,C_WS,C_WD " +
-                "from t_wind_turbine_status_data where C_EQUIPMENT_ID='" + equirpmentNo + "' and C_TIME between '" + startTime + "'and '" + endTime + "'";
+                "from t_wind_turbine_status_data where C_EQUIPMENT_ID='" + equirpmentNo
+                + "' and C_TIME between '" + startTime
+                + WHITH_AND_SQL_STR + endTime + "'";
         log.info("风机回传数据查询sql:{}", fjsSql);
         return jdbcTemplate.queryForList(fjsSql);
     }

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

@@ -6,6 +6,7 @@ import cn.hutool.core.util.CharsetUtil;
 import cn.hutool.core.util.ZipUtil;
 import cn.hutool.http.HttpUtil;
 import cn.hutool.json.JSONUtil;
+import com.jiayue.client.util.Constants;
 import com.jiayue.client.util.MD5Util;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
@@ -18,11 +19,9 @@ import java.util.*;
 @Repository
 @Slf4j
 public class SendDataService {
-    public final QueryDataService queryDataService;
     //青海回传数据通用签名key
-    private final static String qinghaiKey = "Syjy*3377";
-
-    public static Properties properties;
+    private final static String QINGHAIKEY = "Syjy*3377";
+    protected static Properties properties;
 
     static {
         YamlPropertiesFactoryBean yaml = new YamlPropertiesFactoryBean();
@@ -30,6 +29,8 @@ public class SendDataService {
         properties = yaml.getObject();
     }
 
+    public final QueryDataService queryDataService;
+
     public SendDataService(QueryDataService queryDataService) {
         this.queryDataService = queryDataService;
     }
@@ -46,7 +47,7 @@ public class SendDataService {
         try {
             List<Map<String, Object>> stations = queryDataService.getStations();
             for (Map<String, Object> station : stations) {
-                String stationCode = Convert.toStr(station.get("C_STATION_CODE"));
+                String stationCode = Convert.toStr(station.get(Constants.C_STATION_CODE_FIELD));
 
                 if ("".equals(flag) || "all".equals(flag)) {
                     sendAll(startTime, endTime, stationCode);
@@ -115,18 +116,18 @@ public class SendDataService {
             List<Map<String, Object>> valueList = new ArrayList<>();
             for (Map<String, Object> powerStationStatusData : rps) {
                 Map<String, Object> valueMap = new HashMap<>();
-                valueMap.put("time", powerStationStatusData.get("C_TIME"));
-                valueMap.put("stationCode", powerStationStatusData.get("C_STATION_CODE"));
+                valueMap.put("time", powerStationStatusData.get(Constants.C_TIME_FIELD));
+                valueMap.put(Constants.stationCode_FIELD, powerStationStatusData.get(Constants.C_STATION_CODE_FIELD));
                 valueMap.put("value", powerStationStatusData.get("C_REAL_VALUE"));
                 valueList.add(valueMap);
             }
 
-            if (valueList.size() > 0) {
+            if (!valueList.isEmpty()) {
                 createReqAndSend("rp", JSONUtil.toJsonStr(valueList));
             }
 
         } catch (Exception e) {
-            log.error("向数据中心发送短期数据出现错误:{}", e);
+            log.error("向数据中心发送实际功率数据出现错误:{}", e);
             //TODO 微信警告
         }
     }
@@ -147,11 +148,11 @@ public class SendDataService {
             for (Map<String, Object> forecastPowerUltraShortTermHis : dqs) {
                 Map<String, Object> valueMap = new HashMap<>();
                 valueMap.put("time", forecastPowerUltraShortTermHis.get("C_FORECAST_TIME"));
-                valueMap.put("value", forecastPowerUltraShortTermHis.get("C_ABLE_VALUE"));
-                valueMap.put("stationCode", forecastPowerUltraShortTermHis.get("C_STATION_CODE"));
+                valueMap.put("value", forecastPowerUltraShortTermHis.get(Constants.C_ABLE_VALUE_FIELD));
+                valueMap.put(Constants.stationCode_FIELD, forecastPowerUltraShortTermHis.get(Constants.C_STATION_CODE_FIELD));
                 valueList.add(valueMap);
             }
-            if (valueList.size() > 0) {
+            if (!valueList.isEmpty()) {
                 createReqAndSend("dq", JSONUtil.toJsonStr(valueList));
             }
 
@@ -176,17 +177,17 @@ public class SendDataService {
             for (Map<String, Object> forecastPowerShortTermHis : cdqs) {
                 Map<String, Object> valueMap = new HashMap<>();
                 valueMap.put("time", forecastPowerShortTermHis.get("C_FORECAST_TIME"));
-                valueMap.put("valueK", forecastPowerShortTermHis.get("C_ABLE_VALUE"));
-                valueMap.put("valueX", forecastPowerShortTermHis.get("C_ABLE_VALUE"));
-                valueMap.put("stationCode", forecastPowerShortTermHis.get("C_STATION_CODE"));
+                valueMap.put("valueK", forecastPowerShortTermHis.get(Constants.C_ABLE_VALUE_FIELD));
+                valueMap.put("valueX", forecastPowerShortTermHis.get(Constants.C_ABLE_VALUE_FIELD));
+                valueMap.put(Constants.stationCode_FIELD, forecastPowerShortTermHis.get(Constants.C_STATION_CODE_FIELD));
                 valueList.add(valueMap);
             }
-            if (valueList.size() > 0) {
+            if (!valueList.isEmpty()) {
                 createReqAndSend("cdq", JSONUtil.toJsonStr(valueList));
             }
 
         } catch (Exception e) {
-            log.error("向数据中心发送短期数据出现错误:{}", e);
+            log.error("向数据中心发送短期数据出现错误:{}", e);
             //TODO 微信警告
         }
     }
@@ -206,22 +207,22 @@ public class SendDataService {
         //遍历设备列表
         for (Map<String, Object> weatherStationInfo : weatherStationInfos) {
             //判断是否为检测仪设备
-            if (Convert.toStr(weatherStationInfo.get("C_EQUIPMENT_TYPE")).equals("1")) {
-                String equipmentNo = Convert.toStr(weatherStationInfo.get("C_EQUIPMENT_NO"));
+            if (Convert.toStr(weatherStationInfo.get(Constants.C_EQUIPMENT_TYPE_FIELD)).equals(Constants.C_EQUIPMENT_TYPE_1)) {
+                String equipmentNo = Convert.toStr(weatherStationInfo.get(Constants.C_EQUIPMENT_NO_FIELD));
                 //根据时间和设备号查询环境检测仪数据
                 List<Map<String, Object>> cdqs = queryDataService.getWeatherds(startTime, endTime, equipmentNo);
                 for (Map<String, Object> weatherStationStatusData : cdqs) {
                     Map<String, Object> valueMap = new HashMap<>();
-                    valueMap.put("time", weatherStationStatusData.get("C_TIME"));
+                    valueMap.put("time", weatherStationStatusData.get(Constants.C_TIME_FIELD));
                     valueMap.put("wsNo", equipmentNo);
-                    valueMap.put("stationCode", stationCode);
+                    valueMap.put(Constants.stationCode_FIELD, stationCode);
                     valueMap.put("globalr", weatherStationStatusData.get("C_GLOBALR"));
                     valueMap.put("airt", weatherStationStatusData.get("C_AIRT"));
                     valueList.add(valueMap);
                 }
             }
         }
-        if (valueList.size() > 0) {
+        if (!valueList.isEmpty()) {
             createReqAndSend("qxz", JSONUtil.toJsonStr(valueList));
         }
 
@@ -243,22 +244,22 @@ public class SendDataService {
         //遍历设备列表
         for (Map<String, Object> windTowerInfo : windTowerInfos) {
             //判断是否为测风塔设备
-            if (Convert.toStr(windTowerInfo.get("C_EQUIPMENT_TYPE")).equals("3")) {
-                String equipmentNo = Convert.toStr(windTowerInfo.get("C_EQUIPMENT_NO"));
+            if (Convert.toStr(windTowerInfo.get(Constants.C_EQUIPMENT_TYPE_FIELD)).equals(Constants.C_EQUIPMENT_TYPE_3)) {
+                String equipmentNo = Convert.toStr(windTowerInfo.get(Constants.C_EQUIPMENT_NO_FIELD));
                 //根据时间和设备号查询风速数据
                 List<Map<String, Object>> windTowerStatusDatas = queryDataService.getCfts(startTime, endTime, equipmentNo);
                 for (Map<String, Object> windTowerStatusData : windTowerStatusDatas) {
                     Map<String, Object> valueMap = new HashMap<>();
                     valueMap.put("time", windTowerStatusData.get("C_TIME"));
                     valueMap.put("atNo", equipmentNo);
-                    valueMap.put("stationCode", stationCode);
+                    valueMap.put(Constants.stationCode_FIELD, stationCode);
                     valueMap.put("speed", windTowerStatusData.get("C_WS_INST_HUB_HEIGHT"));
                     valueMap.put("direction", windTowerStatusData.get("C_WD_INST_HUB_HEIGHT"));
                     valueList.add(valueMap);
                 }
             }
         }
-        if (valueList.size() > 0) {
+        if (!valueList.isEmpty()) {
             createReqAndSend("cft", JSONUtil.toJsonStr(valueList));
         }
 
@@ -280,22 +281,22 @@ public class SendDataService {
         //遍历设备列表
         for (Map<String, Object> windTurbineInfo : windTurbineInfos) {
             //判断是否为测风塔设备
-            if (Convert.toStr(windTurbineInfo.get("C_EQUIPMENT_TYPE")).equals("4")) {
-                String equipmentNo = Convert.toStr(windTurbineInfo.get("C_EQUIPMENT_NO"));
+            if (Convert.toStr(windTurbineInfo.get(Constants.C_EQUIPMENT_TYPE_FIELD)).equals("4")) {
+                String equipmentNo = Convert.toStr(windTurbineInfo.get(Constants.C_EQUIPMENT_NO_FIELD));
                 //根据时间和设备号查询风速数据
                 List<Map<String, Object>> windTurbineDatas = queryDataService.getFjs(startTime, endTime, equipmentNo);
                 for (Map<String, Object> windTurbineData : windTurbineDatas) {
                     Map<String, Object> valueMap = new HashMap<>();
                     valueMap.put("time", windTurbineData.get("C_TIME"));
                     valueMap.put("atNo", equipmentNo);
-                    valueMap.put("stationCode", stationCode);
+                    valueMap.put(Constants.stationCode_FIELD, stationCode);
                     valueMap.put("speed", windTurbineData.get("C_WS"));
                     valueMap.put("direction", windTurbineData.get("C_WD"));
                     valueList.add(valueMap);
                 }
             }
         }
-        if (valueList.size() > 0) {
+        if (!valueList.isEmpty()) {
             createReqAndSend("fj", JSONUtil.toJsonStr(valueList));
         }
     }
@@ -311,23 +312,22 @@ public class SendDataService {
         Map<String, Object> resultMap = new HashMap<>();
         resultMap.put("type", dataType);
         resultMap.put("body", valueList);
-        String sign = MD5Util.encode(valueList + qinghaiKey, "MD5");
+        String sign = MD5Util.encode(valueList + QINGHAIKEY, "MD5");
         resultMap.put("sign", sign);
 
         String reqStr = JSONUtil.toJsonStr(resultMap);
-        log.info("回传数据给数据中心,请求原报文:{}", reqStr);
-        log.info("回传数据给数据中心,请求地址:{}", properties.getProperty("remote.dcUrl")+"");
+        log.debug("回传数据给数据中心,请求原报文:{}", reqStr);
+        log.debug("回传数据给数据中心,请求地址:{}", properties.getProperty("remote.dcUrl") + "");
         Map<String, Object> reqMap = new HashMap<>();
         reqMap.put("reqMsg", Base64.encode(ZipUtil.gzip(reqStr, CharsetUtil.CHARSET_UTF_8.name())));
-        log.info("回传数据给数据中心,压缩加密后报文:{}", reqMap);
-        String resp = HttpUtil.get(properties.getProperty("remote.dcUrl"),reqMap);
-       // String resp = HttpUtil.post(properties.getProperty("remote.dcUrl")+"", reqStr);
-        if (resp.length() > 0) {
-            if (!"0".equals(JSONUtil.parseObj(resp).get("code"))) {
-                new Exception("回传数据给数据中心错误:" + resp);
-            }
+        log.debug("回传数据给数据中心,压缩加密后报文:{}", reqMap);
+        String resp = HttpUtil.get(properties.getProperty("remote.dcUrl"), reqMap);
+        if (resp.length() > 0 && (0 == JSONUtil.parseObj(resp).getInt("code"))) {
+            log.info("回传数据给数据中心成功,获得响应报文:{}", resp);
+        } else {
+            log.error("回传数据给数据中心错误:{}", resp);
         }
-        log.info("回传数据给数据中心,获得响应报文:{}", resp);
+
     }
 
 }

+ 13 - 0
ipfcst-client/src/main/java/com/jiayue/client/util/Constants.java

@@ -0,0 +1,13 @@
+package com.jiayue.client.util;
+
+public class Constants {
+    public static final String C_STATION_CODE_FIELD = "C_STATION_CODE";
+    public static final String C_ABLE_VALUE_FIELD = "C_ABLE_VALUE";
+    public static final String C_EQUIPMENT_TYPE_FIELD = "C_EQUIPMENT_TYPE";
+    public static final String C_EQUIPMENT_TYPE_1 = "1";
+    public static final String C_EQUIPMENT_TYPE_2 = "2";
+    public static final String C_EQUIPMENT_TYPE_3 = "3";
+    public static final String C_EQUIPMENT_NO_FIELD = "C_EQUIPMENT_NO";
+    public static final String stationCode_FIELD = "stationCode";
+    public static final String C_TIME_FIELD = "C_TIME";
+}

+ 1 - 7
ipfcst-client/src/main/java/com/jiayue/client/util/MD5Util.java

@@ -8,13 +8,7 @@ import java.security.MessageDigest;
  * @author Administrator
  */
 public class MD5Util {
-
-
-    //工具类不允许被实例化
-    private MD5Util() throws Exception {
-        throw new Exception("异常");
-    }
-
+    
     public static String encode(String str) {
         MessageDigest md5;
         try {

+ 4 - 7
ipfcst-client/src/main/java/com/jiayue/client/util/Scpclient.java

@@ -44,16 +44,13 @@ public class Scpclient {
             conn.connect();
             boolean isAuthenticated = conn.authenticateWithPassword(username,
                     password);
-            if (!isAuthenticated) {
-                log.info("authentication failed");
-                return null;
+            if (isAuthenticated) {
+                SCPClient client = new SCPClient(conn);
+                client.get(remoteFile, localTargetDirectory);
+                conn.close();
             }
-            SCPClient client = new SCPClient(conn);
-            client.get(remoteFile, localTargetDirectory);
-            conn.close();
         } catch (IOException e) {
             log.info(e.getMessage());
-            return null;
         }
         return null;
     }

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

@@ -76,34 +76,6 @@ const consoleRouter = {
       sign: 'currency'
     },
     {
-      path: 'manualInterventionData',
-      component: () => import('@/views/console/manualInterventionData/index'),
-      name: 'ManualInterventionData',
-      meta: { title: '人工干预设置', noCache: true },
-      sign: 'currency'
-    },
-    {
-      path: 'manualInterventionQuery',
-      component: () => import('@/views/console/manualInterventionQuery/index'),
-      name: 'ManualInterventionQuery',
-      meta: { title: '人工干预数据查询', noCache: true },
-      sign: 'currency'
-    },
-    {
-      path: 'dataLimitation',
-      component: () => import('@/views/console/dataLimitation/index'),
-      name: 'DataLimitation',
-      meta: { title: '上报数据限制', noCache: true },
-      sign: 'currency'
-    },
-    {
-      path: 'dataLimitationLog',
-      component: () => import('@/views/console/dataLimitationLog/index'),
-      name: 'DataLimitationLog',
-      meta: { title: '上报数据操作记录', noCache: true },
-      sign: 'currency'
-    },
-    {
       path: 'fileAnalysisRecord',
       component: () => import('@/views/console/FileAnalysisRecord/index'),
       name: 'FileAnalysisRecord',

+ 0 - 361
ipfcst-console/src/main/frontend/views/console/dataLimitation/index.vue

@@ -1,361 +0,0 @@
-<template>
-  <div class="app-container">
-      <el-card class="box-carde">
-        <div slot="header" class="clearfix">
-          <span>上报数据限制设置</span>
-
-        </div>
-    <el-container>
-      <el-header style="padding: 0px;display:flex;justify-content:space-between;align-items: center">
-        <div style="display: inline">
-          <el-date-picker
-            v-model="dateTime"
-            type="date"
-            placeholder="选择日期"/>
-          <el-button type="primary" size="mini" style="margin-left: 5px" icon="el-icon-search" @click="searchEmp">搜索
-          </el-button>
-          <el-button type="primary" size="mini" style="margin-left: 5px" icon="el-icon-plus" @click="saveManual('form')">保存
-          </el-button>
-        </div>
-      </el-header>
-
-      <el-tabs v-model="activeName" type="card">
-
-        <div>
-          <el-table
-            v-loading="tableLoading"
-            :data="form.slice((currentPage-1)*pageSize,currentPage*pageSize)"
-            height="550px"
-            border
-            stripe
-            size="mini"
-            style="width: 100%">
-            <el-table-column
-              prop="time1"
-              header-align="center"
-              align="center"
-              label="时间">
-            </el-table-column>
-            <el-table-column
-              :show-overflow-tooltip="true"
-              prop="dataMin1"
-              header-align="center"
-              align="center"
-              label="下限值">
-              <template slot-scope="scope">
-                <vxe-input type="number" v-model="scope.row.dataMin1" size="small"  style="width:100%" min="0" :max="capacity" placeholder="超过装机容量默认最大值"></vxe-input>
-              </template>
-            </el-table-column>
-            <el-table-column
-              :show-overflow-tooltip="true"
-              prop="dataMax1"
-              header-align="center"
-              align="center"
-              label="上限值">
-              <template slot-scope="scope">
-                <vxe-input type="number" v-model="scope.row.dataMax1" size="small"  style="width:100%" min="0" :max="capacity" placeholder="超过装机容量默认最大值"></vxe-input>
-              </template>
-            </el-table-column>
-            <el-table-column
-              :show-overflow-tooltip="true"
-              prop="time2"
-              align="center"
-              header-align="center"
-              label="时间"/>
-            <el-table-column
-              :show-overflow-tooltip="true"
-              prop="dataMin2"
-              align="center"
-              header-align="center"
-              label="下限值">
-              <template slot-scope="scope">
-                <vxe-input type="number" v-model="scope.row.dataMin2" size="small"  style="width:100%" min="0" :max="capacity" placeholder="超过装机容量默认最大值"></vxe-input>
-              </template>
-            </el-table-column>
-            <el-table-column
-              :show-overflow-tooltip="true"
-              prop="dataMax2"
-              align="center"
-              header-align="center"
-              label="上限值">
-              <template slot-scope="scope">
-                <vxe-input type="number" v-model="scope.row.dataMax2" size="small"  style="width:100%" min="0" :max="capacity" placeholder="超过装机容量默认最大值"></vxe-input>
-              </template>
-            </el-table-column>
-            <el-table-column
-              :show-overflow-tooltip="true"
-              prop="time3"
-              align="center"
-              header-align="center"
-              label="时间"/>
-            <el-table-column
-              :show-overflow-tooltip="true"
-              prop="dataMin3"
-              align="center"
-              header-align="center"
-              label="下限值">
-              <template slot-scope="scope">
-                <vxe-input type="number" v-model="scope.row.dataMin3" size="small"  style="width:100%" min="0" :max="capacity" placeholder="超过装机容量默认最大值"></vxe-input>
-              </template>
-            </el-table-column>
-            <el-table-column
-              :show-overflow-tooltip="true"
-              prop="dataMax3"
-              align="center"
-              header-align="center"
-              label="上限值">
-              <template slot-scope="scope">
-                <vxe-input type="number" v-model="scope.row.dataMax3" size="small"  style="width:100%" min="0" :max="capacity" placeholder="超过装机容量默认最大值"></vxe-input>
-              </template>
-            </el-table-column>
-            <el-table-column
-              :show-overflow-tooltip="true"
-              prop="time4"
-              align="center"
-              header-align="center"
-              label="时间"/>
-            <el-table-column
-              :show-overflow-tooltip="true"
-              prop="dataMin4"
-              align="center"
-              header-align="center"
-              label="下限值">
-              <template slot-scope="scope">
-                <vxe-input type="number" v-model="scope.row.dataMin4" size="small"  style="width:100%" min="0" :max="capacity" placeholder="超过装机容量默认最大值"></vxe-input>
-              </template>
-            </el-table-column>
-            <el-table-column
-              :show-overflow-tooltip="true"
-              prop="dataMax4"
-              align="center"
-              header-align="center"
-              label="上限值">
-              <template slot-scope="scope">
-                <vxe-input type="number" v-model="scope.row.dataMax4" size="small"  style="width:100%" min="0" :max="capacity" placeholder="超过装机容量默认最大值"></vxe-input>
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-      </el-tabs>
-    </el-container>
-    </el-card>
-  </div>
-</template>
-<script>
-export default {
-  data() {
-    return {
-      ef: '',
-      // 日期选择器
-      dateTime:  new Date(new Date().toLocaleDateString()),
-      // 场站信息存储对象
-      elTableData: [],
-      efiId: '',
-      emps: [],
-      dataList: [],
-      keywords: '',
-      jType: '',
-      dialogTitle: '',
-      multipleSelection: [],
-      downLoading: false,
-      depTextColor: '#c0c4cc',
-      totalCount: -1,
-      currentPage: 1,
-      pageSize:25,
-      dialogVisible: false,
-      tableLoading: false,
-      fileParsing: [],
-      activeName: 'first',
-      ultraValueData: [],
-      shortValueData: [],
-      realPowerValueData: [],
-      capacityUnit: '',
-      capacity: '',
-      shortValueDate: [],
-      form:[{
-        time1:'',
-        dataMax1:'',
-        dataMin1:'',
-        time2:'',
-        dataMax2:'',
-        dataMin2:'',
-        time3:'',
-        dataMax3:'',
-        dataMin3:'',
-        time4:'',
-        dataMax4:'',
-        dataMin4:'',
-        lastModifyTime:''
-      }],
-
-    }
-  },
-  created: function() {
-    this.getEl()
-
-  },
-
-  methods: {
-    getEl(){
-      this.$axios.get("/electricField/").then(res => {
-        this.capacity = res.data.capacity
-        this.queryManualIntervention()
-        // console.log("获取场站信息成功")
-      })
-    },
-    timestampToTimess(time) {
-      const date = new Date(time)// 时间戳为10位需*1000,时间戳为13位的话不需乘1000
-      const Y = date.getFullYear() + '-'
-      const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
-      const D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '
-      const H = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'
-      const m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes())
-      return Y + M + D + H + m
-    },
-    timestampToTimes(time) {
-      const a = parseInt(time)
-      const date = new Date(a) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
-      const Y = date.getFullYear() + '-'
-      const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
-      const D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '
-      const H = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'
-      const m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes())
-      return Y + M + D
-    },
-    // 根据类型获取class
-    queryManualIntervention() {
-      this.tableLoading =true
-      const a=[];
-      const b=[];
-      const c=[];
-      const d=[];
-      for(var i=0; i<=23;i++){
-        if(i<10){
-          a.push(this.timestampToTimes(Math.round(this.dateTime))+"0"+i+":00")
-          b.push(this.timestampToTimes(Math.round(this.dateTime))+"0"+i+":15")
-          c.push(this.timestampToTimes(Math.round(this.dateTime))+"0"+i+":30")
-          d.push(this.timestampToTimes(Math.round(this.dateTime))+"0"+i+":45")
-        }else{
-          a.push(this.timestampToTimes(Math.round(this.dateTime))+i+":00")
-          b.push(this.timestampToTimes(Math.round(this.dateTime))+i+":15")
-          c.push(this.timestampToTimes(Math.round(this.dateTime))+i+":30")
-          d.push(this.timestampToTimes(Math.round(this.dateTime))+i+":45")
-        }
-      }
-      for(var i=0; i<a.length;i++){
-        this.form[i]={
-          time1:a[i],
-          dataMax1:"",
-          dataMin1:"",
-          time2:b[i],
-          dataMax2:"",
-          dataMin2:"",
-          time3:c[i],
-          dataMax3:"",
-          dataMin3:"",
-          time4:d[i],
-          dataMax4:"",
-          dataMin4:"",
-        }
-      }
-      const startTime = Math.round(this.dateTime)
-      const endTime = Math.round(this.dateTime) + 60 * 60 * 24 * 1000 - 1
-      this.$axios.get('/dataLimitationController/queryDataLimitationServicea/'+startTime+'/'+endTime).then((res) => {
-        for(var i=0;i<res.data.length;i++){
-          for(var j=0;j<this.form.length;j++){
-            if(this.timestampToTimess(res.data[i].limitTime) == this.form[j].time1){
-              this.form[j].dataMax1 = res.data[i].upperLimit
-              this.form[j].dataMin1 = res.data[i].lowerLimit
-            }
-            if(this.timestampToTimess(res.data[i].limitTime) == this.form[j].time2){
-              this.form[j].dataMax2 = res.data[i].upperLimit
-              this.form[j].dataMin2 = res.data[i].lowerLimit
-            }
-            if(this.timestampToTimess(res.data[i].limitTime) == this.form[j].time3){
-              this.form[j].dataMax3 = res.data[i].upperLimit
-              this.form[j].dataMin3 = res.data[i].lowerLimit
-            }
-            if(this.timestampToTimess(res.data[i].limitTime) == this.form[j].time4){
-              this.form[j].dataMax4 = res.data[i].upperLimit
-              this.form[j].dataMin4 = res.data[i].lowerLimit
-            }
-          }
-        }
-        this.totalCount = this.form.length
-        this.tableLoading = false
-      }).catch((error) => {
-        this.$message.error('查询人工干预数据出错' + error)
-      })
-    },
-
-    saveManual(formName){
-      this.tableLoading = true
-      this.form[0].lastModifyTime = Math.round(this.dateTime)
-      this.$axios.put('/dataLimitationController/saveDataLimitation', this.form).then((res) => {
-        this.$message.success(`保存成功`)
-        this.queryManualIntervention()
-        this.tableLoading = false
-      }).catch((error) => {
-        this.$message.error('保存数据限制出错' + error)
-      })
-    },
-    // 时间格式化
-    dateFormat(row, column) {
-      const date = row[column.property]
-      if (date === undefined) {
-        return ''
-      }
-      return this.$moment(date).format('YYYY-MM-DD HH:mm:ss')// 使用moment插件进行日期格式化
-    },
-    timestampToTime(time) {
-      const a = parseInt(time)
-      const date = new Date(a) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
-      const Y = date.getFullYear() + '-'
-      const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
-      const D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '
-      const H = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'
-      const m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes())
-      return H + m
-    },
-
-    searchEmp() {
-      this.queryManualIntervention()
-    },
-    currentChange(currentChange) {
-      this.currentPage = currentChange
-      this.queryManualIntervention()
-    },
-    handleSizeChange(handleSizeChange) {
-      this.pageSize = handleSizeChange
-      this.queryManualIntervention()
-    },
-    changeTime(row, column) {
-      return this.timestampToTime(row.time1)
-    },
-  }
-}
-</script>
-<style>
-.el-dialog__body {
-  padding-top: 0px;
-  padding-bottom: 0px;
-}
-
-.slide-fade-enter-active {
-  transition: all .8s ease;
-}
-
-.slide-fade-leave-active {
-  transition: all .8s cubic-bezier(1.0, 0.5, 0.8, 1.0);
-}
-
-.slide-fade-enter, .slide-fade-leave-to {
-  transform: translateX(10px);
-  opacity: 0;
-}
-
-#MyUltraShortTermChart {
-  width: 100%;
-  height: 400px;
-}
-</style>

+ 0 - 274
ipfcst-console/src/main/frontend/views/console/dataLimitationLog/index.vue

@@ -1,274 +0,0 @@
-<template>
-  <div class="app-container">
-    <el-card class="box-carde">
-      <div slot="header" class="clearfix">
-        <span>上报数据限制记录</span>
-      </div>
-      <el-container>
-        <el-header style="padding: 0px;display:flex;justify-content:space-between;align-items: center">
-          <div style="display: inline">
-            <el-date-picker
-              v-model="dateTime"
-              type="daterange"
-              range-separator="至"
-              start-placeholder="开始日期"
-              end-placeholder="结束日期"/>
-            <el-button type="primary" size="mini" style="margin-left: 5px" icon="el-icon-search" @click="searchEmp">搜索
-            </el-button>
-          </div>
-        </el-header>
-            <div>
-              <el-table
-                v-loading="tableLoading"
-                :data="emps.slice((currentPage-1)*pageSize,currentPage*pageSize)"
-                height="500px"
-                border
-                stripe
-                size="mini"
-                style="width: 100%">
-                <el-table-column
-                  :show-overflow-tooltip="true"
-                  :formatter="dateFormat"
-                  prop="operationalTime"
-                  align="center"
-                  header-align="center"
-                  label="操作时间"/>
-                <el-table-column
-                  :show-overflow-tooltip="true"
-                  prop="limitTime"
-                  :formatter="dateFormats"
-                  align="center"
-                  header-align="center"
-                  label="干预数据日期"/>
-                <el-table-column
-                  :show-overflow-tooltip="true"
-                  :formatter="operationalFormat"
-                  prop="operationalStatus"
-                  align="center"
-                  header-align="center"
-                  label="操作类型"/>
-                <el-table-column
-                  header-align="center"
-                  align="center"
-                  label="操作">
-                  <template slot-scope="scope">
-                    <el-button
-                      style="padding: 3px 4px 3px 4px;margin: 2px"
-                      size="mini"
-                      icon="el-icon-document"
-                      @click="showErrorInfo(scope.row)">查看内容
-                    </el-button>
-                  </template>
-                </el-table-column>
-              </el-table>
-              <div style="display: flex;justify-content: space-between;margin: 2px;float: right">
-                <el-pagination
-                  :current-page="currentPage"
-                  :page-size="pageSize"
-                  :page-sizes="[10, 25, 50, 100]"
-                  :total="totalCount"
-                  background
-                  layout="total, sizes, prev, pager, next, jumper"
-                  @size-change="handleSizeChange"
-                  @current-change="currentChange"/>
-              </div>
-            </div>
-        <el-form
-          ref="addEmpForm"
-          :model="emp"
-          style="margin: 0px;padding: 0px;"
-          label-width="100px">
-          <el-dialog
-            :close-on-click-modal="false"
-            :visible.sync="dialogVisibleErrorInfo"
-            title="具体信息"
-            style="padding: 0px;"
-            label-width="1px"
-            width="1000px">
-            <el-input
-              v-model="emp.operationalContext"
-              :rows="20"
-              type="textarea"
-              style="width: 100%" />
-            <span
-              slot="footer"
-              class="dialog-footer">
-            <el-button
-              size="mini"
-              @click="cancelEidtEI">关 闭</el-button>
-          </span>
-          </el-dialog>
-        </el-form>
-      </el-container>
-    </el-card>
-  </div>
-</template>
-<script>
-export default {
-
-
-  data() {
-    return {
-      ef: '',
-      // 日期选择器
-      dateTime: [new Date(new Date().toLocaleDateString()).getTime() , new Date(new Date().toLocaleDateString()).getTime() + 60 * 60 * 24 * 3 * 1000],
-      // 场站信息存储对象
-      elTableData: [],
-      efiId: '',
-      emps: [],
-      keywords: '',
-      jType: '',
-      dialogTitle: '',
-      dialogVisibleErrorInfo: false,
-      multipleSelection: [],
-      depTextColor: '#c0c4cc',
-      totalCount: -1,
-      currentPage: 1,
-      pageSize: 10,
-      dialogVisible: false,
-      tableLoading: false,
-      fileParsing: [],
-      activeName: 'first',
-      forecastAndManualInterventionData: [],
-      forecastValueCorrectAfterData: [],
-      forecastTimeData: [],
-      capacityUnit: '',
-      capacity:'',
-      emp:{
-        operationalContext:''
-      }
-    }
-  },
-  mounted: function() {
-    this.fileType=0;
-    this.getAllClass()
-  },
-
-  methods: {
-    cancelEidtEI () {
-      this.dialogVisibleErrorInfo = false
-    },
-    showErrorInfo (row) {
-      this.emp.operationalContext = row.operationalContext
-      this.dialogVisibleErrorInfo = true
-    },
-    // // 获取后台所有场站信息
-    // getELData() {
-    //   this.$axios.post('/electricFieldInfo/findAllElectricFieldInfo').then((res) => {
-    //     this.elTableData = res.data
-    //     this.efiId = res.data[0].id
-    //     // this.capacityUnit=res.data[0].capacityUnit
-    //     // this.type = 'NWP'
-    //     this.getAllClass()
-    //   })
-    // },
-    // 表格所属场站,ID转换场站名称
-    formatStation(row, column) {
-      let belongTo = '未知的所属场站'
-      for (let i = 0; i < this.elTableData.length; i++) {
-        if (row.efiId === this.elTableData[i].id) {
-          belongTo = this.elTableData[i].name
-        }
-      }
-      return belongTo
-    },
-    // 根据类型获取class
-    getAllClass() {
-      if (this.dateTime == '' || this.dateTime == null) {
-        alert('请选择时间')
-        return
-      }
-      this.$axios.get('/electricField/').then((res) => {
-        this.capacityUnit = 'mw'
-        this.capacity=res.data.capacity
-      })
-      const formData = new FormData()
-      const startTime = Math.round(this.dateTime[0])
-      const endTime = Math.round(this.dateTime[1]) + 60 * 60 * 24 * 1000 - 1
-      this.$axios.get('/dataLimitationLogController/queryDataLimitationLog/'+ startTime +'/' + endTime ).then((res) => {
-        this.emps = res.data
-        this.totalCount = this.emps.length
-      })
-
-    },
-    operationalFormat(row, column) {
-      let belongTo = '未知的文件类型场站'
-      for (let i = 0; i < this.emps.length; i++) {
-        if (row.operationalStatus =="0") {
-          belongTo ="新增"
-        }
-        if (row.operationalStatus =="1") {
-          belongTo ="修改"
-        }
-        if (row.operationalStatus =="2") {
-          belongTo ="删除"
-        }
-      }
-      return belongTo
-    },
-    // 时间格式化
-    dateFormat(row, column) {
-      const date = row[column.property]
-      if (date === undefined) {
-        return ''
-      }
-      return this.$moment(date).format('YYYY-MM-DD HH:mm:ss')// 使用moment插件进行日期格式化
-    },
-    timestampToTime(time) {
-      const a = parseInt(time)
-      const date = new Date(a) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
-      const Y = date.getFullYear() + '-'
-      const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
-      const D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '
-      const H = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'
-      const m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':'
-      const s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds())
-      return Y + M + D + H + m + s
-    },
-    // 时间格式化
-    dateFormats(row, column) {
-      const date = row[column.property]
-      if (date === undefined) {
-        return ''
-      }
-      return this.$moment(date).format('YYYY-MM-DD')// 使用moment插件进行日期格式化
-    },
-    searchEmp() {
-      this.getAllClass()
-    },
-    currentChange(currentChange) {
-      this.currentPage = currentChange
-      this.getAllClass()
-    },
-    handleSizeChange(handleSizeChange) {
-      this.pageSize = handleSizeChange
-      this.getAllClass()
-    },
-    // 自定义排序
-  }
-}
-</script>
-<style>
-.el-dialog__body {
-  padding-top: 0px;
-  padding-bottom: 0px;
-}
-
-.slide-fade-enter-active {
-  transition: all .8s ease;
-}
-
-.slide-fade-leave-active {
-  transition: all .8s cubic-bezier(1.0, 0.5, 0.8, 1.0);
-}
-
-.slide-fade-enter, .slide-fade-leave-to {
-  transform: translateX(10px);
-  opacity: 0;
-}
-
-#MyShortTermRealCharts {
-  width: 100%;
-  height: 500px;
-}
-</style>

+ 0 - 566
ipfcst-console/src/main/frontend/views/console/manualInterventionData/index.vue

@@ -1,566 +0,0 @@
-<template>
-  <div class="app-container">
-      <el-card class="box-carde">
-        <div slot="header" class="clearfix">
-          <span>人工干预设置</span>
-        </div>
-    <el-container>
-      <el-header style="padding: 0px;display:flex;justify-content:space-between;align-items: center">
-        <div style="display: inline">
-          <el-date-picker
-            v-model="dateTime"
-            type="date"
-            placeholder="选择日期"/>
-          <el-select v-model="fileType" :filterable="true" placeholder="请选择文件类型" prop="fileType">
-            <el-option
-              v-for="item in fileTypeData"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"/>
-          </el-select>
-          <el-button type="primary" size="mini" style="margin-left: 5px" icon="el-icon-search" @click="searchEmp">搜索
-          </el-button>
-          <el-button type="primary" size="mini" style="margin-left: 5px" icon="el-icon-plus" v-if="activeName=='first'" @click="saveManual('form')">保存
-          </el-button>
-          <el-button type="primary" size="mini" style="margin-left: 5px" icon="el-icon-refresh" v-if="activeName=='first'" @click="refresh">更新首页短期数据
-          </el-button>
-          <el-button type="primary" size="mini" v-if="activeName=='second'"  @click="insertEvent" style="margin-left: 5px"
-                     :loading="btnLonding">新增
-          </el-button>
-        </div>
-      </el-header>
-
-      <el-tabs v-model="activeName" type="card">
-        <el-tab-pane label="点位设置" name="first">
-          <div>
-          <el-table
-            v-loading="tableLoading"
-            :data="form.slice((currentPage-1)*pageSize,currentPage*pageSize)"
-            height="550px"
-            border
-            stripe
-            size="mini"
-            style="width: 100%">
-            <el-table-column
-              prop="time1"
-              header-align="center"
-              align="center"
-              label="时间">
-            </el-table-column>
-            <el-table-column
-              :show-overflow-tooltip="true"
-              prop="data1"
-              header-align="center"
-              align="center"
-              label="预测值">
-              <template slot-scope="scope">
-                <vxe-input type="number" v-model="scope.row.data1" size="small"  style="width:100%" min="0" :max="capacity" placeholder="超过装机容量默认最大值"></vxe-input>
-              </template>
-            </el-table-column>
-            <el-table-column
-              :show-overflow-tooltip="true"
-              prop="time2"
-              align="center"
-              header-align="center"
-              label="时间"/>
-            <el-table-column
-              :show-overflow-tooltip="true"
-              prop="data2"
-              align="center"
-              header-align="center"
-              label="预测值">
-              <template slot-scope="scope">
-                <vxe-input type="number" v-model="scope.row.data2" size="small"  style="width:100%" min="0" :max="capacity" placeholder="超过装机容量默认最大值"></vxe-input>
-              </template>
-            </el-table-column>
-            <el-table-column
-              :show-overflow-tooltip="true"
-              prop="time3"
-              align="center"
-              header-align="center"
-              label="时间"/>
-            <el-table-column
-              :show-overflow-tooltip="true"
-              prop="data3"
-              align="center"
-              header-align="center"
-              label="预测值">
-              <template slot-scope="scope">
-                <vxe-input type="number" v-model="scope.row.data3" size="small"  style="width:100%" min="0" :max="capacity" placeholder="超过装机容量默认最大值"></vxe-input>
-              </template>
-            </el-table-column>
-            <el-table-column
-              :show-overflow-tooltip="true"
-              prop="time4"
-              align="center"
-              header-align="center"
-              label="时间"/>
-            <el-table-column
-              :show-overflow-tooltip="true"
-              prop="data4"
-              align="center"
-              header-align="center"
-              label="预测值">
-              <template slot-scope="scope">
-                <vxe-input type="number" v-model="scope.row.data4" size="small"  style="width:100%" min="0" :max="capacity" placeholder="超过装机容量默认最大值"></vxe-input>
-              </template>
-            </el-table-column>
-          </el-table>
-          <div style="display: flex;justify-content: space-between;margin: 2px;float: right">
-            <el-pagination
-              :current-page="currentPage"
-              :page-size="pageSize"
-              :page-sizes="[25, 50, 100]"
-              :total="totalCount"
-              layout="total, sizes, prev, pager, next, jumper"
-              @size-change="handleSizeChange"
-              @current-change="currentChange"/>
-          </div>
-        </div>
-        </el-tab-pane>
-        <el-tab-pane label="系数设置" name="second">
-          <div style="padding-top: 10px">
-            <vxe-table
-              highlight-hover-row
-              :keep-source="true"
-              align="center"
-              :loading="loading"
-              v-loading="false"
-              ref="xTable"
-              auto-resize
-              highlight-current-row
-              border
-              resizable
-              show-overflow
-              :data="tableData"
-              :edit-config="{trigger: 'manual', mode: 'row',autoClear: false,icon:'none'}"
-            >
-                <vxe-table-column width="25%" field="interveneStartTime" title="开始时间"
-                                  :edit-render="{name:'$input',attrs:{type:'text'}}">
-                  <template v-slot:edit="{ row }">
-                    <el-time-select
-                      style="width: 100%"
-                      v-model="row.interveneStartTime"
-                      :picker-options="{
-                        start: '00:00',
-                        step: '00:15',
-                        end: '23:45'
-                      }"
-                      placeholder="选择开始时间"
-                      />
-                  </template>
-                  <template v-slot="{ row }">{{ timestampToTimeRatio(row.interveneStartTime) }}
-                  </template>
-                </vxe-table-column>
-                <vxe-table-column width="25%" field="interveneEndTime" title="结束时间"
-                                  :edit-render="{name:'$input',attrs:{type:'text'}}">
-                  <template v-slot:edit="{ row }">
-                    <el-time-select
-                      style="width: 100%"
-                      v-model="row.interveneEndTime"
-                      :picker-options="{
-                        start: '00:00',
-                        step: '00:15',
-                        end: '23:45'
-                      }"
-                      placeholder="选择结束时间"/>
-                  </template>
-                  <template v-slot="{ row }">{{
-                      timestampToTimeRatio(row.interveneEndTime)
-                    }}
-                  </template>
-                </vxe-table-column>
-              <vxe-table-column field="ratio" width="25%" title="系数"
-                                :edit-render="{name:'$input',attrs:{type:'text'}}"></vxe-table-column>
-              <vxe-table-column fixed="right" width="25%" title="操作">
-                <template v-slot="{ row }">
-                  <template v-if="$refs.xTable.isActiveByRow(row)">
-                    <el-button
-                      style="padding: 3px 4px 3px 4px;margin: 2px"
-                      size="mini"
-                      icon="el-icon-edit"
-                      :loading="saveLoding"
-                      @click="saveRatioData(row)">保存
-                    </el-button>
-                    <el-button
-                      style="padding: 3px 4px 3px 4px;margin: 2px"
-                      size="mini"
-                      icon="el-icon-edit"
-                      @click="cancelRowEvent(row)">取消
-                    </el-button>
-                  </template>
-                  <template v-else>
-                    <el-button
-                      style="padding: 3px 4px 3px 4px;margin: 2px"
-                      size="mini"
-                      icon="el-icon-edit"
-                      @click="editRowEvent(row)"
-                      :loading="btnLonding">编辑
-                    </el-button>
-                    <el-button
-                      type="danger"
-                      style="padding: 3px 4px 3px 4px;margin: 2px"
-                      size="mini"
-                      icon="el-icon-delete"
-                      @click="removeEvent(row)"
-                      :loading=btnLonding>删除
-                    </el-button>
-                  </template>
-                </template>
-              </vxe-table-column>
-            </vxe-table>
-          </div>
-        </el-tab-pane>
-      </el-tabs>
-    </el-container>
-    </el-card>
-  </div>
-</template>
-<script>
-export default {
-  data() {
-    return {
-      saveLoding: false,
-      showTable: true,
-      btnLonding: false,
-      ef: '',
-      // 日期选择器
-      dateTime:  new Date(new Date().toLocaleDateString()),
-      // 场站信息存储对象
-      elTableData: [],
-      efiId: '',
-      emps: [],
-      dataList: [],
-      keywords: '',
-      jType: '',
-      dialogTitle: '',
-      loading:false,
-      multipleSelection: [],
-      downLoading: false,
-      depTextColor: '#c0c4cc',
-      totalCount: -1,
-      currentPage: 1,
-      pageSize:25,
-      dialogVisible: false,
-      tableLoading: false,
-      fileParsing: [],
-      activeName: 'first',
-      ultraValueData: [],
-      shortValueData: [],
-      realPowerValueData: [],
-      capacityUnit: '',
-      capacity: '',
-      shortValueDate: [],
-      fileType:'',
-      fileTypeData:[
-        { value: 0, label: '短期' },
-        { value: 1, label: '超短期' }
-      ],
-      form:[{
-        time1:'',
-        data1:'',
-        time2:'',
-        data2:'',
-        time3:'',
-        data3:'',
-        time4:'',
-        data4:'',
-        fileType:'',
-        lastModifyTime:''
-      }],
-      radioStartTime:'',
-      radioEndTime:',',
-      tableData:[],
-      isEdit:false,
-    }
-  },
-  created: function() {
-    this.fileType=0;
-    this.getEl()
-
-  },
-
-  methods: {
-    //取消编辑或添加操作
-    cancelRowEvent(row) {
-      this.saveLoding = false
-      this.btnLonding = false
-      const xTable = this.$refs.xTable
-      xTable.clearActived().then(() => {
-        // 还原行数据
-        if (!this.isEdit) {
-          //编辑
-          xTable.revertData(row)
-        } else {
-          //新增
-          xTable.remove(row)
-        }
-        this.isEdit = false
-      })
-    },
-    //编辑框改变
-    editRowEvent(row) {
-      this.startTimeShow = false
-      if(row.interveneStartTime < new Date().getTime()){
-        this.startTimeShow = true
-      }
-      this.checkSign = true
-      this.btnLonding = true
-      row.interveneStartTime = this.timestampToTimeRatio(row.interveneStartTime)
-      row.interveneEndTime = this.timestampToTimeRatio(row.interveneEndTime)
-      this.$refs.xTable.setActiveRow(row)
-    },
-    //删除数据
-    removeEvent(row) {
-      this.$XModal.confirm('您确定要删除该数据?').then(type => {
-        if (type === 'confirm') {
-          this.$axios.delete("/manualInterventionRatioController/delete/"+row.id).then(response => {
-            this.$message.success(`删除成功`)
-            this.queryManualInterventionRatio()
-          })
-        }
-      })
-    },
-    //新增编辑框
-    insertEvent() {
-      this.isEdit = true
-      this.startTimeShow = false
-      this.showTable = true
-      this.btnLonding = true
-      this.checkSign = false
-      this.$refs.xTable.insert()
-        .then(({row}) => this.$refs.xTable.setActiveRow(row))
-    },
-    getEl(){
-      this.$axios.get("/electricField/").then(res => {
-        this.capacity = res.data.capacity
-        this.queryManualIntervention()
-        this.queryManualInterventionRatio()
-      })
-    },
-    refreshShortTermHisData(){
-      this.$XModal.confirm('您确定要更新首页短期数据?').then(type => {
-        if (type === 'confirm') {
-          this.$axios.get('/manualInterventionController/refreshSt',).then(res => {
-            if(res.code == 0 ){
-              this.$message.success("更新成功!")
-            }
-          })
-        }
-      })
-    },
-    timestampToTimess(time) {
-      const date = new Date(time)// 时间戳为10位需*1000,时间戳为13位的话不需乘1000
-      const Y = date.getFullYear() + '-'
-      const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
-      const D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '
-      const H = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'
-      const m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes())
-      return Y + M + D + H + m
-    },
-    timestampToTimeRatio(time) {
-      const date = new Date(time)// 时间戳为10位需*1000,时间戳为13位的话不需乘1000
-      const H = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'
-      const m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes())
-      return H + m
-    },
-    // 根据类型获取class
-    queryManualIntervention() {
-      this.tableLoading =true
-      const a=[];
-      const b=[];
-      const c=[];
-      const d=[];
-      for(var i=0; i<=23;i++){
-        if(i<10){
-          a.push(this.timestampToTimes(Math.round(this.dateTime))+"0"+i+":00")
-          b.push(this.timestampToTimes(Math.round(this.dateTime))+"0"+i+":15")
-          c.push(this.timestampToTimes(Math.round(this.dateTime))+"0"+i+":30")
-          d.push(this.timestampToTimes(Math.round(this.dateTime))+"0"+i+":45")
-        }else{
-          a.push(this.timestampToTimes(Math.round(this.dateTime))+i+":00")
-          b.push(this.timestampToTimes(Math.round(this.dateTime))+i+":15")
-          c.push(this.timestampToTimes(Math.round(this.dateTime))+i+":30")
-          d.push(this.timestampToTimes(Math.round(this.dateTime))+i+":45")
-        }
-      }
-      for(var i=0; i<a.length;i++){
-        this.form[i]={
-          time1:a[i],
-          data1:"",
-          time2:b[i],
-          data2:"",
-          time3:c[i],
-          data3:"",
-          time4:d[i],
-          data4:"",
-        }
-      }
-      const startTime = Math.round(this.dateTime)
-      const endTime = Math.round(this.dateTime) + 60 * 60 * 24 * 1000 - 1
-      this.$axios.get('/manualInterventionController/queryManualInterventionData/'+startTime+'/'+endTime+'/'+this.fileType).then((res) => {
-        for(var i=0;i<res.data.length;i++){
-          for(var j=0;j<this.form.length;j++){
-            if(this.timestampToTimess(res.data[i].interveneTime) == this.form[j].time1){
-              this.form[j].data1 = res.data[i].interveneData
-            }
-            if(this.timestampToTimess(res.data[i].interveneTime) == this.form[j].time2){
-              this.form[j].data2 = res.data[i].interveneData
-            }
-            if(this.timestampToTimess(res.data[i].interveneTime) == this.form[j].time3){
-              this.form[j].data3 = res.data[i].interveneData
-            }
-            if(this.timestampToTimess(res.data[i].interveneTime) == this.form[j].time4){
-              this.form[j].data4 = res.data[i].interveneData
-            }
-          }
-        }
-        this.totalCount = this.form.length
-        this.tableLoading = false
-      }).catch((error) => {
-        this.$message.error('查询人工干预数据出错' + error)
-      })
-    },
-
-    saveManual(formName){
-      this.tableLoading = true
-      this.form[0].fileType = this.fileType
-      this.form[0].lastModifyTime = Math.round(this.dateTime)
-      this.$axios.put('/manualInterventionController/saveManualIntervention', this.form).then((res) => {
-        this.$message.success(`保存成功`)
-        this.queryManualIntervention()
-        this.tableLoading = false
-      }).catch((error) => {
-        this.$message.error('保存人工干预数据出错' + error)
-      })
-    },
-    time_to_sec(time) {
-
-      if (time !== null) {
-        var s = "";
-        var hour = time.split(":")[0];
-        var min = time.split(":")[1];
-        var sec = time.split(":")[2];
-        s = Number(hour * 3600) + Number(min * 60) + Number(sec);
-        return s;
-      }
-    },
-    queryManualInterventionRatio(){
-      this.loading = true
-      this.saveLoding = false
-      const startTime = Math.round(this.dateTime)
-      const endTime = Math.round(this.dateTime) + 60 * 60 * 24 * 1000 - 1
-      this.$axios.get('/manualInterventionRatioController/queryManualInterventionRatioData/'+startTime+'/'+endTime+'/'+this.fileType).then((res) => {
-        this.tableData = res.data
-        this.loading = false
-      })
-    },
-    saveRatioData(row){
-      this.saveLoding = true
-      if(row.ratio == null || row.interveneStartTime ==null ||row.interveneEndTime == null||row.interveneStartTime >= row.interveneEndTime){
-        this.saveLoding = false
-        return this.$XModal.message({status: 'error', message: '校验不通过!'})
-      }
-      const formData = new FormData()
-      formData.append('ratio', row.ratio)
-      formData.append('interveneStartTime', this.dateTime.getTime()+this.time_to_sec(row.interveneStartTime+":00")*1000)
-      formData.append('interveneEndTime',this.dateTime.getTime()+this.time_to_sec(row.interveneEndTime+":00")*1000)
-      formData.append('interveneType', this.fileType)
-      row.interveneStartTime = this.dateTime.getTime()+this.time_to_sec(row.interveneStartTime+":00")*1000
-      row.interveneEndTime = this.dateTime.getTime()+this.time_to_sec(row.interveneEndTime+":00")*1000
-      row.interveneType = this.fileType
-      this.$refs.xTable.validate(valid => {
-        if (valid) {
-          this.$refs.xTable.clearActived().then(() => {
-            this.loading = true
-            this.$axios.post("/manualInterventionRatioController/saveManualInterventionRatio", row).then(response => {
-              this.$XModal.message({status: 'warning', message: response.message})
-              this.saveLoding = false
-
-              this.queryManualInterventionRatio()
-            })
-            this.btnLonding = false
-            this.loading = false
-          })
-
-        } else {
-          this.$XModal.message({status: 'error', message: '校验不通过!'})
-          this.saveLoding = false
-          this.loading = false
-        }
-
-      })
-    },
-    // 时间格式化
-    dateFormat(row, column) {
-      const date = row[column.property]
-      if (date === undefined) {
-        return ''
-      }
-      return this.$moment(date).format('YYYY-MM-DD HH:mm:ss')// 使用moment插件进行日期格式化
-    },
-    timestampToTime(time) {
-      const a = parseInt(time)
-      const date = new Date(a) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
-      const Y = date.getFullYear() + '-'
-      const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
-      const D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '
-      const H = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'
-      const m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes())
-      return H + m
-    },
-    timestampToTimes(time) {
-      const a = parseInt(time)
-      const date = new Date(a) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
-      const Y = date.getFullYear() + '-'
-      const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
-      const D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '
-      const H = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'
-      const m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes())
-      return Y + M +D
-    },
-    searchEmp() {
-      this.queryManualIntervention()
-      this.queryManualInterventionRatio()
-    },
-    refresh(){
-      this.refreshShortTermHisData()
-    },
-    currentChange(currentChange) {
-      this.currentPage = currentChange
-      this.queryManualIntervention()
-    },
-    handleSizeChange(handleSizeChange) {
-      this.pageSize = handleSizeChange
-      this.queryManualIntervention()
-    },
-    changeTime(row, column) {
-      return this.timestampToTime(row.time1)
-    },
-  }
-}
-</script>
-<style>
-.el-dialog__body {
-  padding-top: 0px;
-  padding-bottom: 0px;
-}
-
-.slide-fade-enter-active {
-  transition: all .8s ease;
-}
-
-.slide-fade-leave-active {
-  transition: all .8s cubic-bezier(1.0, 0.5, 0.8, 1.0);
-}
-
-.slide-fade-enter, .slide-fade-leave-to {
-  transform: translateX(10px);
-  opacity: 0;
-}
-
-#MyUltraShortTermChart {
-  width: 100%;
-  height: 400px;
-}
-</style>

+ 0 - 492
ipfcst-console/src/main/frontend/views/console/manualInterventionQuery/index.vue

@@ -1,492 +0,0 @@
-<template>
-  <div class="app-container">
-    <el-card class="box-carde">
-      <div slot="header" class="clearfix">
-        <span>人工干预记录</span>
-      </div>
-    <el-container>
-      <el-header style="padding: 0px;display:flex;justify-content:space-between;align-items: center">
-        <div style="display: inline">
-          <el-date-picker
-            v-model="dateTime"
-            type="daterange"
-            range-separator="至"
-            start-placeholder="开始日期"
-            end-placeholder="结束日期"/>
-
-          <el-select v-model="fileType" :filterable="true" placeholder="请选择文件类型" prop="fileType">
-            <el-option
-              v-for="item in fileTypeData"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"/>
-          </el-select>
-          <el-button type="primary" size="mini" style="margin-left: 5px" icon="el-icon-search" @click="searchEmp">搜索
-          </el-button>
-        </div>
-      </el-header>
-
-      <el-tabs v-model="activeName" type="card">
-        <el-tab-pane label="人工干预数据图表对比" name="first">
-          <el-main style="padding-left: 0px;padding-top: 0px">
-            <div class="container">
-              <div id="MyShortTermRealCharts"/>
-            </div>
-          </el-main>
-        </el-tab-pane>
-
-        <el-tab-pane label="人工干预记录列表" name="second">
-          <div>
-            <el-table
-              v-loading="tableLoading"
-              :data="emps.slice((currentPage-1)*pageSize,currentPage*pageSize)"
-              height="500px"
-              border
-              stripe
-              size="mini"
-              style="width: 100%">
-              <el-table-column
-                sortable="custom"
-                :formatter="fileTypeFormat"
-                prop="fileType"
-                align="center"
-                header-align="center"
-                label="文件类型"/>
-              <el-table-column
-                :show-overflow-tooltip="true"
-                :formatter="dateFormat"
-                prop="operationalTime"
-                align="center"
-                header-align="center"
-                label="操作时间"/>
-              <el-table-column
-                :show-overflow-tooltip="true"
-                prop="interveneTime"
-                :formatter="dateFormats"
-                align="center"
-                header-align="center"
-                label="干预数据日期"/>
-              <el-table-column
-                :show-overflow-tooltip="true"
-                :formatter="operationalFormat"
-                prop="operationalStatus"
-                align="center"
-                header-align="center"
-                label="操作类型"/>
-              <el-table-column
-                header-align="center"
-                align="center"
-                label="操作">
-                <template slot-scope="scope">
-                  <el-button
-                    style="padding: 3px 4px 3px 4px;margin: 2px"
-                    size="mini"
-                    icon="el-icon-document"
-                    @click="showErrorInfo(scope.row)">查看内容
-                  </el-button>
-                </template>
-              </el-table-column>
-            </el-table>
-            <div style="display: flex;justify-content: space-between;margin: 2px;float: right">
-              <el-pagination
-                :current-page="currentPage"
-                :page-size="pageSize"
-                :page-sizes="[10, 25, 50, 100]"
-                :total="totalCount"
-                background
-                layout="total, sizes, prev, pager, next, jumper"
-                @size-change="handleSizeChange"
-                @current-change="currentChange"/>
-            </div>
-          </div>
-        </el-tab-pane>
-      </el-tabs>
-      <el-form
-        ref="addEmpForm"
-        :model="emp"
-        style="margin: 0px;padding: 0px;"
-        label-width="100px">
-        <el-dialog
-          :close-on-click-modal="false"
-          :visible.sync="dialogVisibleErrorInfo"
-          title="具体信息"
-          style="padding: 0px;"
-          label-width="1px"
-          width="1000px">
-          <el-input
-            v-model="emp.operationalContext"
-            :rows="20"
-            type="textarea"
-            style="width: 100%" />
-          <span
-            slot="footer"
-            class="dialog-footer">
-            <el-button
-              size="mini"
-              @click="cancelEidtEI">关 闭</el-button>
-          </span>
-        </el-dialog>
-      </el-form>
-    </el-container>
-    </el-card>
-  </div>
-</template>
-<script>
-export default {
-
-
-  data() {
-    return {
-      ef: '',
-      // 日期选择器
-      dateTime: [new Date(new Date().toLocaleDateString()).getTime() , new Date(new Date().toLocaleDateString()).getTime() + 60 * 60 * 24 * 3 * 1000],
-      // 场站信息存储对象
-      elTableData: [],
-      efiId: '',
-      emps: [],
-      fileType:'',
-      fileTypeData:[
-        { value: 0, label: '短期' },
-        { value: 1, label: '超短期' }
-      ],
-      keywords: '',
-      jType: '',
-      dialogTitle: '',
-      dialogVisibleErrorInfo: false,
-      multipleSelection: [],
-      depTextColor: '#c0c4cc',
-      totalCount: -1,
-      currentPage: 1,
-      pageSize: 10,
-      dialogVisible: false,
-      tableLoading: false,
-      fileParsing: [],
-      activeName: 'first',
-      forecastAndManualInterventionData: [],
-      forecastValueCorrectAfterData: [],
-      forecastTimeData: [],
-      capacityUnit: '',
-      capacity:'',
-      emp:{
-        operationalContext:''
-      }
-    }
-  },
-  mounted: function() {
-    this.fileType=0;
-    this.getAllClass()
-  },
-
-  methods: {
-    cancelEidtEI () {
-      this.dialogVisibleErrorInfo = false
-    },
-    showErrorInfo (row) {
-      this.emp.operationalContext = row.operationalContext
-      this.dialogVisibleErrorInfo = true
-    },
-    // // 获取后台所有场站信息
-    // getELData() {
-    //   this.$axios.post('/electricFieldInfo/findAllElectricFieldInfo').then((res) => {
-    //     this.elTableData = res.data
-    //     this.efiId = res.data[0].id
-    //     // this.capacityUnit=res.data[0].capacityUnit
-    //     // this.type = 'NWP'
-    //     this.getAllClass()
-    //   })
-    // },
-    // 表格所属场站,ID转换场站名称
-    formatStation(row, column) {
-      let belongTo = '未知的所属场站'
-      for (let i = 0; i < this.elTableData.length; i++) {
-        if (row.efiId === this.elTableData[i].id) {
-          belongTo = this.elTableData[i].name
-        }
-      }
-      return belongTo
-    },
-    // 根据类型获取class
-    getAllClass() {
-      if (this.dateTime == '' || this.dateTime == null) {
-        alert('请选择时间')
-        return
-      }
-      this.$axios.get('/electricField/').then((res) => {
-        this.capacityUnit = 'mw'
-        this.capacity=res.data.capacity
-      })
-      const formData = new FormData()
-      const startTime = Math.round(this.dateTime[0])
-      const endTime = Math.round(this.dateTime[1]) + 60 * 60 * 24 * 1000 - 1
-      this.$axios.get('/manualInterventionLogController/queryManualInterventionLogData/'+ startTime +'/' + endTime +'/'+ this.fileType ).then((res) => {
-        this.emps = res.data
-        this.totalCount = this.emps.length
-      })
-      const s = Math.round(this.dateTime[1])+ 60 * 60 * 24  * 1000 -1000
-      this.$axios.get('/manualInterventionLogController/getForecastPowerShortTermDrawing/' + Math.round(this.dateTime[0]) + '/' + s).then(resp => {
-        var data = resp.data
-        // 可用预测功率(修正后)
-        for (let k = 0; k < data.list.length; k++) {
-          this.forecastValueCorrectAfterData.push(data.list[k].fpValue)
-        }
-        for (let i = 0; i < data.list.length; i++) {
-          this.forecastTimeData.push(this.timestampToTime(data.list[i].forecastTime))
-        }
-        const startTime1 = Math.round(this.dateTime[0])
-        const endTime1 = Math.round(this.dateTime[1]) + 60 * 60 * 24 * 1000 - 1
-        this.$axios.get('/manualInterventionLogController/queryForecastAndManualInterventionData/'+startTime1+'/'+endTime1+'/'+this.fileType).then(resp => {
-          for (let i = 0; i < resp.data.length; i++) {
-            if(resp.data[i].intervention!=null){
-              this.forecastAndManualInterventionData.push(resp.data[i].intervention)
-            }
-
-          }
-          this.drawLine(this.forecastValueCorrectAfterData, this.forecastAndManualInterventionData, this.forecastTimeData, this.capacityUnit,this.capacity)
-          this.forecastValueCorrectAfterData = []
-          this.forecastAndManualInterventionData=[]
-          this.forecastTimeData = []
-          this.capacity=''
-        })
-
-
-
-      })
-    },
-    drawLine(forecastValueCorrectAfterData, forecastAndManualInterventionData, forecastTimeData, capacityUnit,capacity) {
-      var echarts = require('echarts')
-      // 基于准备好的dom,初始化echarts实例
-      const MyShortTermRealCharts = echarts.init(document.getElementById('MyShortTermRealCharts'))
-      // 绘制图表
-      MyShortTermRealCharts.setOption({
-        // 标题
-        title: {
-          text: '人工干预数据对比',
-          left: '3%', // left 的值可以是像 20 这样的具体像素值,可以是像 '20%' 这样相对于容器高宽的百分比,也可以是 'left', 'center', 'right',如果 left 的值为'left', 'center', 'right',组件会根据相应的位置自动对齐。
-          top: '10px', // left 的值可以是像 20 这样的具体像素值,可以是像 '20%' 这样相对于容器高宽的百分比,也可以是 'left', 'center', 'right',如果 left 的值为'left', 'center', 'right',组件会根据相应的位置自动对齐。
-          right: 'auto', // right 的值可以是像 20 这样的具体像素值,可以是像 '20%' 这样相对于容器高宽的百分比。
-          bottom: 'auto'// bottom 的值可以是像 20 这样的具体像素值,可以是像 '20%' 这样相对于容器高宽的百分比。
-        },
-        tooltip: {
-          trigger: 'axis',
-          axisPointer: { // 会出现横竖2个方向的指示器
-            type: 'cross'
-          }
-        },
-        // 图例名
-        legend: {
-          top: '2%',
-          data: ['预测数据', '干预后预测数据']
-        },
-        grid: {
-          top: '70px',
-          left: '5%', // 图表距边框的距离
-          right: '5%',
-          bottom: '20%',
-          containLabel: true
-        },
-        // 工具框,可以选择
-        toolbox: {
-          show: true,
-          feature: {
-            mark: { show: true },
-            dataView: { show: true, readOnly: false },
-            magicType: { show: true, type: ['line', 'bar'] },
-            restore: { show: true },
-            saveAsImage: { show: true }
-          }
-        },
-        dataZoom: [{
-          show: true,
-          realtime: true,
-          start: 0,
-          end: 100,
-        },{
-          type: 'inside'
-        }],
-        // x轴信息样式
-
-        xAxis: {
-          type: 'category',
-          boundaryGap: false,
-          axisLine: { onZero: false },
-          data: forecastTimeData,
-          // 坐标轴颜色
-          axisLine: {
-            lineStyle: {
-              color: 'gray'
-            }
-          },
-          // x轴文字旋转
-          axisLabel: {
-            rotate: 0,
-            // interval: 'auto',
-            show: true, // true为显示字体 false则不显示
-            textStyle: {// 字体颜色
-              color: 'gray'
-            }
-          }
-        },
-        yAxis: [
-          {
-            type: 'value',
-            min:0,
-            max:capacity,
-            axisPointer: {
-              type: 'line'
-            },
-            position: 'left',
-            splitLine: {// 网格线
-              show: true
-            },
-            axisTick: {// y轴刻度线
-              show: false
-            },
-            axisLabel: {// y轴线
-              formatter: '{value} ' + capacityUnit
-            },
-            axisLine: {// y轴线
-              show: false
-            }
-          }
-        ],
-        series: [
-          {
-            name: '预测数据',
-            type: 'line',
-            symbol: 'circle',
-            showSymbol: false,
-            symbolSize: 4,
-            data: forecastValueCorrectAfterData,
-            color: ['orange'],
-            smooth: true,
-            itemStyle: {
-              normal: {
-                lineStyle: {
-                  width: 2,
-                  type: 'solid' // 'dotted'虚线 'solid'实线
-                }
-              }
-            }
-          },
-          {
-            name: '干预后预测数据',
-            type: 'line',
-            color: ['red'],
-            symbol: 'circle',
-            showSymbol: false,
-            smooth: true,
-            symbolSize: 4,
-            data: forecastAndManualInterventionData,
-            itemStyle: {
-              normal: {
-                lineStyle: {
-                  width: 2,
-                  type: 'solid' // 'dotted'虚线 'solid'实线
-                }
-              }
-            }
-          }
-        ]
-      })
-      window.onresize = MyShortTermRealCharts.resize// 图表自适应浏览器大小
-    },
-    // 时间格式化
-    fileTypeFormat(row, column) {
-      let belongTo = '未知的文件类型场站'
-      for (let i = 0; i < this.emps.length; i++) {
-        if (row.fileType =="0") {
-          belongTo ="短期"
-        }
-        if (row.fileType =="1") {
-          belongTo ="超短期"
-        }
-      }
-      return belongTo
-    },
-    operationalFormat(row, column) {
-      let belongTo = '未知的文件类型场站'
-      for (let i = 0; i < this.emps.length; i++) {
-        if (row.operationalStatus =="0") {
-          belongTo ="点位新增"
-        }
-        if (row.operationalStatus =="1") {
-          belongTo ="点位修改"
-        }
-        if (row.operationalStatus =="2") {
-          belongTo ="点位删除"
-        }
-        if (row.operationalStatus =="3") {
-          belongTo ="系数"
-        }
-        if (row.operationalStatus =="4") {
-          belongTo ="系数删除"
-        }
-      }
-      return belongTo
-    },
-    // 时间格式化
-    dateFormat(row, column) {
-      const date = row[column.property]
-      if (date === undefined) {
-        return ''
-      }
-      return this.$moment(date).format('YYYY-MM-DD HH:mm:ss')// 使用moment插件进行日期格式化
-    },
-    timestampToTime(time) {
-      const a = parseInt(time)
-      const date = new Date(a) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
-      const Y = date.getFullYear() + '-'
-      const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
-      const D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '
-      const H = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'
-      const m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':'
-      const s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds())
-      return Y + M + D + H + m + s
-    },
-    // 时间格式化
-    dateFormats(row, column) {
-      const date = row[column.property]
-      if (date === undefined) {
-        return ''
-      }
-      return this.$moment(date).format('YYYY-MM-DD')// 使用moment插件进行日期格式化
-    },
-    searchEmp() {
-      this.getAllClass()
-    },
-    currentChange(currentChange) {
-      this.currentPage = currentChange
-      this.getAllClass()
-    },
-    handleSizeChange(handleSizeChange) {
-      this.pageSize = handleSizeChange
-      this.getAllClass()
-    },
-    // 自定义排序
-  }
-}
-</script>
-<style>
-.el-dialog__body {
-  padding-top: 0px;
-  padding-bottom: 0px;
-}
-
-.slide-fade-enter-active {
-  transition: all .8s ease;
-}
-
-.slide-fade-leave-active {
-  transition: all .8s cubic-bezier(1.0, 0.5, 0.8, 1.0);
-}
-
-.slide-fade-enter, .slide-fade-leave-to {
-  transform: translateX(10px);
-  opacity: 0;
-}
-
-#MyShortTermRealCharts {
-  width: 100%;
-  height: 500px;
-}
-</style>

+ 2 - 2
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/ForecastPowerShortTermController.java

@@ -38,7 +38,7 @@ public class ForecastPowerShortTermController {
       map = forecastPowerShortTermService.findByForecastTimeBetweenAndStationCode(startTime, endTime, stationCode);
       return ResponseVO.success(map);
     } catch (Exception e) {
-      e.printStackTrace();
+      log.error("按时间查询实时预测短期错误:{}",e);
       return ResponseVO.fail(e.getMessage());
     }
   }
@@ -65,7 +65,7 @@ public class ForecastPowerShortTermController {
       map = forecastPowerShortTermService.findByTimeBetweenAndNoForPaging(startTime, endTime, stationCode, page, size, sortOrder);
       return ResponseVO.success(map);
     } catch (Exception e) {
-      e.printStackTrace();
+      log.error("按时间查询实时预测短期错误-分页查询:{}",e);
       return ResponseVO.fail(e.toString());
     }
   }

+ 1 - 1
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/ForecastPowerShortTermHisController.java

@@ -42,7 +42,7 @@ public class ForecastPowerShortTermHisController {
       map = forecastPowerShortTermHisService.findByForecastTimeBetweenAndStationCode(startTime, endTime, stationCode, page, size, sortOrder);
       return ResponseVO.success(map);
     } catch (Exception e) {
-      e.printStackTrace();
+      log.error("按时间查询历史预测短期错误:{}",e);
       return ResponseVO.fail(e.toString());
     }
   }

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

@@ -43,7 +43,7 @@ public class ForecastPowerUltraShortTermHisController {
       map = forecastPowerUltraShortTermService.findByForecastTimeBetweenAndForecastHowLongAgoOrderByForecastTime(startTime, endTime, ago);
       return ResponseVO.success(map);
     } catch (Exception e) {
-      e.printStackTrace();
+      log.error("按时间查询历史预测超短期错误:{}",e);
       return ResponseVO.fail(e.toString());
     }
   }
@@ -62,7 +62,7 @@ public class ForecastPowerUltraShortTermHisController {
       map = forecastPowerUltraShortTermService.findByForecastRealTimeUltraShortTerm16(startTime, stationCode);
       return ResponseVO.success(map);
     } catch (Exception e) {
-      e.printStackTrace();
+      log.error("查询超短期16个点的信息错误:{}",e);
       return ResponseVO.fail(e.toString());
     }
   }

+ 2 - 4
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/NwpController.java

@@ -43,8 +43,7 @@ public class NwpController {
       map = nwpService.findByForecastTimeBetween(startTime, endTime, stationCode);
       return ResponseVO.success(map);
     } catch (Exception e) {
-      e.printStackTrace();
-      log.error("nwp实时查询错误");
+      log.error("nwp实时查询错误:{}", e);
       return ResponseVO.fail(e.toString());
     }
   }
@@ -71,8 +70,7 @@ public class NwpController {
       map = nwpService.findByTimeBetweenAndNoForPaging(startTime, endTime, stationCode, page, size, sortOrder);
       return ResponseVO.success(map);
     } catch (Exception e) {
-      e.printStackTrace();
-      log.error("nwp实时分页查询错误");
+      log.error("nwp实时分页查询错误:{}", e);
       return ResponseVO.fail(e.toString());
     }
   }

+ 22 - 15
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/ReceiveDataService.java

@@ -70,6 +70,7 @@ public class ReceiveDataService {
   @Value("${receive.path}")
   private  String path;
 
+  private  String Active = "activePower";
   public void receive() {
     List<ElectricField> electricFieldList = electricFieldService.getAll();
     //每个场站请求一次
@@ -141,8 +142,6 @@ public class ReceiveDataService {
       SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
       if (jsonRows.size()>0){
         values = jsonRows.getJSONObject(0);
-        //设备id
-        //String deviceId = jsonObj.getString("deviceId");
         //时间戳
         String time = values.getString("timestamp");
         //所有数据
@@ -163,29 +162,34 @@ public class ReceiveDataService {
             }
           }
         }
-        switch (map.get("status")) {
+        String STATUS = "status";
+        switch (map.get(STATUS)) {
           case "1.00":
           case "true":
             //运行
-            map.put("status", "1");
+            map.put(STATUS, "1");
             break;
           case "2.00":
             //待机
-            map.put("status", "2");
+            map.put(STATUS, "2");
             break;
           case "3.00":
             //停用
-            map.put("status", "3");
+            map.put(STATUS, "3");
             break;
           case "4.00":
           case "false":
             //故障
-            map.put("status", "4");
+            map.put(STATUS, "4");
             break;
           case "-99":
-            map.put("status", "5");
+            map.put(STATUS, "5");
+            break;
+          default:
             break;
         }
+
+        String ap = map.get(Active);
         switch(equipmentType.getCode()){
           case 1:
             //气象站
@@ -196,9 +200,9 @@ public class ReceiveDataService {
             break;
           case 2:
             //逆变器
-            if (map.get("activePower") != null && map.get("electricalCurrent") != null) {
+            if (ap != null && map.get("electricalCurrent") != null) {
               //有功
-              BigDecimal activePower = new BigDecimal(map.get("activePower"));
+              BigDecimal activePower = new BigDecimal(ap);
               //电流
               BigDecimal electricalCurrent = new BigDecimal(map.get("electricalCurrent"));
               //有功/电流=电压
@@ -222,6 +226,8 @@ public class ReceiveDataService {
             windTowerStatusDataRepository.save(windTowerStatusData);
             log.info("cft-" + electricField.getStationCode() + "-" + equipmentId+"已存入");
             break;
+          default:
+            break;
         }
       }else {
         log.info(electricField.getStationCode()+ "-" +equipmentType.getMessage() + "-" + equipmentId+"无数据,不进行任何操作");
@@ -263,16 +269,18 @@ public class ReceiveDataService {
         List<InverterInfo> inverterInfoList = inverterInfoService.getByStationCode(electricField.getStationCode());
         for (InverterInfo inverterInfo : inverterInfoList) {
           Map<String, String> getMap = redisUtils.hgetall("nbq-" + electricField.getStationCode() + "-" + inverterInfo.getId());
-          if (getMap.get("activePower") != null) {
-            pssd = pssd.add(new BigDecimal(getMap.get("activePower")));
+          String activePower = getMap.get(Active);
+          if (activePower != null) {
+            pssd = pssd.add(new BigDecimal(activePower));
           }
         }
       } else {
         List<WindTurbineInfo> windTurbineInfoList = windTurbineInfoService.getByStationCode(electricField.getStationCode());
         for (WindTurbineInfo windTurbineInfo : windTurbineInfoList) {
           Map<String, String> getMap = redisUtils.hgetall("fj-" + electricField.getStationCode() + "-" + windTurbineInfo.getId());
-          if (getMap.get("activePower") != null) {
-            pssd = pssd.add(new BigDecimal(getMap.get("activePower")));
+          String activePower = getMap.get(Active);
+          if (activePower != null) {
+            pssd = pssd.add(new BigDecimal(activePower));
           }
         }
       }
@@ -290,5 +298,4 @@ public class ReceiveDataService {
       e.printStackTrace();
     }
   }
-
 }