| | |
| | | //说明是第一题 |
| | | List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = cacheList.get(0).getSvyTaskTemplateTargetoptions(); |
| | | svyTaskTemplateScriptVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateTargetoptions); |
| | | Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, tid, pid); |
| | | Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, tid, pid, null); |
| | | if (map == null) continue aa; |
| | | if (!Objects.isNull(map.get("nextScriptNo"))) |
| | | nextScriptno = Long.valueOf(map.get("nextScriptNo")); |
| | |
| | | |
| | | if (svyTaskTemplateScriptVO.getSort() != null && svyTaskTemplateScriptVO.getSort().equals(nextScriptno)) { |
| | | // log.error("svyTaskTemplateScriptVO的值为:{}", svyTaskTemplateScriptVO); |
| | | Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0])); |
| | | Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0]), null); |
| | | log.error("nextScriptNo的信息为:{}", map.get("nextScriptNo")); |
| | | if (!Objects.isNull(map.get("nextScriptNo"))) |
| | | nextScriptno = Long.valueOf(map.get("nextScriptNo")); |
| | |
| | | List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptions = cacheList.get(0).getIvrTaskScriptTargetoptionList(); |
| | | // List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptions = DtoConversionUtils.sourceToTarget(ivrLibaTemplateTargetoptions, IvrTaskTemplateTargetoption.class); |
| | | ivrTaskTemplateScriptVO.setIvrTaskScriptTargetoptionList(ivrTaskTemplateTargetoptions); |
| | | Map<String, String> map = setSFInfo(ivrTaskTemplateScriptVO, tid, pid); |
| | | Map<String, String> map = setSFInfo(ivrTaskTemplateScriptVO, tid, pid, null); |
| | | if (!Objects.isNull(map.get("nextScriptNo"))) |
| | | nextScriptno = Long.valueOf(map.get("nextScriptNo")); |
| | | if (score == null) { |
| | |
| | | ivrTaskTemplateScriptVO.setIvrTaskScriptTargetoptionList(ivrTaskTemplateTargetoptions); |
| | | |
| | | if (ivrTaskTemplateScriptVO.getSort() != null && Long.valueOf(ivrTaskTemplateScriptVO.getSort()).equals(nextScriptno)) { |
| | | Map<String, String> map = setSFInfo(ivrTaskTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0])); |
| | | Map<String, String> map = setSFInfo(ivrTaskTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0]), null); |
| | | log.error("----nextScriptNo2的信息为:{}", map.get("nextScriptNo")); |
| | | if (!Objects.isNull(map.get("nextScriptNo"))) |
| | | nextScriptno = Long.valueOf(map.get("nextScriptNo")); |
| | |
| | | public Integer saveQuestionDetail(ServiceSubTaskCacheReq serviceSubTaskCacheReq, Long flag) { |
| | | Long tid = Long.valueOf(serviceSubTaskCacheReq.getParam1()); |
| | | Long pid = Long.valueOf(serviceSubTaskCacheReq.getParam2()); |
| | | Long subid = Long.valueOf(serviceSubTaskCacheReq.getParam6()); |
| | | Double score = null; |
| | | if (ObjectUtils.isNotEmpty(serviceSubTaskCacheReq)) { |
| | | Long nextScriptno = null; |
| | |
| | | //说明是第一题 |
| | | List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = cacheList.get(0).getSvyTaskTemplateTargetoptions(); |
| | | svyTaskTemplateScriptVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateTargetoptions); |
| | | Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, tid, pid); |
| | | Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, tid, pid, subid); |
| | | if (map == null) continue; |
| | | if (!Objects.isNull(map.get("nextScriptNo"))) |
| | | nextScriptno = Long.valueOf(map.get("nextScriptNo")); |
| | |
| | | svyTaskTemplateScriptVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateTargetoptions); |
| | | |
| | | if (svyTaskTemplateScriptVO.getSort() != null && svyTaskTemplateScriptVO.getSort().equals(nextScriptno)) { |
| | | Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, tid, pid); |
| | | Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, tid, pid, subid); |
| | | log.error("nextScriptNo的信息为:{}", map.get("nextScriptNo")); |
| | | if (!Objects.isNull(map.get("nextScriptNo"))) |
| | | nextScriptno = Long.valueOf(map.get("nextScriptNo")); |
| | |
| | | } |
| | | } else if (serviceSubTaskCacheReq.getType() == 1) { |
| | | List<IvrTaskTemplateScriptVO> cacheList = serviceSubTaskCacheReq.getIvrTaskTemplateScriptVOList(); |
| | | cacheList.sort(Comparator.comparingLong(IvrTaskTemplateScriptVO::getSort)); |
| | | cacheList.sort(Comparator.comparingLong( |
| | | vo -> Optional.ofNullable(vo.getSort()).orElse(0) |
| | | )); |
| | | log.error("电话随访问卷回答结果:{}", cacheList.size()); |
| | | for (int i = 0; i < cacheList.size(); i++) { |
| | | if (i == 0) { |
| | | //这个时间要找到第一题 |
| | | for (IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO : cacheList) { |
| | | if (ivrTaskTemplateScriptVO.getSort() == 1L) { |
| | | if (ivrTaskTemplateScriptVO.getSort() != null && ivrTaskTemplateScriptVO.getSort() == 1L) { |
| | | //说明是第一题 |
| | | List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptions = cacheList.get(0).getIvrTaskScriptTargetoptionList(); |
| | | ivrTaskTemplateScriptVO.setIvrTaskScriptTargetoptionList(ivrTaskTemplateTargetoptions); |
| | | //它俩都是ivr_task_templatescript_id,所以这里需要设置一下 |
| | | ivrTaskTemplateScriptVO.setId(ivrTaskTemplateScriptVO.getScriptID()); |
| | | Map<String, String> map = setSFInfo(ivrTaskTemplateScriptVO, tid, pid); |
| | | Map<String, String> map = setSFInfo(ivrTaskTemplateScriptVO, tid, pid, subid); |
| | | if (!Objects.isNull(map.get("nextScriptNo"))) |
| | | nextScriptno = Long.valueOf(map.get("nextScriptNo")); |
| | | if (score == null) { |
| | |
| | | ivrTaskTemplateScriptVO.setIvrTaskScriptTargetoptionList(ivrTaskTemplateTargetoptions); |
| | | |
| | | if (ivrTaskTemplateScriptVO.getSort() != null && Long.valueOf(ivrTaskTemplateScriptVO.getSort()).equals(nextScriptno)) { |
| | | Map<String, String> map = setSFInfo(ivrTaskTemplateScriptVO, tid, pid); |
| | | Map<String, String> map = setSFInfo(ivrTaskTemplateScriptVO, tid, pid, subid); |
| | | log.error("----nextScriptNo2的信息为:{}", map.get("nextScriptNo")); |
| | | if (!Objects.isNull(map.get("nextScriptNo"))) |
| | | nextScriptno = Long.valueOf(map.get("nextScriptNo")); |
| | |
| | | List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = svyTaskTemplateScriptVOS.get(0).getSvyTaskTemplateTargetoptions(); |
| | | // List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = DtoConversionUtils.sourceToTarget(svyTaskTemplateTargetoptions, SvyTaskTemplateTargetoption.class); |
| | | svyTaskTemplateScriptVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateTargetoptions); |
| | | Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, Long.valueOf(serviceSubTaskMYDAnswerReq.getTaskId()), patid); |
| | | Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, Long.valueOf(serviceSubTaskMYDAnswerReq.getTaskId()), patid, null); |
| | | if (map == null) continue; |
| | | if (!Objects.isNull(map.get("nextScriptNo"))) |
| | | nextScriptno = Long.valueOf(map.get("nextScriptNo")); |
| | |
| | | |
| | | if (svyTaskTemplateScriptVO.getSort() != null && svyTaskTemplateScriptVO.getSort().equals(nextScriptno)) { |
| | | log.error("svyTaskTemplateScriptVO的值为:{}", svyTaskTemplateScriptVO); |
| | | Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, Long.valueOf(serviceSubTaskMYDAnswerReq.getTaskId()), patid); |
| | | Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, Long.valueOf(serviceSubTaskMYDAnswerReq.getTaskId()), patid, null); |
| | | log.error("map的信息为:{}", map); |
| | | if (!Objects.isNull(map.get("nextScriptNo"))) |
| | | nextScriptno = Long.valueOf(map.get("nextScriptNo")); |
| | |
| | | return null; |
| | | } |
| | | |
| | | private Map<String, String> setWJInfo(SvyTaskTemplateScriptVO svyTaskTemplateScriptVO, Long taskid, Long patid) { |
| | | private Map<String, String> setWJInfo(SvyTaskTemplateScriptVO svyTaskTemplateScriptVO, Long taskid, Long patid, Long subid) { |
| | | log.error("-----svyTaskTemplateScriptVO的值为:{}", svyTaskTemplateScriptVO); |
| | | ServiceSubtaskEntity serviceSubtaskVO = new ServiceSubtaskEntity(); |
| | | serviceSubtaskVO.setTaskid(taskid); |
| | |
| | | serviceSubtaskDetailVO.setGuid(serviceTask.getGuid()); |
| | | serviceSubtaskDetailVO.setOrgid(serviceTask.getOrgid()); |
| | | } |
| | | serviceSubtaskDetailVO.setSubId(CollectionUtils.isNotEmpty(selectServiceSubtaskList) ? selectServiceSubtaskList.get(0).getId() : null); |
| | | serviceSubtaskDetailVO.setSubId(subid == null ? CollectionUtils.isNotEmpty(selectServiceSubtaskList) ? selectServiceSubtaskList.get(0).getId() : null : subid); |
| | | serviceSubtaskDetailVO.setTemplatequestionnum(svyTaskTemplateScriptVO.getId()); |
| | | ServiceSubtaskDetail serviceSubtaskDetail = DtoConversionUtils.sourceToTarget(serviceSubtaskDetailVO, ServiceSubtaskDetail.class); |
| | | |
| | |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskDetailTraces)) { |
| | | subtaskDetailTrace.setId(serviceSubtaskDetailTraces.get(0).getId()); |
| | | traceService.updateServiceSubtaskDetailTtrace(subtaskDetailTrace); |
| | | } |
| | | else traceService.insertServiceSubtaskDetailTtrace(subtaskDetailTrace); |
| | | } else traceService.insertServiceSubtaskDetailTtrace(subtaskDetailTrace); |
| | | } else if (ObjectUtils.isNotEmpty(stt) && stt.getIsabnormal() != 1L) { |
| | | //这里主要是怕医护人员把异常选项改成了非异常的,这里就需要查一下这条数据是不是在满意度异常表,如果在,则要删除 |
| | | ServiceSubtaskDetailTraceVO subtaskDetailTraceVO = new ServiceSubtaskDetailTraceVO(); |
| | |
| | | return commonTaskcallMQJson; |
| | | } |
| | | |
| | | private Map<String, String> setSFInfo(IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO, Long taskid, Long patid) { |
| | | private Map<String, String> setSFInfo(IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO, Long taskid, Long patid, Long subid) { |
| | | ServiceSubtaskEntity serviceSubtaskVO = new ServiceSubtaskEntity(); |
| | | serviceSubtaskVO.setTaskid(taskid); |
| | | serviceSubtaskVO.setPatid(patid); |
| | |
| | | String nextScriptNo = null; |
| | | ServiceSubtaskDetailVO serviceSubtaskDetailVO = new ServiceSubtaskDetailVO(); |
| | | String isabnormalFlag = "0"; |
| | | if (ivrTaskTemplateScriptVO.getScriptType().equals("1") || ivrTaskTemplateScriptVO.getScriptType().equals("2")) { |
| | | if (ivrTaskTemplateScriptVO.getScriptType() != null && (ivrTaskTemplateScriptVO.getScriptType().equals("1") || ivrTaskTemplateScriptVO.getScriptType().equals("2"))) { |
| | | //1、2为单选或多选 |
| | | for (IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption : ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList()) { |
| | | //将问题选项记录下来 |
| | |
| | | serviceSubtaskDetailVO.setGuid(ivrTaskTemplateScriptVO.getGuid()); |
| | | serviceSubtaskDetailVO.setOrgid(ivrTaskTemplateScriptVO.getOrgid()); |
| | | serviceSubtaskDetailVO.setUpdateTime(new Date()); |
| | | serviceSubtaskDetailVO.setSubId(selectServiceSubtaskList.get(0).getId()); |
| | | serviceSubtaskDetailVO.setSubId(subid == null ? selectServiceSubtaskList.get(0).getId() : subid); |
| | | serviceSubtaskDetailVO.setTemplatequestionnum(ivrTaskTemplateScriptVO.getId()); |
| | | serviceSubtaskDetailVO.setTemplateType(1); |
| | | serviceSubtaskDetailVO.setTemplateid(ivrTaskTemplateScriptVO.getTemplateID() == null ? null : ivrTaskTemplateScriptVO.getTemplateID().toString()); |
| | |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskDetailTraces)) { |
| | | subtaskDetailTrace.setId(serviceSubtaskDetailTraces.get(0).getId()); |
| | | traceService.updateServiceSubtaskDetailTtrace(subtaskDetailTrace); |
| | | } |
| | | else traceService.insertServiceSubtaskDetailTtrace(subtaskDetailTrace); |
| | | } else if (stt.getIsabnormal() != null && stt.getIsabnormal() != 1L) { |
| | | } else traceService.insertServiceSubtaskDetailTtrace(subtaskDetailTrace); |
| | | } else if (stt != null && stt.getIsabnormal() != null && stt.getIsabnormal() != 1L) { |
| | | //这里主要是怕医护人员把异常选项改成了非异常的,这里就需要查一下这条数据是不是在满意度异常表,如果在,则要删除 |
| | | ServiceSubtaskDetailTraceVO subtaskDetailTraceVO = new ServiceSubtaskDetailTraceVO(); |
| | | subtaskDetailTraceVO.setSubId(serviceSubtaskDetailVO.getSubId()); |