diff --git a/src/main/java/com/docus/server/report/job/ReportJob.java b/src/main/java/com/docus/server/report/job/ReportJob.java index 64b49d5..5b51b51 100644 --- a/src/main/java/com/docus/server/report/job/ReportJob.java +++ b/src/main/java/com/docus/server/report/job/ReportJob.java @@ -237,16 +237,20 @@ public class ReportJob { boolean isPage = true; String orgCode = "4560886379"; Date admissDate = tBasic.getAdmissDate(); - if (admissDate == null) { + Date disDate = tBasic.getDisDate(); + if (admissDate == null || disDate==null) { throw new BaseException("patientId:" + tBasic.getPatientId() + "的入院时间为空"); } - Instant instant = admissDate.toInstant(); ZoneId zoneId = ZoneId.systemDefault(); - LocalDate admissLocalDate = instant.atZone(zoneId).toLocalDate(); - LocalDate endTimeLocalDate = admissLocalDate.plusDays(1); + Instant adminssDateInstant = admissDate.toInstant(); + Instant disDateInstant = disDate.toInstant(); + sdRyReportPatientId="m"+sdRyReportPatientId; + // 开始时间去入院前三天 + LocalDate admissLocalDate = adminssDateInstant.atZone(zoneId).toLocalDate(); LocalDate startTimeLocalDate = admissLocalDate.plusDays(-3); - String startTime = startTimeLocalDate + " 00:00:00"; - String endTime = endTimeLocalDate + " 00:00:00"; + LocalDate disLocalDate = disDateInstant.atZone(zoneId).toLocalDate(); + String startTime = startTimeLocalDate.toString() + " 00:00:00"; + String endTime = disLocalDate.toString() + " 23:59:59"; HashMap map = new HashMap<>(7); map.put("isPage", isPage); @@ -469,16 +473,20 @@ public class ReportJob { boolean isPage = true; String orgCode = "4560886379"; Date admissDate = tBasic.getAdmissDate(); - if (admissDate == null) { + Date disDate = tBasic.getDisDate(); + if (admissDate == null || disDate==null) { throw new BaseException("patientId:" + tBasic.getPatientId() + "的入院时间为空"); } - Instant instant = admissDate.toInstant(); ZoneId zoneId = ZoneId.systemDefault(); - LocalDate admissLocalDate = instant.atZone(zoneId).toLocalDate(); - LocalDate endTimeLocalDate = admissLocalDate.plusDays(1); + Instant adminssDateInstant = admissDate.toInstant(); + Instant disDateInstant = disDate.toInstant(); + sdRyReportPatientId="m"+sdRyReportPatientId; + // 开始时间去入院前三天 + LocalDate admissLocalDate = adminssDateInstant.atZone(zoneId).toLocalDate(); LocalDate startTimeLocalDate = admissLocalDate.plusDays(-3); - String startTime = startTimeLocalDate + " 00:00:00"; - String endTime = endTimeLocalDate + " 00:00:00"; + LocalDate disLocalDate = disDateInstant.atZone(zoneId).toLocalDate(); + String startTime = startTimeLocalDate.toString() + " 00:00:00"; + String endTime = disLocalDate.toString() + " 23:59:59"; HashMap map = new HashMap<>(7); map.put("isPage", isPage);