|
|
@@ -167,14 +167,24 @@ public class QxybDataService {
|
|
|
BASE_URL, divisionCode, hour, startTime, endTime);
|
|
|
log.info("下载{}:{}", batchFileName, url);
|
|
|
String batchResult = getResult(url);
|
|
|
- writeFile(batchResult, downloadFilePath + batchFileName);
|
|
|
- log.info("下载{}成功", batchFileName);
|
|
|
|
|
|
JSONObject json = JSONObject.parseObject(batchResult);
|
|
|
publishList = json.getJSONArray("data").toJavaList(PublishInfo.class);
|
|
|
Map<String, List<PublishInfo>> publishDtMap = publishList.stream()
|
|
|
.collect(Collectors.groupingBy(e -> e.getPublishDT(), Collectors.toList()));
|
|
|
|
|
|
+ publishDtMap.forEach((k, v) -> {
|
|
|
+ v.add(new PublishInfo(k, "MPSE", getPublishTime(k)));
|
|
|
+ });
|
|
|
+ List<PublishInfo> newPublishList = new ArrayList<>();
|
|
|
+ publishDtMap.forEach((k, v) -> {
|
|
|
+ newPublishList.addAll(v);
|
|
|
+ });
|
|
|
+ json.put("data", newPublishList);
|
|
|
+ batchResult = json.toJSONString();
|
|
|
+ writeFile(batchResult, downloadFilePath + batchFileName);
|
|
|
+ log.info("下载{}成功", batchFileName);
|
|
|
+
|
|
|
publishDtMap.forEach((k, v) -> {
|
|
|
v.forEach(p -> {
|
|
|
downloadDivRainData("DomainRain", divisionCode, p, 24);
|
|
|
@@ -197,9 +207,9 @@ public class QxybDataService {
|
|
|
String publishDT = p.getPublishDT();
|
|
|
String ensemble1 = p.getEnsemble();
|
|
|
String fileName = String.format("%s,%s,%s,%s,%s.json", prefix, divisionCode, publishDT, ensemble1, hour);
|
|
|
- if (!isSuccess(fileName)) {
|
|
|
+ if (!isSuccess(fileName) || "MPSE".equals(ensemble1)) {
|
|
|
String url2 = String.format("%s/getForePrecipData?publishDT=%s&divisionCode=%s&hour=%s&ensemble=%s",
|
|
|
- BASE_URL, publishDT, divisionCode, hour, ensemble1.equals("MPSE") ? "" : ensemble1);
|
|
|
+ BASE_URL, publishDT, divisionCode, hour, "MPSE".equals(ensemble1) ? "" : ensemble1);
|
|
|
log.info("下载{}:{}", fileName, url2);
|
|
|
String result = getResult(url2);
|
|
|
writeFile(result, downloadFilePath + fileName);
|
|
|
@@ -219,9 +229,9 @@ public class QxybDataService {
|
|
|
String publishDT = p.getPublishDT();
|
|
|
String ensemble1 = p.getEnsemble();
|
|
|
String fileName = String.format("%s,%s,%s,%s.json", prefix, publishDT, ensemble1, hour);
|
|
|
- if (!isSuccess(fileName)) {
|
|
|
+ if (!isSuccess(fileName) || "MPSE".equals(ensemble1)) {
|
|
|
String url2 = String.format("%s/getT_Forecast_24h_avg_division?publishDT=%s&divisionCode=%s&ensemble=%s",
|
|
|
- BASE_URL, publishDT, divisionCode, ensemble1.equals("MPSE") ? "" : ensemble1);
|
|
|
+ BASE_URL, publishDT, divisionCode, "MPSE".equals(ensemble1) ? "" : ensemble1);
|
|
|
log.info("下载{}:{}", fileName, url2);
|
|
|
String result = getResult(url2);
|
|
|
writeFile(result, downloadFilePath + fileName);
|
|
|
@@ -256,7 +266,7 @@ public class QxybDataService {
|
|
|
String fileName = String.format("%s,%s,%s,%s,%s.json", prefix, publishDT, ensemble1, hour, dt1);
|
|
|
if (!isSuccess(fileName)) {
|
|
|
String url2 = String.format("%s/getForecastMatrixByWrfRDField?content=precipitation&RDField=%s&domain=%s&publishDT=%s&ensemble=%s&step=%s&DT1=%s&DT2=%s",
|
|
|
- BASE_URL, rdField, domain, publishDT, ensemble1.equals("MPSE") ? "" : ensemble1, hour, dt1, dt2);
|
|
|
+ BASE_URL, rdField, domain, publishDT, ensemble1, hour, dt1, dt2);
|
|
|
log.info("下载{}:{}", fileName, url2);
|
|
|
String result = getResult(url2);
|
|
|
writeFile(result, downloadFilePath + fileName);
|
|
|
@@ -286,7 +296,7 @@ public class QxybDataService {
|
|
|
String fileName = String.format("%s,%s,%s,%s,%s.json", prefix, publishDT, ensemble1, hour, dt1);
|
|
|
if (!isSuccess(fileName)) {
|
|
|
String url2 = String.format("%s/getForecastMatrixByWrfRDField?content=precipitation&RDField=%s&domain=%s&publishDT=%s&ensemble=%s&step=%s&DT1=%s&DT2=%s",
|
|
|
- BASE_URL, rdField, domain, publishDT, ensemble1.equals("MPSE") ? "" : ensemble1, hour, dt1, dt2);
|
|
|
+ BASE_URL, rdField, domain, publishDT, ensemble1, hour, dt1, dt2);
|
|
|
log.info("下载{}:{}", fileName, url2);
|
|
|
String result = getResult(url2);
|
|
|
writeFile(result, downloadFilePath + fileName);
|
|
|
@@ -329,7 +339,7 @@ public class QxybDataService {
|
|
|
String fileName = String.format("%s,%s,%s,%s,%s.json", prefix, publishDT, ensemble1, hour, dt1);
|
|
|
if (!isSuccess(fileName)) {
|
|
|
String url2 = String.format("%s/getForecastMatrixByWrfRDField?RDField=%s&domain=%s&publishDT=%s&ensemble=%s&step=%s&DT1=%s&content=2mTC",
|
|
|
- BASE_URL, rdField, domain, publishDT, ensemble1.equals("MPSE") ? "" : ensemble1, hour, dt1);
|
|
|
+ BASE_URL, rdField, domain, publishDT, ensemble1, hour, dt1);
|
|
|
log.info("下载{}:{}", fileName, url2);
|
|
|
String result = getResult(url2);
|
|
|
writeFile(result, downloadFilePath + fileName);
|
|
|
@@ -361,9 +371,9 @@ public class QxybDataService {
|
|
|
String ensemble1 = p.getEnsemble();
|
|
|
|
|
|
String fileName = String.format("%s,%s,%s,%s.json", prefix, publishDT, ensemble1, hour);
|
|
|
- if (!isSuccess(fileName)) {
|
|
|
+ if (!isSuccess(fileName) || "MPSE".equals(ensemble1)) {
|
|
|
String url2 = String.format("%s/getForeTempData?RDField=%s&publishDT=%s&ensemble=%s",
|
|
|
- BASE_URL, rdField, publishDT, ensemble1.equals("MPSE") ? "" : ensemble1);
|
|
|
+ BASE_URL, rdField, publishDT, "MPSE".equals(ensemble1) ? "" : ensemble1);
|
|
|
log.info("下载{}:{}", fileName, url2);
|
|
|
String result = getResult(url2);
|
|
|
writeFile(result, downloadFilePath + fileName);
|
|
|
@@ -395,7 +405,7 @@ public class QxybDataService {
|
|
|
String fileName = String.format("%s,%s,%s,%s,%s.json", prefix, publishDT, ensemble1, hour, dt1);
|
|
|
if (!isSuccess(fileName)) {
|
|
|
String url2 = String.format("%s/getForecastHydroMatrixByWrfRDField?RDField=%s&domain=%s&publishDT=%s&ensemble=%s&step=%s&DT1=%s",
|
|
|
- BASE_URL, rdField, domain, publishDT, ensemble1.equals("MPSE") ? "" : ensemble1, hour, dt1);
|
|
|
+ BASE_URL, rdField, domain, publishDT, ensemble1, hour, dt1);
|
|
|
log.info("下载{}:{}", fileName, url2);
|
|
|
String result = getResult(url2);
|
|
|
writeFile(result, downloadFilePath + fileName);
|