liusheng
3 天以前 4d537968ac6efb3a5e3d0f8ea5071d5254eb63c3
smartor/src/main/java/com/smartor/service/impl/HNGatherPatArchiveServiceImpl.java
@@ -14,6 +14,9 @@
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.*;
/**
@@ -106,6 +109,30 @@
        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) {