From 7eb4c98f4d96bebf28685d801e7b978d6c3d251e Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期四, 24 七月 2025 22:23:40 +0800 Subject: [PATCH] 代码提交 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/HNGatherPatArchiveController.java | 38 ++++++++++++++++++++++++++++++++------ 1 files changed, 32 insertions(+), 6 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/HNGatherPatArchiveController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/HNGatherPatArchiveController.java index 6b3a9ed..da5b443 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/HNGatherPatArchiveController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/HNGatherPatArchiveController.java @@ -24,7 +24,13 @@ import javax.servlet.http.HttpServletResponse; import java.lang.reflect.Array; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.Date; import java.util.List; + +import static com.ruoyi.framework.datasource.DynamicDataSourceContextHolder.log; /** * 娌冲崡閲囬泦鎮h�呬俊鎭帴鍙ontroller @@ -45,12 +51,32 @@ //@PreAuthorize("@ss.hasPermi('smartor:patouthosp:list')") @PostMapping("/selectGatherList") @ApiOperation("娌冲崡鏁版嵁閲囬泦") - public Integer selectUserList(@RequestBody SysUser sysUser) { -// Integer integer = ihnGatherPatArchiveService.selectUserList(null); -// Integer deptInt = ihnGatherPatArchiveService.selectDeptList(null); -// Integer icdInt = ihnGatherPatArchiveService.selectIcd10List(null); - Integer integer = ihnGatherPatArchiveService.selectPatMedInhospList(new PatMedInhosp()); - return integer; + public Integer selectUserList(@RequestBody PatMedInhosp patMedInhosp) { +// Integer sd = ihnGatherPatArchiveService.selectDeptList(null); +// Integer su = ihnGatherPatArchiveService.selectUserList(null); +// Integer icd = ihnGatherPatArchiveService.selectIcd10List(null); + + log.info("寮�濮嬫寜澶╁悓姝ョ敤鎴锋暟鎹紝鏃堕棿鑼冨洿: {} 鍒� {}", patMedInhosp.getStartOutHospTime(), patMedInhosp.getEndOutHospTime()); + + LocalDate startDate = patMedInhosp.getStartOutHospTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + LocalDate endDate = patMedInhosp.getEndOutHospTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + + Integer po = null; + // 寰幆澶勭悊姣忎竴澶� + for (LocalDate currentDate = startDate; !currentDate.isAfter(endDate); currentDate = currentDate.plusDays(1)) { + PatMedInhosp dailyCondition = new PatMedInhosp(); + LocalDateTime dayStart = currentDate.atStartOfDay(); + LocalDateTime dayEnd = currentDate.atTime(23, 59, 59); + dailyCondition.setStartOutHospTime(Date.from(dayStart.atZone(ZoneId.systemDefault()).toInstant())); + dailyCondition.setEndOutHospTime(Date.from(dayEnd.atZone(ZoneId.systemDefault()).toInstant())); + Integer pi = ihnGatherPatArchiveService.selectPatMedInhospList(dailyCondition); + + PatMedOuthosp patMedOuthosp = new PatMedOuthosp(); + patMedOuthosp.setBeginTime(Date.from(dayStart.atZone(ZoneId.systemDefault()).toInstant())); + patMedOuthosp.setEndTime(Date.from(dayEnd.atZone(ZoneId.systemDefault()).toInstant())); + po = ihnGatherPatArchiveService.selectPatMedOuthospList(patMedOuthosp); + } + return po; } } -- Gitblit v1.9.3