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 71c7135e0..2c3675cc8 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 @@ -464,29 +464,29 @@ public class BalanceAppService return dtos; } - /// - /// 根据发料任务需求,算出推荐的库存 (在获取时 已经添加预占用) - /// - /// - /// - /// - [HttpGet("recommend-list-location")] - public virtual async Task> GetRecommendBalancesAsync(RecommendBalanceRequestInput input) - { - var traceId = GuidGenerator.Create(); - var itemCode = input.ItemCode; - var qty = input.Qty; - var locationTypes = input.LocationTypes; - var locationAreas = input.LocationAreas; - var statuses = input.Statuses; - Logger.LogDebug(traceId + "|Input:" + input); - - var balances = await _balanceManager.GetRecommendBalancesAsync(traceId, itemCode, qty, locationTypes, locationAreas, statuses).ConfigureAwait(false); - - var dtos = ObjectMapper.Map, List>(balances); - - return dtos; - } + ///// + ///// 根据发料任务需求,算出推荐的库存 (在获取时 已经添加预占用) + ///// + ///// + ///// + ///// + //[HttpGet("recommend-list-location")] + //public virtual async Task> GetRecommendBalancesListAsync(RecommendBalanceRequestInput input) + //{ + // var traceId = GuidGenerator.Create(); + // var itemCode = input.ItemCode; + // var qty = input.Qty; + // var locationTypes = input.LocationTypes; + // var locationAreas = input.LocationAreas; + // var statuses = input.Statuses; + // Logger.LogDebug(traceId + "|Input:" + input); + + // var balances = await _balanceManager.GetRecommendBalancesAsync(traceId, itemCode, qty, locationTypes, locationAreas, statuses).ConfigureAwait(false); + + // var dtos = ObjectMapper.Map, List>(balances); + + // return dtos; + //} /// /// pda发料执行查询使用 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ProductReceiptNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ProductReceiptNoteEventHandler.cs index c20a43160..42f9e65fe 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ProductReceiptNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ProductReceiptNoteEventHandler.cs @@ -1,7 +1,9 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Castle.Components.DictionaryAdapter; using Volo.Abp.EventBus; +using Volo.Abp.ObjectMapping; using Volo.Abp.Uow; using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Store.Application.Contracts; @@ -32,12 +34,25 @@ public class ProductReceiptNoteEventHandler protected override async Task AddExchangeDataAsync(List entities) { - var dtos = ObjectMapper.Map, List>(entities); - foreach (var detail in dtos.SelectMany(dto => dto.Details)) + var result = new List(); + + foreach (var entity in entities) + { + foreach (var detail in entity.Details) + { + var dto = ObjectMapper.Map(entity); + var detailDto = ObjectMapper.Map(detail); + dto.Details = new EditableList{ detailDto }; + result.Add(dto); + } + } + + foreach (var detail in result.SelectMany(dto => dto.Details)) { await detail.TrySetLocationAsync(LocationAclService, detail.LocationCode).ConfigureAwait(false); } - var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, ExchangeDataType, dtos).ConfigureAwait(false); + + var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, ExchangeDataType, result).ConfigureAwait(false); await AddManyAsync(exchangeData).ConfigureAwait(false); }