| | |
| | | log.error("selectPatQuesTionResult的入参为:{}", serviceSubTaskQueryReq); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | |
| | | //获取本次的问答结果 |
| | | Map<String, Object> scriptInfoByCondition = serviceTaskService.getScriptInfoByCondition(serviceSubTaskQueryReq.getTaskid(), serviceSubTaskQueryReq.getPatid(), serviceSubTaskQueryReq.getIsFinish(), serviceSubTaskQueryReq.getPatfrom()); |
| | | map = getMap(scriptInfoByCondition, serviceSubTaskQueryReq.getSubId(), serviceSubTaskQueryReq.getPatid()); |
| | | |
| | | //获取上次的问答结果 |
| | | ServiceSubtask serviceSubtask = serviceSubtaskMapper.selectServiceSubtaskById(serviceSubTaskQueryReq.getSubId()); |
| | | map.put("upScriptResult", null); |
| | | map.put("upTaskName", null); |
| | | if (ObjectUtils.isNotEmpty(serviceSubtask) && serviceSubtask.getUpid() != null) { |
| | | Map<String, Object> scriptInfoByCondition2 = serviceTaskService.getScriptInfoByCondition(serviceSubTaskQueryReq.getTaskid(), serviceSubTaskQueryReq.getPatid(), serviceSubTaskQueryReq.getIsFinish(), serviceSubTaskQueryReq.getPatfrom()); |
| | | Map<String, Object> map1 = getMap(scriptInfoByCondition2, Long.valueOf(serviceSubtask.getUpid()), serviceSubTaskQueryReq.getPatid()); |
| | | if (!map1.isEmpty()) { |
| | | map.put("upScriptResult", map1.get("scriptResult")); |
| | | map.put("upTaskName", map1.get("taskName")); |
| | | } |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | |
| | | |
| | | private Map<String, Object> getMap(Map<String, Object> scriptInfoByCondition, Long subid, Long patid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (ObjectUtils.isNotEmpty(scriptInfoByCondition) && ObjectUtils.isNotEmpty(scriptInfoByCondition.get("script"))) { |
| | | log.error("-----------scriptInfoByCondition的值为:{}", scriptInfoByCondition); |
| | | // log.error("-----------scriptInfoByCondition的值为:{}", scriptInfoByCondition); |
| | | if (scriptInfoByCondition.get("type").equals("1")) { |
| | | List<IvrLibaTemplateScriptVO> ivrLibaTemplateScriptVOList = (List) scriptInfoByCondition.get("script"); |
| | | for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : ivrLibaTemplateScriptVOList) { |
| | | Map<String, String> scriptResult = getScriptResult(serviceSubTaskQueryReq.getSubId(), serviceSubTaskQueryReq.getPatid(), ivrLibaTemplateScriptVO.getId()); |
| | | Map<String, String> scriptResult = getScriptResult(subid, patid, ivrLibaTemplateScriptVO.getId()); |
| | | if (ObjectUtils.isNotEmpty(scriptResult)) { |
| | | ivrLibaTemplateScriptVO.setScriptResult(scriptResult.get("asrtext")); |
| | | ivrLibaTemplateScriptVO.setScriptResultId(scriptResult.get("asrtextId")); |
| | |
| | | } |
| | | map.put("scriptResult", ivrLibaTemplateScriptVOList); |
| | | map.put("taskName", scriptInfoByCondition.get("taskName")); |
| | | return map; |
| | | } else if (scriptInfoByCondition.get("type").equals("2")) { |
| | | List<SvyLibTemplateScriptVO> svyLibTemplateScriptVOList = (List) scriptInfoByCondition.get("script"); |
| | | for (SvyLibTemplateScriptVO svyLibTemplateScriptVO : svyLibTemplateScriptVOList) { |
| | | Map<String, String> scriptResult = getScriptResult(serviceSubTaskQueryReq.getSubId(), serviceSubTaskQueryReq.getPatid(), svyLibTemplateScriptVO.getId()); |
| | | Map<String, String> scriptResult = getScriptResult(subid, patid, svyLibTemplateScriptVO.getId()); |
| | | if (ObjectUtils.isNotEmpty(scriptResult)) { |
| | | if (StringUtils.isNotEmpty(scriptResult.get("asrtext"))) |
| | | svyLibTemplateScriptVO.setScriptResult(StringUtils.isNotEmpty(scriptResult.get("asrtext")) ? scriptResult.get("asrtext").replaceAll("^(\"|')(.*)\\1$", "$2") : ""); |
| | |
| | | } |
| | | map.put("scriptResult", svyLibTemplateScriptVOList); |
| | | map.put("taskName", scriptInfoByCondition.get("taskName")); |
| | | return map; |
| | | } else if (scriptInfoByCondition.get("type").equals("3")) { |
| | | //宣教不需要查看 |
| | | List<HeLibrary> heLibraryList = (List) scriptInfoByCondition.get("script"); |
| | | map.put("scriptResult", heLibraryList); |
| | | map.put("taskName", scriptInfoByCondition.get("taskName")); |
| | | return map; |
| | | } |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | private Map<String, String> getScriptResult(Long subid, Long pid, Long sid) { |
| | | Map<String, String> map = new HashMap<>(); |
| | | ServiceSubtaskDetail serviceSubtaskDetail = new ServiceSubtaskDetail(); |