Commit 50d342a2 by 潘诗林

fix:获取语音转文本时为空校验,添加异常获取

1 parent 0073f885
...@@ -409,6 +409,9 @@ public class ConversationDateService { ...@@ -409,6 +409,9 @@ public class ConversationDateService {
public String getBadgeText(Integer recordId){ public String getBadgeText(Integer recordId){
ConversationBatch conversationBatch = conversationBatchMapper.selectByRecordId(recordId); ConversationBatch conversationBatch = conversationBatchMapper.selectByRecordId(recordId);
if(Objects.isNull(conversationBatch)){
return null;
}
//获取文件内容 //获取文件内容
List<ConversationDetail> conversationDetails = inspectionConversationDetailExtService.listByBatchId(Arrays.asList( List<ConversationDetail> conversationDetails = inspectionConversationDetailExtService.listByBatchId(Arrays.asList(
conversationBatch.getId())); conversationBatch.getId()));
......
...@@ -166,46 +166,53 @@ public class PreLearnBigModelService { ...@@ -166,46 +166,53 @@ public class PreLearnBigModelService {
// 2d. 为每个订单生成剧本 // 2d. 为每个订单生成剧本
int caseIndex = 1; int caseIndex = 1;
for (OrderCustomerDTO orderCustomer : orderCustomers) { for (OrderCustomerDTO orderCustomer : orderCustomers) {
if (caseIndex >= 50) { try{
break; if (caseIndex >= 50) {
} break;
//获取接待录音数据 }
BadgeRecordings badgeRecordings = fetchReceptionRecordings(orderCustomer.getCustomerPhone(), //获取接待录音数据
orderCustomer.getEarliestCreatedDate()); BadgeRecordings badgeRecordings = fetchReceptionRecordings(orderCustomer.getCustomerPhone(),
if(Objects.isNull(badgeRecordings)){ orderCustomer.getEarliestCreatedDate());
continue; if(Objects.isNull(badgeRecordings)){
} continue;
// 2d-i. 查询录音及ASR文本(连表查询) }
String asrText = conversationDateService.getBadgeText(badgeRecordings.getId()); // 2d-i. 查询录音及ASR文本(连表查询)
if (!StringUtils.hasText(asrText)) { String asrText = conversationDateService.getBadgeText(badgeRecordings.getId());
log.info("未获取到ASR文本: phone={}, orderCode={}", if (!StringUtils.hasText(asrText)) {
orderCustomer.getCustomerPhone(), orderCustomer.getOrderCode()); log.info("未获取到ASR文本: phone={}, orderCode={}",
continue; orderCustomer.getCustomerPhone(), orderCustomer.getOrderCode());
} continue;
}
// 2e. 提交大模型异步任务 // 2e. 提交大模型异步任务
String modelTaskId = submitAsyncTask(asrText); String modelTaskId = submitAsyncTask(asrText);
if (!StringUtils.hasText(modelTaskId)) { if (!StringUtils.hasText(modelTaskId)) {
log.warn("大模型任务提交失败: phone={}, orderCode={}", log.warn("大模型任务提交失败: phone={}, orderCode={}",
orderCustomer.getCustomerPhone(), orderCustomer.getOrderCode()); orderCustomer.getCustomerPhone(), orderCustomer.getOrderCode());
continue; continue;
} }
// 2f. 新建剧本记录,状态为生产中 // 2f. 新建剧本记录,状态为生产中
PreLearnProductScript script = PreLearnProductScript.builder() PreLearnProductScript script = PreLearnProductScript.builder()
.activityId(activityId) .activityId(activityId)
.activityProductId(activityProductId) .activityProductId(activityProductId)
.caseIndex(caseIndex) .caseIndex(caseIndex)
.modelTaskId(modelTaskId) .modelTaskId(modelTaskId)
.aiStatus("GENERATING") .aiStatus(AiStatusEnum.GENERATING.getValue())
.createdBy("system") .createdBy("system")
.createdDate(new Date()) .createdDate(new Date())
.carModel(badgeRecordings.getCarModel()) .carModel(badgeRecordings.getCarModel())
.customerName(badgeRecordings.getCustomerName()) .customerName(badgeRecordings.getCustomerName())
.build(); .build();
preLearnProductScriptMapper.insert(script); preLearnProductScriptMapper.insert(script);
caseIndex++;
}catch (Exception e){
log.error("生成案例异常,e",e);
log.error("生成案例失败: activityId={}, activityProductId={}, 提交数量={}",
activityId, activityProductId, caseIndex);
}
caseIndex++;
} }
log.info("活动商品剧本提交完成: activityId={}, activityProductId={}, 提交数量={}", log.info("活动商品剧本提交完成: activityId={}, activityProductId={}, 提交数量={}",
activityId, activityProductId, caseIndex); activityId, activityProductId, caseIndex);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!