优化
This commit is contained in:
@@ -647,36 +647,40 @@ namespace WMS.Web.Domain.Services
|
||||
var tagBox = targetBoxInventorys.Where(x => x.BoxId == dto.TargetBoxId).FirstOrDefault();
|
||||
if (tagBox != null)
|
||||
{
|
||||
var subStockId = tagBox.SubStockId;
|
||||
var stockCode = tagBox.StockCode;
|
||||
var orgCode = tagBox.OrgCode;
|
||||
|
||||
var tag_update_entity = tagBox;
|
||||
//2.2.1这里为了重新上架,改变仓库和仓位的需求
|
||||
if (!string.IsNullOrEmpty(dto.StockCode) && dto.SubStockId.HasValue)
|
||||
{
|
||||
//2.2.2仓位和原来的目标箱的仓位不一致的情况下-》》把目标箱原来仓位的物料进行-即时库存的变更-(减库存)
|
||||
if (dto.SubStockId.Value != tag_update_entity.SubStockId)
|
||||
{
|
||||
foreach (var item in tag_update_entity.Details)
|
||||
{
|
||||
//2.2.2组装即时库存dto
|
||||
var inventoryDet = new InventoryDetailsGenerateDto();
|
||||
inventoryDet.MaterialId = item.MaterialId;
|
||||
inventoryDet.OrgCode = tag_update_entity.OrgCode;
|
||||
inventoryDet.StockCode = tag_update_entity.StockCode;
|
||||
inventoryDet.SubStockId = tag_update_entity.SubStockId;
|
||||
inventoryDet.Qty = item.Qty;
|
||||
inventoryDet.InventoryInOutType = (int)InventoryInOutType.Out;
|
||||
//2.2.2即时库存:修改箱库存的集合
|
||||
InventoryDetailsGenerateDto.Add(inventoryDet);
|
||||
}
|
||||
}
|
||||
|
||||
//2.2.3.在变更目标箱的-仓库-仓位-组织
|
||||
tag_update_entity.StockCode = dto.StockCode;
|
||||
tag_update_entity.SubStockId = dto.SubStockId.Value;
|
||||
tag_update_entity.OrgCode = dto.TargetBoxOrgCode;
|
||||
|
||||
|
||||
tag_update_entity.OrgCode = dto.TargetBoxOrgCode;
|
||||
}
|
||||
tag_update_entity.Details = tagBox.Details;
|
||||
|
||||
|
||||
//2.2.2仓位和原来的目标箱的仓位不一致的情况下-》》把目标箱原来仓位的物料进行-即时库存的变更-(减库存)
|
||||
if (subStockId != tag_update_entity.SubStockId)
|
||||
{
|
||||
foreach (var item in tag_update_entity.Details)
|
||||
{
|
||||
//2.2.2组装即时库存dto
|
||||
var inventoryDet = new InventoryDetailsGenerateDto();
|
||||
inventoryDet.MaterialId = item.MaterialId;
|
||||
inventoryDet.OrgCode = orgCode;
|
||||
inventoryDet.StockCode = stockCode;
|
||||
inventoryDet.SubStockId = subStockId;
|
||||
inventoryDet.Qty = item.Qty;
|
||||
inventoryDet.InventoryInOutType = (int)InventoryInOutType.Out;
|
||||
//2.2.2即时库存:修改箱库存的集合
|
||||
InventoryDetailsGenerateDto.Add(inventoryDet);
|
||||
}
|
||||
}
|
||||
|
||||
//2.2.1遍历改变的明细
|
||||
foreach (var item in dto.Details)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user