Browse Source

添加 库位类型判断

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

22
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}】不存在");
}
if (LocationDto.Type == EnumLocationType.WIP)
{
throw new UserFriendlyException($"库位代码【{LocationCode}】不是【{EnumLocationType.WIP.GetDisplayName()}】类型");
}
}
@ -212,6 +217,10 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase<MaterialR
foreach (var detailInput in input.Details)
{
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 productionLineDto = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationDto.LocationGroupCode).ConfigureAwait(false);
detailInput.ToLocationCode = toLocationDto.ErpLocationCode;
@ -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;
}

Loading…
Cancel
Save