|
@@ -12,9 +12,6 @@ import cn.hutool.json.JSONUtil;
|
|
import com.jiayue.insu.incloud.compermisson.QNHLComPermisson;
|
|
import com.jiayue.insu.incloud.compermisson.QNHLComPermisson;
|
|
import com.jiayue.insu.incloud.constants.CommonStant;
|
|
import com.jiayue.insu.incloud.constants.CommonStant;
|
|
import com.jiayue.insu.incloud.constants.CompanyConstant;
|
|
import com.jiayue.insu.incloud.constants.CompanyConstant;
|
|
-import com.jiayue.insu.incloud.constants.ConnectConstant;
|
|
|
|
-import com.jiayue.insu.incloud.constants.StatusConstant;
|
|
|
|
-import com.jiayue.insu.incloud.constants.enums.DataTypeEnum;
|
|
|
|
import com.jiayue.insu.incloud.constants.enums.QNHLEnum;
|
|
import com.jiayue.insu.incloud.constants.enums.QNHLEnum;
|
|
import com.jiayue.insu.incloud.constants.enums.StatusEnum;
|
|
import com.jiayue.insu.incloud.constants.enums.StatusEnum;
|
|
import com.jiayue.insu.incloud.constants.vo.RequestVo;
|
|
import com.jiayue.insu.incloud.constants.vo.RequestVo;
|
|
@@ -63,7 +60,7 @@ public class PushDataForQNHL implements IPushInitForecastData {
|
|
Record record = new Record();
|
|
Record record = new Record();
|
|
record.setStationCode(station.getStationCode());
|
|
record.setStationCode(station.getStationCode());
|
|
record.setInCode(station.getInCode());
|
|
record.setInCode(station.getInCode());
|
|
- record.setType(CommonStant.RECORD_TYPE_PUSH);
|
|
|
|
|
|
+ record.setType(CommonStant.RECORD_TYPE_PUSH_INIT);
|
|
LocalDateTime localDateTime = LocalDateTimeUtil.beginOfDay(LocalDateTime.now());
|
|
LocalDateTime localDateTime = LocalDateTimeUtil.beginOfDay(LocalDateTime.now());
|
|
record.setTime(localDateTime);
|
|
record.setTime(localDateTime);
|
|
record.setCreateTime(LocalDateTime.now());
|
|
record.setCreateTime(LocalDateTime.now());
|
|
@@ -122,7 +119,7 @@ public class PushDataForQNHL implements IPushInitForecastData {
|
|
//如果数据小于961条 不上送数据
|
|
//如果数据小于961条 不上送数据
|
|
if (aList.size() >= 961) {
|
|
if (aList.size() >= 961) {
|
|
|
|
|
|
- if (StatusConstant.ET_PHOTOVOLTAIC.equals(station.getType())) {
|
|
|
|
|
|
+ if (CommonStant.ET_PHOTOVOLTAIC.equals(station.getType())) {
|
|
requestVo = generatePhotovoltaicRequest(station.getSignCode(), aList, startTime, endTime);
|
|
requestVo = generatePhotovoltaicRequest(station.getSignCode(), aList, startTime, endTime);
|
|
} else {
|
|
} else {
|
|
requestVo = generateWindRequest(station.getSignCode(), aList, startTime, endTime);
|
|
requestVo = generateWindRequest(station.getSignCode(), aList, startTime, endTime);
|
|
@@ -213,6 +210,7 @@ public class PushDataForQNHL implements IPushInitForecastData {
|
|
log.error("=========={}:{} ==>上送短期原始数据失败 无token ==========",integrationCompany.getName(),st.getStationCode());
|
|
log.error("=========={}:{} ==>上送短期原始数据失败 无token ==========",integrationCompany.getName(),st.getStationCode());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ recordService.save(record);
|
|
|
|
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
@@ -225,35 +223,35 @@ public class PushDataForQNHL implements IPushInitForecastData {
|
|
|
|
|
|
DateTime dateTime = DateUtil.parse(DateUtil.now());
|
|
DateTime dateTime = DateUtil.parse(DateUtil.now());
|
|
|
|
|
|
- String fileName = el + "_" + dateTime.toString("yyyyMMdd_HHmm") + "_" + DataTypeEnum.PUSH_QNHL_DQ.getSign() + ".CIME";
|
|
|
|
|
|
+ String fileName = el + "_" + dateTime.toString("yyyyMMdd_HHmm") + "_" + QNHLEnum.DATA_FORE_TYPE.getSign() + ".CIME";
|
|
|
|
|
|
String content = "";
|
|
String content = "";
|
|
|
|
|
|
Long momentTime = 900000L; // 15分钟一个时刻
|
|
Long momentTime = 900000L; // 15分钟一个时刻
|
|
|
|
|
|
- String header = "<! Entity=" + el + " time='" + dateTime.toString("yyyy-MM-dd HH:mm:ss") + "' !>" + ConnectConstant.LINE_CONSTANT;
|
|
|
|
- String labelStart = "<ForecastPower>" + ConnectConstant.LINE_CONSTANT;
|
|
|
|
- String labelEnd = "</ForecastPower>" + ConnectConstant.LINE_CONSTANT;
|
|
|
|
- String title = "@" + ConnectConstant.SPACE1_CONSTANT + "序号" + ConnectConstant.SPACE4_CONSTANT + "时间"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "功率预测" + ConnectConstant.SPACE4_CONSTANT + "总辐照度"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "直射辐照度" + ConnectConstant.SPACE4_CONSTANT + "散射辐照度"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "温度" + ConnectConstant.SPACE4_CONSTANT + "湿度" + ConnectConstant.SPACE4_CONSTANT
|
|
|
|
- + "气压" + ConnectConstant.SPACE4_CONSTANT + "风速" + ConnectConstant.SPACE4_CONSTANT + " 风向" + ConnectConstant.LINE_CONSTANT;
|
|
|
|
|
|
+ String header = "<! Entity=" + el + " time='" + dateTime.toString("yyyy-MM-dd HH:mm:ss") + "' !>" + CommonStant.LINE_CONSTANT;
|
|
|
|
+ String labelStart = "<ForecastPower>" + CommonStant.LINE_CONSTANT;
|
|
|
|
+ String labelEnd = "</ForecastPower>" + CommonStant.LINE_CONSTANT;
|
|
|
|
+ String title = "@" + CommonStant.SPACE1_CONSTANT + "序号" + CommonStant.SPACE4_CONSTANT + "时间"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "功率预测" + CommonStant.SPACE4_CONSTANT + "总辐照度"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "直射辐照度" + CommonStant.SPACE4_CONSTANT + "散射辐照度"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "温度" + CommonStant.SPACE4_CONSTANT + "湿度" + CommonStant.SPACE4_CONSTANT
|
|
|
|
+ + "气压" + CommonStant.SPACE4_CONSTANT + "风速" + CommonStant.SPACE4_CONSTANT + " 风向" + CommonStant.LINE_CONSTANT;
|
|
content += header;
|
|
content += header;
|
|
content += labelStart;
|
|
content += labelStart;
|
|
content += title;
|
|
content += title;
|
|
- String template = "#" + ConnectConstant.SPACE1_CONSTANT + "{}"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "{}"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "{}"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "{}"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "{}"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "{}"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "{}"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "{}"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "{}"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "{}"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "{}"
|
|
|
|
- + ConnectConstant.LINE_CONSTANT;
|
|
|
|
|
|
+ String template = "#" + CommonStant.SPACE1_CONSTANT + "{}"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "{}"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "{}"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "{}"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "{}"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "{}"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "{}"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "{}"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "{}"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "{}"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "{}"
|
|
|
|
+ + CommonStant.LINE_CONSTANT;
|
|
|
|
|
|
|
|
|
|
Map<Long, List<ForecastData>> forecastMap =
|
|
Map<Long, List<ForecastData>> forecastMap =
|
|
@@ -308,9 +306,9 @@ public class PushDataForQNHL implements IPushInitForecastData {
|
|
content += labelEnd;
|
|
content += labelEnd;
|
|
|
|
|
|
RequestVo requestVo = RequestVo.builder()
|
|
RequestVo requestVo = RequestVo.builder()
|
|
- .transferType(ConnectConstant.TRANSFER_TYPE_DOWNLOAD)
|
|
|
|
|
|
+ .transferType(QNHLEnum.TRANSFER_TYPE_DOWNLOAD.getCode())
|
|
.date(dateTime.toString("yyyyMMdd"))
|
|
.date(dateTime.toString("yyyyMMdd"))
|
|
- .dataType(DataTypeEnum.PUSH_QNHL_DQ.getSign())
|
|
|
|
|
|
+ .dataType(QNHLEnum.DATA_FORE_TYPE.getSign())
|
|
.fileName(fileName)
|
|
.fileName(fileName)
|
|
.data(content).build();
|
|
.data(content).build();
|
|
|
|
|
|
@@ -327,31 +325,31 @@ public class PushDataForQNHL implements IPushInitForecastData {
|
|
|
|
|
|
DateTime dateTime = DateUtil.parse(DateUtil.now());
|
|
DateTime dateTime = DateUtil.parse(DateUtil.now());
|
|
|
|
|
|
- String fileName = el + "_" + dateTime.toString("yyyyMMdd_HHmm") + "_" + DataTypeEnum.PUSH_QNHL_DQ.getSign() + ".CIME";
|
|
|
|
|
|
+ String fileName = el + "_" + dateTime.toString("yyyyMMdd_HHmm") + "_" + QNHLEnum.DATA_FORE_TYPE.getSign() + ".CIME";
|
|
|
|
|
|
StringBuilder content = new StringBuilder();
|
|
StringBuilder content = new StringBuilder();
|
|
|
|
|
|
long momentTime = 900000L; // 15分钟一个时刻
|
|
long momentTime = 900000L; // 15分钟一个时刻
|
|
|
|
|
|
- String header = "<! Entity=" + el + " time='" + dateTime.toString("yyyy-MM-dd HH:mm:ss") + "' !>" + ConnectConstant.LINE_CONSTANT;
|
|
|
|
- String labelStart = "<ForecastPower>" + ConnectConstant.LINE_CONSTANT;
|
|
|
|
- String labelEnd = "</ForecastPower>" + ConnectConstant.LINE_CONSTANT;
|
|
|
|
- String title = "@" + ConnectConstant.SPACE1_CONSTANT + "序号" + ConnectConstant.SPACE4_CONSTANT + "时间"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "功率预测" + ConnectConstant.SPACE4_CONSTANT + "风速"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "风向" + ConnectConstant.SPACE4_CONSTANT + "温度"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "湿度" + ConnectConstant.SPACE4_CONSTANT + "气压" + ConnectConstant.LINE_CONSTANT;
|
|
|
|
|
|
+ String header = "<! Entity=" + el + " time='" + dateTime.toString("yyyy-MM-dd HH:mm:ss") + "' !>" + CommonStant.LINE_CONSTANT;
|
|
|
|
+ String labelStart = "<ForecastPower>" + CommonStant.LINE_CONSTANT;
|
|
|
|
+ String labelEnd = "</ForecastPower>" + CommonStant.LINE_CONSTANT;
|
|
|
|
+ String title = "@" + CommonStant.SPACE1_CONSTANT + "序号" + CommonStant.SPACE4_CONSTANT + "时间"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "功率预测" + CommonStant.SPACE4_CONSTANT + "风速"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "风向" + CommonStant.SPACE4_CONSTANT + "温度"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "湿度" + CommonStant.SPACE4_CONSTANT + "气压" + CommonStant.LINE_CONSTANT;
|
|
content.append(header);
|
|
content.append(header);
|
|
content.append(labelStart);
|
|
content.append(labelStart);
|
|
content.append(title);
|
|
content.append(title);
|
|
- String template = "#" + ConnectConstant.SPACE1_CONSTANT + "{}"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "{}"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "{}"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "{}"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "{}"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "{}"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "{}"
|
|
|
|
- + ConnectConstant.SPACE4_CONSTANT + "{}"
|
|
|
|
- + ConnectConstant.LINE_CONSTANT;
|
|
|
|
|
|
+ String template = "#" + CommonStant.SPACE1_CONSTANT + "{}"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "{}"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "{}"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "{}"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "{}"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "{}"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "{}"
|
|
|
|
+ + CommonStant.SPACE4_CONSTANT + "{}"
|
|
|
|
+ + CommonStant.LINE_CONSTANT;
|
|
|
|
|
|
|
|
|
|
Map<Long, List<ForecastData>> forecastMap =
|
|
Map<Long, List<ForecastData>> forecastMap =
|
|
@@ -400,9 +398,9 @@ public class PushDataForQNHL implements IPushInitForecastData {
|
|
content.append(labelEnd);
|
|
content.append(labelEnd);
|
|
|
|
|
|
RequestVo requestVo = RequestVo.builder()
|
|
RequestVo requestVo = RequestVo.builder()
|
|
- .transferType(ConnectConstant.TRANSFER_TYPE_DOWNLOAD)
|
|
|
|
|
|
+ .transferType(QNHLEnum.TRANSFER_TYPE_DOWNLOAD.getCode())
|
|
.date(dateTime.toString("yyyyMMdd"))
|
|
.date(dateTime.toString("yyyyMMdd"))
|
|
- .dataType(DataTypeEnum.PUSH_QNHL_DQ.getSign())
|
|
|
|
|
|
+ .dataType(QNHLEnum.DATA_FORE_TYPE.getSign())
|
|
.fileName(fileName)
|
|
.fileName(fileName)
|
|
.data(content.toString()).build();
|
|
.data(content.toString()).build();
|
|
|
|
|