Browse Source

机器人客服统计接口新增2个统计指标

王苗苗 3 months ago
parent
commit
7914ee1076

+ 1 - 1
slibra-system/src/main/java/com/slibra/business/mapper/TCallRecordMapper.java

@@ -79,7 +79,7 @@ public interface TCallRecordMapper
 
     int getSpecialCount();
 
-    int getTransferCount();
+    int getTransferCount(@Param("userId") String userId, @Param("date") String date);
 
     int getPersonCountByState(Integer state);
 

+ 6 - 0
slibra-system/src/main/java/com/slibra/business/res/CallUserCountInfo.java

@@ -35,5 +35,11 @@ public class CallUserCountInfo {
 
     //累计通话时长
     private long totalTimes;
+
+    //今日转人工
+    private int todayTransferCount;
+
+    //累计转人工
+    private int totalTransferCount;
 }
 

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

@@ -273,7 +273,7 @@ public class TCallRecordServiceImpl implements ITCallRecordService
             callRecordCount.setTraditionPercent((double)traditionTotal / total);
         }
         callRecordCount.setSpecialCount(this.tCallRecordMapper.getSpecialCount());
-        int transferCount = this.tCallRecordMapper.getTransferCount();
+        int transferCount = this.tCallRecordMapper.getTransferCount(null, null);
         callRecordCount.setTransferCount(transferCount);
         //处理人工客服状态统计信息
         callRecordCount.setTotalPerson(this.tCallRecordMapper.getPersonCountByState(null));
@@ -325,11 +325,13 @@ public class TCallRecordServiceImpl implements ITCallRecordService
                 String userId = callUserCountInfo.getUserId();
                 if(StringUtils.isNotBlank(userId)){
 //                    callUserCountInfo.setStatus(this.tCallRecordMapper.getStatusByUserId(userId));
-                    callUserCountInfo.setTotalTimes(this.tCallRecordMapper.getPersonTotalRecordIsRobot(1, userId));
+//                    callUserCountInfo.setTotalTimes(this.tCallRecordMapper.getPersonTotalRecordIsRobot(1, userId));
                     callUserCountInfo.setInTodayCount(this.tCallRecordMapper.getCountByTypeAndDate(0, date));
                     callUserCountInfo.setInAllCount(this.tCallRecordMapper.getCountByTypeAndDate(0, null));
-                    callUserCountInfo.setOutTodayCount(this.tCallRecordMapper.getCountByTypeAndDate(1, date));
-                    callUserCountInfo.setOutAllCount(this.tCallRecordMapper.getCountByTypeAndDate(1, null));
+//                    callUserCountInfo.setOutTodayCount(this.tCallRecordMapper.getCountByTypeAndDate(1, date));
+//                    callUserCountInfo.setOutAllCount(this.tCallRecordMapper.getCountByTypeAndDate(1, null));
+                    callUserCountInfo.setTodayTransferCount(this.tCallRecordMapper.getTransferCount(userId, date));
+                    callUserCountInfo.setTotalTransferCount(this.tCallRecordMapper.getTransferCount(userId, null));
                 }
             }
         }

+ 2 - 0
slibra-system/src/main/resources/mapper/business/TCallRecordMapper.xml

@@ -244,6 +244,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             t_call_record
         WHERE
             1 = 1 and service_category = 2 AND del_flag = 0
+        <if test="userId != null "> and user_id = #{userId} </if>
+        <if test="date != null "> and DATE_FORMAT(create_time, '%Y-%m-%d') = #{date} </if>
     </select>
 
     <select id="getPersonCountByState" resultType="int">