|
|
@ -129,7 +129,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase |
|
|
|
|
|
|
|
CheckLocation(toLocationDto, detail); |
|
|
|
CheckFromLocation(fromLocationDto, detail); |
|
|
|
await CheckPackingCode(detail.FromPackingCode).ConfigureAwait(false); |
|
|
|
await CheckPackingCodeAsync(detail.FromPackingCode).ConfigureAwait(false); |
|
|
|
if (toLocationDto.Type != fromLocationDto.Type) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"来源库位与目标库位类型不一致"); |
|
|
@ -403,7 +403,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase |
|
|
|
{ |
|
|
|
if (!string.IsNullOrEmpty(detail.FromPackingCode)) |
|
|
|
{ |
|
|
|
await CheckPackingCode(detail.FromPackingCode).ConfigureAwait(false); |
|
|
|
await CheckPackingCodeAsync(detail.FromPackingCode).ConfigureAwait(false); |
|
|
|
} |
|
|
|
} |
|
|
|
entity =await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false); |
|
|
@ -431,7 +431,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase |
|
|
|
{ |
|
|
|
if (!string.IsNullOrEmpty(detail.FromPackingCode)) |
|
|
|
{ |
|
|
|
await CheckPackingCode(detail.FromPackingCode).ConfigureAwait(false); |
|
|
|
await CheckPackingCodeAsync(detail.FromPackingCode).ConfigureAwait(false); |
|
|
|
} |
|
|
|
} |
|
|
|
resultEntity.Add(await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false)); |
|
|
@ -447,12 +447,15 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase |
|
|
|
/// <param name="packingCode"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <exception cref="UserFriendlyException"></exception>
|
|
|
|
private async Task CheckPackingCode(string packingCode) |
|
|
|
private async Task CheckPackingCodeAsync(string packingCode) |
|
|
|
{ |
|
|
|
var packingcode = await _expectOutAppService.GetListByPackingCodeAsync(packingCode).ConfigureAwait(false); |
|
|
|
if (packingcode != null && packingCode.Length>0) |
|
|
|
if (!string.IsNullOrEmpty(packingCode)) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"箱码{packingCode}在预计出中已存在!"); |
|
|
|
var packingcode = await _expectOutAppService.GetListByPackingCodeAsync(packingCode).ConfigureAwait(false); |
|
|
|
if (packingcode != null && packingCode.Length > 0) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"箱码{packingCode}在预计出中已存在!"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|