|
@@ -168,7 +168,7 @@ public class ServiceAnalyseController {
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "项目调配完成进度", response = Long.class) })
|
|
|
public Result allocation(@ApiParam(value = "服务单元", required = true) @RequestParam Long serviceUnitId) {
|
|
|
List<UserArchivesAllocationResult> crmAllocation = serviceAnalyseService.findCrmAllocation(serviceUnitId, null, null);
|
|
|
- return ResultUtil.ok(crmAllocation.stream().filter(e->e.getDistributed()<e.getQuota()).count()*100/crmAllocation.size());
|
|
|
+ return ResultUtil.ok(crmAllocation.isEmpty() ?0:crmAllocation.stream().filter(e->e.getDistributed()<e.getQuota()).count()/crmAllocation.size());
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -182,7 +182,7 @@ public class ServiceAnalyseController {
|
|
|
List<UserArchivesAllocationResult> list = serviceAnalyseService.findCrmAllocation(serviceUnitId, null, null);
|
|
|
int quota = list.stream().mapToInt(UserArchivesAllocationResult::getQuota).sum();
|
|
|
int distributed = list.stream().mapToInt(UserArchivesAllocationResult::getDistributed).sum();
|
|
|
- return ResultUtil.ok(distributed*100/quota);
|
|
|
+ return ResultUtil.ok(quota==0?0:distributed/quota);
|
|
|
}
|
|
|
|
|
|
/**
|