|
|
@ -124,6 +124,14 @@ public class ProductRecycleRequestAppService : |
|
|
|
} |
|
|
|
|
|
|
|
#region 校验
|
|
|
|
private void CheckItemBasic(ItemBasicDTO itemBasicDto, string itemCode) |
|
|
|
{ |
|
|
|
if (itemBasicDto == null) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"物品代码为【{itemCode}】不存在"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void CheckLocation(LocationDTO locationDTO, string locationCode) |
|
|
|
{ |
|
|
|
if (locationDTO == null) |
|
|
@ -150,7 +158,7 @@ public class ProductRecycleRequestAppService : |
|
|
|
ProductRecycleRequestDetail detail) |
|
|
|
{ |
|
|
|
var item = await ItemBasicAclService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); |
|
|
|
|
|
|
|
CheckItemBasic(item, detail.ItemCode); |
|
|
|
if (item != null) |
|
|
|
{ |
|
|
|
detail.ItemName = item.Name; |
|
|
@ -161,7 +169,7 @@ public class ProductRecycleRequestAppService : |
|
|
|
} |
|
|
|
|
|
|
|
var location = await LocationAclService.GetByCodeAsync(detail.LocationCode).ConfigureAwait(false); |
|
|
|
|
|
|
|
CheckLocation(location, detail.LocationCode); |
|
|
|
if (location != null) |
|
|
|
{ |
|
|
|
detail.LocationErpCode = location.ErpLocationCode; |
|
|
@ -171,7 +179,7 @@ public class ProductRecycleRequestAppService : |
|
|
|
} |
|
|
|
|
|
|
|
var rawLocation = await LocationAclService.GetByCodeAsync(detail.RawLocationCode).ConfigureAwait(false); |
|
|
|
|
|
|
|
CheckLocation(rawLocation, detail.RawLocationCode); |
|
|
|
if (rawLocation != null) |
|
|
|
{ |
|
|
|
detail.RawLocationErpCode = rawLocation.ErpLocationCode; |
|
|
|