|
@@ -171,6 +171,11 @@ public class FsStatisSalerWatchServiceImpl implements FsStatisSalerWatchService
|
|
|
// 确定当前销售对应的sop任务的执行记录
|
|
|
List<String> periodList = sopUserLogsMapper.selectSopUserLogsByQwUserIds(qwUserIdList);
|
|
|
|
|
|
+ if(CollectionUtils.isEmpty(periodList)){
|
|
|
+ log.info("当前销售 {} 没有相关的SOP营期!", companyUser.getUserId());
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
for (String periodId : periodList) {
|
|
|
// 去sop记录表找对应的SOP发送记录,记录数作为营期人数
|
|
|
Long periodCount = qwSopLogsMapper.selectQwSopLogsCountByQwUserId(qwUserIdList,periodId,previousDay);
|
|
@@ -183,19 +188,13 @@ public class FsStatisSalerWatchServiceImpl implements FsStatisSalerWatchService
|
|
|
fsStatisSalerWatch.setDeptId(companyUser.getDeptId());
|
|
|
fsStatisSalerWatch.setCompanyUserId(companyUser.getUserId());
|
|
|
fsStatisSalerWatch.setTrainCampNum(periodCount);
|
|
|
- fsStatisSalerWatch.setNotRegisteredNum(periodCount - registerCount);
|
|
|
+ fsStatisSalerWatch.setNotRegisteredNum(Math.max(0, periodCount - registerCount));
|
|
|
fsStatisSalerWatch.setRegisteredNum(registerCount);
|
|
|
fsStatisSalerWatch.setCompletedNum(completedCount);
|
|
|
|
|
|
- float regRate = 0.0f;
|
|
|
- if(periodCount != 0) {
|
|
|
- regRate = registerCount / periodCount;
|
|
|
- }
|
|
|
- float finishedRate = 0.0f;
|
|
|
- if(registerCount != 0) {
|
|
|
- finishedRate = completedCount / registerCount;
|
|
|
- }
|
|
|
-
|
|
|
+ // 修复比率计算
|
|
|
+ float regRate = (periodCount > 0) ? (float) registerCount / periodCount : 0.0f;
|
|
|
+ float finishedRate = (registerCount > 0) ? (float) completedCount / registerCount : 0.0f;
|
|
|
|
|
|
fsStatisSalerWatch.setRegRate(regRate);
|
|
|
fsStatisSalerWatch.setFinishedRate(finishedRate);
|