平衡表

This commit is contained in:
mashuai 2025-10-31 10:25:58 +08:00
parent 4ef78a3a49
commit f98f630eba
1 changed files with 4 additions and 3 deletions

View File

@ -1465,8 +1465,8 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
// 获取施工队及分包数据
List<MaterialProvideNumInfo> subList = materialMachineMapper.getSubNumList(bean);
// 任一列表为空直接返回无需处理
if (CollectionUtils.isEmpty(recordList) || CollectionUtils.isEmpty(subList)) {
// 列表为空直接返回无需处理
if (CollectionUtils.isEmpty(recordList) && CollectionUtils.isEmpty(subList)) {
return recordList;
}
@ -1490,7 +1490,8 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
// 合并数值字段假设为BigDecimal确保非null若可能为null需先判断
matchedRecord.setUseNum(subInfo.getUseNum().add(matchedRecord.getUseNum()));
matchedRecord.setStoreNum(matchedRecord.getStoreNum().subtract(subInfo.getUseNum()));
matchedRecord.setStoreNum(matchedRecord.getStoreNum().subtract(subInfo.getUseNum()).compareTo(BigDecimal.ZERO) < 0
? BigDecimal.ZERO : matchedRecord.getStoreNum().subtract(subInfo.getUseNum()));
// 合并协议ID使用StringBuilder优化拼接
matchedRecord.setAgreementIds(matchedRecord.getAgreementIds() + "," + subInfo.getAgreementIds());
}