From 6944a924e0865a6bf3f55f34db4abb3adb9cf1ac Mon Sep 17 00:00:00 2001 From: wyb <1977763549@qq.com> Date: Thu, 28 Mar 2024 13:49:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9D=9C=E7=BB=9D=E5=9B=A0=E4=B8=BA?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=B7=AE=E6=9C=89=E4=BA=9B=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=88=B0=EF=BC=8C=E5=9F=BA=E7=A1=80=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=90=8C=E6=AD=A5=E6=AF=8F=E6=AC=A1job=E5=90=8C?= =?UTF-8?q?=E6=AD=A52=E5=A4=A9=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/docus/server/archive/job/PatientInfoSyncJob.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/docus/server/archive/job/PatientInfoSyncJob.java b/src/main/java/com/docus/server/archive/job/PatientInfoSyncJob.java index bf2d0a9..909dec1 100644 --- a/src/main/java/com/docus/server/archive/job/PatientInfoSyncJob.java +++ b/src/main/java/com/docus/server/archive/job/PatientInfoSyncJob.java @@ -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("====================> 佛山三院基础数据同步任务结束 ==================="); }