修改bug

This commit is contained in:
lcj
2025-12-10 10:58:25 +08:00
parent b8334c7764
commit f2c0932e2e

View File

@ -2005,9 +2005,12 @@ public class PgsProgressCategoryServiceImpl extends ServiceImpl<PgsProgressCateg
case null, default -> throw new ServiceException("不支持的设施类型", HttpStatus.BAD_REQUEST);
}
// 更新进度类别数量
BigDecimal total = category.getTotal().add(BigDecimal.valueOf(number));
PgsProgressCategory updateCategory = new PgsProgressCategory();
updateCategory.setId(progressCategoryId);
updateCategory.setTotal(category.getTotal().add(BigDecimal.valueOf(number)));
updateCategory.setTotal(total);
updateCategory.setOwnerPrice(total.multiply(category.getOwnerPrice()));
updateCategory.setConstructionPrice(total.multiply(category.getConstructionPrice()));
boolean update = this.updateById(updateCategory);
if (!update) {
throw new ServiceException("修改进度类别数量失败,数据库异常", HttpStatus.ERROR);