From 18d2f40bbf40469b033de6f07ca8a8e3bc191132 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期六, 26 四月 2025 19:21:40 +0800 Subject: [PATCH] 优化代码 --- 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Service/OutboundOrderDetailService.cs | 21 ++++++++++++++++++--- 1 files changed, 18 insertions(+), 3 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Service/OutboundOrderDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Service/OutboundOrderDetailService.cs" index 09bda15..94fd9ab 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Service/OutboundOrderDetailService.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Service/OutboundOrderDetailService.cs" @@ -132,11 +132,26 @@ } public (List<Dt_StockInfo>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) AssignStockOutbound(Dt_OutboundOrder outboundOrder, List<StockSelectViewDTO> stockSelectViews) { - List<Dt_StockInfo> outStocks = null; - List<Dt_OutStockLockInfo> outStockLockInfos = _outStockLockInfoService.GetOutStockLockInfos(outboundOrder, outboundOrder.Details.First(), outStocks); + var PalletCodes = string.Join("", stockSelectViews.Select(x => x.PalletCode).ToList()); + List<Dt_StockInfo> outStocks = _stockService.StockInfoService.Repository.QueryData(x => PalletCodes.Contains(x.PalletCode)); - List<Dt_LocationInfo> locationInfos = _basicService.LocationInfoService.Repository.GetLocationInfos(outStocks.Select(x => x.LocationCode).ToList()); + outStocks.ForEach(x => + { + x.StockStatus = StockStatusEmun.鍑哄簱涓�.ObjToInt(); + }); + List<Dt_OutStockLockInfo> outStockLockInfos = new List<Dt_OutStockLockInfo>(); + foreach (var item in stockSelectViews) + { + var outstocks = outStocks.Where(x => item.PalletCode.Contains(x.PalletCode)).ToList(); + outStockLockInfos.AddRange(_outStockLockInfoService.GetOutStockLockInfo(outboundOrder, outboundOrder.Details.First(), outstocks, BatchNo: item.BatchNo)); + } + + List<Dt_LocationInfo> locationInfos = _basicService.LocationInfoService.Repository.GetLocationInfos(stockSelectViews.Select(x => x.LocationCode).ToList()); + locationInfos.ForEach(x => + { + x.LocationStatus = LocationStatusEnum.Outbounding.ObjToInt(); + }); return (outStocks, outStockLockInfos, locationInfos); } /// <summary> -- Gitblit v1.9.3