| | |
| | | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean hnDataGather(HnDataGatherVO hnDataGatherVO) { |
| | | |
| | | LocalDate startDate = hnDataGatherVO.getStartOutHospTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); |
| | | LocalDate endDate = hnDataGatherVO.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 = 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 = selectPatMedOuthospList(patMedOuthosp); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Integer selectPatMedOuthospList(PatMedOuthosp patMedOuthosp) { |