Commit 21958404 by wenyang Committed by akexiu

团队商机预测,解决完成率报错问题(除数为0无法计算)

parent b49c4138
...@@ -2810,7 +2810,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -2810,7 +2810,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
} }
//年完成率 //年完成率
if (!CommonUtil.isNullOrZero(performanceForecast.get("totalFYCYear"))) { if (!CommonUtil.isNullOrZero(performanceForecast.get("totalFYCYear")) && !CommonUtil.isNullOrZero(yearGoal)) {
Double achievementRateYear = performanceForecast.get("totalFYCYear") Double achievementRateYear = performanceForecast.get("totalFYCYear")
.multiply(BigDecimal.valueOf(100)) .multiply(BigDecimal.valueOf(100))
.divide(BigDecimal.valueOf(yearGoal), 2, BigDecimal.ROUND_HALF_UP) .divide(BigDecimal.valueOf(yearGoal), 2, BigDecimal.ROUND_HALF_UP)
...@@ -2818,7 +2818,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -2818,7 +2818,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
achievementRateMap.put("achievementRateYear", achievementRateYear); achievementRateMap.put("achievementRateYear", achievementRateYear);
} }
//季完成率 //季完成率
if (!CommonUtil.isNullOrZero(performanceForecast.get("totalFYCQuarter"))) { if (!CommonUtil.isNullOrZero(performanceForecast.get("totalFYCQuarter")) && !CommonUtil.isNullOrZero(quarterGoal)) {
Double achievementRateQuarter = performanceForecast.get("totalFYCQuarter") Double achievementRateQuarter = performanceForecast.get("totalFYCQuarter")
.multiply(BigDecimal.valueOf(100)) .multiply(BigDecimal.valueOf(100))
.divide(BigDecimal.valueOf(quarterGoal), 2, BigDecimal.ROUND_HALF_UP) .divide(BigDecimal.valueOf(quarterGoal), 2, BigDecimal.ROUND_HALF_UP)
...@@ -2826,7 +2826,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -2826,7 +2826,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
achievementRateMap.put("achievementRateQuarter", achievementRateQuarter); achievementRateMap.put("achievementRateQuarter", achievementRateQuarter);
} }
//月完成率 //月完成率
if (!CommonUtil.isNullOrZero(performanceForecast.get("totalFYCMonth"))) { if (!CommonUtil.isNullOrZero(performanceForecast.get("totalFYCMonth")) && !CommonUtil.isNullOrZero(monthGoal)) {
Double achievementRateMonth = performanceForecast.get("totalFYCMonth") Double achievementRateMonth = performanceForecast.get("totalFYCMonth")
.multiply(BigDecimal.valueOf(100)) .multiply(BigDecimal.valueOf(100))
.divide(BigDecimal.valueOf(monthGoal), 2, BigDecimal.ROUND_HALF_UP) .divide(BigDecimal.valueOf(monthGoal), 2, BigDecimal.ROUND_HALF_UP)
...@@ -2985,10 +2985,10 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -2985,10 +2985,10 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
if (practitionerId != null) { if (practitionerId != null) {
//等保调整 //等保调整
List<AclCustomer> findByObjSortable = aclPractitionerDALService.getAclCustomers(practitionerId, null); List<AclCustomer> findByObjSortable = aclPractitionerDALService.getAclCustomers(practitionerId, null);
if (null == findByObjSortable) { // if (null == findByObjSortable) {
responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("630028"))); // responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("630028")));
return responseVO; // return responseVO;
} // }
Integer time = requestVO.getTime(); Integer time = requestVO.getTime();
time = (time == null) ? 1 : time; time = (time == null) ? 1 : time;
PageHelper.clearPage();//偶然遇到了这个问题,同一个查询结果一会是10个(预期),一会是真实个数(刷新/重启应用就又变成真实个数) 查看日志,发现了问题:结果为10个时查询SQL自动加上了Limit 10 PageHelper.clearPage();//偶然遇到了这个问题,同一个查询结果一会是10个(预期),一会是真实个数(刷新/重启应用就又变成真实个数) 查看日志,发现了问题:结果为10个时查询SQL自动加上了Limit 10
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment