解决结构体不一致问题
This commit is contained in:
@@ -235,42 +235,38 @@ public class TmNameplateCorpusServiceImpl extends ServiceImpl<TmNameplateCorpusM
|
||||
|
||||
@Override
|
||||
public ResultMsg<Object> updateNameplate(String message) {
|
||||
try {
|
||||
|
||||
if(StringUtils.isNotEmpty(message)){
|
||||
log.info("updateNameplate 回调 message: {}", message);
|
||||
JSONObject analysisResp = JSONObject.parseObject(message);
|
||||
String aiAnalysisRequestId = analysisResp.getString(aiAnalysisRequestIdFinal);
|
||||
String difyResponse = analysisResp.getString("difyResponse");
|
||||
String customerFlowId = analysisResp.getString("customerFlowId");
|
||||
String businessType;
|
||||
|
||||
AiAnalysisRequestLogs aiAnalysisRequestLogs = new AiAnalysisRequestLogs();
|
||||
JSONObject difyJson =null;
|
||||
if (StringUtils.isEmpty(customerFlowId)){ // 客户画像场景
|
||||
log.info(" customerFlowId 为空,客户画像场景");
|
||||
String text = analysisResp.getString(outputsFinal);
|
||||
JSONObject outputs = JSONObject.parseObject(text);
|
||||
String businessId = outputs.getString("businessId");
|
||||
String businessType = outputs.getString("businessType");
|
||||
|
||||
if (aiAnalysisRequestId==null){
|
||||
aiAnalysisRequestId = outputs.getString(aiAnalysisRequestIdFinal);
|
||||
}
|
||||
|
||||
log.info("aiAnalysisRequestId is : ",analysisResp.getString(aiAnalysisRequestIdFinal));
|
||||
log.info("businessType is : ", businessType);
|
||||
|
||||
if (aiAnalysisRequestId.indexOf(BusinessTypeEnum.CORPUS_PORTRAIT_NAMEPLATE.getCode())>=0){
|
||||
customerFlowId = outputs.getString("businessId");
|
||||
aiAnalysisRequestId=analysisResp.getString(aiAnalysisRequestIdFinal);
|
||||
businessType=BusinessTypeEnum.CORPUS_PORTRAIT_NAMEPLATE.getCode();
|
||||
customerFlowId = businessId;
|
||||
log.info("客户画像场景 businessType is : ", businessType);
|
||||
}else {
|
||||
aiAnalysisRequestLogs.setBusinessResponse(text);
|
||||
}else { //总结+分类
|
||||
businessType = BusinessTypeEnum.SMART_ASSISTANT_NAMEPLATE.getCode();
|
||||
difyJson = JSONObject.parseObject(difyResponse);
|
||||
aiAnalysisRequestLogs.setBusinessResponse(difyJson.getString(outputsFinal));
|
||||
}
|
||||
|
||||
|
||||
Optional.ofNullable(aiAnalysisRequestLogsService.queryByAiAnalysisRequestId(aiAnalysisRequestId))
|
||||
.orElseThrow(() -> new IllegalArgumentException("AiAnalysisRequestId查询对象为空!"));
|
||||
log.info("1111111111111,{}", customerFlowId);
|
||||
AiAnalysisRequestLogs aiAnalysisRequestLogs = new AiAnalysisRequestLogs();
|
||||
aiAnalysisRequestLogs.setAiAnalysisRequestId(aiAnalysisRequestId);
|
||||
aiAnalysisRequestLogs.setDifyResponse(difyResponse);
|
||||
|
||||
JSONObject difyJson = JSONObject.parseObject(difyResponse);
|
||||
aiAnalysisRequestLogs.setBusinessResponse(difyJson.getString(outputsFinal));
|
||||
aiAnalysisRequestLogs.setAiAnalysisRequestType(businessType);
|
||||
aiAnalysisRequestLogsService.saveOrUpdateAiAnalysisRequestLogs(aiAnalysisRequestLogs);
|
||||
log.info("333333333333");
|
||||
@@ -290,12 +286,15 @@ public class TmNameplateCorpusServiceImpl extends ServiceImpl<TmNameplateCorpusM
|
||||
aiAnalysisErrorsMapper.update(AiAnalysisErrors.builder().aiAnalysisRequestId(oldAiAnalysisErrors.getAiAnalysisRequestId()).aiAnalysisErrorHandlingStatus("1").build(), errorQueryWrapper);
|
||||
}
|
||||
}else {
|
||||
|
||||
log.info("555555555555");
|
||||
|
||||
log.info("没找到语料记录");
|
||||
}
|
||||
return ResultMsg.ok();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("updateNameplate error {}", e);
|
||||
|
||||
}
|
||||
|
||||
return ResultMsg.failed();
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -227,7 +227,7 @@ public class TmOdsVdqwMessagearchivingServiceImpl extends ServiceImpl<TmOdsVdqwM
|
||||
if (null != execDifyFlow && execDifyFlow.get("status").equals("succeeded")) {
|
||||
JSONObject text = execDifyFlow.getJSONObject("outputs");
|
||||
// 发送MQ
|
||||
log.info("send mq {}", text);
|
||||
log.info("send mq企微总结 {}", text);
|
||||
tmTelephoneCorpusService.sendMq( CategoryEnum.ENTERPRISE_WECHAT.getCode(), text.toJSONString());
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user