| | |
| | | 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()); |
| | | patMedOuthospQueryReq.setDeptcode(result); |
| | | } |
| | | |
| | | List<PatMedOuthosp> patMedOuthospQueryResps = patMedOuthospMapper.callSpQueryOuthosp(patMedOuthospQueryReq); |
| | | if (patMedOuthosp.getPageNum() != null) { |
| | | for (PatMedOuthosp patMedOuthosp1 : patMedOuthospQueryResps) { |
| | |
| | | } |
| | | |
| | | //封装serviceSubtask |
| | | private ServiceSubtask boxedServiceSubtask(ServiceTask serviceTask, PatMedOuthosp patMedOuthosp, PatArchive patArchive) { |
| | | @Override |
| | | public ServiceSubtask boxedServiceSubtask(ServiceTask serviceTask, PatMedOuthosp patMedOuthosp, PatArchive patArchive) { |
| | | ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(serviceTask, ServiceSubtask.class); |
| | | serviceSubtask.setTaskid(serviceTask.getTaskid()); |
| | | if (StringUtils.isNotEmpty(serviceTask.getLibtemplateid())) |
| | |
| | | return serviceSubtask; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param patMedOuthosp |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Integer followUpAgainByPatMedOuthosp(PatMedOuthosp patMedOuthosp,Date adminDate, Integer visitTimeNum){ |
| | | int hoursToAdd = visitTimeNum * 24; |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(adminDate); |
| | | calendar.add(Calendar.HOUR_OF_DAY, hoursToAdd); |
| | | Date newDate = calendar.getTime(); |
| | | |
| | | Integer i = 0; |
| | | String deptcode = patMedOuthosp.getDeptcode(); |
| | | Long patid = patMedOuthosp.getPatid(); |
| | | //查看有无进行中的任务 |
| | | ServiceSubtaskEntity serviceSubtaskEntity0 = new ServiceSubtaskEntity(); |
| | | serviceSubtaskEntity0.setOrgid(patMedOuthosp.getOrgid()); |
| | | serviceSubtaskEntity0.setSendstates(new ArrayList<>(Arrays.asList(1L, 2L, 3L, 7L))); |
| | | serviceSubtaskEntity0.setPatid(patid); |
| | | serviceSubtaskEntity0.setDeptcode(deptcode); |
| | | serviceSubtaskEntity0.setSort(0); |
| | | List<ServiceSubtask> serviceSubtaskList0 = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskEntity0); |
| | | if(!CollectionUtils.isEmpty(serviceSubtaskList0)){ |
| | | ServiceSubtask serviceSubtask0 = serviceSubtaskList0.get(0); |
| | | serviceSubtask0.setSendstate(6L); |
| | | serviceSubtask0.setUpdateTime(new Date()); |
| | | serviceSubtask0.setFinishtime(adminDate); |
| | | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask0); |
| | | |
| | | ServiceSubtask serviceSubtask1 = serviceSubtaskList0.get(0); |
| | | serviceSubtask1.setSendstate(2L); |
| | | serviceSubtask1.setCreateTime(new Date()); |
| | | serviceSubtask1.setUpdateTime(new Date()); |
| | | |
| | | serviceSubtask1.setVisitTime(newDate); |
| | | serviceSubtask1.setLongSendTime(newDate); |
| | | i = serviceSubtaskMapper.insertServiceSubtask(serviceSubtask1); |
| | | }else { |
| | | //查看已完成的任务 |
| | | // ServiceSubtaskEntity serviceSubtaskEntity = new ServiceSubtaskEntity(); |
| | | // serviceSubtaskEntity0.setOrgid(patMedOuthosp.getOrgid()); |
| | | // serviceSubtaskEntity.setSendstates(new ArrayList<>(Arrays.asList(6L))); |
| | | // serviceSubtaskEntity.setPatid(patid); |
| | | // serviceSubtaskEntity.setDeptcode(deptcode); |
| | | // serviceSubtaskEntity.setSort(0); |
| | | // List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskEntity); |
| | | // if(!CollectionUtils.isEmpty(serviceSubtaskList)){ |
| | | // ServiceSubtask serviceSubtask = serviceSubtaskList.get(0); |
| | | // serviceSubtask.setSendstate(2L); |
| | | // serviceSubtask.setCreateTime(new Date()); |
| | | // serviceSubtask.setUpdateTime(new Date()); |
| | | // |
| | | // serviceSubtask.setVisitTime(newDate); |
| | | // serviceSubtask.setLongSendTime(newDate); |
| | | // i = serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); |
| | | // } |
| | | } |
| | | return i; |
| | | } |
| | | |
| | | private Date addDays(Date date, Integer days) { |
| | | if (days == null) { |
| | | days = 1; |