优化
This commit is contained in:
@ -2444,6 +2444,11 @@ public class PgsProgressCategoryServiceImpl extends ServiceImpl<PgsProgressCateg
|
|||||||
.map(PgsProgressCategory::getUnitType)
|
.map(PgsProgressCategory::getUnitType)
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.findFirst().orElse(null);
|
.findFirst().orElse(null);
|
||||||
|
if (StringUtils.isNotBlank(unitType) && unitType.equals(PgsProgressUnitTypeEnum.PERCENTAGE.getValue())) {
|
||||||
|
BigDecimal size = BigDecimal.valueOf(value.size());
|
||||||
|
completedTotal = completedTotal.divide(size, 2, RoundingMode.HALF_UP);
|
||||||
|
finishedNum = finishedNum.divide(size, 2, RoundingMode.HALF_UP);
|
||||||
|
}
|
||||||
// 封装数据
|
// 封装数据
|
||||||
PgsProgressCategoryDateTotalVo vo = new PgsProgressCategoryDateTotalVo();
|
PgsProgressCategoryDateTotalVo vo = new PgsProgressCategoryDateTotalVo();
|
||||||
vo.setName(name);
|
vo.setName(name);
|
||||||
@ -2521,11 +2526,6 @@ public class PgsProgressCategoryServiceImpl extends ServiceImpl<PgsProgressCateg
|
|||||||
if (planNumber.compareTo(BigDecimal.ZERO) <= 0) {
|
if (planNumber.compareTo(BigDecimal.ZERO) <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 获取累计完成数量
|
|
||||||
BigDecimal completedTotal = value.stream()
|
|
||||||
.map(PgsProgressCategory::getCompleted)
|
|
||||||
.filter(Objects::nonNull)
|
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
||||||
// 获取类别单位
|
// 获取类别单位
|
||||||
String unit = value.stream()
|
String unit = value.stream()
|
||||||
.map(PgsProgressCategory::getUnit)
|
.map(PgsProgressCategory::getUnit)
|
||||||
|
|||||||
Reference in New Issue
Block a user