| | |
| | | try { |
| | | List<Map<String, Object>> mapList = objectMapper.readValue(serviceTask.getPreachformDesc(), List.class); |
| | | serviceTaskVO.setPreachformList(mapList); |
| | | if(ObjectUtils.isNotEmpty(serviceTask.getTaskid())){ |
| | | ServiceTaskoper operVo = new ServiceTaskoper(); |
| | | operVo.setTaskId(serviceTask.getTaskid()); |
| | | operVo.setOrgid(serviceTask.getOrgid()); |
| | | List<ServiceTaskoper> serviceTaskopers = serviceTaskoperService.selectServiceTaskoperList(operVo); |
| | | if(ObjectUtils.isNotEmpty(serviceTaskopers)){ |
| | | serviceTaskVO.setOplevelcode(serviceTaskopers.get(0).getOplevelcode()); |
| | | } |
| | | } |
| | | // |
| | | // String result = mapList.stream().map(mapList1 -> mapList1.get("preachform")).map(String::valueOf).collect(Collectors.joining(",")); |
| | | // serviceTaskVO.setPreachform(result); |
| | |
| | | serviceTaskVO.setShowTimeNoon(serviceTask.getShowTimeNoon()); |
| | | serviceTaskVO.setShowTimeNight(serviceTask.getShowTimeNight()); |
| | | serviceTaskVO.setPreachform(serviceTask.getPreachform()); |
| | | if(ObjectUtils.isNotEmpty(serviceTask.getTaskid())){ |
| | | ServiceTaskoper operVo = new ServiceTaskoper(); |
| | | operVo.setTaskId(serviceTask.getTaskid()); |
| | | operVo.setOrgid(serviceTask.getOrgid()); |
| | | List<ServiceTaskoper> serviceTaskopers = serviceTaskoperService.selectServiceTaskoperList(operVo); |
| | | if(ObjectUtils.isNotEmpty(serviceTaskopers)){ |
| | | serviceTaskVO.setOplevelcode(serviceTaskopers.get(0).getOplevelcode()); |
| | | } |
| | | } |
| | | String sendTimeSlot = serviceTask.getSendTimeSlot(); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | try { |
| | |
| | | // String result = resultList.stream().map(mapList1 -> mapList1.get("preachform")).map(String::valueOf).collect(Collectors.joining(",")); |
| | | // serviceTaskVO.setPreachform(result); |
| | | } |
| | | |
| | | serviceTaskVO.setPatTaskRelevances(patTaskRelevances); |
| | | return serviceTaskVO; |
| | | } |
| | |
| | | if (CollectionUtils.isEmpty(serviceSubtaskList)) { |
| | | continue; |
| | | } |
| | | ServiceSubtaskStatistic statistic = getStatistic(serviceSubtaskList, serviceSubtaskCountReq.getFollowUpCountStyle()); |
| | | ServiceSubtaskStatistic statistic = getStatistic(serviceSubtaskList, serviceSubtaskCountReq.getFollowUpCountStyle(), serviceSubtaskCountReq.getVisitCount()); |
| | | if (ObjectUtils.isNotEmpty(jsRates)) { |
| | | Map<String, Object> jsRateMap = jsRates.get(collectKey); |
| | | BigDecimal jsRate = new BigDecimal("0"); |
| | |
| | | ssRate.setOrgid(serviceSubtaskCountReq.getOrgid()); |
| | | ssRate.setStarttime(serviceSubtaskCountReq.getStartTime()); |
| | | ssRate.setEndtime(serviceSubtaskCountReq.getEndTime()); |
| | | ssRate.setVisitCount(serviceSubtaskCountReq.getVisitCount()); |
| | | if (serviceSubtaskCountReq.getEndTime() != null && new Date().before(serviceSubtaskCountReq.getEndTime())) { |
| | | ssRate.setEndtime(new Date()); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | private ServiceSubtaskStatistic getStatistic(List<ServiceSubtask> serviceSubtaskList, String followUpCountStyle) { |
| | | private ServiceSubtaskStatistic getStatistic(List<ServiceSubtask> serviceSubtaskList, String followUpCountStyle, Integer visitCount) { |
| | | ServiceSubtaskStatistic serviceSubtaskStatistic = new ServiceSubtaskStatistic(); |
| | | |
| | | if (visitCount != null && visitCount > 1) { |
| | | serviceSubtaskStatistic = getStatisticAgain(serviceSubtaskList, followUpCountStyle); |
| | | }else { |
| | | serviceSubtaskStatistic = getStatisticFirst(serviceSubtaskList, followUpCountStyle); |
| | | } |
| | | return serviceSubtaskStatistic; |
| | | } |
| | | |
| | | /** |
| | | * 首次随访统计 |
| | | * @param serviceSubtaskList |
| | | * @param followUpCountStyle |
| | | * @return |
| | | */ |
| | | private ServiceSubtaskStatistic getStatisticFirst(List<ServiceSubtask> serviceSubtaskList, String followUpCountStyle) { |
| | | ServiceSubtaskStatistic serviceSubtaskStatistic = new ServiceSubtaskStatistic(); |
| | | //格式化为两位小数的百分比 |
| | | DecimalFormat percentFormat = new DecimalFormat("##.##%"); |
| | |
| | | List<ServiceSubtask> smsInfo = new ArrayList<>(); |
| | | //记录首次随访微信详情 |
| | | List<ServiceSubtask> wechatInfo = new ArrayList<>(); |
| | | |
| | | //记录再次应随访详情 |
| | | List<ServiceSubtask> needFollowUpAgainInfo = new ArrayList<>(); |
| | | //记录再次待随访详情 |
| | | List<ServiceSubtask> pendingFollowUpAgainInfo = new ArrayList<>(); |
| | | //记录再次随访成功详情 |
| | | List<ServiceSubtask> followUpSuccessAgainInfo = new ArrayList<>(); |
| | | //记录再次随访失败详情 |
| | | List<ServiceSubtask> followUpFailAgainInfo = new ArrayList<>(); |
| | | //记录首次随访人工详情 |
| | | List<ServiceSubtask> manualAgainInfo = new ArrayList<>(); |
| | | //记录首次随访短信详情 |
| | | List<ServiceSubtask> smsAgainInfo = new ArrayList<>(); |
| | | //记录首次随访微信详情 |
| | | List<ServiceSubtask> wechatAgainInfo = new ArrayList<>(); |
| | | |
| | | for (ServiceSubtask serviceSubtask : serviceSubtaskList) { |
| | | //无需随访人次 |
| | |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getExcep().equals("1")) { |
| | | serviceSubtaskStatistic.setAbnormal(serviceSubtaskStatistic.getAbnormal() + 1L); |
| | | } |
| | | }//二次出院随访 |
| | | else if (serviceSubtask.getVisitCount() != null && serviceSubtask.getVisitCount() > 1) { |
| | | } |
| | | //随访情况 |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 1) { |
| | | serviceSubtaskStatistic.setTaskSituation1(serviceSubtaskStatistic.getTaskSituation1() + 1); |
| | | } |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 2) { |
| | | serviceSubtaskStatistic.setTaskSituation2(serviceSubtaskStatistic.getTaskSituation2() + 1); |
| | | } |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 3) { |
| | | serviceSubtaskStatistic.setTaskSituation3(serviceSubtaskStatistic.getTaskSituation3() + 1); |
| | | } |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 4) { |
| | | serviceSubtaskStatistic.setTaskSituation4(serviceSubtaskStatistic.getTaskSituation4() + 1); |
| | | } |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 5) { |
| | | serviceSubtaskStatistic.setTaskSituation5(serviceSubtaskStatistic.getTaskSituation5() + 1); |
| | | } |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 7) { |
| | | serviceSubtaskStatistic.setTaskSituation6(serviceSubtaskStatistic.getTaskSituation6() + 1); |
| | | } |
| | | } |
| | | serviceSubtaskStatistic.setFilterCountList(filterServiceSubtasks); |
| | | //记录首次应随访详情 |
| | | serviceSubtaskStatistic.setNeedFollowUpInfo(needFollowUpInfo); |
| | | //记录首次待随访详情 |
| | | serviceSubtaskStatistic.setPendingFollowUpInfo(pendingFollowUpInfo); |
| | | //记录首次随访成功详情 |
| | | serviceSubtaskStatistic.setFollowUpSuccessInfo(followUpSuccessInfo); |
| | | //记录首次随访失败详情 |
| | | serviceSubtaskStatistic.setFollowUpFailInfo(followUpFailInfo); |
| | | //记录首次随访人工详情 |
| | | serviceSubtaskStatistic.setManualInfo(manualInfo); |
| | | //记录首次随访短信详情 |
| | | serviceSubtaskStatistic.setSmsInfo(smsInfo); |
| | | //记录首次随访微信详情 |
| | | serviceSubtaskStatistic.setWechatInfo(wechatInfo); |
| | | return serviceSubtaskStatistic; |
| | | } |
| | | |
| | | /** |
| | | * 再次随访统计 |
| | | * @param serviceSubtaskList |
| | | * @param followUpCountStyle |
| | | * @return |
| | | */ |
| | | private ServiceSubtaskStatistic getStatisticAgain(List<ServiceSubtask> serviceSubtaskList, String followUpCountStyle) { |
| | | ServiceSubtaskStatistic serviceSubtaskStatistic = new ServiceSubtaskStatistic(); |
| | | //格式化为两位小数的百分比 |
| | | DecimalFormat percentFormat = new DecimalFormat("##.##%"); |
| | | serviceSubtaskStatistic.setDeptname(serviceSubtaskList.get(0).getDeptname()); |
| | | serviceSubtaskStatistic.setDeptcode(serviceSubtaskList.get(0).getDeptcode()); |
| | | serviceSubtaskStatistic.setLeavehospitaldistrictname(serviceSubtaskList.get(0).getLeavehospitaldistrictname()); |
| | | serviceSubtaskStatistic.setLeavehospitaldistrictcode(serviceSubtaskList.get(0).getLeavehospitaldistrictcode()); |
| | | serviceSubtaskStatistic.setDrcode(serviceSubtaskList.get(0).getDrcode()); |
| | | serviceSubtaskStatistic.setDrname(serviceSubtaskList.get(0).getDrname()); |
| | | //出院人次 |
| | | serviceSubtaskStatistic.setDischargeCount(serviceSubtaskList.size()); |
| | | //记录过滤患者详情 |
| | | List<ServiceSubtask> filterServiceSubtasks = new ArrayList<>(); |
| | | |
| | | //记录再次应随访详情 |
| | | List<ServiceSubtask> needFollowUpAgainInfo = new ArrayList<>(); |
| | | //记录再次待随访详情 |
| | | List<ServiceSubtask> pendingFollowUpAgainInfo = new ArrayList<>(); |
| | | //记录再次随访成功详情 |
| | | List<ServiceSubtask> followUpSuccessAgainInfo = new ArrayList<>(); |
| | | //记录再次随访失败详情 |
| | | List<ServiceSubtask> followUpFailAgainInfo = new ArrayList<>(); |
| | | //记录再次随访人工详情 |
| | | List<ServiceSubtask> manualAgainInfo = new ArrayList<>(); |
| | | //记录再次随访短信详情 |
| | | List<ServiceSubtask> smsAgainInfo = new ArrayList<>(); |
| | | //记录再次随访微信详情 |
| | | List<ServiceSubtask> wechatAgainInfo = new ArrayList<>(); |
| | | |
| | | for (ServiceSubtask serviceSubtask : serviceSubtaskList) { |
| | | //无需随访人次 |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 4) { |
| | | serviceSubtaskStatistic.setNonFollowUp(serviceSubtaskStatistic.getNonFollowUp() + 1L); |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 6) { |
| | | serviceSubtaskStatistic.setFilterCount(serviceSubtaskStatistic.getFilterCount() + 1L); |
| | | filterServiceSubtasks.add(serviceSubtask); |
| | | } |
| | | } |
| | | //应随访人次 |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() != 4) { |
| | | serviceSubtaskStatistic.setFollowUpNeeded(serviceSubtaskStatistic.getFollowUpNeeded() + 1L); |
| | | } |
| | | |
| | | //再次出院随访 |
| | | if (serviceSubtask.getVisitCount() != null && serviceSubtask.getVisitCount() > 1) { |
| | | //再次应随访 |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() != 4) { |
| | | serviceSubtaskStatistic.setNeedFollowUpAgain(serviceSubtaskStatistic.getNeedFollowUpAgain() + 1L); |
| | |
| | | } |
| | | } |
| | | serviceSubtaskStatistic.setFilterCountList(filterServiceSubtasks); |
| | | //记录首次应随访详情 |
| | | serviceSubtaskStatistic.setNeedFollowUpInfo(needFollowUpInfo); |
| | | //记录首次待随访详情 |
| | | serviceSubtaskStatistic.setPendingFollowUpInfo(pendingFollowUpInfo); |
| | | //记录首次随访成功详情 |
| | | serviceSubtaskStatistic.setFollowUpSuccessInfo(followUpSuccessInfo); |
| | | //记录首次随访失败详情 |
| | | serviceSubtaskStatistic.setFollowUpFailInfo(followUpFailInfo); |
| | | //记录首次随访人工详情 |
| | | serviceSubtaskStatistic.setManualInfo(manualInfo); |
| | | //记录首次随访短信详情 |
| | | serviceSubtaskStatistic.setSmsInfo(smsInfo); |
| | | //记录首次随访微信详情 |
| | | serviceSubtaskStatistic.setWechatInfo(wechatInfo); |
| | | //记录再次应随访详情 |
| | | serviceSubtaskStatistic.setNeedFollowUpAgainInfo(needFollowUpAgainInfo); |
| | | //记录再次待随访详情 |
| | |
| | | return serviceSubtaskStatistic; |
| | | } |
| | | |
| | | |
| | | private ServiceSubtaskStatistic getStatisticJoy(List<ServiceSubtask> serviceSubtaskList, List<ServiceSubtaskCount> joySubCount) { |
| | | ServiceSubtaskStatistic serviceSubtaskStatistic = new ServiceSubtaskStatistic(); |
| | | //格式化为两位小数的百分比 |