瀏覽代碼

通话记录统计列表新增新的统计字段

王苗苗 1 月之前
父節點
當前提交
64feed12c2

+ 16 - 0
slibra-system/src/main/java/com/slibra/business/res/CallRecordListResp.java

@@ -50,6 +50,22 @@ public class CallRecordListResp {
     //未接通率
     private BigDecimal failRate = BigDecimal.ZERO;
 
+    //2025年02月17日16:09:30 因为逻辑调整 下面是新增的字段,上面的逻辑保持不变
+    //AI处理量
+    private int aiTotal;
+
+    //AI转人工处理量
+    private int aiToHuman;
+
+    //人工处理量(含转人工)
+    private int humanAndTransferTotal;
+
+    //AI处理率
+    private BigDecimal aiRate = BigDecimal.ZERO;
+
+    //接通率
+    private BigDecimal successRate = BigDecimal.ZERO;
+
 
 
 }

+ 16 - 2
slibra-system/src/main/java/com/slibra/business/service/impl/TCallRecordServiceImpl.java

@@ -513,7 +513,8 @@ public class TCallRecordServiceImpl implements ITCallRecordService
                 //呼入总量
                 int inTotal = this.tCallRecordMapper.getTotalInByType(null, date);
                 callRecordListResp.setInTotal(inTotal);
-                callRecordListResp.setSuccessTotal(this.tCallRecordMapper.getTotalInByType(0, date));
+                int successTotal = this.tCallRecordMapper.getTotalInByType(0, date);
+                callRecordListResp.setSuccessTotal(successTotal);
                 callRecordListResp.setFailTotal(this.tCallRecordMapper.getTotalInByType(1, date));
                 callRecordListResp.setRobotHearTotal(this.tCallRecordMapper.getTotalInByType(2, date));
                 callRecordListResp.setTransferTotal(this.tCallRecordMapper.getTotalInByType(3, date));
@@ -524,13 +525,26 @@ public class TCallRecordServiceImpl implements ITCallRecordService
                 //人工处理量
                 int humanHandleTotal = this.tCallRecordMapper.getTotalInByType(6, date);
                 callRecordListResp.setHumanHandleTotal(humanHandleTotal);
-                //处理 占比
+                //2025年02月17日16:28:14 新增新的统计
+                //AI处理量
+                int aiTotal = this.tCallRecordMapper.getTotalInByType(7, date);
+                callRecordListResp.setAiTotal(aiTotal);
+                //AI转人工处理量
+                int aiToHuman = this.tCallRecordMapper.getTotalInByType(8, date);
+                callRecordListResp.setAiToHuman(aiToHuman);
+                //人工处理量(含转人工)
+                int humanAndTransferTotal =this.tCallRecordMapper.getTotalInByType(9, date);
+                callRecordListResp.setHumanAndTransferTotal(humanAndTransferTotal);
+
                 if(inTotal > 0){
                     BigDecimal robotRate = DecimalUtils.getNLengthHalfUp(new BigDecimal(robotHandleTotal/(double)inTotal).multiply(BigDecimal_100), INT_2);
                     BigDecimal humanRate = DecimalUtils.getNLengthHalfUp(new BigDecimal(humanHandleTotal/(double)inTotal).multiply(BigDecimal_100), INT_2);
                     callRecordListResp.setRobotRate(robotRate);
                     callRecordListResp.setHumanRate(humanRate);
                     callRecordListResp.setFailRate(DecimalUtils.getNLengthHalfUp(BigDecimal_100.subtract(robotRate).subtract(humanRate), INT_2));
+                    //2025年02月17日16:28:14 新增新的统计-占比
+                    callRecordListResp.setAiRate(DecimalUtils.getNLengthHalfUp(new BigDecimal(aiTotal/(double)inTotal).multiply(BigDecimal_100), INT_2));
+                    callRecordListResp.setSuccessRate(DecimalUtils.getNLengthHalfUp(new BigDecimal(successTotal/(double)inTotal).multiply(BigDecimal_100), INT_2));
                 }
                 result.add(callRecordListResp);
             }

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

@@ -432,6 +432,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 <when test="6 == type">
                     AND (service_category = 2 or service_category = 0) AND status = 1
                 </when>
+                <when test="7 == type">
+                    AND service_category = 1
+                </when>
+                <when test="8 == type">
+                    AND service_category = 2
+                </when>
+                <when test="9 == type">
+                    AND (service_category = 0 OR service_category = 2) AND status = 1
+                </when>
             </choose>
         </if>
     </select>