移位库存调整记录调整数量修改

This commit is contained in:
zhou-hongcheng
2026-03-13 11:10:12 +08:00
parent b90b27fd2c
commit b568bccf02
@@ -436,7 +436,7 @@ public class ShiftMaterialDetailImpl extends ServiceImpl<ShiftMaterialDetailMapp
inventoryAdjustmentRecord.setAdjustAfterStatusName("合格");
inventoryAdjustmentRecord.setAdjustBeforeStatusName("合格");
inventoryAdjustmentRecord.setMaterialBaseInfoId(shiftMaterialDetailDO.getMaterialBaseInfoId());
inventoryAdjustmentRecord.setMaterialCode(shiftMaterialDetailDO.getBarCode());
inventoryAdjustmentRecord.setMaterialCode(shiftMaterialDetailDO.getMaterialCode());
inventoryAdjustmentRecord.setMaterialName(shiftMaterialDetailDO.getMaterialName());
inventoryAdjustmentRecord.setBarCode(shiftMaterialDetailDO.getBarCode());
inventoryAdjustmentRecord.setMaterialBaseInfoId(shiftMaterialDetailDO.getMaterialBaseInfoId());
@@ -463,14 +463,13 @@ public class ShiftMaterialDetailImpl extends ServiceImpl<ShiftMaterialDetailMapp
UserPo userPo = loginUser.getUserPo();
if (userPo != null) inventoryAdjustmentRecord.setCreateByName(userPo.getUserName());
inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecord.setInventoryBeforeQuantity(BigDecimal.ZERO);
inventoryAdjustmentRecord.setInventoryAfterQuantity(shiftMaterialDetailDO.getShiftQuantity());
inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventory1.getAllocationQuantity() == null ? BigDecimal.ZERO : materialInventory1.getAllocationQuantity());
inventoryAdjustmentRecord.setAllocationBeforeQuantity(materialInventory1.getAllocationQuantity() == null ? BigDecimal.ZERO : materialInventory1.getAllocationQuantity());
inventoryAdjustmentRecord.setFreezeBeforeQuantity(materialInventory1.getFreezeQuantity() == null ? BigDecimal.ZERO : materialInventory1.getFreezeQuantity());
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()));
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);//移位前物料记录
InventoryAdjustmentRecord inventoryAdjustmentRecord2 = new InventoryAdjustmentRecord();
BeanUtils.copyProperties(inventoryAdjustmentRecord, inventoryAdjustmentRecord2);
@@ -479,7 +478,8 @@ public class ShiftMaterialDetailImpl extends ServiceImpl<ShiftMaterialDetailMapp
inventoryAdjustmentRecord2.setGrossWeight(BigDecimal.ZERO);
inventoryAdjustmentRecord2.setVolume(BigDecimal.ZERO);
inventoryAdjustmentRecord2.setArea(BigDecimal.ZERO);
inventoryAdjustmentRecord.setInventoryBeforeQuantity(BigDecimal.ZERO);
inventoryAdjustmentRecord.setAllocationBeforeQuantity(BigDecimal.ZERO);
inventoryAdjustmentRecord2.setAdjustedNetWeight(shiftMaterialDetailDO.getNetWeight());
inventoryAdjustmentRecord2.setAdjustedGrossWeight(shiftMaterialDetailDO.getGrossWeight());
inventoryAdjustmentRecord2.setAdjustedVolume(shiftMaterialDetailDO.getVolume());