库存接口

This commit is contained in:
tongfei
2023-11-23 11:38:29 +08:00
parent c4f90f0c7e
commit 8aee4380fe
8 changed files with 81 additions and 30 deletions

View File

@@ -73,27 +73,9 @@ namespace WMS.Web.Domain.Services
return serialNumber_result;
//保存成功后:变更库存
var boxInventoryBackGenerateDto = dto.Details.GroupBy(x =>new { x.BoxId,x.StockCode,x.SubStockId}).Select(x => new BoxInventoryBackGenerateDto()
{
BoxId=x.Key.BoxId,
StockCode=x.Key.StockCode,
SubStockId=x.Key.SubStockId,
InventoryInOutType= type== BackRecordType.OutstockOn? (int)InventoryInOutType.In:(int)InventoryInOutType.Out,
}).ToList();
foreach (var item in dto.Details)
{
var current= boxInventoryBackGenerateDto.Where(x => x.BoxId == item.BoxId).FirstOrDefault();
if (current != null)
{
var detail = new BoxInventoryBackDetailsGenerateDto();
detail.MaterialId = item.MaterialId;
detail.Qty = item.Qty;
detail.SerialNumbers = item.SerialNumbers;
current.Details.Add(detail);
}
}
var boxInventoryResult= await _boxInventoryService.GenerateBackBox(boxInventoryBackGenerateDto, isTransaction);
var entitys = new List<BackRecord>();
entitys.Add(entity);
var boxInventoryResult= await _boxInventoryService.GenerateBackBox(entitys, isTransaction);
if (!boxInventoryResult.IsSuccess)
return boxInventoryResult;