fix: 杜绝因为时间差有些没有同步到,基础数据同步每次job同步2天的数据

master
wyb 1 year ago
parent f733ee85f8
commit 6944a924e0

@ -22,7 +22,7 @@ public class PatientInfoSyncJob {
private PatientInfoSyncService patientInfoSyncService;
/**
* ,
* ,
*
* @date 2024/3/27 16:27
* @author YongBin Wen
@ -38,7 +38,8 @@ public class PatientInfoSyncJob {
Integer pageSize = syncJobConfig.getPageSize();
Integer pageNumber = syncJobConfig.getPageNumber();
String startDate = syncJobConfig.getStartDate();
String runJobDate = LocalDate.now().toString();
LocalDate runLocalDate = LocalDate.now();
String runJobDate = runLocalDate.toString();
patientInfoSyncService.syncInHospitalData();
while (true) {
@ -48,8 +49,10 @@ public class PatientInfoSyncJob {
}
pageNumber += 1;
}
// 下次同步则开始多同步一天,防止时间差引起同步缺漏 例如 10分钟同步一次 导致 23:50:01 出院未同步到
String nexRunStartDate = runLocalDate.plusDays(-1).toString();
syncJobConfig.setPageNumber(1);
syncJobConfig.setStartDate(runJobDate);
syncJobConfig.setStartDate(nexRunStartDate);
jsonReader.Save(jobConfigPath, jobConfigName, Func.toJson(syncJobConfig));
log.info("====================> 佛山三院基础数据同步任务结束 ===================");
}

Loading…
Cancel
Save