|
|
@ -133,6 +133,8 @@ public class InventoryLabelAppService |
|
|
|
[UnitOfWork] |
|
|
|
public virtual async Task<List<InventoryLabelDto>> CreateManyByNoCodeAsync(List<InventoryLabelEditInput> inputs) |
|
|
|
{ |
|
|
|
await InsertSplitBoxRecAsync(inputs).ConfigureAwait(false); //插入拆箱记录表
|
|
|
|
|
|
|
|
var entitys = ObjectMapper.Map<List<InventoryLabelEditInput>, List<InventoryLabel>>(inputs); |
|
|
|
await _repository.InsertManyAsync(entitys).ConfigureAwait(false); |
|
|
|
return ObjectMapper.Map<List<InventoryLabel>, List<InventoryLabelDto>>(entitys); |
|
|
@ -149,10 +151,24 @@ public class InventoryLabelAppService |
|
|
|
[UnitOfWork] |
|
|
|
public virtual async Task<List<InventoryLabelDto>> CreateManyByNoCode_NewAsync(List<InventoryLabelEditInput> inputs) |
|
|
|
{ |
|
|
|
#region 插入拆箱记录表
|
|
|
|
await InsertSplitBoxRecAsync(inputs).ConfigureAwait(false); //插入拆箱记录表
|
|
|
|
|
|
|
|
var entitys = ObjectMapper.Map<List<InventoryLabelEditInput>, List<InventoryLabel>>(inputs); |
|
|
|
await _repository.InsertManyAsync(entitys).ConfigureAwait(false); |
|
|
|
return ObjectMapper.Map<List<InventoryLabel>, List<InventoryLabelDto>>(entitys); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 插入拆箱记录表
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="inputs">InventoryLabelEditInput列表</param>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <exception cref="UserFriendlyException"></exception>
|
|
|
|
private async Task InsertSplitBoxRecAsync(List<InventoryLabelEditInput> inputs) |
|
|
|
{ |
|
|
|
List<SplitPackingRecEditInput> recLst = new List<SplitPackingRecEditInput>(); |
|
|
|
foreach (var inputObj in inputs) |
|
|
|
{ |
|
|
|
List<SplitPackingRecEditInput> recLst = new List<SplitPackingRecEditInput>(); |
|
|
|
SplitPackingRecEditInput packRec = new SplitPackingRecEditInput(); |
|
|
|
packRec.OprType = OprTypeEnum.Other; |
|
|
|
packRec.FromPackingCode = inputObj.Code; |
|
|
@ -178,17 +194,13 @@ public class InventoryLabelAppService |
|
|
|
packRec.ReceiptRecNumber = null; //收货记录单
|
|
|
|
packRec.PutOnShelfNumber = null; //上架单
|
|
|
|
recLst.Add(packRec); |
|
|
|
bool bo = await _splitPackingRecAppService.BatchInsertAsync(recLst).ConfigureAwait(false); |
|
|
|
if (bo == false) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("调用插入拆箱记录表方法时返回假!"); |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
bool bo = await _splitPackingRecAppService.BatchInsertAsync(recLst).ConfigureAwait(false); |
|
|
|
if (bo == false) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("调用插入拆箱记录表方法时返回假!"); |
|
|
|
} |
|
|
|
|
|
|
|
var entitys = ObjectMapper.Map<List<InventoryLabelEditInput>, List<InventoryLabel>>(inputs); |
|
|
|
await _repository.InsertManyAsync(entitys).ConfigureAwait(false); |
|
|
|
return ObjectMapper.Map<List<InventoryLabel>, List<InventoryLabelDto>>(entitys); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -233,6 +245,10 @@ public class InventoryLabelAppService |
|
|
|
var createInput = ObjectMapper.Map<InventoryLabelWithoutCodeCreateInput, InventoryLabelEditInput>(input); |
|
|
|
createInput.Code = numbers[i]; |
|
|
|
|
|
|
|
var lst = new List<InventoryLabelEditInput>(); |
|
|
|
lst.Add(createInput); |
|
|
|
await InsertSplitBoxRecAsync(lst).ConfigureAwait(false); //插入拆箱记录表
|
|
|
|
|
|
|
|
|
|
|
|
await CheckCreatePolicyAsync().ConfigureAwait(continueOnCapturedContext: false); |
|
|
|
var createEntity=ObjectMapper.Map<InventoryLabelEditInput, InventoryLabel>(createInput); |
|
|
|