移位库存调整记录 调整后可用数量=库存-移位

This commit is contained in:
zhou-hongcheng
2026-03-18 15:46:06 +08:00
parent b2d65c734c
commit b094f57266
@@ -776,7 +776,7 @@ public class ShiftMaterialDetailImpl extends ServiceImpl<ShiftMaterialDetailMapp
inventoryAdjustmentRecord.setFreezeAfterQuantity(materialInventory1.getFreezeQuantity() == null ? BigDecimal.ZERO : materialInventory1.getFreezeQuantity());
inventoryAdjustmentRecord.setInventoryBeforeQuantity(shiftMaterialDetailDO.getInventoryQuantity());
inventoryAdjustmentRecord.setInventoryAfterQuantity(shiftMaterialDetailDO.getInventoryQuantity().subtract(shiftMaterialDetailDO.getShiftQuantity()));
inventoryAdjustmentRecord.setAllocationAfterQuantity(shiftMaterialDetailDO.getInventoryQuantity().subtract(shiftMaterialDetailDO.getShiftQuantity()));
inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventory1.getAllocationQuantity().subtract(shiftMaterialDetailDO.getShiftQuantity()));
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);//移位前物料记录
InventoryAdjustmentRecord inventoryAdjustmentRecord2 = new InventoryAdjustmentRecord();
BeanUtils.copyProperties(inventoryAdjustmentRecord, inventoryAdjustmentRecord2);
@@ -824,7 +824,7 @@ public class ShiftMaterialDetailImpl extends ServiceImpl<ShiftMaterialDetailMapp
inventoryAdjustmentRecord2.setFreezeBeforeQuantity(newFreezeBefore);
inventoryAdjustmentRecord2.setFreezeAfterQuantity(newFreezeBefore);
inventoryAdjustmentRecord2.setInventoryAfterQuantity(newInvBefore.add(shiftQty));
inventoryAdjustmentRecord2.setAllocationAfterQuantity(newAllocBefore.add(shiftQty));
inventoryAdjustmentRecord2.setAllocationAfterQuantity(materialInventory1.getAllocationQuantity().subtract(shiftMaterialDetailDO.getShiftQuantity()));
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord2);//移位后物料记录(新库位增加)
}