|
@@ -1,8 +1,40 @@
|
|
|
package com.jiayue.insu.incloud.pushdata;
|
|
|
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
+import cn.hutool.core.date.DateTime;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
+import cn.hutool.core.date.LocalDateTimeUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.hutool.http.HttpRequest;
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
+import com.jiayue.insu.incloud.compermisson.QNHLComPermisson;
|
|
|
+import com.jiayue.insu.incloud.constants.CommonStant;
|
|
|
+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.StatusEnum;
|
|
|
+import com.jiayue.insu.incloud.constants.vo.RequestVo;
|
|
|
+import com.jiayue.insu.incloud.constants.vo.ResponseVo;
|
|
|
+import com.jiayue.insu.incloud.entity.ForecastData;
|
|
|
+import com.jiayue.insu.incloud.entity.IntegrationCompany;
|
|
|
+import com.jiayue.insu.incloud.entity.Record;
|
|
|
import com.jiayue.insu.incloud.entity.Station;
|
|
|
+import com.jiayue.insu.incloud.service.ForecastDataService;
|
|
|
+import com.jiayue.insu.incloud.service.IntegrationCompanyService;
|
|
|
+import com.jiayue.insu.incloud.service.RecordService;
|
|
|
+import com.jiayue.insu.incloud.service.StationService;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
/**
|
|
|
* 清能推送数据
|
|
|
*
|
|
@@ -11,8 +43,372 @@ import org.springframework.stereotype.Component;
|
|
|
* @since 2022/5/22 11:29
|
|
|
*/
|
|
|
@Component
|
|
|
+@Slf4j
|
|
|
public class PushDataForQNHL implements IPushInitForecastData {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ForecastDataService forecastDataService;
|
|
|
+ @Autowired
|
|
|
+ private StationService stationService;
|
|
|
+ @Autowired
|
|
|
+ private IntegrationCompanyService integrationCompanyService;
|
|
|
+ @Autowired
|
|
|
+ private QNHLComPermisson qNHLComPermisson;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private RecordService recordService;
|
|
|
+
|
|
|
+ public Boolean pushDQAndNWPData(Station station) {
|
|
|
+
|
|
|
+ Record record = new Record();
|
|
|
+ record.setStationCode(station.getStationCode());
|
|
|
+ record.setInCode(station.getInCode());
|
|
|
+ record.setType(CommonStant.RECORD_TYPE_PUSH);
|
|
|
+ LocalDateTime localDateTime = LocalDateTimeUtil.beginOfDay(LocalDateTime.now());
|
|
|
+ record.setTime(localDateTime);
|
|
|
+ record.setCreateTime(LocalDateTime.now());
|
|
|
+
|
|
|
+ Station st = stationService.findByStationCode(station.getStationCode());
|
|
|
+ String token = st.getKey();
|
|
|
+ LocalDateTime tokenTime = st.getKeyTime();
|
|
|
+
|
|
|
+ IntegrationCompany integrationCompany = integrationCompanyService.findByCode(CompanyConstant.COMPANY_QNHL);
|
|
|
+ String dataPushUrl = integrationCompany.getPushUrl();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ boolean result =false;
|
|
|
+ String response;
|
|
|
+ RequestVo requestVo;
|
|
|
+
|
|
|
+ if (StrUtil.isEmpty(token) || LocalDateTime.now().isAfter(tokenTime)) {
|
|
|
+ if(qNHLComPermisson.generateKey(station)){
|
|
|
+ st = stationService.findByStationCode(station.getStationCode());
|
|
|
+ token = st.getKey();
|
|
|
+ tokenTime = st.getKeyTime();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StrUtil.isNotEmpty(token) && LocalDateTime.now().isBefore(tokenTime)) {
|
|
|
+ long startTime = DateUtil.beginOfDay(new Date()).getTime();
|
|
|
+ long endTime = DateUtil.offsetDay(new Date(startTime), 10).getTime();
|
|
|
+ long momentTime = 900000L;
|
|
|
+ List<ForecastData> aList;
|
|
|
+ aList = forecastDataService.findTimeByStation(station.getStationCode(), startTime, endTime);
|
|
|
+ aList.sort(Comparator.comparing(ForecastData::getForecastTime));
|
|
|
+
|
|
|
+ if (CollectionUtil.isNotEmpty(aList)) {
|
|
|
+
|
|
|
+ /**************************补点 start*************************/
|
|
|
+ if (aList.get(0).getForecastTime().longValue() != startTime) {
|
|
|
+ List<ForecastData> bList = new ArrayList<>();
|
|
|
+ long finallyTime = aList.get(0).getForecastTime().longValue();
|
|
|
+ ForecastData source = aList.get(0);
|
|
|
+ for (Long tempTime = startTime; tempTime < finallyTime; tempTime = tempTime + momentTime) {
|
|
|
+ ForecastData target = new ForecastData();
|
|
|
+ BeanUtil.copyProperties(source, target, false);
|
|
|
+ target.setId(null);
|
|
|
+ target.setForecastTime(tempTime);
|
|
|
+ bList.add(target);
|
|
|
+
|
|
|
+ }
|
|
|
+ forecastDataService.saveBatch(bList);
|
|
|
+ aList = forecastDataService.findTimeByStation(station.getStationCode(), startTime, endTime);
|
|
|
+ aList.sort(Comparator.comparing(ForecastData::getForecastTime));
|
|
|
+ }
|
|
|
+ /**************************补点 end*************************/
|
|
|
+
|
|
|
+
|
|
|
+ //如果数据小于961条 不上送数据
|
|
|
+ if (aList.size() >= 961) {
|
|
|
+
|
|
|
+ if (StatusConstant.ET_PHOTOVOLTAIC.equals(station.getType())) {
|
|
|
+ requestVo = generatePhotovoltaicRequest(station.getSignCode(), aList, startTime, endTime);
|
|
|
+ } else {
|
|
|
+ requestVo = generateWindRequest(station.getSignCode(), aList, startTime, endTime);
|
|
|
+ }
|
|
|
+
|
|
|
+ JSONObject json = JSONUtil.parseObj(requestVo, false);
|
|
|
+ String body = json.toString();
|
|
|
+
|
|
|
+ try {
|
|
|
+
|
|
|
+ HttpRequest httpRequest = HttpRequest.post(dataPushUrl)
|
|
|
+ .header("Content-Type", "application/json")
|
|
|
+ .header("Authorization", token);
|
|
|
+ httpRequest.setGlobalTimeout(20000);
|
|
|
+
|
|
|
+ response = httpRequest
|
|
|
+ .body(body)
|
|
|
+ .execute().body();
|
|
|
+
|
|
|
+ if (StrUtil.isNotEmpty(response)) {
|
|
|
+ boolean isJson = JSONUtil.isJsonObj(response);
|
|
|
+ if (isJson) {
|
|
|
+ ResponseVo responseVo = JSONUtil.toBean(response, ResponseVo.class);
|
|
|
+ String code = responseVo.getRetCode();
|
|
|
+ if (code.equals(QNHLEnum.REQUEST_SUCCESS.getCode())) {
|
|
|
+
|
|
|
+ for (ForecastData a : aList) {
|
|
|
+ a.setUploadTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ forecastDataService.saveBatch(aList);
|
|
|
+ record.setState(QNHLEnum.REQUEST_SUCCESS.getSign());
|
|
|
+ result = true;
|
|
|
+ log.info("=========={}:{} ==>上送短期原始数据成功 {}条==========",integrationCompany.getName(), st.getStationCode(), aList.size());
|
|
|
+ } else {
|
|
|
+ QNHLEnum[] values = QNHLEnum.values();
|
|
|
+ for (QNHLEnum q: values) {
|
|
|
+ if(code.equals(q.getCode())){
|
|
|
+ log.error("=========={}:{} ==>上送数据失败 失败标识:{} ,失败原因:{} ==========", integrationCompany.getName(),st.getStationCode(),code, responseVo.getRetMsg());
|
|
|
+ record.setState(q.getSign());
|
|
|
+ record.setStateContent(q.getMsg());
|
|
|
+ if(q.name().startsWith("PERMISSON")){
|
|
|
+ log.error("=========={}:{} ==>重新请求token ==========", integrationCompany.getName(),st.getStationCode(),code);
|
|
|
+ qNHLComPermisson.generateKey(station);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ record.setState(StatusEnum.CONNECT_RESPONSE_FORMAT_ERROR.getSign());
|
|
|
+ record.setStateContent(StatusEnum.CONNECT_RESPONSE_FORMAT_ERROR.getMsg());
|
|
|
+ log.error("=========={}:{} ==>上送短期原始数据失败 接收响应字符串非json格式 " ,integrationCompany.getName(),st.getStationCode());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ record.setState(StatusEnum.CONNECT_RESPONSE_CONTENT_NULL.getSign());
|
|
|
+ record.setStateContent(StatusEnum.CONNECT_RESPONSE_CONTENT_NULL.getMsg());
|
|
|
+ log.error("=========={}:{} ==>上送短期原始数据失败 返回响应内容为空 ==========" ,integrationCompany.getName(),st.getStationCode());
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+
|
|
|
+ record.setState(StatusEnum.CONNECT_ERROR.getSign());
|
|
|
+ record.setStateContent(StatusEnum.CONNECT_ERROR.getMsg());
|
|
|
+ log.error("=========={}:{} ==>上送短期原始数据失败 连接断开或请求超时 ==========",integrationCompany.getName(),st.getStationCode());
|
|
|
+ e.printStackTrace();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ record.setState(StatusEnum.DATA_DEFICIENCY.getSign());
|
|
|
+ record.setStateContent(StatusEnum.DATA_DEFICIENCY.getMsg());
|
|
|
+ log.warn("=========={}:{} ==>上送短期原始数据失败 上送数据不足 不上送数据 ==========",integrationCompany.getName(),st.getStationCode());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ } else {
|
|
|
+ record.setState(StatusEnum.DATA_DEFICIENCY.getSign());
|
|
|
+ record.setStateContent(StatusEnum.DATA_DEFICIENCY.getMsg());
|
|
|
+ log.warn("=========={}:{} ==>上送短期原始数据失败 上送数据查询为空 不上送数据 ==========",integrationCompany.getName(),st.getStationCode());
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ record.setState(QNHLEnum.PERMISSON_LOGIN_NOT.getSign());
|
|
|
+ record.setStateContent(QNHLEnum.PERMISSON_LOGIN_NOT.getMsg());
|
|
|
+ log.error("=========={}:{} ==>上送短期原始数据失败 无token ==========",integrationCompany.getName(),st.getStationCode());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 生成光短期请求
|
|
|
+ *
|
|
|
+ * @return RequestVo
|
|
|
+ */
|
|
|
+ public RequestVo generatePhotovoltaicRequest(String el, List<ForecastData> aList, long startTime, long endTime) {
|
|
|
+
|
|
|
+ DateTime dateTime = DateUtil.parse(DateUtil.now());
|
|
|
+
|
|
|
+ String fileName = el + "_" + dateTime.toString("yyyyMMdd_HHmm") + "_" + DataTypeEnum.PUSH_QNHL_DQ.getSign() + ".CIME";
|
|
|
+
|
|
|
+ String content = "";
|
|
|
+
|
|
|
+ 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;
|
|
|
+ content += header;
|
|
|
+ content += labelStart;
|
|
|
+ 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;
|
|
|
+
|
|
|
+
|
|
|
+ Map<Long, List<ForecastData>> forecastMap =
|
|
|
+ aList.stream().collect(Collectors.groupingBy(ForecastData::getForecastTime));
|
|
|
+
|
|
|
+ int i = 1;
|
|
|
+
|
|
|
+ for (Long tempTime = startTime; tempTime <= endTime; tempTime = tempTime + momentTime) {
|
|
|
+
|
|
|
+ List<ForecastData> list = forecastMap.get(tempTime);
|
|
|
+
|
|
|
+ String time = DateUtil.date(tempTime).toString("yyyyMMddHHmmss");
|
|
|
+
|
|
|
+ if (CollectionUtil.isNotEmpty(list)) {
|
|
|
+ ForecastData aioForecastPowerShortTerm = forecastMap.get(tempTime).get(0);
|
|
|
+ String dataStr = StrUtil.format(template,
|
|
|
+ i,
|
|
|
+ time,
|
|
|
+ aioForecastPowerShortTerm.getFpValue() == null ? "NULL" : aioForecastPowerShortTerm.getFpValue().setScale(6).toString(),
|
|
|
+ aioForecastPowerShortTerm.getSwr() == null ? "NULL" : aioForecastPowerShortTerm.getSwr().setScale(6).toString(),
|
|
|
+ aioForecastPowerShortTerm.getDirectRadiation() == null ? "NULL" : aioForecastPowerShortTerm.getDirectRadiation().setScale(6).toString(),
|
|
|
+ aioForecastPowerShortTerm.getDiffuseRadiation() == null ? "NULL" : aioForecastPowerShortTerm.getDiffuseRadiation().setScale(6).toString(),
|
|
|
+ aioForecastPowerShortTerm.getTemperature() == null ? "NULL" : aioForecastPowerShortTerm.getTemperature().setScale(6).toString(),
|
|
|
+ aioForecastPowerShortTerm.getHumidity() == null ? "NULL" : aioForecastPowerShortTerm.getHumidity().setScale(6).toString(),
|
|
|
+ aioForecastPowerShortTerm.getPressure() == null ? "NULL" : aioForecastPowerShortTerm.getPressure().setScale(6).toString(),
|
|
|
+ aioForecastPowerShortTerm.getWindSpeed() == null ? "NULL" : aioForecastPowerShortTerm.getWindSpeed().setScale(6).toString(),
|
|
|
+ aioForecastPowerShortTerm.getWindDir() == null ? "NULL" : aioForecastPowerShortTerm.getWindDir().setScale(6).toString()
|
|
|
+ );
|
|
|
+ content += dataStr;
|
|
|
+
|
|
|
+ } else {
|
|
|
+ String dataStr = StrUtil.format(template,
|
|
|
+ i,
|
|
|
+ time,
|
|
|
+ "NULL",
|
|
|
+ "NULL",
|
|
|
+ "NULL",
|
|
|
+ "NULL",
|
|
|
+ "NULL",
|
|
|
+ "NULL",
|
|
|
+ "NULL",
|
|
|
+ "NULL",
|
|
|
+ "NULL"
|
|
|
+ );
|
|
|
+ content += dataStr;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+
|
|
|
+ content += labelEnd;
|
|
|
+
|
|
|
+ RequestVo requestVo = RequestVo.builder()
|
|
|
+ .transferType(ConnectConstant.TRANSFER_TYPE_DOWNLOAD)
|
|
|
+ .date(dateTime.toString("yyyyMMdd"))
|
|
|
+ .dataType(DataTypeEnum.PUSH_QNHL_DQ.getSign())
|
|
|
+ .fileName(fileName)
|
|
|
+ .data(content).build();
|
|
|
+
|
|
|
+ return requestVo;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生成风短期请求
|
|
|
+ *
|
|
|
+ * @return RequestVo
|
|
|
+ */
|
|
|
+ public RequestVo generateWindRequest(String el, List<ForecastData> aList, long startTime, long endTime) {
|
|
|
+
|
|
|
+ DateTime dateTime = DateUtil.parse(DateUtil.now());
|
|
|
+
|
|
|
+ String fileName = el + "_" + dateTime.toString("yyyyMMdd_HHmm") + "_" + DataTypeEnum.PUSH_QNHL_DQ.getSign() + ".CIME";
|
|
|
+
|
|
|
+ StringBuilder content = new StringBuilder();
|
|
|
+
|
|
|
+ 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;
|
|
|
+ content.append(header);
|
|
|
+ content.append(labelStart);
|
|
|
+ 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;
|
|
|
+
|
|
|
+
|
|
|
+ Map<Long, List<ForecastData>> forecastMap =
|
|
|
+ aList.stream().collect(Collectors.groupingBy(ForecastData::getForecastTime));
|
|
|
+
|
|
|
+ int i = 1;
|
|
|
+
|
|
|
+ for (long tempTime = startTime; tempTime <= endTime; tempTime = tempTime + momentTime) {
|
|
|
+
|
|
|
+
|
|
|
+ List<ForecastData> list = forecastMap.get(tempTime);
|
|
|
+
|
|
|
+ String time = DateUtil.date(tempTime).toString("yyyyMMddHHmmss");
|
|
|
+
|
|
|
+ if (CollectionUtil.isNotEmpty(list)) {
|
|
|
+
|
|
|
+ ForecastData aioForecastPowerShortTerm = list.get(0);
|
|
|
+
|
|
|
+ String dataStr = StrUtil.format(template, i, time,
|
|
|
+ aioForecastPowerShortTerm.getFpValue() == null ? "NULL" : aioForecastPowerShortTerm.getFpValue().setScale(6).toString(),
|
|
|
+ aioForecastPowerShortTerm.getWindSpeed() == null ? "NULL" : aioForecastPowerShortTerm.getWindSpeed().setScale(6).toString(),
|
|
|
+ aioForecastPowerShortTerm.getWindDir() == null ? "NULL" : aioForecastPowerShortTerm.getWindDir().setScale(6).toString(),
|
|
|
+ aioForecastPowerShortTerm.getTemperature() == null ? "NULL" : aioForecastPowerShortTerm.getTemperature().setScale(6).toString(),
|
|
|
+ aioForecastPowerShortTerm.getHumidity() == null ? "NULL" : aioForecastPowerShortTerm.getHumidity().setScale(6).toString(),
|
|
|
+ aioForecastPowerShortTerm.getPressure() == null ? "NULL" : aioForecastPowerShortTerm.getPressure().setScale(6).toString()
|
|
|
+ );
|
|
|
+
|
|
|
+ content.append(dataStr);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ String dataStr = StrUtil.format(template, i, time,
|
|
|
+ "NULL",
|
|
|
+ "NULL",
|
|
|
+ "NULL",
|
|
|
+ "NULL",
|
|
|
+ "NULL",
|
|
|
+ "NULL"
|
|
|
+ );
|
|
|
+
|
|
|
+ content.append(dataStr);
|
|
|
+ }
|
|
|
+
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+
|
|
|
+ content.append(labelEnd);
|
|
|
+
|
|
|
+ RequestVo requestVo = RequestVo.builder()
|
|
|
+ .transferType(ConnectConstant.TRANSFER_TYPE_DOWNLOAD)
|
|
|
+ .date(dateTime.toString("yyyyMMdd"))
|
|
|
+ .dataType(DataTypeEnum.PUSH_QNHL_DQ.getSign())
|
|
|
+ .fileName(fileName)
|
|
|
+ .data(content.toString()).build();
|
|
|
+
|
|
|
+ return requestVo;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public Boolean pushDQData(Station station) {
|
|
@@ -26,7 +422,4 @@ public class PushDataForQNHL implements IPushInitForecastData {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public Boolean pushDQAndNWPData(Station station) {
|
|
|
- return false;
|
|
|
- }
|
|
|
}
|