库存及调整记录 添加创建人信息;
This commit is contained in:
+16
-2
@@ -428,6 +428,7 @@ public class StockShelfOrderDomainService {
|
|||||||
Long shipperId = stockReceiptOrderDO.getShipperId();
|
Long shipperId = stockReceiptOrderDO.getShipperId();
|
||||||
MaterialInventory param = getParam(shelfMaterialDetail, fieldNames, shipperId);
|
MaterialInventory param = getParam(shelfMaterialDetail, fieldNames, shipperId);
|
||||||
List<MaterialInventoryPO> materialInventoryPOS = materialInventoryMapper.selectListByWhere(param);
|
List<MaterialInventoryPO> materialInventoryPOS = materialInventoryMapper.selectListByWhere(param);
|
||||||
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
if (materialInventoryPOS.size() == 0) {
|
if (materialInventoryPOS.size() == 0) {
|
||||||
MaterialInventory materialInventory = new MaterialInventory();
|
MaterialInventory materialInventory = new MaterialInventory();
|
||||||
//仓库信息
|
//仓库信息
|
||||||
@@ -472,11 +473,15 @@ public class StockShelfOrderDomainService {
|
|||||||
materialInventory.setAllocationQuantity(shelfMaterialDetail.getShelvesQuantity());
|
materialInventory.setAllocationQuantity(shelfMaterialDetail.getShelvesQuantity());
|
||||||
materialInventory.setFreezeQuantity(BigDecimal.ZERO);
|
materialInventory.setFreezeQuantity(BigDecimal.ZERO);
|
||||||
|
|
||||||
|
//创建人信息
|
||||||
|
materialInventory.setCreateBy(loginUser.getUserid());
|
||||||
|
materialInventory.setCreateByName(loginUser.getUsername());
|
||||||
|
materialInventory.setCreateTime(new Date());
|
||||||
|
|
||||||
materialInventoryMapper.insert(materialInventory);
|
materialInventoryMapper.insert(materialInventory);
|
||||||
|
|
||||||
|
|
||||||
//库存调整记录
|
//库存调整记录
|
||||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
||||||
InventoryAdjustmentRecord inventoryAdjustmentRecord = new InventoryAdjustmentRecord();
|
InventoryAdjustmentRecord inventoryAdjustmentRecord = new InventoryAdjustmentRecord();
|
||||||
inventoryAdjustmentRecord.setAdjustType(0L);
|
inventoryAdjustmentRecord.setAdjustType(0L);
|
||||||
inventoryAdjustmentRecord.setMaterialBaseInfoId(materialInventory.getMaterialBaseInfoId());
|
inventoryAdjustmentRecord.setMaterialBaseInfoId(materialInventory.getMaterialBaseInfoId());
|
||||||
@@ -510,6 +515,9 @@ public class StockShelfOrderDomainService {
|
|||||||
inventoryAdjustmentRecord.setFreezeAfterQuantity(BigDecimal.ZERO);
|
inventoryAdjustmentRecord.setFreezeAfterQuantity(BigDecimal.ZERO);
|
||||||
inventoryAdjustmentRecord.setInventoryBeforeQuantity(BigDecimal.ZERO);
|
inventoryAdjustmentRecord.setInventoryBeforeQuantity(BigDecimal.ZERO);
|
||||||
inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity());
|
inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity());
|
||||||
|
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
|
||||||
|
inventoryAdjustmentRecord.setCreateByName(loginUser.getUsername());
|
||||||
|
inventoryAdjustmentRecord.setCreateTime(new Date());
|
||||||
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);
|
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);
|
||||||
} else if (materialInventoryPOS.size() == 1) {
|
} else if (materialInventoryPOS.size() == 1) {
|
||||||
MaterialInventory materialInventory = new MaterialInventory();
|
MaterialInventory materialInventory = new MaterialInventory();
|
||||||
@@ -521,9 +529,12 @@ public class StockShelfOrderDomainService {
|
|||||||
materialInventoryPO.setInventoryQuantity(newInventoryQuantity);
|
materialInventoryPO.setInventoryQuantity(newInventoryQuantity);
|
||||||
materialInventoryPO.setAllocationQuantity(newAllocationQuantity);
|
materialInventoryPO.setAllocationQuantity(newAllocationQuantity);
|
||||||
BeanUtils.copyBeanProp(materialInventoryPO, materialInventory);
|
BeanUtils.copyBeanProp(materialInventoryPO, materialInventory);
|
||||||
|
materialInventory.setUpdateBy(loginUser.getUserid());
|
||||||
|
materialInventory.setUpdateByName(loginUser.getUsername());
|
||||||
|
materialInventory.setUpdateTime(new Date());
|
||||||
materialInventoryMapper.updateById(materialInventory);
|
materialInventoryMapper.updateById(materialInventory);
|
||||||
|
|
||||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
||||||
InventoryAdjustmentRecord inventoryAdjustmentRecord = new InventoryAdjustmentRecord();
|
InventoryAdjustmentRecord inventoryAdjustmentRecord = new InventoryAdjustmentRecord();
|
||||||
inventoryAdjustmentRecord.setAdjustType(0L);
|
inventoryAdjustmentRecord.setAdjustType(0L);
|
||||||
inventoryAdjustmentRecord.setMaterialBaseInfoId(materialInventory.getMaterialBaseInfoId());
|
inventoryAdjustmentRecord.setMaterialBaseInfoId(materialInventory.getMaterialBaseInfoId());
|
||||||
@@ -557,6 +568,9 @@ public class StockShelfOrderDomainService {
|
|||||||
inventoryAdjustmentRecord.setFreezeAfterQuantity(materialInventory.getFreezeQuantity());
|
inventoryAdjustmentRecord.setFreezeAfterQuantity(materialInventory.getFreezeQuantity());
|
||||||
inventoryAdjustmentRecord.setInventoryBeforeQuantity(oldInventoryQuantity);
|
inventoryAdjustmentRecord.setInventoryBeforeQuantity(oldInventoryQuantity);
|
||||||
inventoryAdjustmentRecord.setInventoryAfterQuantity(newInventoryQuantity);
|
inventoryAdjustmentRecord.setInventoryAfterQuantity(newInventoryQuantity);
|
||||||
|
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
|
||||||
|
inventoryAdjustmentRecord.setCreateByName(loginUser.getUsername());
|
||||||
|
inventoryAdjustmentRecord.setCreateTime(new Date());
|
||||||
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);
|
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user