| | |
| | | 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 if(visitCount != null && visitCount == 1){ |
| | | serviceSubtaskStatistic = getStatisticFirst(serviceSubtaskList, followUpCountStyle); |
| | | }else { |
| | | //格式化为两位小数的百分比 |
| | | 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> needFollowUpInfo = new ArrayList<>(); |
| | | //记录首次待随访详情 |
| | | List<ServiceSubtask> pendingFollowUpInfo = new ArrayList<>(); |
| | | //记录首次随访成功详情 |
| | | List<ServiceSubtask> followUpSuccessInfo = new ArrayList<>(); |
| | | //记录首次随访失败详情 |
| | | List<ServiceSubtask> followUpFailInfo = new ArrayList<>(); |
| | | //记录首次随访人工详情 |
| | | List<ServiceSubtask> manualInfo = new ArrayList<>(); |
| | | //记录首次随访短信详情 |
| | | 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.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.setNeedFollowUp(serviceSubtaskStatistic.getNeedFollowUp() + 1L); |
| | | needFollowUpInfo.add(serviceSubtask); |
| | | } |
| | | //首次待随访 |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 2) { |
| | | serviceSubtaskStatistic.setPendingFollowUp(serviceSubtaskStatistic.getPendingFollowUp() + 1L); |
| | | pendingFollowUpInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访失败(包括随访失败+人工超时) |
| | | if (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate() == 5 || serviceSubtask.getSendstate() == 7)) { |
| | | serviceSubtaskStatistic.setFollowUpFail(serviceSubtaskStatistic.getFollowUpFail() + 1L); |
| | | followUpFailInfo.add(serviceSubtask); |
| | | } |
| | | /** |
| | | * 不同统计方式下不同的随访成功数 参数 followUpCountStyle 控制 |
| | | */ |
| | | if (StringUtils.isNotEmpty(followUpCountStyle) && followUpCountStyle.equals("1")) { |
| | | //首次随访成功 |
| | | if (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate() == 6L)) { |
| | | serviceSubtaskStatistic.setFollowUpSuccess(serviceSubtaskStatistic.getFollowUpSuccess() + 1L); |
| | | followUpSuccessInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访人工 (不统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && serviceSubtask.getPreachform().equals("1")) { |
| | | serviceSubtaskStatistic.setManual(serviceSubtaskStatistic.getManual() + 1L); |
| | | manualInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访短信(不统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && serviceSubtask.getPreachform().equals("4")) { |
| | | serviceSubtaskStatistic.setSms(serviceSubtaskStatistic.getSms() + 1L); |
| | | smsInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访微信(不统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && serviceSubtask.getPreachform().equals("5")) { |
| | | serviceSubtaskStatistic.setWeChat(serviceSubtaskStatistic.getWeChat() + 1L); |
| | | wechatInfo.add(serviceSubtask); |
| | | } |
| | | } else { |
| | | //首次随访成功 - 统计时候加上不执行的,已发送的 |
| | | if (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate().equals(6L) || serviceSubtask.getSendstate().equals(3L) || serviceSubtask.getSendstate().equals(4L))) { |
| | | serviceSubtaskStatistic.setFollowUpSuccess(serviceSubtaskStatistic.getFollowUpSuccess() + 1L); |
| | | followUpSuccessInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访人工 (统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("1")) { |
| | | serviceSubtaskStatistic.setManual(serviceSubtaskStatistic.getManual() + 1L); |
| | | manualInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访短信(统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("4")) { |
| | | serviceSubtaskStatistic.setSms(serviceSubtaskStatistic.getSms() + 1L); |
| | | smsInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访微信(统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("5")) { |
| | | serviceSubtaskStatistic.setWeChat(serviceSubtaskStatistic.getWeChat() + 1L); |
| | | wechatInfo.add(serviceSubtask); |
| | | } |
| | | } |
| | | if (serviceSubtaskStatistic.getNeedFollowUp() > 0) { |
| | | double rate = (double) (serviceSubtaskStatistic.getFollowUpSuccess() + serviceSubtaskStatistic.getFollowUpFail()) / serviceSubtaskStatistic.getNeedFollowUp(); |
| | | serviceSubtaskStatistic.setFollowUpRate(percentFormat.format(rate)); |
| | | } else { |
| | | serviceSubtaskStatistic.setFollowUpRate("0.00%"); |
| | | } |
| | | //结果异常 |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getExcep().equals("1")) { |
| | | serviceSubtaskStatistic.setAbnormal(serviceSubtaskStatistic.getAbnormal() + 1L); |
| | | } |
| | | }//二次出院随访 |
| | | else if (serviceSubtask.getVisitCount() != null && serviceSubtask.getVisitCount() > 1) { |
| | | //再次应随访 |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() != 4) { |
| | | serviceSubtaskStatistic.setNeedFollowUpAgain(serviceSubtaskStatistic.getNeedFollowUpAgain() + 1L); |
| | | needFollowUpAgainInfo.add(serviceSubtask); |
| | | } |
| | | //再次待随访 |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 2) { |
| | | serviceSubtaskStatistic.setPendingFollowUpAgain(serviceSubtaskStatistic.getPendingFollowUpAgain() + 1L); |
| | | pendingFollowUpAgainInfo.add(serviceSubtask); |
| | | } |
| | | //再次随访失败 |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 5) { |
| | | serviceSubtaskStatistic.setFollowUpFailAgain(serviceSubtaskStatistic.getFollowUpFailAgain() + 1L); |
| | | followUpFailAgainInfo.add(serviceSubtask); |
| | | } |
| | | /** |
| | | * 不同统计方式下不同的随访成功数 参数 followUpCountStyle 控制 |
| | | */ |
| | | if (StringUtils.isNotEmpty(followUpCountStyle) && followUpCountStyle.equals("1")) { |
| | | //再次随访成功 |
| | | if (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate() == 1 || serviceSubtask.getSendstate() == 3 || serviceSubtask.getSendstate() == 6)) { |
| | | serviceSubtaskStatistic.setFollowUpSuccessAgain(serviceSubtaskStatistic.getFollowUpSuccessAgain() + 1L); |
| | | followUpSuccessAgainInfo.add(serviceSubtask); |
| | | } |
| | | //再次随访人工(不统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && serviceSubtask.getPreachform().equals("1")) { |
| | | serviceSubtaskStatistic.setManualAgain(serviceSubtaskStatistic.getManualAgain() + 1L); |
| | | manualAgainInfo.add(serviceSubtask); |
| | | } |
| | | //再次随访短信(不统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && serviceSubtask.getPreachform().equals("4")) { |
| | | serviceSubtaskStatistic.setSmsAgain(serviceSubtaskStatistic.getSmsAgain() + 1L); |
| | | smsAgainInfo.add(serviceSubtask); |
| | | } |
| | | //再次随访微信(不统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && serviceSubtask.getPreachform().equals("5")) { |
| | | serviceSubtaskStatistic.setWeChatAgain(serviceSubtaskStatistic.getWeChatAgain() + 1L); |
| | | wechatAgainInfo.add(serviceSubtask); |
| | | } |
| | | } else { |
| | | //再次随访成功 |
| | | if (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate().equals(1L) || serviceSubtask.getSendstate().equals(6L) || serviceSubtask.getSendstate().equals(3L) || serviceSubtask.getSendstate().equals(4L))) { |
| | | serviceSubtaskStatistic.setFollowUpSuccessAgain(serviceSubtaskStatistic.getFollowUpSuccessAgain() + 1L); |
| | | followUpSuccessAgainInfo.add(serviceSubtask); |
| | | } |
| | | //再次随访人工(统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("1")) { |
| | | serviceSubtaskStatistic.setManualAgain(serviceSubtaskStatistic.getManualAgain() + 1L); |
| | | manualAgainInfo.add(serviceSubtask); |
| | | } |
| | | //再次随访短信(统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("4")) { |
| | | serviceSubtaskStatistic.setSmsAgain(serviceSubtaskStatistic.getSmsAgain() + 1L); |
| | | smsAgainInfo.add(serviceSubtask); |
| | | } |
| | | //再次随访微信(统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("5")) { |
| | | serviceSubtaskStatistic.setWeChatAgain(serviceSubtaskStatistic.getWeChatAgain() + 1L); |
| | | wechatAgainInfo.add(serviceSubtask); |
| | | } |
| | | } |
| | | if (serviceSubtaskStatistic.getNeedFollowUp() > 0) { |
| | | double rate = (double) (serviceSubtaskStatistic.getFollowUpSuccessAgain() + serviceSubtaskStatistic.getFollowUpFailAgain()) / serviceSubtaskStatistic.getNeedFollowUpAgain(); |
| | | serviceSubtaskStatistic.setFollowUpRateAgain(percentFormat.format(rate)); |
| | | } else { |
| | | serviceSubtaskStatistic.setFollowUpRateAgain("0.00%"); |
| | | } |
| | | //再次异常 |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getExcep().equals("1")) { |
| | | serviceSubtaskStatistic.setAbnormalAgain(serviceSubtaskStatistic.getAbnormalAgain() + 1L); |
| | | } |
| | | } |
| | | //随访情况 |
| | | 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); |
| | | //记录再次应随访详情 |
| | | serviceSubtaskStatistic.setNeedFollowUpAgainInfo(needFollowUpAgainInfo); |
| | | //记录再次待随访详情 |
| | | serviceSubtaskStatistic.setPendingFollowUpAgainInfo(pendingFollowUpAgainInfo); |
| | | //记录再次随访成功详情 |
| | | serviceSubtaskStatistic.setFollowUpSuccessAgainInfo(followUpSuccessAgainInfo); |
| | | //记录再次随访失败详情 |
| | | serviceSubtaskStatistic.setFollowUpFailAgainInfo(followUpFailAgainInfo); |
| | | //记录再次随访人工详情 |
| | | serviceSubtaskStatistic.setManualAgainInfo(manualAgainInfo); |
| | | //记录再次随访短信详情 |
| | | serviceSubtaskStatistic.setSmsAgainInfo(smsAgainInfo); |
| | | //记录再次随访微信详情 |
| | | serviceSubtaskStatistic.setWechatAgainInfo(wechatAgainInfo); |
| | | return serviceSubtaskStatistic; |
| | | } |
| | | 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(); |
| | | //格式化为两位小数的百分比 |