fix: 结算单空指针异常

This commit is contained in:
刘泉佳
2026-11-02 09:30:55 +08:00
parent 5fc3b3aacb
commit f6dcca9d6b
22 changed files with 2 additions and 1 deletions
@@ -2061,7 +2061,8 @@ public class FormalSettlementServiceImpl extends BaseServiceImpl<FormalSettlemen
.orderByAsc(FormalSettlementDetailFee::getLineNo)).stream()
.collect(Collectors.groupingBy(FormalSettlementDetailFee::getFormalSettlementDetailId, LinkedHashMap::new, Collectors.toList()));
for (FormalSettlementDetail detail : details) {
Waybill waybill = waybillMap.get(detail.getWaybillId());
// waybillMap 为不可变空 Map(全部明细均无运单号时),get(null) 会抛 NPE,需先判空
Waybill waybill = detail.getWaybillId() == null ? null : waybillMap.get(detail.getWaybillId());
LinkedHashSet<String> goodsNames = new LinkedHashSet<>();
LinkedHashSet<String> goodsTypes = new LinkedHashSet<>();
if (waybill != null) {