|
|
@@ -1541,30 +1541,30 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
|
|
|
.filter(Objects::nonNull)
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
- //拿取业务id
|
|
|
- List<Long> businessIds = records.stream()
|
|
|
- .map(WorkflowExecRecordVo::getBusinessId)
|
|
|
- .filter(Objects::nonNull)
|
|
|
- .collect(Collectors.toList());
|
|
|
-
|
|
|
- if (!businessIds.isEmpty()) {
|
|
|
- List<CompanyVoiceRoboticBusiness> businesses = companyVoiceRoboticBusinessMapper.selectList(new LambdaQueryWrapper<CompanyVoiceRoboticBusiness>()
|
|
|
- .in(CompanyVoiceRoboticBusiness::getId, businessIds));
|
|
|
- if (ObjectUtil.isNotEmpty(businesses)) {
|
|
|
- Map<Long, CompanyVoiceRoboticBusiness> businessMap = businesses.stream().collect(Collectors.toMap(CompanyVoiceRoboticBusiness::getId, Function.identity()));
|
|
|
- records.forEach(record -> {
|
|
|
- if (record.getBusinessId() != null && businessMap.containsKey(record.getBusinessId())) {
|
|
|
- CompanyVoiceRoboticBusiness business = businessMap.get(record.getBusinessId());
|
|
|
- CompanyVoiceRoboticCallLogCallphone callLogCallphone = companyVoiceRoboticCallLogCallphoneMapper.selectOne(new LambdaQueryWrapper<CompanyVoiceRoboticCallLogCallphone>()
|
|
|
- .eq(CompanyVoiceRoboticCallLogCallphone::getRoboticId, business.getRoboticId())
|
|
|
- .eq(CompanyVoiceRoboticCallLogCallphone::getCallerId, business.getCalleeId()));
|
|
|
- if (ObjectUtil.isNotEmpty(callLogCallphone)) {
|
|
|
- record.setContentList(callLogCallphone.getContentList());
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
+// //拿取业务id
|
|
|
+// List<Long> businessIds = records.stream()
|
|
|
+// .map(WorkflowExecRecordVo::getBusinessId)
|
|
|
+// .filter(Objects::nonNull)
|
|
|
+// .collect(Collectors.toList());
|
|
|
+//
|
|
|
+// if (!businessIds.isEmpty()) {
|
|
|
+// List<CompanyVoiceRoboticBusiness> businesses = companyVoiceRoboticBusinessMapper.selectList(new LambdaQueryWrapper<CompanyVoiceRoboticBusiness>()
|
|
|
+// .in(CompanyVoiceRoboticBusiness::getId, businessIds));
|
|
|
+// if (ObjectUtil.isNotEmpty(businesses)) {
|
|
|
+// Map<Long, CompanyVoiceRoboticBusiness> businessMap = businesses.stream().collect(Collectors.toMap(CompanyVoiceRoboticBusiness::getId, Function.identity()));
|
|
|
+// records.forEach(record -> {
|
|
|
+// if (record.getBusinessId() != null && businessMap.containsKey(record.getBusinessId())) {
|
|
|
+// CompanyVoiceRoboticBusiness business = businessMap.get(record.getBusinessId());
|
|
|
+// CompanyVoiceRoboticCallLogCallphone callLogCallphone = companyVoiceRoboticCallLogCallphoneMapper.selectOne(new LambdaQueryWrapper<CompanyVoiceRoboticCallLogCallphone>()
|
|
|
+// .eq(CompanyVoiceRoboticCallLogCallphone::getRoboticId, business.getRoboticId())
|
|
|
+// .eq(CompanyVoiceRoboticCallLogCallphone::getCallerId, business.getCalleeId()));
|
|
|
+// if (ObjectUtil.isNotEmpty(callLogCallphone)) {
|
|
|
+// record.setContentList(callLogCallphone.getContentList());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// });
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
if (!instanceIds.isEmpty()) {
|
|
|
List<CompanyAiWorkflowExecLog> allLogs = companyAiWorkflowExecLogMapper.selectByInstanceIds(instanceIds);
|
|
|
@@ -1668,6 +1668,9 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
|
|
|
if (logs == null || logs.isEmpty()) {
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
+ List<CompanyAiWorkflowExecLog> callLogs = logs.stream().filter(a -> "外呼".equals(a.getNodeName())).collect(Collectors.toList());
|
|
|
+ HashMap<Long,String> callContentMap = selectCallContentByCallLogs(callLogs);
|
|
|
+
|
|
|
return logs.stream().map(log -> {
|
|
|
WorkflowExecRecordVo.NodeExecLogVo vo = new WorkflowExecRecordVo.NodeExecLogVo();
|
|
|
vo.setId(log.getId());
|
|
|
@@ -1682,7 +1685,26 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
|
|
|
vo.setDuration(log.getDuration());
|
|
|
vo.setErrorMessage(log.getErrorMessage());
|
|
|
vo.setOutputData(log.getOutputData());
|
|
|
+ vo.setNodeContentList(callContentMap.get(log.getId()));
|
|
|
return vo;
|
|
|
}).collect(Collectors.toList());
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据外呼记录得到外呼内容
|
|
|
+ * @param callLogs
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public HashMap<Long,String> selectCallContentByCallLogs(List<CompanyAiWorkflowExecLog> callLogs){
|
|
|
+ List<Long> ids = callLogs.stream().map(a -> a.getId()).collect(Collectors.toList());
|
|
|
+ List<CallContentVO> callContentVOS = companyAiWorkflowExecLogMapper.selectCallContent(ids);
|
|
|
+ if(null != callContentVOS && !callContentVOS.isEmpty()){
|
|
|
+ HashMap<Long,String> map = new HashMap<>();
|
|
|
+ callContentVOS.forEach(a -> map.put(a.getLogId(),a.getCallContent()));
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ return new HashMap<>();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|