diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/DTOs/DeliverRequestDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/DTOs/DeliverRequestDTO.cs index 1e8b57ba5..b2eef205b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/DTOs/DeliverRequestDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/DTOs/DeliverRequestDTO.cs @@ -36,6 +36,11 @@ public class DeliverRequestDTO : SfsStoreRequestDTOBase /// Mes车牌号 /// public string MesTruckNumber { get; set; } + + [Display(Name = "Mes器具号")] + public string MesDeliveryContainer { get; set; } + + /// /// 发货类型 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAppService.cs index 71d460828..8480dd421 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAppService.cs @@ -9,6 +9,7 @@ using Volo.Abp; using Volo.Abp.Application.Dtos; using Win_in.Sfs.Basedata.Application; using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Basedata.Domain; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; @@ -32,7 +33,7 @@ public class CustomerProductionReturnNoteAppService : private readonly ICustomerItemAppService _customerItemAppService; private readonly ICustomerAppService _customerAppService; - + private readonly ICustomerItemRepository _customerItemRepository; private readonly ISalePriceSheetAppService _salePriceSheetAppService; public CustomerProductionReturnNoteAppService( @@ -40,10 +41,12 @@ public class CustomerProductionReturnNoteAppService : , ICustomerProductionReturnNoteManager CustomerProductionReturnNoteManager , ICustomerItemAppService customerItemAppService, ISalePriceSheetAppService salePriceSheetAppService, - ICustomerAppService customerAppService + ICustomerAppService customerAppService, + ICustomerItemRepository customerItemRepository ) : base(repository) { + _customerItemRepository = customerItemRepository; _customerItemAppService = customerItemAppService; @@ -89,6 +92,7 @@ public class CustomerProductionReturnNoteAppService : if (customerlist.Count > 0) { + entity.CustomerName = customerlist.FirstOrDefault().Name; } else @@ -114,7 +118,17 @@ public class CustomerProductionReturnNoteAppService : #endregion #region 20241230修改 - + foreach (var itm in input.Details) + { + var part= custitmDetail.FirstOrDefault(p => p.CustomerCode == entity.CustomerCode && p.ItemCode==itm.ItemCode); + if (part == null) + { + throw new UserFriendlyException($"零件编号{itm.ItemCode}客户编码{entity.CustomerCode}在零件关系表中不存在!"); + } + } + + + 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 2c60ee45f..b37115ca0 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 @@ -78,7 +78,8 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase IPostionLocationAppService postionLocationAppService, IItemBasicAppService itemBasicAppService, UnitOfWorkManager unitOfWorkManager, - IExpectOutAppService expectOutAppService, IProductionLineAppService productionLineAppService) : base(repository) + IProductionLineAppService _productionLineAppService, + IExpectOutAppService expectOutAppService) : base(repository) { _unitOfWorkManager = unitOfWorkManager; _transferNoteManager = transferNoteManager; @@ -91,7 +92,6 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase _issueJobAppService = issueJobAppService; _inventoryLabelAppService = inventoryLabelAppService; _expectOutAppService = expectOutAppService; - _productionLineAppService = productionLineAppService; _logger = logger; _agvOptions = agvOptions; _postionLocationAppService = postionLocationAppService; @@ -172,7 +172,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase } /// - /// 拆箱 + /// 拆箱 /// /// /// @@ -187,7 +187,6 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase } #region 校验 - private void CheckLocation(LocationDTO locationDto, TransferNoteDetail detail) { if (locationDto == null) @@ -195,7 +194,6 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase throw new UserFriendlyException($"库位代码为【{detail.ToLocationCode}】不存在"); } } - private void CheckFromLocation(LocationDTO locationDto, TransferNoteDetail detail) { if (locationDto == null) @@ -203,7 +201,6 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase throw new UserFriendlyException($"库位代码为【{detail.FromLocationCode}】不存在"); } } - #endregion /// @@ -713,34 +710,40 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase errors.Add($"来源起始点{detail.BeginPosition}库位没查到"); } - var tolocation = await _locationAppService.GetByCodeAsync(detail.EndPosition).ConfigureAwait(false); - + LocationDTO tolocation = await _locationAppService.GetByCodeAsync(detail.EndPosition).ConfigureAwait(false); if (tolocation == null) { errors.Add($"结束点{detail.EndPosition}库位没查到"); } - - - //fromlocation.Type == EnumLocationType.WIP; - //tolocation.Type==EnumLocationType.SEMI||EnumLocationType.DimensionalStorehouse - //var productionLineDto=await _productionLineAppService.GetByLocationCodeAsync(tolocation.Code); - //productionLineDto.ProductionLineType==EnumProductionLineType.Assemble - - 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) { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs index 8120df6a9..c2499ec2e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs @@ -135,6 +135,9 @@ public class DeliverRequestAppService : entitys.ForEach(r => { r.MesTruckNumber = truckNumber; }); Check.NotNull(entitys, typeof(DeliverRequest).Name); List errors=new List(); + + + foreach (var request in entitys) { foreach (var itm in request.Details) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAutoMapperProfile.cs index 1fe9e1b56..62b11ea95 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAutoMapperProfile.cs @@ -29,6 +29,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile CreateMap() + // .ForMember(x => x.DeliverRequestType, y => y.MapFrom(t => EnumDeliverRequestType.Normal)) .Ignore(x => x.CustomerAddressCode) .Ignore(x => x.DeliverPlanNumber) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/DeliverRequests/DeliverRequest.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/DeliverRequests/DeliverRequest.cs index e722611d3..ea9655cc1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/DeliverRequests/DeliverRequest.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/DeliverRequests/DeliverRequest.cs @@ -43,6 +43,12 @@ public class DeliverRequest : SfsStoreRequestAggregateRootBase public string MesTruckNumber { get; set; } + /// + /// 器具编号 + /// + public string MesDeliveryContainer { get; set; } + + /// /// 任务明细 ///