移位的库存调整记录修改,以及新库存没有更新时间

This commit is contained in:
秦鸿展
2026-04-22 18:29:34 +08:00
parent 48f53b2d35
commit 3c8aea5093
2 changed files with 5 additions and 2 deletions
@@ -899,6 +899,9 @@ public class ShiftManageDomainService {
materialInventoryDONow.setCreateBy(loginUser.getUserid());
materialInventoryDONow.setCreateByName(loginUser.getUsername());
materialInventoryDONow.setCreateTime(new Date());
materialInventoryDONow.setUpdateBy(loginUser.getUserid());
materialInventoryDONow.setUpdateByName(loginUser.getUsername());
materialInventoryDONow.setUpdateTime(new Date());
return materialInventoryDONow;
}else {
MaterialInventoryDO materialInventoryDONow = new MaterialInventoryDO();
@@ -772,7 +772,6 @@ public class ShiftMaterialDetailImpl extends ServiceImpl<ShiftMaterialDetailMapp
UserPo userPo = loginUser.getUserPo();
if (userPo != null) inventoryAdjustmentRecord.setCreateByName(userPo.getUserName());
inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecord.setInventoryAfterQuantity(shiftMaterialDetailDO.getShiftQuantity());
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());
@@ -826,7 +825,8 @@ public class ShiftMaterialDetailImpl extends ServiceImpl<ShiftMaterialDetailMapp
inventoryAdjustmentRecord2.setFreezeBeforeQuantity(newFreezeBefore);
inventoryAdjustmentRecord2.setFreezeAfterQuantity(newFreezeBefore);
inventoryAdjustmentRecord2.setInventoryAfterQuantity(newInvBefore.add(shiftQty));
inventoryAdjustmentRecord2.setAllocationAfterQuantity(materialInventory1.getAllocationQuantity().subtract(shiftMaterialDetailDO.getShiftQuantity()));
// 新库位移入:调整后可用数量 = 新库位调整前可用 + 移入数量(与调整后库存数量一致,均为移入可用量)
inventoryAdjustmentRecord2.setAllocationAfterQuantity(newAllocBefore.add(shiftQty));
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord2);//移位后物料记录(新库位增加)
}