解决 业务类型错位问题

This commit is contained in:
ZLI263
2025-09-16 16:39:14 +08:00
parent def6bdef0f
commit 3fa40a42ec

View File

@@ -193,17 +193,13 @@ public class TmNameplateCorpusServiceImpl extends ServiceImpl<TmNameplateCorpusM
log.info("runDify execDifyFlow ,客户画像场景 token-{} , 对象: {}", oneTokenPortrait, diFyImageReq2); log.info("runDify execDifyFlow ,客户画像场景 token-{} , 对象: {}", oneTokenPortrait, diFyImageReq2);
JSONObject execDifyFlowForPortrait = diFyService.executeDifyFlow(diFyImageReq2, BusinessTypeEnum.CORPUS_PORTRAIT_NAMEPLATE.getCode(), JSONObject execDifyFlowForPortrait = diFyService.executeDifyFlow(diFyImageReq2, BusinessTypeEnum.CORPUS_PORTRAIT_NAMEPLATE.getCode(),
JSONObject.toJSONString(corpusReportDTO), null); JSONObject.toJSONString(corpusReportDTO), null);
updateNameplate(execDifyFlowForPortrait.toJSONString());
log.info("runDify execDifyFlow ,铭牌语料 ,客户画像场景,返回: {}", execDifyFlowForPortrait); log.info("runDify execDifyFlow ,铭牌语料 ,客户画像场景,返回: {}", execDifyFlowForPortrait);
}, executorService); }, executorService);
long endTime2 = System.currentTimeMillis(); long endTime2 = System.currentTimeMillis();
log.info("第二个业务场景(用户画像)执行时间: {} ms", (endTime2 - startTime2)); log.info("第二个业务场景(用户画像)执行时间: {} ms", (endTime2 - startTime2));
} catch (Exception e) { } catch (Exception e) {
log.error("nameplate processItem error {}", e.getMessage()); log.error("nameplate processItem error {}", e.getMessage());
} }
@@ -220,10 +216,10 @@ public class TmNameplateCorpusServiceImpl extends ServiceImpl<TmNameplateCorpusM
String text = execDifyFlow.getString("outputs"); String text = execDifyFlow.getString("outputs");
// 发送MQ // 发送MQ
log.info("铭牌send mq 业务类型是:{}, Json 是:{}", businessType, text); log.info("铭牌send mq 业务类型是:{}, Json 是:{}", businessType, text);
if (BusinessTypeEnum.SMART_ASSISTANT_NAMEPLATE.getCode().equals(businessType)) {//一句话总结+分类 if (BusinessTypeEnum.CORPUS_PORTRAIT_NAMEPLATE.getCode().equals(businessType)) {// 客户画像
tmTelephoneCorpusService.sendMq( CategoryEnum.NAMEPLATE_VOICE.getCode(), text);
}else if (BusinessTypeEnum.CORPUS_PORTRAIT_NAMEPLATE.getCode().equals(businessType)) {// 客户画像
tmTelephoneCorpusService.sendMq( CategoryEnum.NAMEPLATE_VOICE_PORTRAIT.getCode(), text); tmTelephoneCorpusService.sendMq( CategoryEnum.NAMEPLATE_VOICE_PORTRAIT.getCode(), text);
}else { //一句话总结+分类
tmTelephoneCorpusService.sendMq( CategoryEnum.NAMEPLATE_VOICE.getCode(), text);
} }
@@ -244,7 +240,12 @@ public class TmNameplateCorpusServiceImpl extends ServiceImpl<TmNameplateCorpusM
String aiAnalysisRequestId = analysisResp.getString("aiAnalysisRequestId"); String aiAnalysisRequestId = analysisResp.getString("aiAnalysisRequestId");
String difyResponse = analysisResp.getString("difyResponse"); String difyResponse = analysisResp.getString("difyResponse");
String customerFlowId = analysisResp.getString("customerFlowId"); String customerFlowId = analysisResp.getString("customerFlowId");
String businessType = analysisResp.getString("businessType"); String businessType = BusinessTypeEnum.CORPUS_PORTRAIT_NAMEPLATE.getCode();
if (aiAnalysisRequestId.indexOf(BusinessTypeEnum.CORPUS_PORTRAIT_NAMEPLATE.getCode())>=0){
businessType = BusinessTypeEnum.CORPUS_PORTRAIT_NAMEPLATE.getCode();
}else {
businessType = BusinessTypeEnum.SMART_ASSISTANT_NAMEPLATE.getCode();
}
Optional.ofNullable(aiAnalysisRequestLogsService.queryByAiAnalysisRequestId(aiAnalysisRequestId)) Optional.ofNullable(aiAnalysisRequestLogsService.queryByAiAnalysisRequestId(aiAnalysisRequestId))
.orElseThrow(() -> new IllegalArgumentException("AiAnalysisRequestId查询对象为空")); .orElseThrow(() -> new IllegalArgumentException("AiAnalysisRequestId查询对象为空"));