陈昶聿
14 小时以前 f6e31c2de04e10373ed4e7aea22bb3f13c8d2cf9
smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetServiceImpl.java
@@ -8,11 +8,13 @@
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.DtoConversionUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysConfigService;
import com.smartor.domain.*;
import com.smartor.mapper.IvrLibaTargetMapper;
import com.smartor.mapper.IvrLibaTargetTagMapper;
import com.smartor.mapper.IvrLibaTargetoptionMapper;
import com.smartor.service.IIvrLibaTargetService;
import com.smartor.service.IServiceSubtaskService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
@@ -43,6 +45,12 @@
    @Autowired
    private IvrLibaTargetoptionMapper ivrLibaTargetoptionMapper;
    @Autowired
    private ISysConfigService configService;
    @Autowired
    private IServiceSubtaskService serviceSubtaskService;
    /**
     * 查询指标选项库
@@ -251,7 +259,24 @@
     */
    @Override
    public String targetQuesMate(IvrLibaTargetVO ivrLibaTargetVO) {
        //1-AI识别
        String url = configService.selectConfigByKey("sys.voice.match.ai.url");
        if (ObjectUtils.isNotEmpty(url)) {
            String matchedText = "";
            String questionText = ivrLibaTargetVO.getQuestionText();
            String voiceText = ivrLibaTargetVO.getContent();
            List<IvrTaskTemplateTargetoption> options = DtoConversionUtils.sourceToTarget(ivrLibaTargetVO.getTargetoptionList(), IvrTaskTemplateTargetoption.class);
            //1-AI识别
            Integer matched = serviceSubtaskService.matchOptionIndex(url, questionText, voiceText, options, "1");
            if (ObjectUtils.isNotEmpty(matched)) {
                if (matched >= 0) {
                    matchedText = options.get(matched).getTargetvalue();
                }
            }
            log.info("ai匹配成功,匹配结果是:" + matchedText);
            return matchedText;
        }
        for (IvrLibaTargetoption ivrLibaTargetoption : ivrLibaTargetVO.getTargetoptionList()) {
            Matcher matcher = null;