判定分机号是否足够分配的逻辑

master
wujingtao 3 years ago
parent 90a2f5e21d
commit ca2f75ab2e

@ -135,7 +135,7 @@ public class ReportServiceImpl implements ReportService {
//获取线索名
String clueName = null;
List<String> label = new ArrayList<>();
String remark = null;
String remark = null;
if (clueMap.containsKey(key)) {
ResSourceLabel resSourceLabel = clueMap.get(key);
clueName = resSourceLabel.getName();
@ -657,17 +657,17 @@ public class ReportServiceImpl implements ReportService {
//统计通话时长
int doubleClueTime = 0;
if (CollUtil.isNotEmpty(doubleCallInfo)) {
for(AllCallInfo ai:doubleCallInfo){
if(ai.getStatus() == DefaultNumberConstants.TWO_NUMBER){
turnOnNum++;
doubleClueTime+=ai.getDuration();
}
}
// doubleClueTime = doubleCallInfo.stream().mapToInt(AllCallInfo::getDuration).sum();
// if (doubleClueTime > 0) {
// //有通话时长 说明电话打通
// turnOnNum++;
// for (AllCallInfo ai : doubleCallInfo) {
// if (ai.getStatus() == DefaultNumberConstants.TWO_NUMBER) {
// doubleClueTime += ai.getDuration();
// }
// }
// doubleClueTime = doubleCallInfo.stream().mapToInt(AllCallInfo::getDuration).sum();
doubleClueTime = doubleCallInfo.stream().filter(item -> item.getStatus() == DefaultNumberConstants.TWO_NUMBER).collect(Collectors.toList()).stream().mapToInt(AllCallInfo::getDuration).sum();
if (doubleClueTime > 0) {
//有通话时长 说明电话打通
turnOnNum++;
}
}
breatheTotalDuration += doubleClueTime;
}

@ -101,7 +101,7 @@ public class TelephoneCallController {
if (ObjectUtil.isEmpty(doubleCallBack) || StrUtil.isEmpty(doubleCallBack.getSessionId())) {
return CommonResponse.createByErrorMessage("参数为空");
}
log.info("=====双呼状态话单 {}", doubleCallBack);
log.info("=====双呼回调状态 {}", doubleCallBack);
telephoneCallService.doubleCallBackStatus(doubleCallBack);
} catch (Exception e) {
log.error("双呼回调状态错误 参数 {}", json);

@ -56,6 +56,10 @@ public class ExtensionNumberServiceImpl implements ExtensionNumberService {
Long companyId = SecurityUtils.getCompanyId();
//查一个分机号
Integer idByStatus = extensionNumberRepository.findIdByStatusAndCompanyId(DefaultNumberConstants.ZERO_NUMBER, companyId);
if (idByStatus == null || idByStatus == 0) {
log.error("可分配的分机号不足,请联系管理员");
throw new BadRequestException("可分配的分机号不足,请联系管理员");
}
ExtensionUser extensionUser = new ExtensionUser();
extensionUser.setMemberId(memberId);
extensionUser.setNumber(idByStatus);

@ -247,13 +247,13 @@ public class TelephoneCallServiceImpl implements TelephoneCallService {
if (sessionId.equals(otherLeg) && StrUtil.isNotBlank(rollCallBackDTO.getRecord_file_url())) {
allCallInfo.setRecordFlag(DefaultNumberConstants.ONE_NUMBER);
allCallInfo.setRecordFileDownloadUrl(rollCallBackDTO.getRecord_file_url());
allCallInfo.setDuration(Integer.valueOf(rollCallBackDTO.getDuration()));
} else {
//拨打线索号的回调
if (StrUtil.isNotBlank(rollCallBackDTO.getCallee_answer_time())) {
//表示接通
callClueRepository.updateByStatus(DefaultNumberConstants.TWO_NUMBER, allCallInfo.getClueId());
allCallInfo.setStatus(DefaultNumberConstants.TWO_NUMBER);
allCallInfo.setDuration(Integer.valueOf(rollCallBackDTO.getDuration()));
}
}
allCallInfoRepository.save(allCallInfo);

Loading…
Cancel
Save