This commit is contained in:
lcj
2025-11-19 17:57:06 +08:00
parent c2afe05e81
commit 403848cb4b

View File

@ -2444,6 +2444,11 @@ public class PgsProgressCategoryServiceImpl extends ServiceImpl<PgsProgressCateg
.map(PgsProgressCategory::getUnitType)
.filter(Objects::nonNull)
.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();
vo.setName(name);
@ -2521,11 +2526,6 @@ public class PgsProgressCategoryServiceImpl extends ServiceImpl<PgsProgressCateg
if (planNumber.compareTo(BigDecimal.ZERO) <= 0) {
return;
}
// 获取累计完成数量
BigDecimal completedTotal = value.stream()
.map(PgsProgressCategory::getCompleted)
.filter(Objects::nonNull)
.reduce(BigDecimal.ZERO, BigDecimal::add);
// 获取类别单位
String unit = value.stream()
.map(PgsProgressCategory::getUnit)