修改sonar扫出的问题
This commit is contained in:
@@ -8,7 +8,6 @@ package com.volvo.ai.analytic.center.dto;
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class PageDto {
|
public class PageDto {
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ package com.volvo.ai.analytic.center.dto.corpus;
|
|||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description IM会话存档消息记录表-湖仓同步表
|
* @description IM会话存档消息记录表-湖仓同步表
|
||||||
* @author jlu
|
* @author jlu
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.volvo.ai.analytic.center.dto.req;
|
package com.volvo.ai.analytic.center.dto.req;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.volvo.ai.analytic.center.dto.resp;
|
package com.volvo.ai.analytic.center.dto.resp;
|
||||||
|
|
||||||
import com.volvo.common.core.constant.CommonConstants;
|
import com.volvo.common.core.constant.CommonConstants;
|
||||||
import com.volvo.common.core.util.ResultMsg;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.volvo.ai.analytic.center.enums;
|
|||||||
public enum CategoryEnum {
|
public enum CategoryEnum {
|
||||||
|
|
||||||
ENTERPRISE_WECHAT("enterprise_wechat", "企微记录"),
|
ENTERPRISE_WECHAT("enterprise_wechat", "企微记录"),
|
||||||
|
ENTERPRISE_WECHAT_PORTRAIT("enterprise_wechat_portrait", "企微语料客户画像"),
|
||||||
PHONE_VOICE("phone_voice", "语音电话"),
|
PHONE_VOICE("phone_voice", "语音电话"),
|
||||||
PORTRAIT_ALLIN("portrait_allin", "语音电话,用户画像"),
|
PORTRAIT_ALLIN("portrait_allin", "语音电话,用户画像"),
|
||||||
NAMEPLATE_VOICE("nameplate_voice", "铭牌"),
|
NAMEPLATE_VOICE("nameplate_voice", "铭牌"),
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.volvo.ai.analytic.center.controller;
|
|||||||
|
|
||||||
import com.huaweicloud.sdk.eg.v1.model.*;
|
import com.huaweicloud.sdk.eg.v1.model.*;
|
||||||
import com.volvo.ai.analytic.center.dto.event.ListSubscriptionsRequestDto;
|
import com.volvo.ai.analytic.center.dto.event.ListSubscriptionsRequestDto;
|
||||||
import com.volvo.ai.analytic.center.dto.event.SendEventDto;
|
|
||||||
import com.volvo.ai.analytic.center.dto.event.SubscriptionCreateReqDto;
|
import com.volvo.ai.analytic.center.dto.event.SubscriptionCreateReqDto;
|
||||||
import com.volvo.ai.analytic.center.dto.event.SubscriptionOperateReqDto;
|
import com.volvo.ai.analytic.center.dto.event.SubscriptionOperateReqDto;
|
||||||
import com.volvo.ai.analytic.center.dto.resp.ResultDTO;
|
import com.volvo.ai.analytic.center.dto.resp.ResultDTO;
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ import java.util.List;
|
|||||||
@RestController
|
@RestController
|
||||||
public class AiAnalysisDifyJob {
|
public class AiAnalysisDifyJob {
|
||||||
|
|
||||||
|
private static final String PROCESS_MESSAGE_TASK_ERROR = "processMessageByTask 定时任务补偿处理消息异常";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private AiAnalysisRequestLogsMapper aiAnalysisRequestLogsMapper;
|
private AiAnalysisRequestLogsMapper aiAnalysisRequestLogsMapper;
|
||||||
|
|
||||||
@@ -63,7 +65,7 @@ public class AiAnalysisDifyJob {
|
|||||||
});
|
});
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("processMessageByTask 定时任务补偿处理消息异常",e.getMessage());
|
log.error(PROCESS_MESSAGE_TASK_ERROR,e.getMessage());
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
return ResultMsg.ok();
|
return ResultMsg.ok();
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ import java.util.List;
|
|||||||
@RestController
|
@RestController
|
||||||
public class QiWeiCorpusJob {
|
public class QiWeiCorpusJob {
|
||||||
|
|
||||||
|
private static final String PROCESS_MESSAGE_TASK_ERROR = "processMessageByTask 定时任务补偿处理消息异常";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TmOdsVdqwMessagearchivingService tmOdsVdqwMessagearchivingService;
|
private TmOdsVdqwMessagearchivingService tmOdsVdqwMessagearchivingService;
|
||||||
|
|
||||||
@@ -58,7 +60,7 @@ public class QiWeiCorpusJob {
|
|||||||
log.info("qiWeiCorpusTask 企微语料查询处理:{}",param);
|
log.info("qiWeiCorpusTask 企微语料查询处理:{}",param);
|
||||||
tmOdsVdqwMessagearchivingService.runQiWeiCorpusDify(param);
|
tmOdsVdqwMessagearchivingService.runQiWeiCorpusDify(param);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("processMessageByTask 定时任务补偿处理消息异常",e.getMessage());
|
log.error(PROCESS_MESSAGE_TASK_ERROR,e.getMessage());
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
return ResultMsg.ok();
|
return ResultMsg.ok();
|
||||||
@@ -86,7 +88,7 @@ public class QiWeiCorpusJob {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("processMessageByTask 定时任务补偿处理消息异常",e.getMessage());
|
log.error(PROCESS_MESSAGE_TASK_ERROR,e.getMessage());
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
return ResultMsg.ok();
|
return ResultMsg.ok();
|
||||||
@@ -111,7 +113,7 @@ public class QiWeiCorpusJob {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("processMessageByTask 定时任务补偿处理消息异常",e.getMessage());
|
log.error(PROCESS_MESSAGE_TASK_ERROR,e.getMessage());
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
return ResultMsg.ok();
|
return ResultMsg.ok();
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
package com.volvo.ai.analytic.center.mq;
|
package com.volvo.ai.analytic.center.mq;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
@@ -50,14 +49,14 @@ public class CorpusDccMqConsumer implements RocketMQListener<MessageExt> {
|
|||||||
try {
|
try {
|
||||||
log.info("corpusDccMqConsumer1 当前线程: {}, 线程ID: {}", Thread.currentThread().getName(), Thread.currentThread().getId());
|
log.info("corpusDccMqConsumer1 当前线程: {}, 线程ID: {}", Thread.currentThread().getName(), Thread.currentThread().getId());
|
||||||
String message = new String(messageExt.getBody());
|
String message = new String(messageExt.getBody());
|
||||||
log.info("dcc_mq message: " + message);
|
log.info("dcc_mq接收到消息 : " + message);
|
||||||
AicorpusTelephoneDTO aicorpusTelephone = objectMapper.readValue(message, AicorpusTelephoneDTO.class);
|
AicorpusTelephoneDTO aicorpusTelephone = objectMapper.readValue(message, AicorpusTelephoneDTO.class);
|
||||||
//DCC场景
|
//DCC场景
|
||||||
if(Objects.equals(aicorpusTelephone.getCategoryCode(), Constant.CHANNEL_DCC)){
|
if(Objects.equals(aicorpusTelephone.getCategoryCode(), Constant.CHANNEL_DCC)){
|
||||||
//TODO 这里需要确认客户画像下这个字段值是什么? 已经确认了,和总结需求的dcc场景是一致的 , 所以不需要修改。。
|
//TODO 这里需要确认客户画像下这个字段值是什么? 已经确认了,和总结需求的dcc场景是一致的 , 所以不需要修改。。
|
||||||
//总结和客户画像都是这一个:Constant.CHANNEL_DCC
|
//总结和客户画像都是这一个:Constant.CHANNEL_DCC
|
||||||
JSONObject jsonObject = JSONObject.parseObject( aicorpusTelephone.getDisplay());
|
JSONObject jsonObject = JSONObject.parseObject( aicorpusTelephone.getDisplay());
|
||||||
log.info(" message: " + JSON.toJSONString(aicorpusTelephone));
|
log.info(" dcc_mq接收到消息 , 总结和分类业务场景: " + JSON.toJSONString(aicorpusTelephone));
|
||||||
tmTelephoneCorpusService.runTelephoneCorpusDify(aicorpusTelephone);
|
tmTelephoneCorpusService.runTelephoneCorpusDify(aicorpusTelephone);
|
||||||
}
|
}
|
||||||
//channel_4in1场景
|
//channel_4in1场景
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
|
|
||||||
package com.volvo.ai.analytic.center.mq;
|
package com.volvo.ai.analytic.center.mq;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.volvo.ai.analytic.center.constant.Constant;
|
import com.volvo.ai.analytic.center.constant.Constant;
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.volvo.ai.analytic.center.service;
|
|||||||
|
|
||||||
import com.volvo.ai.analytic.center.dto.req.AnalysisQueryReq;
|
import com.volvo.ai.analytic.center.dto.req.AnalysisQueryReq;
|
||||||
import com.volvo.ai.analytic.center.dto.req.AnalysisReq;
|
import com.volvo.ai.analytic.center.dto.req.AnalysisReq;
|
||||||
import com.volvo.ai.analytic.center.dto.resp.AnalysisDifyResultDTO;
|
|
||||||
import com.volvo.ai.analytic.center.dto.resp.AnalysisResp;
|
import com.volvo.ai.analytic.center.dto.resp.AnalysisResp;
|
||||||
|
|
||||||
public interface AiAnalysisDifyService {
|
public interface AiAnalysisDifyService {
|
||||||
|
|||||||
@@ -2,11 +2,8 @@ package com.volvo.ai.analytic.center.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.volvo.ai.analytic.center.dto.corpus.AicorpusTelephoneDTO;
|
import com.volvo.ai.analytic.center.dto.corpus.AicorpusTelephoneDTO;
|
||||||
import com.volvo.ai.analytic.center.entity.DataMaskingRule;
|
|
||||||
import com.volvo.ai.analytic.center.entity.TmTelephoneCorpus;
|
import com.volvo.ai.analytic.center.entity.TmTelephoneCorpus;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 电话语料表-同步表
|
* @description 电话语料表-同步表
|
||||||
* @author BEJSON
|
* @author BEJSON
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import com.volvo.ai.analytic.center.dto.resp.ResultDTO;
|
|||||||
import com.volvo.ai.analytic.center.entity.*;
|
import com.volvo.ai.analytic.center.entity.*;
|
||||||
import com.volvo.ai.analytic.center.enums.BizEnum;
|
import com.volvo.ai.analytic.center.enums.BizEnum;
|
||||||
import com.volvo.ai.analytic.center.enums.BusinessTypeEnum;
|
import com.volvo.ai.analytic.center.enums.BusinessTypeEnum;
|
||||||
|
import com.volvo.ai.analytic.center.enums.CategoryEnum;
|
||||||
import com.volvo.ai.analytic.center.feign.CompetingBrandsClient;
|
import com.volvo.ai.analytic.center.feign.CompetingBrandsClient;
|
||||||
import com.volvo.ai.analytic.center.mapper.TmOdsVdqwMessagearchivingMapper;
|
import com.volvo.ai.analytic.center.mapper.TmOdsVdqwMessagearchivingMapper;
|
||||||
import com.volvo.ai.analytic.center.service.*;
|
import com.volvo.ai.analytic.center.service.*;
|
||||||
@@ -265,7 +266,7 @@ public class CorpusPortraitServiceImpl implements CorpusPortraitService {
|
|||||||
// TODO 检查是否发了 unionid , 画像场景 "businessId": "业务ID", // 根据分析不同传不同的值 1、unionId 2、通话ID 3、客流ID 4、试驾ID
|
// TODO 检查是否发了 unionid , 画像场景 "businessId": "业务ID", // 根据分析不同传不同的值 1、unionId 2、通话ID 3、客流ID 4、试驾ID
|
||||||
// huaWeiService.sendEvent(setCloudEvents(aiAnalysisRequestId, text.toJSONString(),"QIWEI"),ltoChannelId);
|
// huaWeiService.sendEvent(setCloudEvents(aiAnalysisRequestId, text.toJSONString(),"QIWEI"),ltoChannelId);
|
||||||
log.info("send mq ,企微语料,画像场景 {}", text);
|
log.info("send mq ,企微语料,画像场景 {}", text);
|
||||||
tmTelephoneCorpusService.sendMq( BusinessTypeEnum.CORPUS_PORTRAIT_QIWEI.getCode(), text.toJSONString());
|
tmTelephoneCorpusService.sendMq( CategoryEnum.ENTERPRISE_WECHAT_PORTRAIT.getCode(), text.toJSONString());
|
||||||
|
|
||||||
aiAnalysisRequestLogsService.saveOrUpdateAiAnalysisRequestLogs(AiAnalysisRequestLogs.builder().aiAnalysisRequestId(execDifyFlow.getString("aiAnalysisRequestId")).businessResponse(text.toJSONString()).build());
|
aiAnalysisRequestLogsService.saveOrUpdateAiAnalysisRequestLogs(AiAnalysisRequestLogs.builder().aiAnalysisRequestId(execDifyFlow.getString("aiAnalysisRequestId")).businessResponse(text.toJSONString()).build());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,6 +167,7 @@ public class TmTelephoneCorpusServiceImpl extends ServiceImpl<TmTelephoneCorpusM
|
|||||||
CompletableFuture<Void> summaryFuture = CompletableFuture.runAsync(() -> {
|
CompletableFuture<Void> summaryFuture = CompletableFuture.runAsync(() -> {
|
||||||
JSONObject execDifyFlow = diFyService.executeDifyFlow(diFyImageReq, BusinessTypeEnum.SMART_ASSISTANT.getCode(),
|
JSONObject execDifyFlow = diFyService.executeDifyFlow(diFyImageReq, BusinessTypeEnum.SMART_ASSISTANT.getCode(),
|
||||||
JSONObject.toJSONString(corpusReportDTO), aicorpusTelephone.getAiAnalysisRequestId());
|
JSONObject.toJSONString(corpusReportDTO), aicorpusTelephone.getAiAnalysisRequestId());
|
||||||
|
|
||||||
log.info("runDify execDifyFlow 返回 ,总结场景 : {}", execDifyFlow);
|
log.info("runDify execDifyFlow 返回 ,总结场景 : {}", execDifyFlow);
|
||||||
parseDfiyResult(execDifyFlow, aicorpusTelephone.getSourceId(), formattedDateStartTime, aicorpusTelephone.getAiAnalysisRequestId(),
|
parseDfiyResult(execDifyFlow, aicorpusTelephone.getSourceId(), formattedDateStartTime, aicorpusTelephone.getAiAnalysisRequestId(),
|
||||||
BusinessTypeEnum.SMART_ASSISTANT.getCode());
|
BusinessTypeEnum.SMART_ASSISTANT.getCode());
|
||||||
|
|||||||
Reference in New Issue
Block a user