| | |
| | | continue; |
| | | } |
| | | //2-AI识别 |
| | | SysConfig configVoiceMatchType = new SysConfig(); |
| | | configVoiceMatchType.setOrgid(phoneCallReqYQVO.getOrgid()); |
| | | configVoiceMatchType.setConfigKey("sys.voice.match.type"); |
| | | SysConfig matchType = sysConfigMapper.selectConfig(configVoiceMatchType); |
| | | // SysConfig configVoiceMatchType = new SysConfig(); |
| | | // configVoiceMatchType.setOrgid(phoneCallReqYQVO.getOrgid()); |
| | | // configVoiceMatchType.setConfigKey("sys.voice.match.type"); |
| | | // SysConfig matchType = sysConfigMapper.selectConfig(configVoiceMatchType); |
| | | boolean matchedFlag = false; |
| | | if (ObjectUtils.isNotEmpty(matchType) && StringUtils.isNotEmpty(matchType.getConfigValue()) && matchType.getConfigValue().equals("2")) { |
| | | int checkFlag = DeepSeekApi.matchQuestionAnswer(ivrTaskTemplateScriptVO.getScriptContent(), |
| | | phoneCallReqYQVO.getAsrtext(), |
| | | ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetvalue()); |
| | | if (checkFlag == 1) { |
| | | matchedFlag = true; |
| | | } |
| | | } else { |
| | | // if (ObjectUtils.isNotEmpty(matchType) && StringUtils.isNotEmpty(matchType.getConfigValue()) && matchType.getConfigValue().equals("2")) { |
| | | // int checkFlag = DeepSeekApi.matchQuestionAnswer(ivrTaskTemplateScriptVO.getScriptContent(), |
| | | // phoneCallReqYQVO.getAsrtext(), |
| | | // ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetvalue()); |
| | | // if (checkFlag == 1) { |
| | | // matchedFlag = true; |
| | | // } |
| | | // } else { |
| | | //包含 |
| | | Matcher matcher = null; |
| | | if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex())) { |
| | |
| | | if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches() || StringUtils.isEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() || StringUtils.isEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches()) { |
| | | matchedFlag = true; |
| | | } |
| | | } |
| | | // } |
| | | //说明匹配正确了 |
| | | if(matchedFlag){ |
| | | //这里应该先判断类型,去再修改,设置IsUserOperation是单选题的改法 |
| | |
| | | |
| | | if (!CollectionUtils.isEmpty(serviceTaskdepts)) { |
| | | PatArchive patArchive = new PatArchive(); |
| | | patArchive.setId(-1L); |
| | | patArchive.setId(999999999L); |
| | | patArchive.setName("虚拟患者"); |
| | | //封装serviceSubtask |
| | | ServiceSubtask serviceSubtask = boxedServiceSubtask(serviceTask, patArchive); |