Jelajahi Sumber

1.通话概况接口过滤掉已接听的过滤筛选 2.获取人工客服统计,新增今日呼入-已接听和 今日呼入-已接听字段统计

王苗苗 1 Minggu lalu
induk
melakukan
c943f4f832

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

@@ -92,7 +92,7 @@ public interface TCallRecordMapper
 
     Integer getStatusByUserId(String userId);
 
-    int getCountByTypeAndDate(@Param("category") int category, @Param("date") String date, @Param("userId") String userId);
+    int getCountByTypeAndDate(@Param("category") int category, @Param("date") String date, @Param("userId") String userId, @Param("status") Integer status);
 
     int getPersonCountByType(int type);
 

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

@@ -42,5 +42,11 @@ public class CallUserCountInfo {
 
     //累计转人工
     private int totalTransferCount;
+
+    //今日呼入-已接听
+    private int inTodaySuccessCount;
+
+    //今日呼入-未接听
+    private int inTodayFailCount;
 }
 

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

@@ -419,10 +419,10 @@ public class TCallRecordServiceImpl implements ITCallRecordService
                 if(StringUtils.isNotBlank(userId)){
                     callUserCountInfo.setStatus(this.parseStatus(this.tCallRecordMapper.getStatusByUserId(userId)));
                     callUserCountInfo.setTotalTimes(this.tCallRecordMapper.getPersonTotalRecordIsRobot(0, userId));
-                    callUserCountInfo.setInTodayCount(this.tCallRecordMapper.getCountByTypeAndDate(0, date, userId));
-                    callUserCountInfo.setInAllCount(this.tCallRecordMapper.getCountByTypeAndDate(0, null, userId));
-                    callUserCountInfo.setOutTodayCount(this.tCallRecordMapper.getCountByTypeAndDate(1, date, userId));
-                    callUserCountInfo.setOutAllCount(this.tCallRecordMapper.getCountByTypeAndDate(1, null, userId));
+                    callUserCountInfo.setInTodayCount(this.tCallRecordMapper.getCountByTypeAndDate(0, date, userId, null));
+                    callUserCountInfo.setInAllCount(this.tCallRecordMapper.getCountByTypeAndDate(0, null, userId, null));
+                    callUserCountInfo.setOutTodayCount(this.tCallRecordMapper.getCountByTypeAndDate(1, date, userId, null));
+                    callUserCountInfo.setOutAllCount(this.tCallRecordMapper.getCountByTypeAndDate(1, null, userId, null));
                 }
             }
         }
@@ -472,12 +472,15 @@ public class TCallRecordServiceImpl implements ITCallRecordService
                 if(StringUtils.isNotBlank(userId)){
 //                    callUserCountInfo.setStatus(this.tCallRecordMapper.getStatusByUserId(userId));
 //                    callUserCountInfo.setTotalTimes(this.tCallRecordMapper.getPersonTotalRecordIsRobot(1, userId));
-                    callUserCountInfo.setInTodayCount(this.tCallRecordMapper.getCountByTypeAndDate(0, date, userId));
-                    callUserCountInfo.setInAllCount(this.tCallRecordMapper.getCountByTypeAndDate(0, null, userId));
+                    callUserCountInfo.setInTodayCount(this.tCallRecordMapper.getCountByTypeAndDate(0, date, userId, null));
+                    callUserCountInfo.setInAllCount(this.tCallRecordMapper.getCountByTypeAndDate(0, null, userId, 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));
+                    //2025年03月24日15:37:36 新增新的统计 今日呼入-已接听 和 今日呼入-未接听
+                    callUserCountInfo.setInTodaySuccessCount(this.tCallRecordMapper.getCountByTypeAndDate(0, date, userId, 1));
+                    callUserCountInfo.setInTodayFailCount(this.tCallRecordMapper.getCountByTypeAndDate(0, date, userId, 0));
                 }
             }
         }

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

@@ -397,6 +397,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           <!-- AND user_id = #{userId} -->
         AND (user_id = #{userId} or transfer_user_id = #{userId})
         <if test="date != null "> and DATE_FORMAT(time_begin, '%Y-%m-%d') = #{date} </if>
+        <if test="status != null "> and status = #{status} </if>
     </select>
 
 
@@ -430,7 +431,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     AND service_category = 1 AND status = 1
                 </when>
                 <when test="6 == type">
-                    AND (service_category = 2 or service_category = 0) AND status = 1
+                    <!-- 2025年03月24日15:21:20 这里过滤掉已接听的筛选条件 -->
+                    AND (service_category = 2 or service_category = 0)
                 </when>
                 <when test="7 == type">
                     AND service_category = 1
@@ -439,7 +441,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     AND service_category = 2
                 </when>
                 <when test="9 == type">
-                    AND (service_category = 0 OR service_category = 2) AND status = 1
+                    <!-- 2025年03月24日15:21:20 这里过滤掉已接听的筛选条件 -->
+                    AND (service_category = 0 OR service_category = 2)
                 </when>
             </choose>
         </if>