差异库存查询处理可用数量

This commit is contained in:
zhou-hongcheng
2026-03-15 14:14:58 +08:00
parent bcb28e40e1
commit 099667fd5d
@@ -190,6 +190,13 @@ public class DifferentManageImpl extends ServiceImpl<DifferentManageMapper, Diff
// if (e.getInvestigationStatus() != 3){ // 库存更新 // if (e.getInvestigationStatus() != 3){ // 库存更新
materialInventory = materialInventoryMapper.selectById(e.getMaterialInventoryId()); materialInventory = materialInventoryMapper.selectById(e.getMaterialInventoryId());
materialInventory.setInventoryQuantity(e.getInvestigationQuantity()); materialInventory.setInventoryQuantity(e.getInvestigationQuantity());
if (e.getInvestigationResult() == 1){
materialInventory.setAllocationQuantity(materialInventory.getAllocationQuantity().add(e.getDifferentQuantity()));
} else if (e.getInvestigationResult() == 2) {
materialInventory.setAllocationQuantity(materialInventory.getAllocationQuantity().subtract(e.getDifferentQuantity()));
}else {
materialInventory.setAllocationQuantity(materialInventory.getAllocationQuantity() == null ? BigDecimal.ZERO : materialInventory.getAllocationQuantity());
}
// } // }
InventoryAdjustmentRecord(e); InventoryAdjustmentRecord(e);
materialInventoryMapper.updateMaterial(JSONUtil.toBean(JSONUtil.toJsonStr(materialInventory), MaterialInventoryDO.class)); materialInventoryMapper.updateMaterial(JSONUtil.toBean(JSONUtil.toJsonStr(materialInventory), MaterialInventoryDO.class));