|
@@ -1,6 +1,7 @@
|
|
|
package com.slibra.business.service.impl;
|
|
|
|
|
|
import java.io.File;
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
@@ -10,6 +11,7 @@ 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 +26,7 @@ import com.slibra.business.domain.TCallRecord;
|
|
|
import com.slibra.business.service.ITCallRecordService;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
-import static com.slibra.common.constant.MyConstants.LONG_1;
|
|
|
+import static com.slibra.common.constant.MyConstants.*;
|
|
|
|
|
|
/**
|
|
|
* 通话记录Service业务层处理
|
|
@@ -289,11 +291,16 @@ public class TCallRecordServiceImpl implements ITCallRecordService
|
|
|
int traditionOutTotal = this.tCallRecordMapper.getTotalByIsAi(2);
|
|
|
callRecordCount.setTraditionOutTotal(traditionOutTotal);
|
|
|
if(total > 0){
|
|
|
- callRecordCount.setHumanPercent(humanTotal / (double)total);
|
|
|
- callRecordCount.setWhiteListPercent(whiteListTotal / (double)total);
|
|
|
- callRecordCount.setAiPercent(aiTotal / (double)total);
|
|
|
+ BigDecimal humanPercent = DecimalUtils.getNLengthHalfUp(new BigDecimal(humanTotal / (double) total).multiply(BigDecimal_100), INT_0);
|
|
|
+ callRecordCount.setHumanPercent(humanPercent);
|
|
|
+ BigDecimal aiPercent = DecimalUtils.getNLengthHalfUp(new BigDecimal(aiTotal / (double) total).multiply(BigDecimal_100), INT_0);
|
|
|
+ callRecordCount.setAiPercent(aiPercent);
|
|
|
//2024年12月19日15:11:01 这里的百分比逻辑改成:traditionTotal + traditionOutTotal
|
|
|
- callRecordCount.setTraditionPercent((traditionTotal + traditionOutTotal) / (double)total);
|
|
|
+ BigDecimal traditionPercent = DecimalUtils.getNLengthHalfUp(BigDecimal.valueOf((traditionTotal + traditionOutTotal) / (double) total).multiply(BigDecimal_100), INT_0);
|
|
|
+ callRecordCount.setTraditionPercent(traditionPercent);
|
|
|
+ //2024年12月19日18:55:23 需要四个值加在一起是100% 所以这里要用100减去上面三个之和
|
|
|
+// callRecordCount.setWhiteListPercent(whiteListTotal / (double)total);
|
|
|
+ callRecordCount.setWhiteListPercent(DecimalUtils.getNLengthHalfUp(BigDecimal_100.subtract(humanPercent).subtract(aiPercent).subtract(traditionPercent), INT_0));
|
|
|
}
|
|
|
callRecordCount.setSpecialCount(this.tCallRecordMapper.getSpecialCount());
|
|
|
int transferCount = this.tCallRecordMapper.getTransferCount(null, null);
|