添加日志,定位是否传 soureId
This commit is contained in:
@@ -206,7 +206,6 @@ public class TmNameplateCorpusServiceImpl extends ServiceImpl<TmNameplateCorpusM
|
||||
long endTime = System.currentTimeMillis();
|
||||
log.info("第一个业务场景(总结和分类)执行时间: {} ms", (endTime - startTime));
|
||||
//第一个业务场景, 结束
|
||||
|
||||
long startTime2 = System.currentTimeMillis();
|
||||
try {
|
||||
log.info("铭牌语料可用许可授权数,画像场景={}", semaphore.availablePermits());
|
||||
|
||||
@@ -116,13 +116,10 @@ public class TmTelephoneCorpusServiceImpl extends ServiceImpl<TmTelephoneCorpusM
|
||||
RunMaskingRuleInput runMaskingRuleInput = new RunMaskingRuleInput();
|
||||
runMaskingRuleInput.setDataMaskingRules(maskingRuleItems);
|
||||
|
||||
Map<String, Object> inputMap = new HashMap();
|
||||
DiFyReq diFyImageReq = new DiFyReq();
|
||||
diFyImageReq.setUser(ConstantStr.corpus_user);
|
||||
diFyImageReq.setFlowId(telephoneToken);
|
||||
JSONObject jsonObject = JSONObject.parseObject(aicorpusTelephone.getDisplay());
|
||||
JSONArray segments = jsonObject.getJSONArray("segments");
|
||||
Long audioDuration = jsonObject.getLong("audio_duration"); // 毫秒
|
||||
|
||||
if (audioDuration / 1000 <= 10) {
|
||||
log.info("电话语料时长小于10秒,不进行dify处理");
|
||||
return;
|
||||
@@ -157,14 +154,20 @@ public class TmTelephoneCorpusServiceImpl extends ServiceImpl<TmTelephoneCorpusM
|
||||
ZonedDateTime zonedDateTime = ZonedDateTime.parse(jsonObject.getString("start_time"));
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
String formattedDateStartTime = zonedDateTime.format(formatter);
|
||||
String businessIdSourceId= aicorpusTelephone.getSourceId();
|
||||
String carModel = getCarModelList();
|
||||
inputMap.put("chat", chatList.toString());
|
||||
inputMap.put("model", carModel);
|
||||
inputMap.put("analysisScene", "2");
|
||||
inputMap.put("recordId", aicorpusTelephone.getSourceId());
|
||||
inputMap.put(communicateDateStr, formattedDateStartTime);
|
||||
inputMap.put("version", 2);
|
||||
diFyImageReq.setInputs(inputMap);
|
||||
|
||||
Map<String, Object> inputMapForSummary = new HashMap<>();
|
||||
inputMapForSummary.put("chat", chatList.toString());
|
||||
inputMapForSummary.put("model", carModel);
|
||||
inputMapForSummary.put("analysisScene", "2");
|
||||
inputMapForSummary.put("recordId", aicorpusTelephone.getSourceId());
|
||||
inputMapForSummary.put(communicateDateStr, formattedDateStartTime);
|
||||
inputMapForSummary.put("version", 2);
|
||||
|
||||
Map<String, Object> inputMapForPortrait = new HashMap<>(inputMapForSummary); // 复制一份
|
||||
inputMapForPortrait.put("businessId", businessIdSourceId); // 仅画像任务需要
|
||||
|
||||
CorpusReportDTO corpusReportDTO = new CorpusReportDTO();
|
||||
corpusReportDTO.setCorpusTime(formattedDateStartTime);
|
||||
corpusReportDTO.setRecordId(aicorpusTelephone.getSourceId());
|
||||
@@ -175,9 +178,13 @@ public class TmTelephoneCorpusServiceImpl extends ServiceImpl<TmTelephoneCorpusM
|
||||
long startTime = System.currentTimeMillis();
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
diFyImageReq.setFlowId(telephoneToken);
|
||||
log.info("dcc语料telephoneToken:{}", telephoneToken);
|
||||
JSONObject execDifyFlow = diFyService.executeDifyFlow(diFyImageReq, BusinessTypeEnum.SMART_ASSISTANT.getCode(),
|
||||
DiFyReq req1 = new DiFyReq();
|
||||
req1.setUser(ConstantStr.corpus_user);
|
||||
req1.setFlowId(telephoneToken);
|
||||
req1.setInputs(inputMapForSummary);
|
||||
|
||||
log.info("dcc语料req1:{}", req1);
|
||||
JSONObject execDifyFlow = diFyService.executeDifyFlow(req1, BusinessTypeEnum.SMART_ASSISTANT.getCode(),
|
||||
JSONObject.toJSONString(corpusReportDTO), aicorpusTelephone.getAiAnalysisRequestId());
|
||||
|
||||
log.info("dcc总结场景,总结和分类 runDify execDifyFlow : {}", execDifyFlow);
|
||||
@@ -194,15 +201,14 @@ public class TmTelephoneCorpusServiceImpl extends ServiceImpl<TmTelephoneCorpusM
|
||||
long startTime2 = System.currentTimeMillis();
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
|
||||
// 创建新的DiFyReq对象以避免线程安全问题
|
||||
inputMap.put("businessId", aicorpusTelephone.getSourceId());
|
||||
DiFyReq req2 = new DiFyReq();
|
||||
req2.setUser(ConstantStr.corpus_user);
|
||||
req2.setFlowId(dccTokenPortrait);
|
||||
req2.setInputs(inputMapForPortrait); // 使用带 businessId 的副本
|
||||
|
||||
diFyImageReq.setInputs(inputMap);
|
||||
|
||||
diFyImageReq.setFlowId(dccTokenPortrait);
|
||||
log.info("dcc总结场景,客户画像runDify execDifyFlow : {}", dccTokenPortrait);
|
||||
JSONObject execDifyFlowForPortrait = diFyService.executeDifyFlow(diFyImageReq, BusinessTypeEnum.CORPUS_PORTRAIT_DCC.getCode(),
|
||||
JSONObject execDifyFlowForPortrait = diFyService.executeDifyFlow(req2, BusinessTypeEnum.CORPUS_PORTRAIT_DCC.getCode(),
|
||||
JSONObject.toJSONString(corpusReportDTO), aicorpusTelephone.getAiAnalysisRequestId());
|
||||
|
||||
log.info("dcc客户画像场景 runDify execDifyFlow 返回 , dcc: {}", execDifyFlowForPortrait);
|
||||
|
||||
Reference in New Issue
Block a user