diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/service/StockShelfOrderDomainService.java b/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/service/StockShelfOrderDomainService.java index bc75f23df..b30401711 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/service/StockShelfOrderDomainService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/service/StockShelfOrderDomainService.java @@ -428,6 +428,7 @@ public class StockShelfOrderDomainService { Long shipperId = stockReceiptOrderDO.getShipperId(); MaterialInventory param = getParam(shelfMaterialDetail, fieldNames, shipperId); List materialInventoryPOS = materialInventoryMapper.selectListByWhere(param); + LoginUser loginUser = SecurityUtils.getLoginUser(); if (materialInventoryPOS.size() == 0) { MaterialInventory materialInventory = new MaterialInventory(); //仓库信息 @@ -472,11 +473,15 @@ public class StockShelfOrderDomainService { materialInventory.setAllocationQuantity(shelfMaterialDetail.getShelvesQuantity()); materialInventory.setFreezeQuantity(BigDecimal.ZERO); + //创建人信息 + materialInventory.setCreateBy(loginUser.getUserid()); + materialInventory.setCreateByName(loginUser.getUsername()); + materialInventory.setCreateTime(new Date()); + materialInventoryMapper.insert(materialInventory); //库存调整记录 - LoginUser loginUser = SecurityUtils.getLoginUser(); InventoryAdjustmentRecord inventoryAdjustmentRecord = new InventoryAdjustmentRecord(); inventoryAdjustmentRecord.setAdjustType(0L); inventoryAdjustmentRecord.setMaterialBaseInfoId(materialInventory.getMaterialBaseInfoId()); @@ -510,6 +515,9 @@ public class StockShelfOrderDomainService { inventoryAdjustmentRecord.setFreezeAfterQuantity(BigDecimal.ZERO); inventoryAdjustmentRecord.setInventoryBeforeQuantity(BigDecimal.ZERO); inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity()); + inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid()); + inventoryAdjustmentRecord.setCreateByName(loginUser.getUsername()); + inventoryAdjustmentRecord.setCreateTime(new Date()); inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord); } else if (materialInventoryPOS.size() == 1) { MaterialInventory materialInventory = new MaterialInventory(); @@ -521,9 +529,12 @@ public class StockShelfOrderDomainService { materialInventoryPO.setInventoryQuantity(newInventoryQuantity); materialInventoryPO.setAllocationQuantity(newAllocationQuantity); BeanUtils.copyBeanProp(materialInventoryPO, materialInventory); + materialInventory.setUpdateBy(loginUser.getUserid()); + materialInventory.setUpdateByName(loginUser.getUsername()); + materialInventory.setUpdateTime(new Date()); materialInventoryMapper.updateById(materialInventory); - LoginUser loginUser = SecurityUtils.getLoginUser(); + InventoryAdjustmentRecord inventoryAdjustmentRecord = new InventoryAdjustmentRecord(); inventoryAdjustmentRecord.setAdjustType(0L); inventoryAdjustmentRecord.setMaterialBaseInfoId(materialInventory.getMaterialBaseInfoId()); @@ -557,6 +568,9 @@ public class StockShelfOrderDomainService { inventoryAdjustmentRecord.setFreezeAfterQuantity(materialInventory.getFreezeQuantity()); inventoryAdjustmentRecord.setInventoryBeforeQuantity(oldInventoryQuantity); inventoryAdjustmentRecord.setInventoryAfterQuantity(newInventoryQuantity); + inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid()); + inventoryAdjustmentRecord.setCreateByName(loginUser.getUsername()); + inventoryAdjustmentRecord.setCreateTime(new Date()); inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord); } }