diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryServiceImpl.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryServiceImpl.java index 5c5c162b..01458c4b 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryServiceImpl.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryServiceImpl.java @@ -422,7 +422,8 @@ public class WmsInventoryServiceImpl implements IWmsInventoryService { for (WmsInventoryLedgerVo record : ledgerList) { String key = record.getMaterialId() + "_" + record.getBatchCode() + "_" + record.getLocationCode(); BigDecimal currentBalance = balanceMap.getOrDefault(key, BigDecimal.ZERO); - BigDecimal newBalance = currentBalance.add(record.getChangeQty()); + BigDecimal changeQty = record.getChangeQty() != null ? record.getChangeQty() : BigDecimal.ZERO; + BigDecimal newBalance = currentBalance.add(changeQty); balanceMap.put(key, newBalance); record.setBalanceQty(newBalance); }