|
@@ -61,6 +61,8 @@ public class ApiServiceImpl implements ApiService {
|
|
|
private String bucketName;
|
|
|
@Value("${minio.pull.cloudFileCreateLog}")
|
|
|
private String cloudFileCreateLog;
|
|
|
+ @Value("${minio.postBackUrl}")
|
|
|
+ private String postBackUrl;
|
|
|
|
|
|
@Autowired
|
|
|
RedisTemplate redisTemplate;
|
|
@@ -673,6 +675,9 @@ public class ApiServiceImpl implements ApiService {
|
|
|
record.setState(StatusEnum.DOWNLOAD_FILE_ERROR.getCode());
|
|
|
log.error("下载minIo原始RB文件 --> {} 失败,失败原因:{}", station.getStationCode(), StatusEnum.DOWNLOAD_FILE_ERROR.getMsg());
|
|
|
}
|
|
|
+
|
|
|
+ // 回传dq和nwp文件状态
|
|
|
+ this.postBackMinIoState(station.getStationCode(),nowFile.getName(),"down","是");
|
|
|
// 返回文件
|
|
|
return nowFile;
|
|
|
} catch (Exception e) {
|
|
@@ -689,11 +694,18 @@ public class ApiServiceImpl implements ApiService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param list
|
|
|
+ * @param data
|
|
|
+ * @param stationName
|
|
|
+ * @param type
|
|
|
+ * @return
|
|
|
+ */
|
|
|
public List<Map<String, Object>> addListData(List<Map<String, Object>> list,JSONObject data,String stationName,String type){
|
|
|
if(JsonResultUtil.Type.success.value().equals(data.get(JsonResultUtil.CODE_TAG))) {
|
|
|
JSONArray dataArr = new JSONArray();
|
|
|
if("minIo".equals(type)){
|
|
|
-// dataArr = data.getJSONArray("data").getJSONObject(0).getJSONArray("values").getJSONObject(0).getJSONArray("datas");
|
|
|
dataArr = data.getJSONArray("data").getJSONObject(0).getJSONArray("values");
|
|
|
for(Object one :dataArr){
|
|
|
JSONArray oneDaysData = JSONUtil.parseObj(one).getJSONArray("datas");
|
|
@@ -707,6 +719,13 @@ public class ApiServiceImpl implements ApiService {
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param list
|
|
|
+ * @param dataArr
|
|
|
+ * @param stationName
|
|
|
+ * @return
|
|
|
+ */
|
|
|
public List<Map<String, Object>> addOneDay(List<Map<String, Object>> list,JSONArray dataArr,String stationName){
|
|
|
for(Object one :dataArr){
|
|
|
JSONObject oneJson = JSONUtil.parseObj(one);
|
|
@@ -718,4 +737,23 @@ public class ApiServiceImpl implements ApiService {
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 从minIo下载文件后,回传状态
|
|
|
+ * @param stationCode
|
|
|
+ * @param fileName
|
|
|
+ * @param type
|
|
|
+ * @param status
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void postBackMinIoState(String stationCode ,String fileName,String type,String status){
|
|
|
+ Map urlParams = new HashMap(4);
|
|
|
+ urlParams.put("stationCode",stationCode);
|
|
|
+ urlParams.put("forecastFileName",fileName);
|
|
|
+ urlParams.put("type",type);
|
|
|
+ urlParams.put("status",status);
|
|
|
+ log.debug("回传文件状态给新平台,请求参数",JSONUtil.toJsonStr(urlParams));
|
|
|
+ String repose = HttpUtil.post(postBackUrl,urlParams,10000);
|
|
|
+ log.info("回传文件状态给新平台,请求相应 {}", repose);
|
|
|
+ }
|
|
|
}
|