Browse Source

添加 库位类型判断

集成Redis
郑勃旭 2 years ago
parent
commit
548a14a169
  1. 24
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs

24
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs

@ -133,6 +133,11 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase<MaterialR
{ {
throw new UserFriendlyException($"库位代码为【{LocationCode}】不存在"); 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) foreach (var detailInput in input.Details)
{ {
var toLocationDto= await _locationAppService.GetByCodeAsync(detailInput.ToLocationCode).ConfigureAwait(false); 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; detailInput.ToLocationCode = toLocationDto.ErpLocationCode;
if (productionLineDto != null) if (productionLineDto != null)
@ -242,8 +251,6 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase<MaterialR
return dto; return dto;
} }
/// <summary> /// <summary>
/// 创建并且执行叫料请求 /// 创建并且执行叫料请求
/// </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); var toLocationDto = await _locationAppService.GetByCodeAsync(detailInput.ToLocationCode).ConfigureAwait(false);
item.ProdLine = location.LocationGroupCode; 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.ProdLine = location.LocationGroupCode;
input.Worker = input.Worker; input.Worker = input.Worker;
} }

Loading…
Cancel
Save