From e92ae6610410a25826093330bbf42296e746c51d Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期五, 10 一月 2025 23:56:47 +0800 Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService_Pick.cs | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService_Pick.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService_Pick.cs" index 6254dbf..07384b3 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService_Pick.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService_Pick.cs" @@ -42,7 +42,6 @@ outStockLockInfos[i].Status = OutLockStockStatusEnum.鎷i�夊畬鎴�.ObjToInt(); } List<Dt_StockInfoDetail> beforeDetaile = stockInfo.Details.GroupBy(x => x.MaterielCode).Select(x => new Dt_StockInfoDetail { MaterielCode = x.Key, StockQuantity = x.Sum(v => v.StockQuantity) }).ToList(); - List<Dt_StockInfoDetail> updateDetailList = new List<Dt_StockInfoDetail>(); List<Dt_StockInfoDetail> deleteDetailList = new List<Dt_StockInfoDetail>(); for (int i = 0; i < stockInfo.Details.Count; i++) @@ -73,7 +72,14 @@ }); stockInfo.StockStatus = StockStatusEmun.鎵嬪姩缁勭洏鍏ュ簱纭.ObjToInt(); //_stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(deleteDetailList, OperateTypeEnum.鑷姩瀹屾垚); - _stockService.StockInfoService.Repository.UpdateData(stockInfo); + if (stockInfo.Details.Sum(x=>x.StockQuantity)== stockInfo.Details.Sum(x => x.OutboundQuantity)) + { + _stockService.StockInfoService.Repository.DeleteData(stockInfo); + } + else + { + _stockService.StockInfoService.Repository.UpdateData(stockInfo); + } _stockService.StockInfoDetailService.Repository.UpdateData(updateDetailList); _stockService.StockInfoDetailService.Repository.DeleteData(deleteDetailList); BaseDal.UpdateData(outStockLockInfos); -- Gitblit v1.9.3