|
@@ -131,7 +131,7 @@ public class PushDataForBJZYYJY implements IPushInitForecastData {
|
|
|
// 从有#的数据开始获取 数据示例:#1 帽子山光伏电站 2023-06-22 00:00:00 0.0
|
|
|
if (originalContent.contains("#")) {
|
|
|
// 刨除当天的数据
|
|
|
- if(originalContent.contains(todaySeparatorStr)){
|
|
|
+ if (originalContent.contains(todaySeparatorStr)) {
|
|
|
continue;
|
|
|
}
|
|
|
// 根据分隔符分割,取时间和功率
|
|
@@ -157,10 +157,12 @@ public class PushDataForBJZYYJY implements IPushInitForecastData {
|
|
|
// 文件存放路径 /jiayue/insu/file/bjInit/J00269/
|
|
|
String newFilePath = bjFilePath + stationCode + File.separatorChar;
|
|
|
String templateName = File.separatorChar + "vms" + File.separatorChar + "BJZYYJYDQ.vm";
|
|
|
- String newFileName = "modeloutput-" + stationCode + "J001-" + todayStr + "_SUBSHORT.RB";
|
|
|
- String fileType = "dq";
|
|
|
+ String tomorrowStr = DateUtil.format(DateUtil.tomorrow(), "yyyyMMdd");
|
|
|
+ String newFileName = "modeloutput-" + stationCode + "J001-" + tomorrowStr + "AM_SUBSHORT.RB";
|
|
|
+ String fileType = todayStr+ File.separatorChar+"dq";
|
|
|
// 文件数据开始时间
|
|
|
String fileDateStr = DateUtil.format(DateUtil.beginOfDay(DateUtil.tomorrow()), "yyyyMMdd_HH:mm:ss");
|
|
|
+
|
|
|
this.pushFileToSftp(record, vList, newFilePath, newFileName, templateName, station, fileType, todayStr, fileDateStr);
|
|
|
return true;
|
|
|
}
|
|
@@ -217,17 +219,14 @@ public class PushDataForBJZYYJY implements IPushInitForecastData {
|
|
|
map.put("realPower", realValue);
|
|
|
vList.add(map);
|
|
|
}
|
|
|
-
|
|
|
// 文件存放路径 /jiayue/insu/file/bjInit/J00269/
|
|
|
String newFilePath = bjFilePath + stationCode + File.separatorChar;
|
|
|
- DateTimeFormatter formatterTime = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
|
|
- String todayTimeStr = today.format(formatterTime);
|
|
|
- String newFileName = "realpowerdata-" + stationCode + "J001-" + todayTimeStr + ".RB";
|
|
|
+ String newFileName = "realpowerdata-" + stationCode + "J001-" + todayStr + "085500.RB";
|
|
|
String templateName = File.separatorChar + "vms" + File.separatorChar + "BJZYYJYRP.vm";
|
|
|
// sftp具体路径
|
|
|
- String sftpFilePath = "real";
|
|
|
+ String sftpFilePath = todayStr + File.separatorChar + "real";
|
|
|
// 文件数据开始时间
|
|
|
- String fileDateStr = DateUtil.format(DateUtil.beginOfDay(new Date()), "yyyyMMdd_HH:mm:ss");
|
|
|
+ String fileDateStr = DateUtil.format(DateUtil.beginOfDay(DateUtil.yesterday()), "yyyyMMdd_HH:mm:ss");
|
|
|
this.pushFileToSftp(record, vList, newFilePath, newFileName, templateName, station, sftpFilePath, todayStr, fileDateStr);
|
|
|
return false;
|
|
|
}
|
|
@@ -239,11 +238,11 @@ public class PushDataForBJZYYJY implements IPushInitForecastData {
|
|
|
* @param newFileName
|
|
|
* @param templateName
|
|
|
* @param station
|
|
|
- * @param fileType
|
|
|
+ * @param dateAndFileType
|
|
|
* @param todayStr
|
|
|
* @return
|
|
|
*/
|
|
|
- public boolean pushFileToSftp(Record record, List<Map<String, Object>> vList, String newFilePath, String newFileName, String templateName, Station station, String fileType, String todayStr, String fileDateStr) {
|
|
|
+ public boolean pushFileToSftp(Record record, List<Map<String, Object>> vList, String newFilePath, String newFileName, String templateName, Station station, String dateAndFileType, String todayStr, String fileDateStr) {
|
|
|
|
|
|
VelocityContext velocityContext = new VelocityContext();
|
|
|
velocityContext.put("vList", vList);
|
|
@@ -288,9 +287,8 @@ public class PushDataForBJZYYJY implements IPushInitForecastData {
|
|
|
}
|
|
|
int sftpPort = Integer.valueOf(sftpInfoArr[3]);
|
|
|
String sftpFilePath = sftpInfoArr[4];
|
|
|
- sftpFilePath = sftpFilePath + File.separatorChar + todayStr + File.separatorChar + fileType;
|
|
|
+ sftpFilePath = sftpFilePath + File.separatorChar + dateAndFileType;
|
|
|
|
|
|
-// SFTPUtil sftp = new SFTPUtil(station.getUsername(), station.getPassword(), sftpUrl, sftpPort);
|
|
|
log.info("getUsername:" + userName);
|
|
|
log.info("getPassword:" + passWord);
|
|
|
log.info("sftpUrl:" + sftpUrl);
|