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/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs index 6c7ca0d7a..5f5c36cc9 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs @@ -85,9 +85,9 @@ public static class IncomingToWmsExtensions } public static async Task HandleErpLocationItemsAsync(this IncomingToWms incomingConverted, PeriodicBackgroundWorkerContext workerContext) { - //var erpLocationItem = JsonSerializer.Deserialize(incomingConverted.DataContent); - //var erpLocationItemAppService = workerContext.ServiceProvider.GetRequiredService(); - //await erpLocationItemAppService.UpsertAsync(erpLocationItem).ConfigureAwait(false); + var erpLocationItem = JsonSerializer.Deserialize(incomingConverted.DataContent); + var erpLocationItemAppService = workerContext.ServiceProvider.GetRequiredService(); + await erpLocationItemAppService.UpsertAsync(erpLocationItem).ConfigureAwait(false); } public static async Task HandleErpLocationsAsync(this IncomingToWms incomingConverted, PeriodicBackgroundWorkerContext workerContext) { 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/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/TransferLibJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/TransferLibJobController.cs index 5c6aed4cb..d1e770fac 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/TransferLibJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/TransferLibJobController.cs @@ -15,7 +15,7 @@ namespace Win_in.Sfs.Wms.Pda.Controllers.Stores; /// /// [ApiController] -[Route($"{PdaHostConst.ROOT_ROUTE}store/transferlib-job")] +[Route($"{PdaHostConst.ROOT_ROUTE}store/transferlib-job")] //??store应该改成job public class TransferLibJobController : AbpController { diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/ThirdLocationRequestController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/ThirdLocationRequestController.cs index 9c5a29854..529776dbb 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/ThirdLocationRequestController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/ThirdLocationRequestController.cs @@ -109,4 +109,17 @@ public class ThirdLocationRequestController : AbpController return Ok(result); } + /// + /// 完成三方库请求 + /// + /// + /// + [HttpPost("complete/{id}")] + public virtual async Task> CompleteAsync(Guid id) + { + var result = await _thirdLocationRequestAppService.CompleteAsync(id).ConfigureAwait(false); + return Ok(result); + } + + } 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); + /// /// /// 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/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/IBalanceAppService.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/IBalanceAppService.cs index 4fc6aa103..e1df84285 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/IBalanceAppService.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/IBalanceAppService.cs @@ -177,4 +177,5 @@ public interface IBalanceAppService string itemCode, string locationCode, EnumInventoryStatus status,string lot); Task> GetRecommendBalancesByLocationsExpectOldBalancesAsync(RecommendBalanceRequestInput input); Task CountPlanActiveAsync(string packingCode, string itemCode, string lot, string locationCode, EnumInventoryStatus status, DateTime datetime, string countPlanNumber); + Task> GetUsableListByTypeAsync(RecommendBalanceRequestInput input); } diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs index ff20cc1b6..597e5b0c4 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs @@ -687,7 +687,25 @@ public class BalanceAppService return dtos; } + /// + /// 获取可用库存列表 + /// + /// + /// + /// + [HttpGet("usable-list-by-type")] + public virtual async Task> GetUsableListByTypeAsync(RecommendBalanceRequestInput input) + { + List locationCodes = new List(); + var locations=await _locationAclService.GetListByTypesAsync(input.LocationTypes).ConfigureAwait(false); + locationCodes= locations.Select(location=>location.Code).ToList(); + var inventoryBalances = await _balanceManager + .GetUsableListAsync(input.ItemCode, locationCodes, input.Statuses, input.IsPackingCode).ConfigureAwait(false); + + var dtos = ObjectMapper.Map, List>(inventoryBalances); + return dtos; + } /// /// pda发料执行查询使用 /// diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs index db0162c61..69f37b12d 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs @@ -560,16 +560,15 @@ public class BalanceManager : DomainService, IBalanceManager .GroupBy(p => p.ContainerCode) .Select(d => d.Key) .ToListAsync().ConfigureAwait(false); - - usableBalances + usableBalances= usableBalances //扣减已占用库存 .DecreaseExpectOutQty(expectOuts, locations) //去除不可拆箱 拆托的且有预占用的库存余额 .IgnoreExpectOutOfSameContainer(expectOutContainerCodes, itemStoreRelationDict, locations) //过滤掉不允许拣料的库位 .FilterLocationEnablePickAsync(locations) - //排序库存余额 最终可用的余额集合 - .SortByFifo(); + //排序库存余额 最终可用的余额集合 + .SortByFifo(); LogDebug(traceId, usableBalances, "AvailableBalances"); diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Transactions/Transaction.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Transactions/Transaction.cs index c77e039f6..2996f4c6d 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Transactions/Transaction.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Transactions/Transaction.cs @@ -238,6 +238,7 @@ public class Transaction : SfsInventoryAggregateRootBase ItemName = item.Name; ItemDesc1 = item.Desc1; ItemDesc2 = item.Desc2; + StdPackQty = item.StdPackQty; } if (string.IsNullOrEmpty(WarehouseCode)) { 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 c391bd22a..9d964a877 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 @@ -626,7 +626,6 @@ public class AssembleIssueJobAppService { var jobDetailInputdetail = assembleIssueJobDto.Details.FirstOrDefault(); - var loctionDto = await _locationAppService.GetByCodeAsync(jobDetailInputdetail.RecommendFromLocationCode) .ConfigureAwait(false); 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..23af60ffa 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 @@ -6,13 +6,16 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Logging; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.Domain.Entities; using Volo.Abp.ObjectMapping; using Volo.Abp.Uow; using Win_in.Sfs.Basedata.Domain.Shared; using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain.Shared; @@ -56,25 +59,29 @@ public class ThirdLocationJobAppService } else { - var jobDetail= job.Details.FirstOrDefault(p => p.ItemCode == dto.Details[0].ItemCode); - - if(jobDetail==null) - { - throw new UserFriendlyException($"任务错误:未找到物品【{dto.Details[0].ItemCode} 的明细信息"); - } - else + foreach(var item in dto.Details) { - if (dto.Details[0].HandledQty > jobDetail.RecommendQty) + var jobDetail = job.Details.FirstOrDefault(p => p.ItemCode == item.ItemCode); + + if (jobDetail == null) { - throw new UserFriendlyException($"任务错误:编号为【{job.Number}】的实际数量【{dto.Details[0].HandledQty}】不能大于推荐数量【{dto.Details[0].RecommendQty}】"); + throw new UserFriendlyException($"任务错误:未找到物品【{item.ItemCode} 的明细信息"); } - if (jobDetail.ToLocationCode != dto.Details[0].ToLocationCode) + else { - throw new UserFriendlyException($"任务错误:编号为【{job.Number}】的实际目标库位【{dto.Details[0].ToLocationCode}】与申请目标库位【{jobDetail.ToLocationCode}】不一致"); + if (item.HandledQty > jobDetail.RecommendQty) + { + throw new UserFriendlyException($"任务错误:编号为【{job.Number}】的实际数量【{item.HandledQty}】不能大于推荐数量【{item.RecommendQty}】"); + } + if (jobDetail.ToLocationCode != item.ToLocationCode) + { + throw new UserFriendlyException($"任务错误:编号为【{job.Number}】的实际目标库位【{item.ToLocationCode}】与申请目标库位【{jobDetail.ToLocationCode}】不一致"); + } } - } - + } + + } @@ -89,6 +96,12 @@ public class ThirdLocationJobAppService return handleDto; } + /// + /// 终止关闭任务 + /// + /// + /// + /// [HttpPost("close-job/{id}")] public virtual async Task CloseJobAsync(Guid id) { @@ -97,8 +110,25 @@ public class ThirdLocationJobAppService { throw new UserFriendlyException($"未找到ID为 {id} 的任务"); } + else + { + if (thirdLocationJob.JobStatus == EnumJobStatus.Partial) + { + thirdLocationJob.JobStatus = EnumJobStatus.Done; + await Task.CompletedTask.ConfigureAwait(false); + await LocalEventBus.PublishAsync(new SfsClosedEntityEventData(thirdLocationJob), false).ConfigureAwait(false); + await Repository.UpdateAsync(thirdLocationJob).ConfigureAwait(false); - await _thirdLocationJobManager.CloseAsync(thirdLocationJob).ConfigureAwait(false); + //await _thirdLocationJobManager.CloseAsync(thirdLocationJob).ConfigureAwait(false); + + } + else + { + throw new UserFriendlyException($"【{thirdLocationJob.JobStatus.GetDisplayName()}】状态不允许终止"); + } + } + + } /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAppService.cs index 7a6e2fd67..b3075b3ac 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAppService.cs @@ -49,10 +49,12 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase(request), false).ConfigureAwait(false); await _repository.UpdateAsync(request).ConfigureAwait(false); - } else @@ -244,6 +243,58 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase(request); } + /// + /// 用来重写 完成请求 + /// + /// + /// + public override async Task CompleteAsync(Guid id) + { + var request = await _repository.GetAsync(id).ConfigureAwait(false); + + if (request.RequestStatus == EnumRequestStatus.Partial) + { + request.RequestStatus = EnumRequestStatus.Completed; + await Task.CompletedTask.ConfigureAwait(false); + //await LocalEventBus.PublishAsync(new SfsCompletedEntityEventData(request), false).ConfigureAwait(false); + await _repository.UpdateAsync(request).ConfigureAwait(false); + + } + else + { + throw new UserFriendlyException($"【{request.RequestStatus.GetDisplayName()}】状态不允许取消"); + } + var entitys = await _thirdLocationJobRepository.GetListAsync(p => p.RequestNumber == request.Number, "", true).ConfigureAwait(false); + + if (entitys.Any()) + { + foreach (var thirdLocationJob in entitys) + { + if (thirdLocationJob.JobStatus == EnumJobStatus.Partial) + { + thirdLocationJob.JobStatus = EnumJobStatus.Done; + await Task.CompletedTask.ConfigureAwait(false); + await LocalEventBus.PublishAsync(new SfsClosedEntityEventData(thirdLocationJob), false).ConfigureAwait(false); + await _thirdLocationJobRepository.UpdateAsync(thirdLocationJob).ConfigureAwait(false); + } + else if (thirdLocationJob.JobStatus == EnumJobStatus.Open) + { + thirdLocationJob.JobStatus = EnumJobStatus.Closed; + await Task.CompletedTask.ConfigureAwait(false); + await LocalEventBus.PublishAsync(new SfsClosedEntityEventData(thirdLocationJob), false).ConfigureAwait(false); + await _thirdLocationJobRepository.UpdateAsync(thirdLocationJob).ConfigureAwait(false); + } + else + { + + } + } + } + + return ObjectMapper.Map(request); + } + + /// /// 赋值Request业务属性 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/KittingPackagingNotes/KittingPackagingNoteChassisDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/KittingPackagingNotes/KittingPackagingNoteChassisDetail.cs index e1349a47e..8615428c9 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/KittingPackagingNotes/KittingPackagingNoteChassisDetail.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/KittingPackagingNotes/KittingPackagingNoteChassisDetail.cs @@ -9,11 +9,18 @@ public class KittingPackagingNoteChassisDetail : SfsStoreDetailEntityBase /// 底盘号 /// [Display(Name = "底盘号")] - public long ChassisNumber { get; set; } + //public long ChassisNumber { get; set; } + public string ChassisNumber { get; set; } //lyf at 20240613 /// /// Kitting代码 /// [Display(Name = "Kitting代码")] public string KittingCode { get; set; } + + /// + /// 底盘号排序序列 + /// + [Display(Name = "底盘号排序序列")] + public long ChassisSortNumber { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/KittingPackagingNotes/KittingPackagingNoteDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/KittingPackagingNotes/KittingPackagingNoteDbContextModelCreatingExtensions.cs index 2ee0c6e2e..09c22253e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/KittingPackagingNotes/KittingPackagingNoteDbContextModelCreatingExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/KittingPackagingNotes/KittingPackagingNoteDbContextModelCreatingExtensions.cs @@ -53,6 +53,7 @@ public static class KittingPackagingNoteDbContextModelCreatingExtensions b.ConfigureSfsBase(); //Properties b.Property(q => q.KittingCode).HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.ChassisNumber).HasMaxLength(SfsPropertyConst.CodeLength); //Indexes }); } 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); + } + } + +} 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..1556e7251 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 @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Microsoft.AspNetCore.Routing.Matching; using Volo.Abp.EventBus; using Volo.Abp.Uow; using Win_in.Sfs.Basedata.Application.Contracts; @@ -24,13 +25,15 @@ public class ThirdLocationJobEventHandler : private readonly ILocationAppService _locationAppService; private readonly IThirdLocationRequestManager _thirdLocationRequestManager; private readonly ITransferLogAppService _transferLogAppService; + private readonly IThirdLocationJobRepository _thirdLocationJobRepository; - public ThirdLocationJobEventHandler(IThirdLocationNoteAppService thirdLocationNoteAppService, ITransferLogAppService transferLogAppService, IThirdLocationRequestManager thirdLocationRequestManager, ILocationAppService locationAppService) + public ThirdLocationJobEventHandler(IThirdLocationNoteAppService thirdLocationNoteAppService, IThirdLocationJobRepository thirdLocationJobRepository, ITransferLogAppService transferLogAppService, IThirdLocationRequestManager thirdLocationRequestManager, ILocationAppService locationAppService) { _thirdLocationNoteAppService = thirdLocationNoteAppService; _locationAppService = locationAppService; _thirdLocationRequestManager = thirdLocationRequestManager; _transferLogAppService = transferLogAppService; + _thirdLocationJobRepository = thirdLocationJobRepository; } /// @@ -104,7 +107,7 @@ public class ThirdLocationJobEventHandler : } /// - /// 关闭任务后 + /// 终止关闭任务后 /// /// /// @@ -119,21 +122,39 @@ public class ThirdLocationJobEventHandler : var transferLogs = new List(); - transferLogs.AddRange(await BuildCancelTransferLogsAsync(thirdLocationRequest).ConfigureAwait(false)); + transferLogs.AddRange(await BuildCancelTransferLogsAsync(thirdLocationRequest, entity.Details[0].ItemCode).ConfigureAwait(false)); await _transferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false); - thirdLocationRequest.RequestStatus = EnumRequestStatus.Abort; - await _thirdLocationRequestManager.UpdateAsync(thirdLocationRequest).ConfigureAwait(false); + var jobEntities = await _thirdLocationJobRepository.GetListAsync(p => p.RequestNumber == entity.RequestNumber, "Number", true).ConfigureAwait(false); + bool isDone = false; + foreach (var job in jobEntities.Where(p=>p.Number!= entity.Number)) + { + if(job.JobStatus == EnumJobStatus.Done) + { + isDone = true; + } + else + { + isDone = false; + } + + } + if(isDone) + { + thirdLocationRequest.RequestStatus = EnumRequestStatus.Completed; + await _thirdLocationRequestManager.UpdateAsync(thirdLocationRequest).ConfigureAwait(false); + } + } } - private async Task> BuildCancelTransferLogsAsync(ThirdLocationRequest thirdLocationRequest) + private async Task> BuildCancelTransferLogsAsync(ThirdLocationRequest thirdLocationRequest,string itemCode) { var transferLogs = new List(); - foreach (var detail in thirdLocationRequest.Details.Where(detail => detail.IssuedQty-detail.ReceivedQty != 0)) + foreach (var detail in thirdLocationRequest.Details.Where(detail => detail.IssuedQty-detail.ReceivedQty != 0 && detail.ItemCode== itemCode)) { var transferLog = ObjectMapper.Map(detail); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs index 783808a45..0eab56632 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs @@ -306,13 +306,18 @@ public class ThirdLocationRequestEventHandler } var fromLocation = await _locationAppService.GetByCodeAsync(thirdLocationRequestDetail.FromLocationCode).ConfigureAwait(false); - var job = jobs.FirstOrDefault(p => p.WorkGroupCode == fromLocation?.WorkGroupCode); - if (job == null || job.Details.Any(p => p.ToLocationCode != thirdLocationRequestDetail.ToLocationCode)) - { - job = BuildThirdLocationJobCreateInput(thirdLocationRequest, fromLocation); - jobs.Add(job); - } + + var job = BuildThirdLocationJobCreateInput(thirdLocationRequest, fromLocation); job.Details.AddRange(jobDetails); + jobs.Add(job); + + //var job = jobs.FirstOrDefault(p => p.WorkGroupCode == fromLocation?.WorkGroupCode); + //if (job == null || job.Details.Any(p => p.ToLocationCode != thirdLocationRequestDetail.ToLocationCode)) + //{ + // job = BuildThirdLocationJobCreateInput(thirdLocationRequest, fromLocation); + // jobs.Add(job); + //} + //job.Details.AddRange(jobDetails); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/NoOkConvertOKNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/NoOkConvertOKNoteEventHandler.cs index 1c2b416a6..9b8e278c3 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/NoOkConvertOKNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/NoOkConvertOKNoteEventHandler.cs @@ -58,7 +58,7 @@ public class NoOkConvertOkNoteEventHandler transferLog.TransType = TransType; transferLog.ToLocationCode = locationInfo.Code; - transferLog.FromLocationArea = locationInfo.AreaCode; + transferLog.ToLocationArea = locationInfo.AreaCode; transferLog.ToLocationErpCode = locationInfo.ErpLocationCode; transferLog.ToLocationGroup = locationInfo.LocationGroupCode; transferLog.ToStatus = EnumInventoryStatus.OK;