|
|
|
@ -313,7 +313,12 @@ public class DeviceSyncService {
|
|
|
|
|
public void downloadUdi(int days) {
|
|
|
|
|
for (int i = 1; i <= days; i++) {
|
|
|
|
|
String day = DateUtil.getLastDay(-i);
|
|
|
|
|
downloadUdi(day, "auto");
|
|
|
|
|
DeviceRequest deviceRequest = new DeviceRequest();
|
|
|
|
|
deviceRequest.setRequestType("1"); //按天请求
|
|
|
|
|
deviceRequest.setRangeValue(day);
|
|
|
|
|
deviceRequest.setDownloadType("auto"); //下载方式
|
|
|
|
|
deviceRequest.setDataType("3"); //全量下载
|
|
|
|
|
downloadUdiData(deviceRequest);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -375,13 +380,14 @@ public class DeviceSyncService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
log.info("开始下载国家UDI库数据");
|
|
|
|
|
redisUtil.set("开始下载时间", DateUtil.getDateTime());
|
|
|
|
|
log.info("本次任务开始下载时间:" + DateUtil.getDateTime());
|
|
|
|
|
for (String date : dates) {
|
|
|
|
|
log.info("下载:" + date + " 的数据");
|
|
|
|
|
deviceRequest.setRangeValue(date);
|
|
|
|
|
|
|
|
|
|
//插入日志
|
|
|
|
|
JobLog jobLog = new JobLog();
|
|
|
|
|
jobLog.setDownloadType("manual");
|
|
|
|
|
jobLog.setDownloadType(deviceRequest.getDownloadType());
|
|
|
|
|
jobLog.setDownloadDate(DateUtil.parseDate(date));
|
|
|
|
|
jobLog.setType("info");
|
|
|
|
|
jobLog.setMsg("下载中");
|
|
|
|
@ -421,8 +427,8 @@ public class DeviceSyncService {
|
|
|
|
|
jobLog.setInsertCount(0);
|
|
|
|
|
jobLogService.update(jobLog);
|
|
|
|
|
}
|
|
|
|
|
log.info(date + " 的数据下载完成");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
redisUtil.set("下载结束时间", DateUtil.getDateTime());
|
|
|
|
|
log.info("本次任务下载结束时间:" + DateUtil.getDateTime());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|