|
@@ -1,9 +1,6 @@
|
|
|
package com.slibra.business.service.impl;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Objects;
|
|
|
+import java.util.*;
|
|
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
import com.slibra.business.domain.TCutOffWater;
|
|
@@ -11,6 +8,7 @@ import com.slibra.business.domain.TUserInfo;
|
|
|
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;
|
|
@@ -286,16 +284,58 @@ public class TCallRecordServiceImpl implements ITCallRecordService
|
|
|
|
|
|
//通话次数和通话时长
|
|
|
callRecordCount.setPersonCount(this.tCallRecordMapper.getPersonCountRecordIsRobot(0));
|
|
|
- callRecordCount.setPersonTotal(this.tCallRecordMapper.getPersonTotalRecordIsRobot(0));
|
|
|
+ callRecordCount.setPersonTotal(this.tCallRecordMapper.getPersonTotalRecordIsRobot(0, null));
|
|
|
|
|
|
callRecordCount.setRobotCount(this.tCallRecordMapper.getPersonCountRecordIsRobot(1));
|
|
|
- callRecordCount.setRobotTotal(this.tCallRecordMapper.getPersonTotalRecordIsRobot(1));
|
|
|
+ callRecordCount.setRobotTotal(this.tCallRecordMapper.getPersonTotalRecordIsRobot(1, null));
|
|
|
//转人工次数
|
|
|
callRecordCount.setRobotTransfer(transferCount);
|
|
|
|
|
|
return callRecordCount;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<CallUserCountInfo> userCallCount() {
|
|
|
+ //先获取所有的人工信息 再查状态 再统计数据
|
|
|
+ List<CallUserCountInfo> result = this.tCallRecordMapper.selectAllUsersByType(0);
|
|
|
+ String date = DateUtils.getDate();
|
|
|
+ if(!CollectionUtils.isEmpty(result)){
|
|
|
+ for (CallUserCountInfo callUserCountInfo : result) {
|
|
|
+ String userId = callUserCountInfo.getUserId();
|
|
|
+ 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));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<CallUserCountInfo> robotCallCount() {
|
|
|
+ //先获取所有的机器人信息 再查状态 再统计数据
|
|
|
+ List<CallUserCountInfo> result = this.tCallRecordMapper.selectAllUsersByType(1);
|
|
|
+ String date = DateUtils.getDate();
|
|
|
+ if(!CollectionUtils.isEmpty(result)){
|
|
|
+ for (CallUserCountInfo callUserCountInfo : result) {
|
|
|
+ String userId = callUserCountInfo.getUserId();
|
|
|
+ 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.setOutTodayCount(this.tCallRecordMapper.getCountByTypeAndDate(1, date));
|
|
|
+ callUserCountInfo.setOutAllCount(this.tCallRecordMapper.getCountByTypeAndDate(1, null));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 校验数据
|