|
|
@ -133,6 +133,11 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase<MaterialR |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"库位代码为【{LocationCode}】不存在"); |
|
|
|
} |
|
|
|
|
|
|
|
if (LocationDto.Type == EnumLocationType.WIP) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"库位代码【{LocationCode}】不是【{EnumLocationType.WIP.GetDisplayName()}】类型"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -212,7 +217,11 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase<MaterialR |
|
|
|
foreach (var detailInput in input.Details) |
|
|
|
{ |
|
|
|
var toLocationDto= await _locationAppService.GetByCodeAsync(detailInput.ToLocationCode).ConfigureAwait(false); |
|
|
|
var productionLineDto=await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationDto.LocationGroupCode).ConfigureAwait(false); |
|
|
|
CheckLocation(toLocationDto, detailInput.ToLocationCode); |
|
|
|
var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detailInput.ItemCode).ConfigureAwait(false); |
|
|
|
CheckItemBasic(itemBasicDto, detailInput.ItemCode); |
|
|
|
|
|
|
|
var productionLineDto = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationDto.LocationGroupCode).ConfigureAwait(false); |
|
|
|
|
|
|
|
detailInput.ToLocationCode = toLocationDto.ErpLocationCode; |
|
|
|
if (productionLineDto != null) |
|
|
@ -242,8 +251,6 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase<MaterialR |
|
|
|
return dto; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 创建并且执行叫料请求
|
|
|
|
/// </summary>
|
|
|
@ -272,10 +279,15 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase<MaterialR |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
foreach (var item in input.Details) //赋值生产线
|
|
|
|
foreach (var detailInput in input.Details) //赋值生产线
|
|
|
|
{ |
|
|
|
var location = await LocationAclService.GetByCodeAsync(item.ToLocationCode).ConfigureAwait(false); |
|
|
|
item.ProdLine = location.LocationGroupCode; |
|
|
|
var toLocationDto = await _locationAppService.GetByCodeAsync(detailInput.ToLocationCode).ConfigureAwait(false); |
|
|
|
CheckLocation(toLocationDto, detailInput.ToLocationCode); |
|
|
|
var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detailInput.ItemCode).ConfigureAwait(false); |
|
|
|
CheckItemBasic(itemBasicDto, detailInput.ItemCode); |
|
|
|
|
|
|
|
var location = await LocationAclService.GetByCodeAsync(detailInput.ToLocationCode).ConfigureAwait(false); |
|
|
|
detailInput.ProdLine = location.LocationGroupCode; |
|
|
|
input.ProdLine = location.LocationGroupCode; |
|
|
|
input.Worker = input.Worker; |
|
|
|
} |
|
|
|