Selaa lähdekoodia

1.通话记录新增字段 2.返回通话记录列表和详情的时候,如果是机器人转人工,返回的客服名字是机器人

王苗苗 2 kuukautta sitten
vanhempi
commit
60233f74f9

+ 8 - 0
slibra-system/src/main/java/com/slibra/business/domain/TCallRecord.java

@@ -98,6 +98,14 @@ public class TCallRecord extends BaseEntity
     @Excel(name = "乐观锁")
     private Long revision;
 
+    //2025年01月07日16:46:51 新增的数据库字段
+    /** 客服ID */
+    @Excel(name = "转接客服id")
+    private Long transferUserId;
+
+    /** 客服名字 */
+    @Excel(name = "转接客服名字")
+    private String transferUserName;
 
     //2024年11月18日10:45:25 新增的返回的字段[当前通话记录]
     private String currentCallRecords;

+ 21 - 4
slibra-system/src/main/java/com/slibra/business/service/impl/TCallRecordServiceImpl.java

@@ -3,7 +3,6 @@ package com.slibra.business.service.impl;
 import java.io.File;
 import java.math.BigDecimal;
 import java.util.*;
-import java.util.stream.Collectors;
 
 import com.alibaba.fastjson2.JSON;
 import com.slibra.business.domain.TCutOffWater;
@@ -16,7 +15,6 @@ import com.slibra.common.DecimalUtils;
 import com.slibra.common.core.domain.entity.SysUser;
 import com.slibra.common.exception.ServiceException;
 import com.slibra.common.utils.DateUtils;
-import com.slibra.common.utils.SecurityUtils;
 import com.slibra.common.utils.StringUtils;
 import com.slibra.system.mapper.SysUserMapper;
 import lombok.extern.slf4j.Slf4j;
@@ -86,7 +84,10 @@ public class TCallRecordServiceImpl implements ITCallRecordService
     @Override
     public TCallRecord selectTCallRecordById(Long id)
     {
-        return tCallRecordMapper.selectTCallRecordById(id);
+        TCallRecord tCallRecord = tCallRecordMapper.selectTCallRecordById(id);
+        if(!Objects.isNull(tCallRecord))
+            this.handleUserName(tCallRecord);
+        return tCallRecord;
     }
 
     /**
@@ -98,7 +99,23 @@ public class TCallRecordServiceImpl implements ITCallRecordService
     @Override
     public List<TCallRecord> selectTCallRecordList(TCallRecord tCallRecord)
     {
-        return tCallRecordMapper.selectTCallRecordList(tCallRecord);
+        List<TCallRecord> tCallRecords = tCallRecordMapper.selectTCallRecordList(tCallRecord);
+        if(!CollectionUtils.isEmpty(tCallRecords)){
+            for (TCallRecord callRecord : tCallRecords) {
+                this.handleUserName(callRecord);
+            }
+        }
+        return tCallRecords;
+    }
+
+    private void handleUserName(TCallRecord callRecord) {
+        Long serviceCategory = callRecord.getServiceCategory();
+        if(!Objects.isNull(serviceCategory) && 2L == serviceCategory){
+            String transferUserName = callRecord.getTransferUserName();//有可能不存在  如果存在,再替换
+            if(!StringUtils.isEmpty(transferUserName)){
+                callRecord.setUserName(transferUserName);
+            }
+        }
     }
 
     /**

+ 3 - 1
slibra-system/src/main/resources/mapper/business/TCallRecordMapper.xml

@@ -28,10 +28,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="createTime"    column="create_time"    />
         <result property="updateBy"    column="update_by"    />
         <result property="updateTime"    column="update_time"    />
+        <result property="transferUserId"    column="transfer_user_id"    />
+        <result property="transferUserName"    column="transfer_user_name"    />
     </resultMap>
 
     <sql id="selectTCallRecordVo">
-        select id, session_id, type, user_id, user_name, service_category, time_begin, time_end, times, category, status, phone, bussiness_type, url, remark, has_parsed, parsed_voice_content, del_flag, revision, create_by, create_time, update_by, update_time from t_call_record
+        select id, session_id, type, user_id, user_name, service_category, time_begin, time_end, times, category, status, phone, bussiness_type, url, remark, has_parsed, parsed_voice_content, del_flag, revision, create_by, create_time, update_by, update_time, transfer_user_id, transfer_user_name from t_call_record
     </sql>