陈昶聿
2 小时以前 b9c9b1265e35eeeefbc1c7abe82a68b43ce59e9f
smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java
@@ -51,6 +51,8 @@
    @Autowired
    private PatArchiveMapper patArchiveMapper;
    @Autowired
    private ServiceTaskmedicalMapper serviceTaskmedicalMapper;
    /**
@@ -76,8 +78,8 @@
        PatMedOuthospQueryReq patMedOuthospQueryReq = DtoConversionUtils.sourceToTarget(patMedOuthosp, PatMedOuthospQueryReq.class);
        patMedOuthospQueryReq.setBeginAdmitdate(patMedOuthosp.getBeginTime());
        patMedOuthospQueryReq.setEndAdmitdate(patMedOuthosp.getEndTime());
        if(!CollectionUtils.isEmpty(patMedOuthosp.getDeptcodes())) {
            String result = String.join(",",   patMedOuthosp.getDeptcodes());
        if (!CollectionUtils.isEmpty(patMedOuthosp.getDeptcodes())) {
            String result = String.join(",", patMedOuthosp.getDeptcodes());
            patMedOuthospQueryReq.setDeptcode(result);
        }
@@ -85,7 +87,7 @@
        if (patMedOuthosp.getPageNum() != null) {
            for (PatMedOuthosp patMedOuthosp1 : patMedOuthospQueryResps) {
                PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patMedOuthosp1.getPatid());
                if (patArchive.getBirthdate() != null) {
                if (ObjectUtils.isNotEmpty(patArchive) && patArchive.getBirthdate() != null) {
                    Map<String, String> map = calculateAge(patArchive.getBirthdate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), LocalDate.now());
                    patArchive.setAge(ObjectUtils.isNotEmpty(map.get("age")) ? Long.valueOf(map.get("age")) : null);
                    patArchive.setAgeUnit(map.get("ageUnit"));
@@ -309,7 +311,7 @@
        PatMedOuthospQueryReq req = new PatMedOuthospQueryReq();
        String deptcodes = CollectionUtils.isEmpty(patMedReq.getDeptcodeList()) ? null : String.join(",", patMedReq.getDeptcodeList());
        req.setBeginAdmitdate(patMedReq.getStartDate());
        req.setEndAdmitdate(DateUtils.addDays(patMedReq.getEndDate(),1));
        req.setEndAdmitdate(DateUtils.addDays(patMedReq.getEndDate(), 1));
        req.setDeptcode(deptcodes);
        req.setOrgid(patMedReq.getOrgid());
//        req.setCampusid(patMedReq.getCampusid());
@@ -537,7 +539,7 @@
     * @return
     */
    @Override
    public Integer followUpAgainByPatMedOuthosp(PatMedOuthosp patMedOuthosp,Date adminDate, Integer visitTimeNum){
    public Integer followUpAgainByPatMedOuthosp(PatMedOuthosp patMedOuthosp, Date adminDate, Integer visitTimeNum) {
        int hoursToAdd = visitTimeNum * 24;
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(adminDate);
@@ -555,7 +557,7 @@
        serviceSubtaskEntity0.setDeptcode(deptcode);
        serviceSubtaskEntity0.setSort(0);
        List<ServiceSubtask> serviceSubtaskList0 = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskEntity0);
        if(!CollectionUtils.isEmpty(serviceSubtaskList0)){
        if (!CollectionUtils.isEmpty(serviceSubtaskList0)) {
            ServiceSubtask serviceSubtask0 = serviceSubtaskList0.get(0);
            serviceSubtask0.setSendstate(6L);
            serviceSubtask0.setUpdateTime(new Date());
@@ -570,7 +572,7 @@
            serviceSubtask1.setVisitTime(newDate);
            serviceSubtask1.setLongSendTime(newDate);
            i = serviceSubtaskMapper.insertServiceSubtask(serviceSubtask1);
        }else {
        } else {
            //查看已完成的任务
//            ServiceSubtaskEntity serviceSubtaskEntity = new ServiceSubtaskEntity();
//            serviceSubtaskEntity0.setOrgid(patMedOuthosp.getOrgid());