From 3683567fbd02fe07804810bb6f06a077f9b1c311 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Thu, 21 Mar 2024 14:03:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=A9=BA=E5=99=A8=E5=85=B7=E5=91=BC?= =?UTF-8?q?=E5=8F=AB=E8=AE=B0=E5=BD=95=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Requests/ContainerRequestEventHandler.cs | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ContainerRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ContainerRequestEventHandler.cs index db5ee4914..97219e3ee 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ContainerRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ContainerRequestEventHandler.cs @@ -124,23 +124,35 @@ public class ContainerRequestEventHandler private async Task BuildContainerNoteAsync(ContainerRequest request) { - var createInput = ObjectMapper.Map(request); + var createInput = ObjectMapper.Map(request); + + ContainerNoteDetailInput detail=new ContainerNoteDetailInput(); createInput.Details = new List(); + detail.ToLocationCode = request.RequestLocationCode; - foreach (var detail in request.Details) - { - detail.ToLocationCode = request.RequestLocationCode; + detail.FromLocationCode = "123"; + detail.FromPackingCode = "123"; + detail.ToPackingCode = "123"; + detail.FromLot = "123"; + detail.ToLot = "123"; + detail.FromLocationErpCode = "123"; + detail.FromWarehouseCode = "123"; + detail.ToLocationErpCode = "123"; + detail.ToWarehouseCode = "123"; + detail.Uom = "123"; + detail.ItemCode = "123"; + detail.ItemName = "123"; - var container = await _equipmentLocApp.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); + //var container = await _equipmentLocApp.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); - if(container != null) - { - detail.ItemCode = container.Code; - } - - } + //if (container != null) + //{ + // detail.ItemCode = container.Code; + //} + createInput.Details.Add(detail); + return createInput; } From 84c861a0d944085869a2291acf15c1513ab03b69 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Fri, 22 Mar 2024 11:43:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=99=A8=E5=85=B7=E5=91=BC=E5=8F=AB?= =?UTF-8?q?=E8=81=94=E8=B0=83=E4=BF=AE=E6=94=B9=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E6=9F=A5=E8=AF=A2=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PublishProfiles/FolderProfile.pubxml | 12 ++++-- .../Jobs/ContainerJobController.cs | 43 +++++++++++++++---- .../PublishProfiles/FolderProfile.pubxml | 4 +- .../ContainerJobs/DTOs/ContainerJobDTO.cs | 6 +++ .../Jobs/ContainerJobAutoMapperProfile.cs | 21 +++++++++ .../Jobs/ContainerJobEventHandler.cs | 17 +------- .../StoreEventAutoMapperProfile.cs | 2 +- 7 files changed, 74 insertions(+), 31 deletions(-) create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ContainerJobAutoMapperProfile.cs diff --git a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile.pubxml b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile.pubxml index c238ca481..47bf33bb7 100644 --- a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile.pubxml +++ b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile.pubxml @@ -4,13 +4,17 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - False - False - True + false + false + true Release Any CPU FileSystem - D:\~all-publish\WMS2.0_东阳\Win_in.Sfs.Wms.Store.HttpApi.Host + D:\发布\WMS\store FileSystem + + net6.0 + 488eeada-cfed-4016-9884-7a1dcbe5eb9c + false \ No newline at end of file diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ContainerJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ContainerJobController.cs index 5b9baac9a..758982be3 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ContainerJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ContainerJobController.cs @@ -1,14 +1,18 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Text.Json; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using Polly.Caching; using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; using Win_in.Sfs.Auth.Application.Contracts; +using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Wms.Inventory.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Pda.Controllers.Jobs; @@ -24,17 +28,21 @@ public class ContainerJobController : AbpController private readonly IUserWorkGroupAppService _userWorkGroupAppService; + private readonly IDictAppService _dictApp; + /// /// /// /// /// public ContainerJobController( - IContainerJobAppService ContainerJobAppService + IContainerJobAppService containerJobAppService, + IDictAppService dictApp , IUserWorkGroupAppService userWorkGroupAppService) { _userWorkGroupAppService = userWorkGroupAppService; - _containerJobAppService = ContainerJobAppService; + _containerJobAppService = containerJobAppService; + _dictApp=dictApp; } /// @@ -69,30 +77,47 @@ public class ContainerJobController : AbpController /// /// [HttpGet("list")] - public virtual async Task> GetListAsync(int pageSize, int pageIndex) + public virtual async Task> GetListAsync(int pageSize, int pageIndex, bool isFinished) { - var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); - _ = JsonSerializer.Serialize(wlgCodes); + var dtos = await _dictApp.GetByCodeAsync("ContainerSpecificationsType").ConfigureAwait(false); - var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + var status = new List(); + if(isFinished==true) + { + status.Add((int)EnumJobStatus.Done); + } + else + { + status.Add((int)EnumJobStatus.Open); + } var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase { MaxResultCount = pageSize, SkipCount = (pageIndex - 1) * pageSize, - Sorting = $"{nameof(ContainerJobDTO.Priority)} ASC", + Sorting = $"{nameof(ContainerJobDTO.CreationTime)} ASC", Condition = new Condition { Filters = new List - { - // new(nameof(ContainerJobDTO.WorkGroupCode),jsonCodes,"In"), + { new(nameof(ContainerJobDTO.JobStatus),jsonStatus,"In") } } }; var list = await _containerJobAppService.GetPagedListByFilterAsync(request, true).ConfigureAwait(false); + foreach (var item in list.Items) + { + if(!string.IsNullOrEmpty(item.SpecificationsType)) + { + var dictName= dtos.Items.FirstOrDefault(t => t.Code == item.SpecificationsType); + item.SpecificationsTypeName = dictName.Name; + } + + + } + return list; } diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Properties/PublishProfiles/FolderProfile.pubxml b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Properties/PublishProfiles/FolderProfile.pubxml index 5c6a0af51..000e05ebd 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Properties/PublishProfiles/FolderProfile.pubxml +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Properties/PublishProfiles/FolderProfile.pubxml @@ -10,11 +10,11 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU FileSystem - .\..\..\..\OutPut\PDA\ + D:\发布\WMS\pda FileSystem net6.0 6ea3cf3a-0bb9-49eb-8537-0cb7107052e2 false - + \ No newline at end of file diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/DTOs/ContainerJobDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/DTOs/ContainerJobDTO.cs index 286f686ae..2204a2b0c 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/DTOs/ContainerJobDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/DTOs/ContainerJobDTO.cs @@ -40,4 +40,10 @@ public class ContainerJobDTO : SfsJobDTOBase [StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")] public string SpecificationsType { get; set; } + /// + /// 器具规格名称 + /// + [Display(Name = "器具规格名称")] + public string SpecificationsTypeName { get; set; } + } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ContainerJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ContainerJobAutoMapperProfile.cs new file mode 100644 index 000000000..26d48ee90 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ContainerJobAutoMapperProfile.cs @@ -0,0 +1,21 @@ +using AutoMapper; +using Volo.Abp.AutoMapper; +using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; + +namespace Win_in.Sfs.Wms.Store.Event; + +public partial class StoreEventAutoMapperProfile : Profile +{ + + private void ContainerJobAutoMapperProfile() + { + CreateMap() + .ForMember(x => x.JobNumber, y => y.MapFrom(d => d.Number)) + .Ignore(x => x.Confirmed) + .Ignore(x => x.ActiveDate) + .Ignore(x => x.Details) + ; + } + +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ContainerJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ContainerJobEventHandler.cs index 1cc8b43df..b9dbe1134 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ContainerJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ContainerJobEventHandler.cs @@ -50,21 +50,8 @@ public class ContainerJobEventHandler : private async Task BuildContainerNoteAsync(ContainerJob entity) { var ContainerNoteCreateInput = ObjectMapper.Map(entity); - ContainerNoteCreateInput.JobNumber = entity.Number; - var locationCodes = ContainerNoteCreateInput.Details.Select(p => p.ToLocationCode).Distinct().ToList(); - var locations = await _locationAppService.GetByCodesAsync(locationCodes).ConfigureAwait(false); - - ContainerNoteCreateInput.Details.RemoveAll(p => p.Qty == 0); - - foreach (var detail in ContainerNoteCreateInput.Details) - { - var location = locations.First(p => p.Code == detail.ToLocationCode); - - detail.ToLocationArea = location.AreaCode; - detail.ToLocationGroup = location.LocationGroupCode; - detail.ToLocationErpCode = location.ErpLocationCode; - detail.ToWarehouseCode = location.WarehouseCode; - } + ContainerNoteCreateInput.JobNumber = entity.Number; + return ContainerNoteCreateInput; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/StoreEventAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/StoreEventAutoMapperProfile.cs index 284067c72..40de8aa9b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/StoreEventAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/StoreEventAutoMapperProfile.cs @@ -30,7 +30,7 @@ public partial class StoreEventAutoMapperProfile : Profile #endregion #region Jobs - + ContainerJobAutoMapperProfile(); CountJobAutoMapperProfile(); DeliverJobAutoMapperProfile(); InspectJobAutoMapperProfile();