优化
This commit is contained in:
@@ -584,6 +584,9 @@ namespace WMS.Web.Domain.Services
|
||||
if (taskBoxList != null && taskBoxList.Count != 0)
|
||||
return Result<InStockTask>.ReFailure(ResultCodes.InStockTaskBoxIsHaveData);
|
||||
|
||||
//序列号
|
||||
var serialNumbs= await _serialNumbersRepositories.GetEntityListByBoxIds(dto_boxIds);
|
||||
|
||||
//3.组装绑定关系表,要添加的集合
|
||||
var boxEntitys = await _boxRepositories.GetEntityList(dto_boxIds);
|
||||
var taskBoxAdd = new List<InStockTaskBox>();
|
||||
@@ -592,9 +595,15 @@ namespace WMS.Web.Domain.Services
|
||||
var taskBox = _mapper.Map<InStockTaskBox>(item);
|
||||
taskBox.TaskId = entity.Id;
|
||||
taskBox.Receiver(staffId);
|
||||
|
||||
var currentBox_serialNumbs= serialNumbs.Where(s => s.BoxId == taskBox.BoxId).ToList();
|
||||
var current_dto_box_dets = boxEntitys.Where(x => x.Id == item.BoxId).SelectMany(x => x.Details).ToList();
|
||||
taskBox.Details = _mapper.Map<List<InStockTaskBoxDetails>>(current_dto_box_dets);
|
||||
taskBox.Details.ForEach(x => { x.ErpDetailId = item.ErpDetailId; });
|
||||
taskBox.Details.ForEach(x =>
|
||||
{
|
||||
x.ErpDetailId = item.ErpDetailId;
|
||||
x.SerialNumbers= currentBox_serialNumbs.Where(s => s.MaterialNumber == x.MaterialNumber).Select(s => s.SerialNumber).ToList();
|
||||
});
|
||||
taskBoxAdd.Add(taskBox);
|
||||
}
|
||||
var isSuccess = await _inStockTaskBoxRepositories.AddRange(taskBoxAdd, isTransaction);
|
||||
|
||||
Reference in New Issue
Block a user