修改统计。

This commit is contained in:
haown 2024-11-08 15:27:18 +08:00
parent 447d7d0250
commit 97d95ff976

View File

@ -325,7 +325,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
// AI拨打人数成功率
if (CollectionUtils.isNotEmpty(aiSuccessList)) {
Map<Long, List<PhoneDialRecordVo>> aiSuccessGroupByPatient = aiSuccessList.stream().collect(Collectors.groupingBy(PhoneDialRecordVo::getPatientId));
retObj.setAiPatientSuccessRate(new BigDecimal(aiSuccessGroupByPatient.keySet().size()).divide(new BigDecimal(retObj.getAiPatientNum()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")));
retObj.setAiPatientSuccessRate((retObj.getAiPatientNum() == null || retObj.getAiPatientNum() == 0) ? BigDecimal.ZERO :new BigDecimal(aiSuccessGroupByPatient.keySet().size()).divide(new BigDecimal(retObj.getAiPatientNum()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")));
}
}
@ -344,7 +344,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
// 人工拨打人数成功率
if (CollectionUtils.isNotEmpty(commonSuccessList)) {
Map<Long, List<PhoneDialRecordVo>> commonSuccessGroupByPatient = commonSuccessList.stream().collect(Collectors.groupingBy(PhoneDialRecordVo::getPatientId));
retObj.setCommonPatientSuccessRate(new BigDecimal(commonSuccessGroupByPatient.keySet().size()).divide(new BigDecimal(retObj.getCommonPatientNum()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")));
retObj.setCommonPatientSuccessRate((retObj.getCommonPatientNum() == null || retObj.getCommonPatientNum()== 0) ? BigDecimal.ZERO : new BigDecimal(commonSuccessGroupByPatient.keySet().size()).divide(new BigDecimal(retObj.getCommonPatientNum()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")));
}
}
return retObj;