Browse Source

修复:巡检任务统计保留两位小数

zhongwei
ty 4 months ago
parent
commit
74f119bfdf
  1. 3
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java

3
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java

@ -1192,7 +1192,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, TaskEntity> impleme
if (CollectionUtil.isEmpty(list)||CollectionUtil.isEmpty(undoneIds)){
voteChartVo.setFinishRate(0.00d);
}else {
BigDecimal divide = new BigDecimal(finishIds.size()).divide(new BigDecimal(list.size()),2, RoundingMode.HALF_UP).setScale(2,RoundingMode.HALF_UP);
BigDecimal divide = new BigDecimal(finishIds.size()).divide(new BigDecimal(list.size()),4, RoundingMode.HALF_UP)
.multiply(new BigDecimal(100)).setScale(2,RoundingMode.HALF_UP);
voteChartVo.setFinishRate(divide.doubleValue());
}
return voteChartVo;

Loading…
Cancel
Save