Browse Source

统计修改

王苗苗 2 months ago
parent
commit
e177a41474

+ 14 - 0
docker.Dockerfile

@@ -0,0 +1,14 @@
+# 使用 OpenJDK 8 作为基础镜像
+FROM openjdk:8-jre-slim
+
+# 设置工作目录
+WORKDIR /app
+
+# 将 JAR 文件复制到工作目录
+COPY target/my-java-app-0.0.1-SNAPSHOT.jar my-java-app.jar
+
+# 暴露应用程序运行的端口
+EXPOSE 8080
+
+# 运行应用程序
+ENTRYPOINT ["java", "-jar", "my-java-app.jar"]

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

@@ -91,5 +91,5 @@ public interface TCallRecordMapper
 
     Integer getStatusByUserId(String userId);
 
-    int getCountByTypeAndDate(@Param("category") int category, @Param("date") String date);
+    int getCountByTypeAndDate(@Param("category") int category, @Param("date") String date, @Param("userId") String userId);
 }

+ 5 - 2
slibra-system/src/main/java/com/slibra/business/res/CallRecordCount.java

@@ -34,16 +34,19 @@ public class CallRecordCount {
 
 
     //------AI机器人------
-    //电话量
+    //电话量 2024年12月19日15:01:22 这里展示的只是呼入[]
     private int aiTotal;
 
     //总量占比
     private Double aiPercent;
 
     //------传统服务------
-    //电话量
+    //电话量 2024年12月19日14:50:48 改成【呼入量】
     private int traditionTotal;
 
+    //2024年12月19日15:04:19 新增字段 传统服务-呼出量
+    private int traditionOutTotal;
+
     //总量占比
     private Double traditionPercent;
 

+ 13 - 12
slibra-system/src/main/java/com/slibra/business/service/impl/TCallRecordServiceImpl.java

@@ -10,7 +10,6 @@ import com.slibra.business.mapper.TCutOffWaterMapper;
 import com.slibra.business.mapper.TUserInfoMapper;
 import com.slibra.business.res.CallRecordCount;
 import com.slibra.business.res.CallUserCountInfo;
-import com.slibra.common.DecimalUtils;
 import com.slibra.common.exception.ServiceException;
 import com.slibra.common.utils.DateUtils;
 import com.slibra.common.utils.SecurityUtils;
@@ -24,7 +23,6 @@ import com.slibra.business.mapper.TCallRecordMapper;
 import com.slibra.business.domain.TCallRecord;
 import com.slibra.business.service.ITCallRecordService;
 import org.springframework.util.CollectionUtils;
-import org.springframework.util.NumberUtils;
 
 import static com.slibra.common.constant.MyConstants.LONG_1;
 
@@ -288,11 +286,14 @@ public class TCallRecordServiceImpl implements ITCallRecordService
         callRecordCount.setAiTotal(aiTotal);
         int traditionTotal = this.tCallRecordMapper.getTotalByIsAi(0);
         callRecordCount.setTraditionTotal(traditionTotal);
+        int traditionOutTotal = this.tCallRecordMapper.getTotalByIsAi(2);
+        callRecordCount.setTraditionOutTotal(traditionOutTotal);
         if(total > 0){
-            callRecordCount.setHumanPercent((double)humanTotal / total);
-            callRecordCount.setWhiteListPercent((double)whiteListTotal / total);
-            callRecordCount.setAiPercent((double)aiTotal / total);
-            callRecordCount.setTraditionPercent((double)traditionTotal / total);
+            callRecordCount.setHumanPercent(humanTotal / (double)total);
+            callRecordCount.setWhiteListPercent(whiteListTotal / (double)total);
+            callRecordCount.setAiPercent(aiTotal / (double)total);
+            //2024年12月19日15:11:01  这里的百分比逻辑改成:traditionTotal + traditionOutTotal
+            callRecordCount.setTraditionPercent((traditionTotal + traditionOutTotal) / (double)total);
         }
         callRecordCount.setSpecialCount(this.tCallRecordMapper.getSpecialCount());
         int transferCount = this.tCallRecordMapper.getTransferCount(null, null);
@@ -331,10 +332,10 @@ public class TCallRecordServiceImpl implements ITCallRecordService
                 if(StringUtils.isNotBlank(userId)){
                     callUserCountInfo.setStatus(this.tCallRecordMapper.getStatusByUserId(userId));
                     callUserCountInfo.setTotalTimes(this.tCallRecordMapper.getPersonTotalRecordIsRobot(0, 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.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));
                 }
             }
         }
@@ -356,8 +357,8 @@ 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));
-                    callUserCountInfo.setInAllCount(this.tCallRecordMapper.getCountByTypeAndDate(0, null));
+                    callUserCountInfo.setInTodayCount(this.tCallRecordMapper.getCountByTypeAndDate(0, date, userId));
+                    callUserCountInfo.setInAllCount(this.tCallRecordMapper.getCountByTypeAndDate(0, null, userId));
 //                    callUserCountInfo.setOutTodayCount(this.tCallRecordMapper.getCountByTypeAndDate(1, date));
 //                    callUserCountInfo.setOutAllCount(this.tCallRecordMapper.getCountByTypeAndDate(1, null));
                     callUserCountInfo.setTodayTransferCount(this.tCallRecordMapper.getTransferCount(userId, date));

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

@@ -224,8 +224,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         t_call_record
         WHERE
         1 = 1 and  type = 1 AND del_flag = 0
-        <if test="businessType == 1 "> and (bussiness_type != '不体验AI服务' or bussiness_type is NULL or bussiness_type = '')</if>
-        <if test="businessType == 0 "> and bussiness_type = '不体验AI服务'</if>
+        <if test="businessType == 1 "> and (bussiness_type != '不体验AI服务' or bussiness_type is NULL or bussiness_type = '') and category = 0</if>
+        <if test="businessType == 0 "> and bussiness_type = '不体验AI服务' and category = 0</if>
+        <if test="businessType == 2 "> and category = 1</if>
     </select>
 
     <select id="getSpecialCount" resultType="int">
@@ -321,6 +322,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             1 = 1
           AND del_flag = 0
           AND category = #{category}
+          AND user_id = #{userId}
         <if test="date != null "> and DATE_FORMAT(create_time, '%Y-%m-%d') = #{date} </if>
     </select>
 </mapper>