From d9324a7472e6186669b8f8fd6619c3e92dd1da8b Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Tue, 11 Jun 2024 11:23:30 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E8=A3=85=E9=85=8DTYRP=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AssembleIssueNoteAutoMapperProfile.cs | 105 ++++++++++++++++++ .../Notes/AssembleNoteAutoMapperProfile.cs | 51 --------- .../AssembleIssueNoteEventHandler.cs | 65 +++++------ 3 files changed, 138 insertions(+), 83 deletions(-) create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/AssembleIssueNoteAutoMapperProfile.cs delete mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/AssembleNoteAutoMapperProfile.cs diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/AssembleIssueNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/AssembleIssueNoteAutoMapperProfile.cs new file mode 100644 index 000000000..f69dfb3f2 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/AssembleIssueNoteAutoMapperProfile.cs @@ -0,0 +1,105 @@ +using AutoMapper; +using Microsoft.OpenApi.Extensions; +using Volo.Abp.AutoMapper; +using Win_in.Sfs.Wms.Inventory.Application.Contracts; +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 AssembleIssueNoteAutoMapperProfile() + { + CreateMap() + .Ignore(x => x.DocNumber) + .Ignore(x => x.JobNumber) + .Ignore(x => x.Worker) + .Ignore(x => x.TransType) + .Ignore(x => x.ExtraProperties) + .Ignore(x => x.TransSubType) + + .ForMember(x => x.Qty, y => y.MapFrom(t => t.HandledToQty)) + .ForMember(x => x.SupplierBatch, y => y.MapFrom(t => t.HandledFromSupplierBatch)) + .ForMember(x => x.ArriveDate, y => y.MapFrom(t => t.HandledFromArriveDate)) + .ForMember(x => x.ProduceDate, y => y.MapFrom(t => t.HandledFromProduceDate)) + .ForMember(x => x.ExpireDate, y => y.MapFrom(t => t.HandledFromExpireDate)) + + .ForMember(x => x.FromPackingCode, y => y.MapFrom(t => t.HandledFromPackingCode)) + .ForMember(x => x.FromContainerCode, y => y.MapFrom(t => t.HandledFromContainerCode)) + + .ForMember(x => x.FromLot, y => y.MapFrom(t => t.HandledFromLot)) + .ForMember(x => x.FromStatus, y => y.MapFrom(t => t.Status)) + + .ForMember(x => x.FromLocationCode, y => y.MapFrom(t => t.HandledFromLocationCode)) + .ForMember(x => x.FromLocationGroup, y => y.MapFrom(t => t.HandledFromLocationGroup)) + .ForMember(x => x.FromLocationArea, y => y.MapFrom(t => t.HandledFromLocationArea)) + .ForMember(x => x.FromLocationErpCode, y => y.MapFrom(t => t.HandledFromLocationErpCode)) + .ForMember(x => x.FromWarehouseCode, y => y.MapFrom(t => t.HandledFromWarehouseCode)) + + .ForMember(x => x.ToLot, y => y.MapFrom(t => t.HandledToLot)) + .ForMember(x => x.ToStatus, y => y.MapFrom(t => t.Status)) + .ForMember(x => x.ToPackingCode, y => y.MapFrom(t => t.HandledToPackingCode)) + .ForMember(x => x.ToContainerCode, y => y.MapFrom(t => t.HandledToContainerCode)) + + .ForMember(x => x.ToLocationCode, y => y.MapFrom(t => t.HandledToLocationCode)) + .ForMember(x => x.ToLocationGroup, y => y.MapFrom(t => t.HandledToLocationGroup)) + .ForMember(x => x.ToLocationArea, y => y.MapFrom(t => t.HandledToLocationArea)) + .ForMember(x => x.ToLocationErpCode, y => y.MapFrom(t => t.HandledToLocationErpCode)) + .ForMember(x => x.ToWarehouseCode, y => y.MapFrom(t => t.HandledToWarehouseCode)) + + ; + CreateMap() + .ForMember(x => x.RequestType, y => y.MapFrom(t => t.IssueRequestType.GetDisplayName())) + .Ignore(x => x.Workshop) + + ; + CreateMap() + .ForMember(x => x.IssueTime, y => y.MapFrom(t => t.CreationTime)) + .ForMember(x => x.WorkStation, y => y.MapFrom(t => t.ProdLine)) + .ForMember(x => x.RecommendQty, y => y.MapFrom(t => t.RecommendFromQty)) + .ForMember(x => x.RecommendContainerCode, y => y.MapFrom(t => t.RecommendFromContainerCode)) + .ForMember(x => x.RecommendPackingCode, y => y.MapFrom(t => t.RecommendFromPackingCode)) + .ForMember(x => x.RecommendSupplierBatch, y => y.MapFrom(t => t.RecommendFromSupplierBatch)) + .ForMember(x => x.RecommendArriveDate, y => y.MapFrom(t => t.RecommendFromArriveDate)) + .ForMember(x => x.RecommendProduceDate, y => y.MapFrom(t => t.RecommendFromProduceDate)) + .ForMember(x => x.RecommendExpireDate, y => y.MapFrom(t => t.RecommendFromExpireDate)) + .ForMember(x => x.RecommendLot, y => y.MapFrom(t => t.RecommendFromLot)) + .ForMember(x => x.HandledContainerCode, y => y.MapFrom(t => t.HandledToContainerCode)) + .ForMember(x => x.HandledPackingCode, y => y.MapFrom(t => t.HandledToPackingCode)) + .ForMember(x => x.HandledSupplierBatch, y => y.MapFrom(t => t.HandledToSupplierBatch)) + .ForMember(x => x.HandledArriveDate, y => y.MapFrom(t => t.HandledToArriveDate)) + .ForMember(x => x.HandledProduceDate, y => y.MapFrom(t => t.HandledToProduceDate)) + .ForMember(x => x.HandledExpireDate, y => y.MapFrom(t => t.HandledToExpireDate)) + .ForMember(x => x.HandledLot, y => y.MapFrom(t => t.HandledToLot)) + .ForMember(x => x.HandledQty, y => y.MapFrom(t => t.HandledToQty)) + .ForMember(x => x.FromPackingCode, y => y.MapFrom(t => t.HandledFromPackingCode)) + .ForMember(x => x.ToPackingCode, y => y.MapFrom(t => t.HandledToPackingCode)) + .ForMember(x => x.FromContainerCode, y => y.MapFrom(t => t.HandledFromContainerCode)) + .ForMember(x => x.ToContainerCode, y => y.MapFrom(t => t.HandledToContainerCode)) + .ForMember(x => x.FromLot, y => y.MapFrom(t => t.HandledFromLot)) + .ForMember(x => x.ToLot, y => y.MapFrom(t => t.HandledToLot)) + .ForMember(x => x.SupplierBatch, y => y.MapFrom(t => t.HandledToSupplierBatch)) + .ForMember(x => x.ArriveDate, y => y.MapFrom(t => t.HandledToArriveDate)) + .ForMember(x => x.ProduceDate, y => y.MapFrom(t => t.HandledToProduceDate)) + .ForMember(x => x.ExpireDate, y => y.MapFrom(t => t.HandledToExpireDate)) + .ForMember(x => x.FromLocationCode, y => y.MapFrom(t => t.HandledFromLocationCode)) + .ForMember(x => x.FromLocationArea, y => y.MapFrom(t => t.HandledFromLocationArea)) + .ForMember(x => x.FromLocationGroup, y => y.MapFrom(t => t.HandledFromLocationGroup)) + .ForMember(x => x.FromLocationErpCode, y => y.MapFrom(t => t.HandledFromLocationErpCode)) + .ForMember(x => x.FromWarehouseCode, y => y.MapFrom(t => t.HandledFromWarehouseCode)) + .ForMember(x => x.ToLocationCode, y => y.MapFrom(t => t.HandledToLocationCode)) + .ForMember(x => x.ToLocationArea, y => y.MapFrom(t => t.HandledToLocationArea)) + .ForMember(x => x.ToLocationGroup, y => y.MapFrom(t => t.HandledToLocationGroup)) + .ForMember(x => x.ToLocationErpCode, y => y.MapFrom(t => t.HandledToLocationErpCode)) + .ForMember(x => x.ToWarehouseCode, y => y.MapFrom(t => t.HandledToWarehouseCode)) + .ForMember(x => x.FromStatus, y => y.MapFrom(t => t.Status)) + .ForMember(x => x.ToStatus, y => y.MapFrom(t => t.Status)) + .ForMember(x => x.Qty, y => y.MapFrom(t => t.HandledToQty)) + .ForMember(x => x.ItemCode, y => y.MapFrom(t => t.ItemCode)) + .Ignore(x => x.ExpiredTime) + + ; + + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/AssembleNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/AssembleNoteAutoMapperProfile.cs deleted file mode 100644 index b4b816da9..000000000 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/AssembleNoteAutoMapperProfile.cs +++ /dev/null @@ -1,51 +0,0 @@ -using AutoMapper; -using Volo.Abp.AutoMapper; -using Win_in.Sfs.Wms.Inventory.Application.Contracts; -using Win_in.Sfs.Wms.Store.Domain; - -namespace Win_in.Sfs.Wms.Store.Event; - -public partial class StoreEventAutoMapperProfile : Profile -{ - private void AssembleIssueNoteAutoMapperProfile() - { - CreateMap() - .Ignore(x => x.DocNumber) - .Ignore(x => x.JobNumber) - .Ignore(x => x.Worker) - .Ignore(x => x.TransType) - .Ignore(x => x.ExtraProperties) - .Ignore(x => x.TransSubType) - - .ForMember(x => x.Qty, y => y.MapFrom(t => t.HandledToQty)) - .ForMember(x => x.SupplierBatch, y => y.MapFrom(t => t.HandledFromSupplierBatch)) - .ForMember(x => x.ArriveDate, y => y.MapFrom(t => t.HandledFromArriveDate)) - .ForMember(x => x.ProduceDate, y => y.MapFrom(t => t.HandledFromProduceDate)) - .ForMember(x => x.ExpireDate, y => y.MapFrom(t => t.HandledFromExpireDate)) - - .ForMember(x => x.FromPackingCode, y => y.MapFrom(t => t.HandledFromPackingCode)) - .ForMember(x => x.FromContainerCode, y => y.MapFrom(t => t.HandledFromContainerCode)) - - .ForMember(x => x.FromLot, y => y.MapFrom(t => t.HandledFromLot)) - .ForMember(x => x.FromStatus, y => y.MapFrom(t => t.Status)) - - .ForMember(x => x.FromLocationCode, y => y.MapFrom(t => t.HandledFromLocationCode)) - .ForMember(x => x.FromLocationGroup, y => y.MapFrom(t => t.HandledFromLocationGroup)) - .ForMember(x => x.FromLocationArea, y => y.MapFrom(t => t.HandledFromLocationArea)) - .ForMember(x => x.FromLocationErpCode, y => y.MapFrom(t => t.HandledFromLocationErpCode)) - .ForMember(x => x.FromWarehouseCode, y => y.MapFrom(t => t.HandledFromWarehouseCode)) - - .ForMember(x => x.ToLot, y => y.MapFrom(t => t.HandledToLot)) - .ForMember(x => x.ToStatus, y => y.MapFrom(t => t.Status)) - .ForMember(x => x.ToPackingCode, y => y.MapFrom(t => t.HandledToPackingCode)) - .ForMember(x => x.ToContainerCode, y => y.MapFrom(t => t.HandledToContainerCode)) - - .ForMember(x => x.ToLocationCode, y => y.MapFrom(t => t.HandledToLocationCode)) - .ForMember(x => x.ToLocationGroup, y => y.MapFrom(t => t.HandledToLocationGroup)) - .ForMember(x => x.ToLocationArea, y => y.MapFrom(t => t.HandledToLocationArea)) - .ForMember(x => x.ToLocationErpCode, y => y.MapFrom(t => t.HandledToLocationErpCode)) - .ForMember(x => x.ToWarehouseCode, y => y.MapFrom(t => t.HandledToWarehouseCode)) - - ; - } -} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/AssembleIssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/AssembleIssueNoteEventHandler.cs index dc316c85f..841238749 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/AssembleIssueNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/AssembleIssueNoteEventHandler.cs @@ -37,44 +37,45 @@ public class AssembleIssueNoteEventHandler protected override async Task AddExchangeDataAsync(List entities) { - var dtos = ObjectMapper.Map, List>(entities); + var dtos = ObjectMapper.Map, List>(entities); foreach (var detail in dtos.SelectMany(dto => dto.Details)) { - if (string.IsNullOrEmpty(detail.HandledFromLocationErpCode)) - { - var location = await LocationAclService.GetByCodeAsync(detail.HandledFromLocationCode).ConfigureAwait(false); - if (location != null) - { - detail.HandledFromLocationErpCode = location.ErpLocationCode; - detail.HandledFromLocationGroup = location.LocationGroupCode; - detail.HandledFromLocationArea = location.AreaCode; + await detail.TrySetLocationAsync(LocationAclService).ConfigureAwait(false); + //if (string.IsNullOrEmpty(detail.HandledFromLocationErpCode)) + //{ + // var location = await LocationAclService.GetByCodeAsync(detail.HandledFromLocationCode).ConfigureAwait(false); + // if (location != null) + // { + // detail.HandledFromLocationErpCode = location.ErpLocationCode; + // detail.HandledFromLocationGroup = location.LocationGroupCode; + // detail.HandledFromLocationArea = location.AreaCode; - if (string.IsNullOrEmpty(detail.HandledFromWarehouseCode)) - { - detail.HandledFromWarehouseCode = location.WarehouseCode; - } - } - } + // if (string.IsNullOrEmpty(detail.HandledFromWarehouseCode)) + // { + // detail.HandledFromWarehouseCode = location.WarehouseCode; + // } + // } + //} - if (string.IsNullOrEmpty(detail.HandledToLocationErpCode)) - { - var location = await LocationAclService.GetByCodeAsync(detail.HandledToLocationCode).ConfigureAwait(false); - if (location != null) - { - detail.HandledToLocationErpCode = location.ErpLocationCode; - detail.HandledToLocationGroup = location.LocationGroupCode; - detail.HandledToLocationArea = location.AreaCode; + //if (string.IsNullOrEmpty(detail.HandledToLocationErpCode)) + //{ + // var location = await LocationAclService.GetByCodeAsync(detail.HandledToLocationCode).ConfigureAwait(false); + // if (location != null) + // { + // detail.HandledToLocationErpCode = location.ErpLocationCode; + // detail.HandledToLocationGroup = location.LocationGroupCode; + // detail.HandledToLocationArea = location.AreaCode; - if (string.IsNullOrEmpty(detail.HandledToWarehouseCode)) - { - detail.HandledToWarehouseCode = location.WarehouseCode; - } - } - } + // if (string.IsNullOrEmpty(detail.HandledToWarehouseCode)) + // { + // detail.HandledToWarehouseCode = location.WarehouseCode; + // } + // } + //} } - var toErpDto = new List(); + var toErpDto = new List(); foreach (var item in dtos) { if (item.Details != null && item.Details.Count != 0) @@ -84,10 +85,10 @@ public class AssembleIssueNoteEventHandler } //2023-12-6要求同储位不传入接口 按历史规则 - var result = new List(); + var result = new List(); foreach (var assembleIssueNoteDto in toErpDto) { - assembleIssueNoteDto.Details.RemoveAll(p => p.HandledFromLocationErpCode == p.HandledToLocationErpCode); + assembleIssueNoteDto.Details.RemoveAll(p => p.HandledFromLocationErpCode == p.ToLocationErpCode); if (assembleIssueNoteDto.Details.Count > 0) { result.Add(assembleIssueNoteDto); From eb13869081239176bc67ea9283340d4dc33694dc Mon Sep 17 00:00:00 2001 From: zhaoxinyu <89237069@qq.com> Date: Tue, 11 Jun 2024 13:40:47 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AssembleIssueJobAppService.cs | 62 ++++++------------- .../settings/appsettings.Development.json | 16 +++++ .../publish/conf/settings/appsettings.json | 15 +++++ 3 files changed, 50 insertions(+), 43 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs index b1323fdad..51556f933 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs @@ -341,11 +341,11 @@ public class AssembleIssueJobAppService #endif //var json = JsonSerializer.Serialize(main); - _options.Value.Address = "http://7e42682n64.goho.co:21171/"; //测试地址 - _options.Value.Token = ""; //测试token - _options.Value.UserName = ""; //测试用户名 - _options.Value.Password = ""; //测试密码 - _options.Value.Path = "zozocnApi/custom/receiveProductionPlan"; //测试密码 + _options.Value.Address =string.IsNullOrEmpty(_options.Value.Address)?"http://7e42682n64.goho.co:21171/": _options.Value.Address; //测试地址 + _options.Value.Token = string.IsNullOrEmpty(_options.Value.Token)? string.Empty: _options.Value.Token; //测试token + _options.Value.UserName = string.IsNullOrEmpty(_options.Value.UserName) ? "": _options.Value.UserName; //测试用户名 + _options.Value.Password = string.IsNullOrEmpty(_options.Value.Password) ? "": _options.Value.Password; //测试密码 + _options.Value.Path = string.IsNullOrEmpty(_options.Value.Path) ? "zozocnApi/custom/receiveProductionPlan":_options.Value.Path; //测试密码 _logger.LogInformation(System.Text.Json.JsonSerializer.Serialize(_options)); @@ -390,13 +390,9 @@ public class AssembleIssueJobAppService var flag = DateTime.Now.ToString("yyyyMMddHHmmss"); _logger.LogInformation($"{flag}接收到立体库确认单据内容:" + json); #if DEBUG - - - - #endif var errors = new List(); - var ret = new ReusltObject { Code = int.Parse(GaoTongResultStatus.Success), OperateTime = DateTime.Now.ToString("yyyy-MM-dd"), Message = "操作成功" }; + var ret = new ReusltObject { Code = int.Parse(GaoTongResultStatus.Success), OperateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Message = "操作成功" }; try { if (input.Jobs.Count > 0) @@ -415,56 +411,43 @@ public class AssembleIssueJobAppService { errors.Add("立体库提交出库任务和WMS任务不符,请核对! \n"); } - - foreach (var itm in dtos) { - - var first = jobs.FirstOrDefault(p => p.JobNumber == itm.Number); var itmDetails = itm.Details.ToList(); var details = new List(); - foreach (var detail in first.Details) { var loc=await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false); - if (loc == null) { - errors.Add($"目标库位{detail.FromLocationCode}没查到"); + errors.Add($"来源库位{detail.FromLocationCode}没查到"); } + var entity = itmDetails.FirstOrDefault(p => p.ItemCode == detail.ItemCode); + if (entity == null) + { + errors.Add($"物料号{detail.ItemCode}明细内!"); + } - - var entity = itmDetails.FirstOrDefault(p => p.ItemCode == detail.ItemCode); var dto = new AssembleIssueJobDetailDTO(); - //dto.HandledFromLocationCode = entity.HandledFromLocationCode; - //dto.HandledToLocationCode = entity.HandledToLocationCode; - // dto.ItemCode = detail.ItemCode; dto.InjectFrom(entity); + + /* 客户说整单完成后才回传 dto.RecommendFromQty = detail.Qty; dto.RecommendToQty = detail.Qty; dto.HandledFromQty = detail.Qty; dto.HandledToQty = detail.Qty; - - //dto.HandledToLocationCode = loc.Code; - //dto.HandledToLocationGroup = loc.LocationGroupCode; - //dto.HandledToLocationArea = loc.AreaCode; - //dto.HandledToLocationErpCode = loc.ErpLocationCode; - //dto.HandledToPackingCode = ""; - + */ dto.HandledFromLocationCode = loc.Code; dto.HandledFromLocationGroup = loc.LocationGroupCode; dto.HandledFromLocationArea = loc.AreaCode; dto.HandledFromLocationErpCode = loc.ErpLocationCode; - dto.HandledFromPackingCode = ""; - - - - //dto.Status = entity.Status; - + // dto.HandledToLocationCode = entity.HandledToLocationCode; + dto.HandledFromPackingCode = ""; details.Add(dto); + await ExecuteDetailAsync(itm.Id, entity.Id, dto).ConfigureAwait(false); } if (errors.Count > 0) { @@ -474,23 +457,16 @@ public class AssembleIssueJobAppService OperateTime = DateTime.Now.ToString("yyyy-MM-dd"), Message = string.Join(",", errors.ToArray()), Data = json - }; } - - - itm.Details = details; - await CompleteAsync(itm.Id, itm).ConfigureAwait(false); + // await CompleteAsync(itm.Id, itm).ConfigureAwait(false); _logger.LogInformation($"{flag}接收到立体库确认单据内容:" + json+"立体库任务完成"); - - } } else { errors.Add("立体库确认单据里无数据! \n"); - } } catch (Exception ex) diff --git a/build/src/docker/publish/conf/settings/appsettings.Development.json b/build/src/docker/publish/conf/settings/appsettings.Development.json index 54cd1daea..ec97ab563 100644 --- a/build/src/docker/publish/conf/settings/appsettings.Development.json +++ b/build/src/docker/publish/conf/settings/appsettings.Development.json @@ -1,5 +1,21 @@ { "AlwaysAllowAuthorization": "true", + "RestoOptions": + { + +"Address" :"http://7e42682n64.goho.co:21171/", + // 用户名 +"UserName" :"", + // 密码 +"Password" :"", + // 令牌 +"Token" :"", +"Path" :"zozocnApi/custom/receiveProductionPlan" + +}, + + + "App": { "CorsOrigins": [ "http://localhost:59080", diff --git a/build/src/docker/publish/conf/settings/appsettings.json b/build/src/docker/publish/conf/settings/appsettings.json index 8ad836316..8e3778d0b 100644 --- a/build/src/docker/publish/conf/settings/appsettings.json +++ b/build/src/docker/publish/conf/settings/appsettings.json @@ -1,4 +1,19 @@ { + "RestoOptions": + { + +"Address" :"http://7e42682n64.goho.co:21171/", + // 用户名 +"UserName" :"", + // 密码 +"Password" :"", + // 令牌 +"Token" :"", +"Path" :"zozocnApi/custom/receiveProductionPlan" + +}, + + //是否绕过权限验证 "AlwaysAllowAuthorization": "True", //跨域 From 43439e27079e263c9d674624f87cf644d3908a0d Mon Sep 17 00:00:00 2001 From: zhaoxinyu <89237069@qq.com> Date: Tue, 11 Jun 2024 13:42:00 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs index 51556f933..541fbf282 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs @@ -427,7 +427,7 @@ public class AssembleIssueJobAppService if (entity == null) { - errors.Add($"物料号{detail.ItemCode}明细内!"); + errors.Add($"物料号{detail.ItemCode}不在任务明细内!"); } var dto = new AssembleIssueJobDetailDTO(); From edf2cad048d1f7c4e496c03380dc3a769595e965 Mon Sep 17 00:00:00 2001 From: liuyunfeng Date: Tue, 11 Jun 2024 14:03:55 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E6=8B=86=E7=AE=B1?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ISplitPackingRecAppService.cs | 8 ++++--- .../SplitPackingRecAppService.cs | 22 +++++++++++++++++++ .../SplitPackings/ISplitPackingRecManager.cs | 8 +++++++ .../SplitPackings/SplitPackingRecManager.cs | 13 +++++++++++ .../TransferNotes/TransferNoteAppService.cs | 6 +++++ 5 files changed, 54 insertions(+), 3 deletions(-) diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/SplitPackings/ISplitPackingRecAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/SplitPackings/ISplitPackingRecAppService.cs index 6a283da3b..98fa3b255 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/SplitPackings/ISplitPackingRecAppService.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/SplitPackings/ISplitPackingRecAppService.cs @@ -31,9 +31,11 @@ public interface ISplitPackingRecAppService Task> GetFirstOrDefaultPackingCode(List toPackingCodeList); /// - /// 根据to箱码取所有具有相同箱码的拆箱记录 + /// /// - /// + /// from箱码 + /// 数量 /// - Task> GetSamePoNumberListByToPackingCode(string toPackingCode); + Task CheckSplitNum(string fromPackCode, decimal inputQty); + } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SplitPackings/SplitPackingRecAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SplitPackings/SplitPackingRecAppService.cs index 755982761..eb38d5d7c 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SplitPackings/SplitPackingRecAppService.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SplitPackings/SplitPackingRecAppService.cs @@ -128,5 +128,27 @@ public class SplitPackingRecAppService : return ret; } + /// + /// + /// + /// from箱码 + /// 数量 + /// + [HttpGet("check-split-num")] + public async Task CheckSplitNum(string fromPackCode, decimal inputQty) + { + var lst = await _splitPackingRecManager.GetAllByFromPackingCode(fromPackCode).ConfigureAwait(false); + var originObj = lst.FirstOrDefault(itm => itm.FromPackingCode == fromPackCode && itm.OprType == OprTypeEnum.Other); + if (originObj == null) + { + throw new UserFriendlyException($"[CheckSplitNum]拆箱记录表没有数据:fromPackCode={fromPackCode},OprType={OprTypeEnum.Other}"); + } + var splitLst = lst.Where(itm => itm.FromPackingCode == fromPackCode && itm.OprType == OprTypeEnum.SplitBox); + decimal splitSum = splitLst.Sum(itm => itm.ToQty); + decimal overplusQty = originObj.FromQty - splitSum; + return overplusQty >= inputQty; + } + + } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/ISplitPackingRecManager.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/ISplitPackingRecManager.cs index 0d9704ec3..53a68d296 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/ISplitPackingRecManager.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/ISplitPackingRecManager.cs @@ -26,4 +26,12 @@ public interface ISplitPackingRecManager : IDomainService Task GetTopPackingCode(string packingCode); Task GetSplitPackingCode(string packingCode); Task> GetFirstOrDefaultPackingCode(List toPackingCodeList); + + /// + /// 根据from箱码取所有记录 + /// + /// + /// + Task> GetAllByFromPackingCode(string fromPackingCode); + } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs index 0a95da7df..04916ad6d 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs @@ -267,4 +267,17 @@ public class SplitPackingRecManager : DomainService, ISplitPackingRecManager //} } + /// + /// 根据from箱码取所有记录 + /// + /// + /// + public async Task> GetAllByFromPackingCode(string fromPackingCode) + { + List lst = await _repository.GetListAsync( + itm => itm.FromPackingCode ==fromPackingCode) + .ConfigureAwait(false); + return lst; + } + } 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 856a18357..d55696e09 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 @@ -414,9 +414,15 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase /// private async Task WriteSplitPackingRec(TransferNoteEditInput transferNoteEditInput, SplitPacking_UpdateJobDetailInput updateJobDetailInput = null) { + List recLst = new List(); foreach (var inputDetail in transferNoteEditInput.Details) { + bool qtyEnough = await _splitPackingRecAppService.CheckSplitNum(inputDetail.FromPackingCode, inputDetail.Qty).ConfigureAwait(false); + if (qtyEnough == false) + { + throw new UserFriendlyException($"[WriteSplitPackingRec]拆箱记录表数量不足:FromPackingCode={inputDetail.FromPackingCode},Qty={inputDetail.Qty}"); + } SplitPackingRecEditInput packRec = new SplitPackingRecEditInput(); packRec.OprType = OprTypeEnum.SplitBox; From 59cb8985ecc53e05078003dccd8c5114e681a9e9 Mon Sep 17 00:00:00 2001 From: zhaoxinyu <89237069@qq.com> Date: Tue, 11 Jun 2024 16:51:15 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E6=91=84=E5=83=8F=E5=A4=B4=E9=87=87?= =?UTF-8?q?=E9=9B=86=E6=8E=A5=E5=8F=A3POST=E6=94=B9=E6=88=90GET=E8=AF=B7?= =?UTF-8?q?=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Client/WebApi.cs | 37 +++++++++---------- .../Incoming/InjectionMoldingRequestReader.cs | 6 +-- .../test/TestAppService.cs | 24 ++++++------ .../AssembleIssueJobAppService.cs | 1 - 4 files changed, 32 insertions(+), 36 deletions(-) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs index d466900cd..a4498b3d5 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs @@ -1,3 +1,5 @@ + + //---------------------- // // Generated using the NSwag toolchain v14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) @@ -212,15 +214,15 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming /// Success /// A server side error occurred. - public virtual System.Threading.Tasks.Task> GetCargoStaticAsync(string p_AreaID) + public virtual System.Threading.Tasks.Task> GetCargoStaticAsync(string areaID) { - return GetCargoStaticAsync(p_AreaID, System.Threading.CancellationToken.None); + return GetCargoStaticAsync(areaID, System.Threading.CancellationToken.None); } /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// Success /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetCargoStaticAsync(string p_AreaID, System.Threading.CancellationToken cancellationToken) + public virtual async System.Threading.Tasks.Task> GetCargoStaticAsync(string areaID, System.Threading.CancellationToken cancellationToken) { var client_ = _httpClient; var disposeClient_ = false; @@ -228,8 +230,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "text/plain"); - request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Method = new System.Net.Http.HttpMethod("GET"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); var urlBuilder_ = new System.Text.StringBuilder(); @@ -237,9 +238,9 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming // Operation Path: "CargoState/GetCargoStatic" urlBuilder_.Append("CargoState/GetCargoStatic"); urlBuilder_.Append('?'); - if (p_AreaID != null) + if (areaID != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("p_AreaID")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(p_AreaID, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + urlBuilder_.Append(System.Uri.EscapeDataString("AreaID")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(areaID, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } urlBuilder_.Length--; @@ -535,16 +536,8 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ResponCargoItem1 { - - /// - /// 读取次数 - /// - [Newtonsoft.Json.JsonProperty("number", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Number { get; set; } - /// /// 区域ID /// @@ -569,8 +562,12 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming [Newtonsoft.Json.JsonProperty("flag", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public int Flag { get; set; } - } + [Newtonsoft.Json.JsonProperty("number", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Number { get; set; } + + + } @@ -612,10 +609,10 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming } -#pragma warning restore 108 -#pragma warning restore 114 -#pragma warning restore 472 -#pragma warning restore 612 +#pragma warning restore 108 +#pragma warning restore 114 +#pragma warning restore 472 +#pragma warning restore 612 #pragma warning restore 1573 #pragma warning restore 1591 #pragma warning restore 8073 diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs index fde6ad445..865ce68a2 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs @@ -50,7 +50,6 @@ public class InjectionMoldingRequestReader : IReader ) { _injectionRequest = injectionRequest; - _logger = logger; _options = options; _httpClientFactory = httpClientFactory; @@ -102,8 +101,7 @@ public class InjectionMoldingRequestReader : IReader { var idsList = await client.GetCargoStaticAsync(itm).ConfigureAwait(false); - - Thread.Sleep(1000);//设备读取50ms延时,设置延时时间为1000ms保证读取更新到信息 + Thread.Sleep(500);//设备读取50ms延时,设置延时时间为1000ms保证读取更新到信息 //flag 1-有货 0-空闲 foreach (var respon in idsList.Where(r => r.Flag == 0)) { @@ -167,6 +165,8 @@ public class InjectionMoldingRequestReader : IReader _logger.LogInformation(MakeGrid($"{guid}同步WMS内容", injectionList)); + //_logger.LogInformation($"标识{guid}同步WMS开始"); + foreach (var inject in injectionList) diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/test/TestAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/test/TestAppService.cs index 194c19364..e5fea514f 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/test/TestAppService.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/test/TestAppService.cs @@ -47,11 +47,11 @@ public class TestService:ApplicationService - [HttpPost("GetCargoStatic")] + [HttpGet("GetCargoStatic")] /// /// 异步开始生命周期操作不能堵塞 /// - public async Task> GetCargoStatic(string p_AreaID) + public async Task> GetCargoStatic(string AreaID) { List result = new List(); @@ -60,28 +60,28 @@ public class TestService:ApplicationService result.Add(new ResponCargoItem() { AreaID = "1", CargoID = "PTXB2", PartCode = "TMDLYA0A061AB", Flag = 0 }); result.Add(new ResponCargoItem() { AreaID = "2", CargoID = "ZSXB2", PartCode = "TMDLYD0ABM5A", Flag = 0 }); - result = result.Where(p => p.AreaID == p_AreaID).ToList(); + result = result.Where(p => p.AreaID == AreaID).ToList(); return result; } - [HttpPost("SyncIssueJobStereo")] + //[HttpPost("SyncIssueJobStereo")] - public virtual async Task SyncIssueJobStereoAsync(IssueJobToRestoDTO input) - { + //public virtual async Task SyncIssueJobStereoAsync(IssueJobToRestoDTO input) + //{ - ReusltObject reuslt=new ReusltObject(); - reuslt.Code = "1"; - reuslt.Message = "操作成功"; - reuslt.OperateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + // ReusltObject reuslt=new ReusltObject(); + // reuslt.Code = "1"; + // reuslt.Message = "操作成功"; + // reuslt.OperateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); - return reuslt; + // return reuslt; - } + //} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs index 541fbf282..b6d1770b6 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs @@ -591,7 +591,6 @@ public class AssembleIssueJobAppService { var jobDetailInputdetail = assembleIssueJobDto.Details.FirstOrDefault(); - var loctionDto = await _locationAppService.GetByCodeAsync(jobDetailInputdetail.RecommendFromLocationCode) .ConfigureAwait(false); From c67ace76d4a37e554452491efe5b01235379bb69 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Tue, 11 Jun 2024 17:01:52 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E5=A4=87=E5=93=81=E3=80=81=E6=B3=A8?= =?UTF-8?q?=E5=A1=91=E3=80=81=E8=A3=85=E9=85=8D=E3=80=81=E5=96=B7=E6=B6=82?= =?UTF-8?q?TYRP=E6=8E=A5=E5=8F=A3=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AssembleIssueNoteEventHandler.cs | 0 .../CoatingIssueNoteEventHandler.cs | 65 +++++------ .../InjectionIssueNoteEventHandler.cs | 65 +++++------ .../KittingIssueNoteEventHandler.cs | 0 .../Issue/SparePartIssueNoteEventHandler.cs | 107 ++++++++++++++++++ 5 files changed, 173 insertions(+), 64 deletions(-) rename be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/{ => Issue}/AssembleIssueNoteEventHandler.cs (100%) rename be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/{ => Issue}/CoatingIssueNoteEventHandler.cs (58%) rename be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/{ => Issue}/InjectionIssueNoteEventHandler.cs (59%) rename be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/{ => Issue}/KittingIssueNoteEventHandler.cs (100%) create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/SparePartIssueNoteEventHandler.cs diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/AssembleIssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/AssembleIssueNoteEventHandler.cs similarity index 100% rename from be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/AssembleIssueNoteEventHandler.cs rename to be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/AssembleIssueNoteEventHandler.cs diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/CoatingIssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/CoatingIssueNoteEventHandler.cs similarity index 58% rename from be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/CoatingIssueNoteEventHandler.cs rename to be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/CoatingIssueNoteEventHandler.cs index ad795164a..698184507 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/CoatingIssueNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/CoatingIssueNoteEventHandler.cs @@ -37,44 +37,45 @@ public class CoatingIssueNoteEventHandler protected override async Task AddExchangeDataAsync(List entities) { - var dtos = ObjectMapper.Map, List>(entities); + var dtos = ObjectMapper.Map, List>(entities); foreach (var detail in dtos.SelectMany(dto => dto.Details)) { - if (string.IsNullOrEmpty(detail.HandledFromLocationErpCode)) - { - var location = await LocationAclService.GetByCodeAsync(detail.HandledFromLocationCode).ConfigureAwait(false); - if (location != null) - { - detail.HandledFromLocationErpCode = location.ErpLocationCode; - detail.HandledFromLocationGroup = location.LocationGroupCode; - detail.HandledFromLocationArea = location.AreaCode; + await detail.TrySetLocationAsync(LocationAclService).ConfigureAwait(false); + //if (string.IsNullOrEmpty(detail.HandledFromLocationErpCode)) + //{ + // var location = await LocationAclService.GetByCodeAsync(detail.HandledFromLocationCode).ConfigureAwait(false); + // if (location != null) + // { + // detail.HandledFromLocationErpCode = location.ErpLocationCode; + // detail.HandledFromLocationGroup = location.LocationGroupCode; + // detail.HandledFromLocationArea = location.AreaCode; - if (string.IsNullOrEmpty(detail.HandledFromWarehouseCode)) - { - detail.HandledFromWarehouseCode = location.WarehouseCode; - } - } - } + // if (string.IsNullOrEmpty(detail.HandledFromWarehouseCode)) + // { + // detail.HandledFromWarehouseCode = location.WarehouseCode; + // } + // } + //} - if (string.IsNullOrEmpty(detail.HandledToLocationErpCode)) - { - var location = await LocationAclService.GetByCodeAsync(detail.HandledToLocationCode).ConfigureAwait(false); - if (location != null) - { - detail.HandledToLocationErpCode = location.ErpLocationCode; - detail.HandledToLocationGroup = location.LocationGroupCode; - detail.HandledToLocationArea = location.AreaCode; + //if (string.IsNullOrEmpty(detail.HandledToLocationErpCode)) + //{ + // var location = await LocationAclService.GetByCodeAsync(detail.HandledToLocationCode).ConfigureAwait(false); + // if (location != null) + // { + // detail.HandledToLocationErpCode = location.ErpLocationCode; + // detail.HandledToLocationGroup = location.LocationGroupCode; + // detail.HandledToLocationArea = location.AreaCode; - if (string.IsNullOrEmpty(detail.HandledToWarehouseCode)) - { - detail.HandledToWarehouseCode = location.WarehouseCode; - } - } - } + // if (string.IsNullOrEmpty(detail.HandledToWarehouseCode)) + // { + // detail.HandledToWarehouseCode = location.WarehouseCode; + // } + // } + //} } - var toErpDto = new List(); + var toErpDto = new List(); foreach (var item in dtos) { if (item.Details != null && item.Details.Count != 0) @@ -84,10 +85,10 @@ public class CoatingIssueNoteEventHandler } //2023-12-6要求同储位不传入接口 按历史规则 - var result = new List(); + var result = new List(); foreach (var coatingIssueNoteDto in toErpDto) { - coatingIssueNoteDto.Details.RemoveAll(p => p.HandledFromLocationErpCode == p.HandledToLocationErpCode); + coatingIssueNoteDto.Details.RemoveAll(p => p.HandledFromLocationErpCode == p.ToLocationErpCode); if (coatingIssueNoteDto.Details.Count > 0) { result.Add(coatingIssueNoteDto); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/InjectionIssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/InjectionIssueNoteEventHandler.cs similarity index 59% rename from be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/InjectionIssueNoteEventHandler.cs rename to be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/InjectionIssueNoteEventHandler.cs index 34d324950..022d1d360 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/InjectionIssueNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/InjectionIssueNoteEventHandler.cs @@ -37,44 +37,45 @@ public class InjectionIssueNoteEventHandler protected override async Task AddExchangeDataAsync(List entities) { - var dtos = ObjectMapper.Map, List>(entities); + var dtos = ObjectMapper.Map, List>(entities); foreach (var detail in dtos.SelectMany(dto => dto.Details)) { - if(string.IsNullOrEmpty(detail.HandledFromLocationErpCode)) - { - var location = await LocationAclService.GetByCodeAsync(detail.HandledFromLocationCode).ConfigureAwait(false); - if (location != null) - { - detail.HandledFromLocationErpCode = location.ErpLocationCode; - detail.HandledFromLocationGroup = location.LocationGroupCode; - detail.HandledFromLocationArea = location.AreaCode; + await detail.TrySetLocationAsync(LocationAclService).ConfigureAwait(false); + //if(string.IsNullOrEmpty(detail.HandledFromLocationErpCode)) + //{ + // var location = await LocationAclService.GetByCodeAsync(detail.HandledFromLocationCode).ConfigureAwait(false); + // if (location != null) + // { + // detail.HandledFromLocationErpCode = location.ErpLocationCode; + // detail.HandledFromLocationGroup = location.LocationGroupCode; + // detail.HandledFromLocationArea = location.AreaCode; - if (string.IsNullOrEmpty(detail.HandledFromWarehouseCode)) - { - detail.HandledFromWarehouseCode = location.WarehouseCode; - } - } - } + // if (string.IsNullOrEmpty(detail.HandledFromWarehouseCode)) + // { + // detail.HandledFromWarehouseCode = location.WarehouseCode; + // } + // } + //} - if(string.IsNullOrEmpty(detail.HandledToLocationErpCode)) - { - var location = await LocationAclService.GetByCodeAsync(detail.HandledToLocationCode).ConfigureAwait(false); - if (location != null) - { - detail.HandledToLocationErpCode = location.ErpLocationCode; - detail.HandledToLocationGroup = location.LocationGroupCode; - detail.HandledToLocationArea = location.AreaCode; + //if(string.IsNullOrEmpty(detail.HandledToLocationErpCode)) + //{ + // var location = await LocationAclService.GetByCodeAsync(detail.HandledToLocationCode).ConfigureAwait(false); + // if (location != null) + // { + // detail.HandledToLocationErpCode = location.ErpLocationCode; + // detail.HandledToLocationGroup = location.LocationGroupCode; + // detail.HandledToLocationArea = location.AreaCode; - if (string.IsNullOrEmpty(detail.HandledToWarehouseCode)) - { - detail.HandledToWarehouseCode = location.WarehouseCode; - } - } - } + // if (string.IsNullOrEmpty(detail.HandledToWarehouseCode)) + // { + // detail.HandledToWarehouseCode = location.WarehouseCode; + // } + // } + //} } - var toErpDto = new List(); + var toErpDto = new List(); foreach (var item in dtos) { if (item.Details != null && item.Details.Count != 0) @@ -84,10 +85,10 @@ public class InjectionIssueNoteEventHandler } //2023-12-6要求同储位不传入接口 按历史规则 - var result = new List(); + var result = new List(); foreach (var injectionIssueNoteDto in toErpDto) { - injectionIssueNoteDto.Details.RemoveAll(p => p.HandledFromLocationErpCode == p.HandledToLocationErpCode); + injectionIssueNoteDto.Details.RemoveAll(p => p.HandledFromLocationErpCode == p.ToLocationErpCode); if (injectionIssueNoteDto.Details.Count > 0) { result.Add(injectionIssueNoteDto); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/KittingIssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/KittingIssueNoteEventHandler.cs similarity index 100% rename from be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/KittingIssueNoteEventHandler.cs rename to be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/KittingIssueNoteEventHandler.cs diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/SparePartIssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/SparePartIssueNoteEventHandler.cs new file mode 100644 index 000000000..bc03a1ed9 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/SparePartIssueNoteEventHandler.cs @@ -0,0 +1,107 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.EventBus; +using Volo.Abp.Uow; +using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Event; +using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; + +namespace Win_in.Sfs.Wms.Store.Event.DataExchanges; + +/// +/// 备品发料记录传给TYRP(线边仓领料单) +/// +public class SparePartIssueNoteEventHandler + : StoreDataExchangeEventHandlerBase + , ILocalEventHandler> + , ILocalEventHandler>> +{ + //线边仓领料单 + private const EnumExchangeDataType ExchangeDataType = EnumExchangeDataType.Issue; + + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + { + var entity = eventData.Entity; + await AddExchangeDataAsync(entity).ConfigureAwait(false); + } + + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + { + var entities = eventData.Entity; + await AddExchangeDataAsync(entities).ConfigureAwait(false); + } + + protected override async Task AddExchangeDataAsync(List entities) + { + var dtos = ObjectMapper.Map, List>(entities); + foreach (var detail in dtos.SelectMany(dto => dto.Details)) + { + await detail.TrySetLocationAsync(LocationAclService).ConfigureAwait(false); + //if(string.IsNullOrEmpty(detail.HandledFromLocationErpCode)) + //{ + // var location = await LocationAclService.GetByCodeAsync(detail.HandledFromLocationCode).ConfigureAwait(false); + // if (location != null) + // { + // detail.HandledFromLocationErpCode = location.ErpLocationCode; + // detail.HandledFromLocationGroup = location.LocationGroupCode; + // detail.HandledFromLocationArea = location.AreaCode; + + // if (string.IsNullOrEmpty(detail.HandledFromWarehouseCode)) + // { + // detail.HandledFromWarehouseCode = location.WarehouseCode; + // } + // } + //} + + //if(string.IsNullOrEmpty(detail.HandledToLocationErpCode)) + //{ + // var location = await LocationAclService.GetByCodeAsync(detail.HandledToLocationCode).ConfigureAwait(false); + // if (location != null) + // { + // detail.HandledToLocationErpCode = location.ErpLocationCode; + // detail.HandledToLocationGroup = location.LocationGroupCode; + // detail.HandledToLocationArea = location.AreaCode; + + // if (string.IsNullOrEmpty(detail.HandledToWarehouseCode)) + // { + // detail.HandledToWarehouseCode = location.WarehouseCode; + // } + // } + //} + + } + + var toErpDto = new List(); + foreach (var item in dtos) + { + if (item.Details != null && item.Details.Count != 0) + { + toErpDto.Add(item); + } + } + + //2023-12-6要求同储位不传入接口 按历史规则 + var result = new List(); + foreach (var sparePartIssueNoteDto in toErpDto) + { + sparePartIssueNoteDto.Details.RemoveAll(p => p.HandledFromLocationErpCode == p.ToLocationErpCode); + if (sparePartIssueNoteDto.Details.Count > 0) + { + result.Add(sparePartIssueNoteDto); + } + } + + if (result.Count > 0) + { + var exchangeDataerp = + await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, ExchangeDataType, result) + .ConfigureAwait(false); + await AddManyAsync(exchangeDataerp).ConfigureAwait(false); + } + } + +} From a7593e4f547ca782c951d4bb4dd3ff903198f237 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Wed, 12 Jun 2024 14:23:34 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Jobs/ThirdLocationJobController.cs | 2 +- .../Jobs/ThirdLocationJobs/ThirdLocationJobAppService.cs | 6 ++++++ .../Jobs/ThirdLocationJobEventHandler.cs | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ThirdLocationJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ThirdLocationJobController.cs index 2c1ed7bb4..3d3f29459 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ThirdLocationJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ThirdLocationJobController.cs @@ -182,7 +182,7 @@ public class ThirdLocationJobController : AbpController } /// - /// 关闭任务 + /// 终止关闭任务 /// /// /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAppService.cs index 647260243..1c505db17 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAppService.cs @@ -89,6 +89,12 @@ public class ThirdLocationJobAppService return handleDto; } + /// + /// 终止关闭任务 + /// + /// + /// + /// [HttpPost("close-job/{id}")] public virtual async Task CloseJobAsync(Guid id) { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ThirdLocationJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ThirdLocationJobEventHandler.cs index bcc80e5c4..af8b6ad51 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ThirdLocationJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ThirdLocationJobEventHandler.cs @@ -104,7 +104,7 @@ public class ThirdLocationJobEventHandler : } /// - /// 关闭任务后 + /// 终止关闭任务后 /// /// /// From 1c05d14f10c4a26f6ddd6204067c3c465a0216b1 Mon Sep 17 00:00:00 2001 From: liuyunfeng Date: Wed, 12 Jun 2024 14:34:57 +0800 Subject: [PATCH 8/8] tijiao --- .../SplitPackings/ISplitPackingRecAppService.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/SplitPackings/ISplitPackingRecAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/SplitPackings/ISplitPackingRecAppService.cs index 98fa3b255..4ba841877 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/SplitPackings/ISplitPackingRecAppService.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/SplitPackings/ISplitPackingRecAppService.cs @@ -30,6 +30,13 @@ public interface ISplitPackingRecAppService Task GetSplitPackingCode(string toPackingCode); Task> GetFirstOrDefaultPackingCode(List toPackingCodeList); + /// + /// 根据to箱码取所有具有相同箱码的拆箱记录 + /// + /// + /// + Task> GetSamePoNumberListByToPackingCode(string toPackingCode); + /// /// ///