diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs index fb6ee6529..b6be21a1f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs @@ -64,6 +64,8 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase private readonly IPostionLocationAppService _postionLocationAppService; + private readonly IProductionLineAppService _productionLineAppService; + private readonly UnitOfWorkManager _unitOfWorkManager; @@ -84,6 +86,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase IPostionLocationAppService postionLocationAppService, IItemBasicAppService itemBasicAppService, UnitOfWorkManager unitOfWorkManager, + IProductionLineAppService _productionLineAppService, IExpectOutAppService expectOutAppService) : base(repository) { _unitOfWorkManager = unitOfWorkManager; @@ -718,27 +721,39 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase } LocationDTO tolocation = await _locationAppService.GetByCodeAsync(detail.EndPosition).ConfigureAwait(false); - if (tolocation == null) { errors.Add($"结束点{detail.EndPosition}库位没查到"); } - switch (tolocation.WarehouseCode) + var productionline=await _productionLineAppService.GetByCodeAsync(tolocation.Code).ConfigureAwait(false); + if (productionline == null) { - case "APA-KWZ":// 装配线边库位组 - transfer.Type = EnumTransSubType.Transfer_Assemble.ToString(); - break; - case "PPA-KWZ"://涂装线边库位组 - transfer.Type = EnumTransSubType.Transfer_Coating.ToString(); - break; - case "IPA-KWZ"://注塑线边库位组 - transfer.Type = EnumTransSubType.Transfer_Injection.ToString(); - break; - default: - throw new UserFriendlyException("结束库位、不是喷涂、注塑、涂装等线边类型!"); - + errors.Add($"结束点{detail.EndPosition}库位不在生产线中!"); } + + + transfer.Type = productionline.ProductionLineType.ToString(); + + + + + //switch (tolocation.WarehouseCode) + //{ + // case "APA-KWZ":// 装配线边库位组 + // transfer.Type = EnumTransSubType.Transfer_Assemble.ToString(); + // break; + // case "PPA-KWZ"://涂装线边库位组 + // transfer.Type = EnumTransSubType.Transfer_Coating.ToString(); + // break; + // case "IPA-KWZ"://注塑线边库位组 + // transfer.Type = EnumTransSubType.Transfer_Injection.ToString(); + // break; + // default: + // throw new UserFriendlyException("结束库位、不是喷涂、注塑、涂装等线边类型!"); + + //} + var item = await _itemBasicAppService.GetByCodeAsync(detail.MatCode).ConfigureAwait(false); if (item == null) {