| | |
| | | if (serviceSubtaskCountReq.getLeavehospitaldistrictcodes() != null && serviceSubtaskCountReq.getLeavehospitaldistrictcodes().size() > 0) { |
| | | if (serviceSubtaskCountReq.getDrcode() != null && !serviceSubtaskCountReq.getDrcode().isEmpty()) { |
| | | collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDrname()).orElse("Unknown"))); |
| | | |
| | | } else { |
| | | collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getLeavehospitaldistrictname()).orElse("Unknown"))); |
| | | } |
| | |
| | | serviceSubtaskStatistic.setDrname(serviceSubtaskList.get(0).getDrname()); |
| | | //出院人次 |
| | | serviceSubtaskStatistic.setDischargeCount(serviceSubtaskList.size()); |
| | | //出院人次详情 |
| | | serviceSubtaskStatistic.setDischargeCountInfo(serviceSubtaskList); |
| | | //无需随访详情 |
| | | List<ServiceSubtask> nonFollowUpInfo = new ArrayList<>(); |
| | | //记录过滤患者详情 |
| | | 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> voiceInfo = 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> voiceAgainInfo = new ArrayList<>(); |
| | | //记录再次随访短信详情 |
| | | List<ServiceSubtask> smsAgainInfo = new ArrayList<>(); |
| | | //记录再次随访微信详情 |
| | | List<ServiceSubtask> wechatAgainInfo = new ArrayList<>(); |
| | | |
| | | //记录随访情况详情 |
| | | List<ServiceSubtask> taskSituation1Info = new ArrayList<>(); |
| | | List<ServiceSubtask> taskSituation2Info = new ArrayList<>(); |
| | | List<ServiceSubtask> taskSituation3Info = new ArrayList<>(); |
| | | List<ServiceSubtask> taskSituation4Info = new ArrayList<>(); |
| | | List<ServiceSubtask> taskSituation5Info = new ArrayList<>(); |
| | | List<ServiceSubtask> taskSituation6Info = new ArrayList<>(); |
| | | |
| | | for (ServiceSubtask serviceSubtask : serviceSubtaskList) { |
| | | //无需随访人次 |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 4) { |
| | | serviceSubtaskStatistic.setNonFollowUp(serviceSubtaskStatistic.getNonFollowUp() + 1L); |
| | | nonFollowUpInfo.add(serviceSubtask); |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 6) { |
| | | serviceSubtaskStatistic.setFilterCount(serviceSubtaskStatistic.getFilterCount() + 1L); |
| | | filterServiceSubtasks.add(serviceSubtask); |
| | | } |
| | | } |
| | | //应随访人次 |
| | |
| | | //首次应随访 |
| | | 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 (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate() == 6L)) { |
| | | serviceSubtaskStatistic.setFollowUpSuccess(serviceSubtaskStatistic.getFollowUpSuccess() + 1L); |
| | | followUpSuccessInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访人工 (不统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("1")) { |
| | | serviceSubtaskStatistic.setManual(serviceSubtaskStatistic.getManual() + 1L); |
| | | manualInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访语音 (不统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("3")) { |
| | | serviceSubtaskStatistic.setVoice(serviceSubtaskStatistic.getVoice() + 1L); |
| | | voiceInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访短信(不统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("4")) { |
| | | serviceSubtaskStatistic.setSms(serviceSubtaskStatistic.getSms() + 1L); |
| | | smsInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访微信(不统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().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 && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("1")) { |
| | | serviceSubtaskStatistic.setManual(serviceSubtaskStatistic.getManual() + 1L); |
| | | manualInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访语音 (统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("3")) { |
| | | serviceSubtaskStatistic.setVoice(serviceSubtaskStatistic.getVoice() + 1L); |
| | | voiceInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访短信(统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("4")) { |
| | | serviceSubtaskStatistic.setSms(serviceSubtaskStatistic.getSms() + 1L); |
| | | smsInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访微信(统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("5")) { |
| | | serviceSubtaskStatistic.setWeChat(serviceSubtaskStatistic.getWeChat() + 1L); |
| | | wechatInfo.add(serviceSubtask); |
| | | } |
| | | } |
| | | if (serviceSubtaskStatistic.getNeedFollowUp() > 0) { |
| | |
| | | //再次应随访 |
| | | 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 (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) && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("1")) { |
| | | serviceSubtaskStatistic.setManualAgain(serviceSubtaskStatistic.getManualAgain() + 1L); |
| | | manualAgainInfo.add(serviceSubtask); |
| | | } |
| | | //再次随访语音(不统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("3")) { |
| | | serviceSubtaskStatistic.setVoiceAgain(serviceSubtaskStatistic.getVoiceAgain() + 1L); |
| | | voiceAgainInfo.add(serviceSubtask); |
| | | } |
| | | //再次随访短信(不统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("4")) { |
| | | serviceSubtaskStatistic.setSmsAgain(serviceSubtaskStatistic.getSmsAgain() + 1L); |
| | | smsAgainInfo.add(serviceSubtask); |
| | | } |
| | | //再次随访微信(不统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().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 && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("1")) { |
| | | serviceSubtaskStatistic.setManualAgain(serviceSubtaskStatistic.getManualAgain() + 1L); |
| | | manualAgainInfo.add(serviceSubtask); |
| | | } |
| | | //再次随访语音(统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("3")) { |
| | | serviceSubtaskStatistic.setVoiceAgain(serviceSubtaskStatistic.getVoiceAgain() + 1L); |
| | | voiceAgainInfo.add(serviceSubtask); |
| | | } |
| | | //再次随访短信(统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("4")) { |
| | | serviceSubtaskStatistic.setSmsAgain(serviceSubtaskStatistic.getSmsAgain() + 1L); |
| | | smsAgainInfo.add(serviceSubtask); |
| | | } |
| | | //再次随访微信(统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("5")) { |
| | | serviceSubtaskStatistic.setWeChatAgain(serviceSubtaskStatistic.getWeChatAgain() + 1L); |
| | | wechatAgainInfo.add(serviceSubtask); |
| | | } |
| | | } |
| | | if (serviceSubtaskStatistic.getNeedFollowUp() > 0) { |
| | |
| | | //随访情况 |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 1) { |
| | | serviceSubtaskStatistic.setTaskSituation1(serviceSubtaskStatistic.getTaskSituation1() + 1); |
| | | taskSituation1Info.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 2) { |
| | | serviceSubtaskStatistic.setTaskSituation2(serviceSubtaskStatistic.getTaskSituation2() + 1); |
| | | taskSituation2Info.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 3) { |
| | | serviceSubtaskStatistic.setTaskSituation3(serviceSubtaskStatistic.getTaskSituation3() + 1); |
| | | taskSituation3Info.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 4) { |
| | | serviceSubtaskStatistic.setTaskSituation4(serviceSubtaskStatistic.getTaskSituation4() + 1); |
| | | taskSituation4Info.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 5) { |
| | | serviceSubtaskStatistic.setTaskSituation5(serviceSubtaskStatistic.getTaskSituation5() + 1); |
| | | taskSituation5Info.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 7) { |
| | | serviceSubtaskStatistic.setTaskSituation6(serviceSubtaskStatistic.getTaskSituation6() + 1); |
| | | taskSituation6Info.add(serviceSubtask); |
| | | } |
| | | } |
| | | serviceSubtaskStatistic.setFilterCountList(filterServiceSubtasks); |
| | | //记录无需随访详情 |
| | | serviceSubtaskStatistic.setNonFollowUpInfo(nonFollowUpInfo); |
| | | //记录首次应随访详情 |
| | | serviceSubtaskStatistic.setNeedFollowUpInfo(needFollowUpInfo); |
| | | //记录首次待随访详情 |
| | | serviceSubtaskStatistic.setPendingFollowUpInfo(pendingFollowUpInfo); |
| | | //记录首次随访成功详情 |
| | | serviceSubtaskStatistic.setFollowUpSuccessInfo(followUpSuccessInfo); |
| | | //记录首次随访失败详情 |
| | | serviceSubtaskStatistic.setFollowUpFailInfo(followUpFailInfo); |
| | | //记录首次随访人工详情 |
| | | serviceSubtaskStatistic.setManualInfo(manualInfo); |
| | | //记录首次随访语音详情 |
| | | serviceSubtaskStatistic.setVoiceInfo(voiceInfo); |
| | | //记录首次随访短信详情 |
| | | serviceSubtaskStatistic.setSmsInfo(smsInfo); |
| | | //记录首次随访微信详情 |
| | | serviceSubtaskStatistic.setWechatInfo(wechatInfo); |
| | | //记录再次应随访详情 |
| | | serviceSubtaskStatistic.setNeedFollowUpAgainInfo(needFollowUpAgainInfo); |
| | | //记录再次待随访详情 |
| | | serviceSubtaskStatistic.setPendingFollowUpAgainInfo(pendingFollowUpAgainInfo); |
| | | //记录再次随访成功详情 |
| | | serviceSubtaskStatistic.setFollowUpSuccessAgainInfo(followUpSuccessAgainInfo); |
| | | //记录再次随访失败详情 |
| | | serviceSubtaskStatistic.setFollowUpFailAgainInfo(followUpFailAgainInfo); |
| | | //记录再次随访人工详情 |
| | | serviceSubtaskStatistic.setManualAgainInfo(manualAgainInfo); |
| | | //记录再次随访语音详情 |
| | | serviceSubtaskStatistic.setVoiceAgainInfo(voiceAgainInfo); |
| | | //记录再次随访短信详情 |
| | | serviceSubtaskStatistic.setSmsAgainInfo(smsAgainInfo); |
| | | //记录再次随访微信详情 |
| | | serviceSubtaskStatistic.setWechatAgainInfo(wechatAgainInfo); |
| | | |
| | | //随访情况详情 |
| | | serviceSubtaskStatistic.setTaskSituation1Info(taskSituation1Info); |
| | | serviceSubtaskStatistic.setTaskSituation2Info(taskSituation2Info); |
| | | serviceSubtaskStatistic.setTaskSituation3Info(taskSituation3Info); |
| | | serviceSubtaskStatistic.setTaskSituation4Info(taskSituation4Info); |
| | | serviceSubtaskStatistic.setTaskSituation5Info(taskSituation5Info); |
| | | serviceSubtaskStatistic.setTaskSituation6Info(taskSituation6Info); |
| | | return serviceSubtaskStatistic; |
| | | } |
| | | return serviceSubtaskStatistic; |
| | |
| | | serviceSubtaskStatistic.setDrname(serviceSubtaskList.get(0).getDrname()); |
| | | //出院人次 |
| | | serviceSubtaskStatistic.setDischargeCount(serviceSubtaskList.size()); |
| | | //出院人次详情 |
| | | serviceSubtaskStatistic.setDischargeCountInfo(serviceSubtaskList); |
| | | //无需随访详情 |
| | | List<ServiceSubtask> nonFollowUpInfo = new ArrayList<>(); |
| | | //记录过滤患者详情 |
| | | 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> voiceInfo = new ArrayList<>(); |
| | | //记录首次随访短信详情 |
| | | List<ServiceSubtask> smsInfo = new ArrayList<>(); |
| | | //记录首次随访微信详情 |
| | | List<ServiceSubtask> wechatInfo = new ArrayList<>(); |
| | | |
| | | //记录随访情况详情 |
| | | List<ServiceSubtask> taskSituation1Info = new ArrayList<>(); |
| | | List<ServiceSubtask> taskSituation2Info = new ArrayList<>(); |
| | | List<ServiceSubtask> taskSituation3Info = new ArrayList<>(); |
| | | List<ServiceSubtask> taskSituation4Info = new ArrayList<>(); |
| | | List<ServiceSubtask> taskSituation5Info = new ArrayList<>(); |
| | | List<ServiceSubtask> taskSituation6Info = new ArrayList<>(); |
| | | |
| | | for (ServiceSubtask serviceSubtask : serviceSubtaskList) { |
| | | //无需随访人次 |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 4) { |
| | | serviceSubtaskStatistic.setNonFollowUp(serviceSubtaskStatistic.getNonFollowUp() + 1L); |
| | | nonFollowUpInfo.add(serviceSubtask); |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 6) { |
| | | serviceSubtaskStatistic.setFilterCount(serviceSubtaskStatistic.getFilterCount() + 1L); |
| | | filterServiceSubtasks.add(serviceSubtask); |
| | | } |
| | | } |
| | | //应随访人次 |
| | |
| | | //首次应随访 |
| | | 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 (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate() == 6L)) { |
| | | serviceSubtaskStatistic.setFollowUpSuccess(serviceSubtaskStatistic.getFollowUpSuccess() + 1L); |
| | | followUpSuccessInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访人工 (不统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("1")) { |
| | | serviceSubtaskStatistic.setManual(serviceSubtaskStatistic.getManual() + 1L); |
| | | manualInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访语音 (不统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("3")) { |
| | | serviceSubtaskStatistic.setVoice(serviceSubtaskStatistic.getVoice() + 1L); |
| | | voiceInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访短信(不统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("4")) { |
| | | serviceSubtaskStatistic.setSms(serviceSubtaskStatistic.getSms() + 1L); |
| | | smsInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访微信(不统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().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 && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("1")) { |
| | | serviceSubtaskStatistic.setManual(serviceSubtaskStatistic.getManual() + 1L); |
| | | manualInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访语音 (统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("3")) { |
| | | serviceSubtaskStatistic.setVoice(serviceSubtaskStatistic.getVoice() + 1L); |
| | | voiceInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访短信(统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("4")) { |
| | | serviceSubtaskStatistic.setSms(serviceSubtaskStatistic.getSms() + 1L); |
| | | smsInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访微信(统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("5")) { |
| | | serviceSubtaskStatistic.setWeChat(serviceSubtaskStatistic.getWeChat() + 1L); |
| | | wechatInfo.add(serviceSubtask); |
| | | } |
| | | } |
| | | if (serviceSubtaskStatistic.getNeedFollowUp() > 0) { |
| | |
| | | //随访情况 |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 1) { |
| | | serviceSubtaskStatistic.setTaskSituation1(serviceSubtaskStatistic.getTaskSituation1() + 1); |
| | | taskSituation1Info.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 2) { |
| | | serviceSubtaskStatistic.setTaskSituation2(serviceSubtaskStatistic.getTaskSituation2() + 1); |
| | | taskSituation2Info.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 3) { |
| | | serviceSubtaskStatistic.setTaskSituation3(serviceSubtaskStatistic.getTaskSituation3() + 1); |
| | | taskSituation3Info.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 4) { |
| | | serviceSubtaskStatistic.setTaskSituation4(serviceSubtaskStatistic.getTaskSituation4() + 1); |
| | | taskSituation4Info.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 5) { |
| | | serviceSubtaskStatistic.setTaskSituation5(serviceSubtaskStatistic.getTaskSituation5() + 1); |
| | | taskSituation5Info.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 7) { |
| | | serviceSubtaskStatistic.setTaskSituation6(serviceSubtaskStatistic.getTaskSituation6() + 1); |
| | | taskSituation6Info.add(serviceSubtask); |
| | | } |
| | | } |
| | | serviceSubtaskStatistic.setFilterCountList(filterServiceSubtasks); |
| | | //记录无需随访详情 |
| | | serviceSubtaskStatistic.setNonFollowUpInfo(nonFollowUpInfo); |
| | | //记录首次应随访详情 |
| | | serviceSubtaskStatistic.setNeedFollowUpInfo(needFollowUpInfo); |
| | | //记录首次待随访详情 |
| | | serviceSubtaskStatistic.setPendingFollowUpInfo(pendingFollowUpInfo); |
| | | //记录首次随访成功详情 |
| | | serviceSubtaskStatistic.setFollowUpSuccessInfo(followUpSuccessInfo); |
| | | //记录首次随访失败详情 |
| | | serviceSubtaskStatistic.setFollowUpFailInfo(followUpFailInfo); |
| | | //记录首次随访人工详情 |
| | | serviceSubtaskStatistic.setManualInfo(manualInfo); |
| | | //记录首次随访语音详情 |
| | | serviceSubtaskStatistic.setVoiceInfo(voiceInfo); |
| | | //记录首次随访短信详情 |
| | | serviceSubtaskStatistic.setSmsInfo(smsInfo); |
| | | //记录首次随访微信详情 |
| | | serviceSubtaskStatistic.setWechatInfo(wechatInfo); |
| | | |
| | | //随访情况详情 |
| | | serviceSubtaskStatistic.setTaskSituation1Info(taskSituation1Info); |
| | | serviceSubtaskStatistic.setTaskSituation2Info(taskSituation2Info); |
| | | serviceSubtaskStatistic.setTaskSituation3Info(taskSituation3Info); |
| | | serviceSubtaskStatistic.setTaskSituation4Info(taskSituation4Info); |
| | | serviceSubtaskStatistic.setTaskSituation5Info(taskSituation5Info); |
| | | serviceSubtaskStatistic.setTaskSituation6Info(taskSituation6Info); |
| | | return serviceSubtaskStatistic; |
| | | } |
| | | |
| | |
| | | serviceSubtaskStatistic.setDrname(serviceSubtaskList.get(0).getDrname()); |
| | | //出院人次 |
| | | serviceSubtaskStatistic.setDischargeCount(serviceSubtaskList.size()); |
| | | //出院人次详情 |
| | | serviceSubtaskStatistic.setDischargeCountInfo(serviceSubtaskList); |
| | | //无需随访详情 |
| | | List<ServiceSubtask> nonFollowUpInfo = new ArrayList<>(); |
| | | //记录过滤患者详情 |
| | | 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> voiceAgainInfo = new ArrayList<>(); |
| | | //记录再次随访短信详情 |
| | | List<ServiceSubtask> smsAgainInfo = new ArrayList<>(); |
| | | //记录再次随访微信详情 |
| | | List<ServiceSubtask> wechatAgainInfo = new ArrayList<>(); |
| | | |
| | | //记录随访情况详情 |
| | | List<ServiceSubtask> taskSituation1Info = new ArrayList<>(); |
| | | List<ServiceSubtask> taskSituation2Info = new ArrayList<>(); |
| | | List<ServiceSubtask> taskSituation3Info = new ArrayList<>(); |
| | | List<ServiceSubtask> taskSituation4Info = new ArrayList<>(); |
| | | List<ServiceSubtask> taskSituation5Info = new ArrayList<>(); |
| | | List<ServiceSubtask> taskSituation6Info = new ArrayList<>(); |
| | | |
| | | for (ServiceSubtask serviceSubtask : serviceSubtaskList) { |
| | | //无需随访人次 |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 4) { |
| | | serviceSubtaskStatistic.setNonFollowUp(serviceSubtaskStatistic.getNonFollowUp() + 1L); |
| | | nonFollowUpInfo.add(serviceSubtask); |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 6) { |
| | | serviceSubtaskStatistic.setFilterCount(serviceSubtaskStatistic.getFilterCount() + 1L); |
| | | filterServiceSubtasks.add(serviceSubtask); |
| | | } |
| | | } |
| | | //应随访人次 |
| | |
| | | //再次应随访 |
| | | 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 (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) && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("1")) { |
| | | serviceSubtaskStatistic.setManualAgain(serviceSubtaskStatistic.getManualAgain() + 1L); |
| | | manualAgainInfo.add(serviceSubtask); |
| | | } |
| | | //再次随访语音(不统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("3")) { |
| | | serviceSubtaskStatistic.setVoiceAgain(serviceSubtaskStatistic.getVoiceAgain() + 1L); |
| | | voiceAgainInfo.add(serviceSubtask); |
| | | } |
| | | //再次随访短信(不统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("4")) { |
| | | serviceSubtaskStatistic.setSmsAgain(serviceSubtaskStatistic.getSmsAgain() + 1L); |
| | | smsAgainInfo.add(serviceSubtask); |
| | | } |
| | | //再次随访微信(不统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().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 && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("1")) { |
| | | serviceSubtaskStatistic.setManualAgain(serviceSubtaskStatistic.getManualAgain() + 1L); |
| | | manualAgainInfo.add(serviceSubtask); |
| | | } |
| | | //再次随访语音(统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("3")) { |
| | | serviceSubtaskStatistic.setVoiceAgain(serviceSubtaskStatistic.getVoiceAgain() + 1L); |
| | | voiceAgainInfo.add(serviceSubtask); |
| | | } |
| | | //再次随访短信(统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("4")) { |
| | | serviceSubtaskStatistic.setSmsAgain(serviceSubtaskStatistic.getSmsAgain() + 1L); |
| | | smsAgainInfo.add(serviceSubtask); |
| | | } |
| | | //再次随访微信(统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("5")) { |
| | | serviceSubtaskStatistic.setWeChatAgain(serviceSubtaskStatistic.getWeChatAgain() + 1L); |
| | | wechatAgainInfo.add(serviceSubtask); |
| | | } |
| | | } |
| | | if (serviceSubtaskStatistic.getNeedFollowUp() > 0) { |
| | |
| | | //随访情况 |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 1) { |
| | | serviceSubtaskStatistic.setTaskSituation1(serviceSubtaskStatistic.getTaskSituation1() + 1); |
| | | taskSituation1Info.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 2) { |
| | | serviceSubtaskStatistic.setTaskSituation2(serviceSubtaskStatistic.getTaskSituation2() + 1); |
| | | taskSituation2Info.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 3) { |
| | | serviceSubtaskStatistic.setTaskSituation3(serviceSubtaskStatistic.getTaskSituation3() + 1); |
| | | taskSituation3Info.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 4) { |
| | | serviceSubtaskStatistic.setTaskSituation4(serviceSubtaskStatistic.getTaskSituation4() + 1); |
| | | taskSituation4Info.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 5) { |
| | | serviceSubtaskStatistic.setTaskSituation5(serviceSubtaskStatistic.getTaskSituation5() + 1); |
| | | taskSituation5Info.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 7) { |
| | | serviceSubtaskStatistic.setTaskSituation6(serviceSubtaskStatistic.getTaskSituation6() + 1); |
| | | taskSituation6Info.add(serviceSubtask); |
| | | } |
| | | } |
| | | serviceSubtaskStatistic.setFilterCountList(filterServiceSubtasks); |
| | | //记录无需随访详情 |
| | | serviceSubtaskStatistic.setNonFollowUpInfo(nonFollowUpInfo); |
| | | //记录再次应随访详情 |
| | | serviceSubtaskStatistic.setNeedFollowUpAgainInfo(needFollowUpAgainInfo); |
| | | //记录再次待随访详情 |
| | | serviceSubtaskStatistic.setPendingFollowUpAgainInfo(pendingFollowUpAgainInfo); |
| | | //记录再次随访成功详情 |
| | | serviceSubtaskStatistic.setFollowUpSuccessAgainInfo(followUpSuccessAgainInfo); |
| | | //记录再次随访失败详情 |
| | | serviceSubtaskStatistic.setFollowUpFailAgainInfo(followUpFailAgainInfo); |
| | | //记录再次随访人工详情 |
| | | serviceSubtaskStatistic.setManualAgainInfo(manualAgainInfo); |
| | | //记录再次随访语音详情 |
| | | serviceSubtaskStatistic.setVoiceAgainInfo(voiceAgainInfo); |
| | | //记录再次随访短信详情 |
| | | serviceSubtaskStatistic.setSmsAgainInfo(smsAgainInfo); |
| | | //记录再次随访微信详情 |
| | | serviceSubtaskStatistic.setWechatAgainInfo(wechatAgainInfo); |
| | | |
| | | //随访情况详情 |
| | | serviceSubtaskStatistic.setTaskSituation1Info(taskSituation1Info); |
| | | serviceSubtaskStatistic.setTaskSituation2Info(taskSituation2Info); |
| | | serviceSubtaskStatistic.setTaskSituation3Info(taskSituation3Info); |
| | | serviceSubtaskStatistic.setTaskSituation4Info(taskSituation4Info); |
| | | serviceSubtaskStatistic.setTaskSituation5Info(taskSituation5Info); |
| | | serviceSubtaskStatistic.setTaskSituation6Info(taskSituation6Info); |
| | | return serviceSubtaskStatistic; |
| | | } |
| | | |
| | |
| | | serviceSubtaskStatistic.setLeavehospitaldistrictcode(serviceSubtaskList.get(0).getLeavehospitaldistrictcode()); |
| | | serviceSubtaskStatistic.setDrcode(serviceSubtaskList.get(0).getDrcode()); |
| | | serviceSubtaskStatistic.setDrname(serviceSubtaskList.get(0).getDrname()); |
| | | // //出院人次 |
| | | // serviceSubtaskStatistic.setDischargeCount(serviceSubtaskList.size()); |
| | | // //出院人次详情 |
| | | // serviceSubtaskStatistic.setDischargeCountInfo(serviceSubtaskList); |
| | | serviceSubtaskStatistic.setJoyCount(0); |
| | | serviceSubtaskStatistic.setJoyAllCount(0); |
| | | |
| | |
| | | if (subCounts == null) { |
| | | subCounts = new ArrayList<>(); |
| | | } |
| | | |
| | | // //无需随访详情 |
| | | // List<ServiceSubtask> nonFollowUpInfo = new ArrayList<>(); |
| | | // //应随访详情 |
| | | // List<ServiceSubtask> followUpNeededAllInfo = 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> voiceInfo = new ArrayList<>(); |
| | | // //记录首次随访短信详情 |
| | | // List<ServiceSubtask> smsInfo = new ArrayList<>(); |
| | | // //记录首次随访微信详情 |
| | | // List<ServiceSubtask> wechatInfo = new ArrayList<>(); |
| | | // |
| | | // //记录首次结果异常详情 |
| | | // List<ServiceSubtask> abnormalInfo = 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> voiceAgainInfo = new ArrayList<>(); |
| | | // //记录再次随访短信详情 |
| | | // List<ServiceSubtask> smsAgainInfo = new ArrayList<>(); |
| | | // //记录再次随访微信详情 |
| | | // List<ServiceSubtask> wechatAgainInfo = new ArrayList<>(); |
| | | // //记录再次结果异常详情 |
| | | // List<ServiceSubtask> abnormalAgainInfo = new ArrayList<>(); |
| | | |
| | | |
| | | for (ServiceSubtask serviceSubtask : serviceSubtaskList) { |
| | |
| | | //无需随访人次 |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 4) { |
| | | serviceSubtaskStatistic.setNonFollowUp(serviceSubtaskStatistic.getNonFollowUp() + 1L); |
| | | // nonFollowUpInfo.add(serviceSubtask); |
| | | } |
| | | //应随访人次 |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() != 4) { |
| | | serviceSubtaskStatistic.setFollowUpNeeded(serviceSubtaskStatistic.getFollowUpNeeded() + 1L); |
| | | // followUpNeededAllInfo.add(serviceSubtask); |
| | | } |
| | | |
| | | //首次出院随访 |
| | | 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() == 6)) { |
| | | serviceSubtaskStatistic.setFollowUpSuccess(serviceSubtaskStatistic.getFollowUpSuccess() + 1L); |
| | | // followUpSuccessInfo.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate() == 5 || serviceSubtask.getSendstate() == 7)) { |
| | | serviceSubtaskStatistic.setFollowUpFail(serviceSubtaskStatistic.getFollowUpFail() + 1L); |
| | | // followUpFailInfo.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtaskStatistic.getNeedFollowUp() > 0) { |
| | | double rate = (double) (serviceSubtaskStatistic.getFollowUpSuccess() + serviceSubtaskStatistic.getFollowUpFail()) / serviceSubtaskStatistic.getNeedFollowUp(); |
| | |
| | | } |
| | | if (serviceSubtask.getSendstate() != null && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("1")) { |
| | | serviceSubtaskStatistic.setManual(serviceSubtaskStatistic.getManual() + 1L); |
| | | // manualInfo.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getSendstate() != null && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("3")) { |
| | | serviceSubtaskStatistic.setVoice(serviceSubtaskStatistic.getVoice() + 1L); |
| | | // voiceInfo.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getSendstate() != null && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("4")) { |
| | | serviceSubtaskStatistic.setSms(serviceSubtaskStatistic.getSms() + 1L); |
| | | // smsInfo.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getSendstate() != null && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("5")) { |
| | | serviceSubtaskStatistic.setWeChat(serviceSubtaskStatistic.getWeChat() + 1L); |
| | | // wechatInfo.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getExcep().equals("1")) { |
| | | serviceSubtaskStatistic.setAbnormal(serviceSubtaskStatistic.getAbnormal() + 1L); |
| | | // abnormalInfo.add(serviceSubtask); |
| | | } |
| | | }//二次出院随访 |
| | | 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() == 1 || serviceSubtask.getSendstate() == 3 || serviceSubtask.getSendstate() == 6)) { |
| | | serviceSubtaskStatistic.setFollowUpSuccessAgain(serviceSubtaskStatistic.getFollowUpSuccessAgain() + 1L); |
| | | // followUpSuccessAgainInfo.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 5) { |
| | | serviceSubtaskStatistic.setFollowUpFailAgain(serviceSubtaskStatistic.getFollowUpFailAgain() + 1L); |
| | | // followUpFailAgainInfo.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtaskStatistic.getNeedFollowUp() > 0) { |
| | | double rate = (double) (serviceSubtaskStatistic.getFollowUpSuccessAgain() + serviceSubtaskStatistic.getFollowUpFailAgain()) / serviceSubtaskStatistic.getNeedFollowUpAgain(); |
| | |
| | | } |
| | | if (serviceSubtask.getSendstate() != null && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("1")) { |
| | | serviceSubtaskStatistic.setManualAgain(serviceSubtaskStatistic.getManualAgain() + 1L); |
| | | // manualAgainInfo.add(serviceSubtask); |
| | | } |
| | | //再次随访语音(统计不执行) |
| | | if (serviceSubtask.getSendstate() != null && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("3")) { |
| | | serviceSubtaskStatistic.setVoiceAgain(serviceSubtaskStatistic.getVoiceAgain() + 1L); |
| | | // voiceAgainInfo.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getSendstate() != null && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("4")) { |
| | | serviceSubtaskStatistic.setSmsAgain(serviceSubtaskStatistic.getSmsAgain() + 1L); |
| | | // smsAgainInfo.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getSendstate() != null && ObjectUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) && serviceSubtask.getCurrentPreachform().equals("5")) { |
| | | serviceSubtaskStatistic.setWeChatAgain(serviceSubtaskStatistic.getWeChatAgain() + 1L); |
| | | // wechatAgainInfo.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getExcep().equals("1")) { |
| | | serviceSubtaskStatistic.setAbnormalAgain(serviceSubtaskStatistic.getAbnormalAgain() + 1L); |
| | | // abnormalAgainInfo.add(serviceSubtask); |
| | | } |
| | | } |
| | | } |
| | |
| | | return serviceSubtaskMapper.getSfStatisticsJoydetails(serviceSubtaskCountReq); |
| | | } |
| | | |
| | | /** |
| | | * 获取随访统计超链接 |
| | | * dischargeCountInfo |
| | | * followUpNeededAllInfo - sendstate != 4 (1,2,3,5,6,7) |
| | | * nonFollowUpInfo - sendstate = 4 |
| | | * needFollowUpInfo - visitCount = 1 && sendstate != 4 |
| | | * pendingFollowUpInfo - visitCount = 1 && sendstate = 2 |
| | | * followUpSuccessInfo - visitCount = 1 && sendstate = 6 |
| | | * followUpFailInfo - visitCount = 1 && (sendstate = 5 || sendstate = 7) |
| | | * manualInfo - visitCount = 1 && currentPreachForm = "1" |
| | | * voiceInfo - visitCount = 1 && currentPreachForm = "3" |
| | | * smsInfo - visitCount = 1 && currentPreachForm = "4" |
| | | * wechatInfo - visitCount = 1 && currentPreachForm = "5" |
| | | * abnormalInfo - visitCount = 1 && excep = "1" |
| | | * needFollowUpAgainInfo - visitCount > 1 && sendstate != 4 |
| | | * pendingFollowUpAgainInfo - visitCount > 1 && sendstate = 2 |
| | | * followUpSuccessAgainInfo - visitCount > 1 && sendstate =6 |
| | | * followUpFailAgainInfo - visitCount > 1 && (sendstate = 5 || sendstate = 7) |
| | | * manualAgainInfo - visitCount > 1 && currentPreachForm = "1" |
| | | * voiceAgainInfo - visitCount > 1 && currentPreachForm = "3" |
| | | * smsAgainInfo - visitCount > 1 && currentPreachForm = "4" |
| | | * wechatAgainInfo - visitCount > 1 && currentPreachForm = "5" |
| | | * abnormalAgainInfo- visitCount = 1 && excep = "1" |
| | | * taskSituation1Info - taskSituation = 1 |
| | | * taskSituation2Info - taskSituation = 2 |
| | | * taskSituation3Info - taskSituation = 3 |
| | | * taskSituation4Info - taskSituation = 4 |
| | | * taskSituation5Info - taskSituation = 5 |
| | | * taskSituation6Info - taskSituation = 7 |
| | | * filterCountList - taskSituation = 6 && sendstate = 4 |
| | | * |
| | | */ |
| | | @Override |
| | | public List<ServiceSubtask> getSfStatisticsHyperlink(ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | List<ServiceSubtask> subtasks = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq); |
| | | return subtasks; |
| | | String hyperLinkInfoType = serviceSubtaskCountReq.getHyperLinkInfoType(); |
| | | if (StringUtils.isNotEmpty(hyperLinkInfoType)) { |
| | | applyHyperLinkInfoType(serviceSubtaskCountReq, hyperLinkInfoType); |
| | | } |
| | | |
| | | String followUpCountStyle = serviceSubtaskCountReq.getFollowUpCountStyle(); |
| | | /** |
| | | * 统计时算上不发送的 |
| | | */ |
| | | if (StringUtils.isNotEmpty(followUpCountStyle) && followUpCountStyle.equals("2")) { |
| | | List<Long> sendstates = serviceSubtaskCountReq.getSendstates(); |
| | | if(CollectionUtils.isNotEmpty(sendstates) && sendstates.get(0).equals(6L)){ |
| | | List<Long> sendstates1 =new ArrayList<>(); |
| | | sendstates1.add(3L); |
| | | sendstates1.add(4L); |
| | | sendstates1.add(6L); |
| | | serviceSubtaskCountReq.setSendstates(sendstates1); |
| | | } |
| | | } |
| | | List<ServiceSubtask> serviceSubtasks = serviceSubtaskMapper.getSfStatisticsHyperlink(serviceSubtaskCountReq); |
| | | return serviceSubtasks; |
| | | } |
| | | |
| | | private void applyHyperLinkInfoType(ServiceSubtaskCountReq serviceSubtaskCountReq, String hyperLinkInfoType) { |
| | | serviceSubtaskCountReq.setVisitCount(null); |
| | | serviceSubtaskCountReq.setSendstates(null); |
| | | serviceSubtaskCountReq.setCurrentPreachform(null); |
| | | serviceSubtaskCountReq.setExcep(null); |
| | | serviceSubtaskCountReq.setTaskSituation(null); |
| | | |
| | | switch (hyperLinkInfoType) { |
| | | case "dischargeCountInfo": |
| | | break; |
| | | case "followUpNeededAllInfo": |
| | | serviceSubtaskCountReq.setSendstates(new ArrayList<>(Arrays.asList(1L, 2L, 3L, 5L, 6L, 7L))); |
| | | break; |
| | | case "nonFollowUpInfo": |
| | | serviceSubtaskCountReq.setSendstates(new ArrayList<>(Collections.singletonList(4L))); |
| | | break; |
| | | case "needFollowUpInfo": |
| | | serviceSubtaskCountReq.setVisitCount(1); |
| | | serviceSubtaskCountReq.setSendstates(new ArrayList<>(Arrays.asList(1L, 2L, 3L, 5L, 6L, 7L))); |
| | | break; |
| | | case "pendingFollowUpInfo": |
| | | serviceSubtaskCountReq.setVisitCount(1); |
| | | serviceSubtaskCountReq.setSendstates(new ArrayList<>(Collections.singletonList(2L))); |
| | | break; |
| | | case "followUpSuccessInfo": |
| | | serviceSubtaskCountReq.setVisitCount(1); |
| | | serviceSubtaskCountReq.setSendstates(new ArrayList<>(Collections.singletonList(6L))); |
| | | break; |
| | | case "followUpFailInfo": |
| | | serviceSubtaskCountReq.setVisitCount(1); |
| | | serviceSubtaskCountReq.setSendstates(new ArrayList<>(Arrays.asList(5L, 7L))); |
| | | break; |
| | | case "manualInfo": |
| | | serviceSubtaskCountReq.setVisitCount(1); |
| | | serviceSubtaskCountReq.setCurrentPreachform("1"); |
| | | break; |
| | | case "voiceInfo": |
| | | serviceSubtaskCountReq.setVisitCount(1); |
| | | serviceSubtaskCountReq.setCurrentPreachform("3"); |
| | | break; |
| | | case "smsInfo": |
| | | serviceSubtaskCountReq.setVisitCount(1); |
| | | serviceSubtaskCountReq.setCurrentPreachform("4"); |
| | | break; |
| | | case "wechatInfo": |
| | | serviceSubtaskCountReq.setVisitCount(1); |
| | | serviceSubtaskCountReq.setCurrentPreachform("5"); |
| | | break; |
| | | case "abnormalInfo": |
| | | serviceSubtaskCountReq.setVisitCount(1); |
| | | serviceSubtaskCountReq.setExcep("1"); |
| | | break; |
| | | case "needFollowUpAgainInfo": |
| | | serviceSubtaskCountReq.setVisitCount(2); |
| | | serviceSubtaskCountReq.setSendstates(new ArrayList<>(Arrays.asList(1L, 2L, 3L, 5L, 6L, 7L))); |
| | | break; |
| | | case "pendingFollowUpAgainInfo": |
| | | serviceSubtaskCountReq.setVisitCount(2); |
| | | serviceSubtaskCountReq.setSendstates(new ArrayList<>(Collections.singletonList(2L))); |
| | | break; |
| | | case "followUpSuccessAgainInfo": |
| | | serviceSubtaskCountReq.setVisitCount(2); |
| | | serviceSubtaskCountReq.setSendstates(new ArrayList<>(Collections.singletonList(6L))); |
| | | break; |
| | | case "followUpFailAgainInfo": |
| | | serviceSubtaskCountReq.setVisitCount(2); |
| | | serviceSubtaskCountReq.setSendstates(new ArrayList<>(Arrays.asList(5L, 7L))); |
| | | break; |
| | | case "manualAgainInfo": |
| | | serviceSubtaskCountReq.setVisitCount(2); |
| | | serviceSubtaskCountReq.setCurrentPreachform("1"); |
| | | break; |
| | | case "voiceAgainInfo": |
| | | serviceSubtaskCountReq.setVisitCount(2); |
| | | serviceSubtaskCountReq.setCurrentPreachform("3"); |
| | | break; |
| | | case "smsAgainInfo": |
| | | serviceSubtaskCountReq.setVisitCount(2); |
| | | serviceSubtaskCountReq.setCurrentPreachform("4"); |
| | | break; |
| | | case "wechatAgainInfo": |
| | | serviceSubtaskCountReq.setVisitCount(2); |
| | | serviceSubtaskCountReq.setCurrentPreachform("5"); |
| | | break; |
| | | case "abnormalAgainInfo": |
| | | serviceSubtaskCountReq.setVisitCount(2); |
| | | serviceSubtaskCountReq.setExcep("1"); |
| | | break; |
| | | case "taskSituation1Info": |
| | | serviceSubtaskCountReq.setTaskSituation(1); |
| | | break; |
| | | case "taskSituation2Info": |
| | | serviceSubtaskCountReq.setTaskSituation(2); |
| | | break; |
| | | case "taskSituation3Info": |
| | | serviceSubtaskCountReq.setTaskSituation(3); |
| | | break; |
| | | case "taskSituation4Info": |
| | | serviceSubtaskCountReq.setTaskSituation(4); |
| | | break; |
| | | case "taskSituation5Info": |
| | | serviceSubtaskCountReq.setTaskSituation(5); |
| | | break; |
| | | case "taskSituation6Info": |
| | | serviceSubtaskCountReq.setTaskSituation(7); |
| | | break; |
| | | case "filterCountList": |
| | | serviceSubtaskCountReq.setTaskSituation(6); |
| | | serviceSubtaskCountReq.setSendstates(new ArrayList<>(Collections.singletonList(4L))); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |