From 7cc4be28036bef1aa1f2fbc0f0e6aea6fc5a77c0 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期五, 10 一月 2025 16:05:59 +0800 Subject: [PATCH] 优化库存视图前端,优化获取旧WMS辅料库存 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService_Pick.cs | 11 +++++++---- 1 files changed, 7 insertions(+), 4 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 e5e22ed..6254dbf 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" @@ -39,7 +39,7 @@ List<Dt_OutStockLockInfo> outStockLockInfos = Repository.QueryData(x => x.PalletCode == palletCode); for (int i = 0; i < outStockLockInfos.Count; i++) { - outStockLockInfos[i].Status = OutLockStockStatusEnum.鍑哄簱瀹屾垚.ObjToInt(); + 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(); @@ -62,24 +62,27 @@ } List<string> mCodes = stockInfo.Details.GroupBy(x => x.MaterielCode).Select(x => x.Key).ToList(); + _unitOfWorkManage.BeginTran(); foreach (string code in mCodes) { _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, updateDetailList, deleteDetailList, StockChangeTypeEnum.Outbound); } - updateDetailList.ForEach(x => { x.OutboundQuantity = 0; }); - + stockInfo.StockStatus = StockStatusEmun.鎵嬪姩缁勭洏鍏ュ簱纭.ObjToInt(); //_stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(deleteDetailList, OperateTypeEnum.鑷姩瀹屾垚); + _stockService.StockInfoService.Repository.UpdateData(stockInfo); _stockService.StockInfoDetailService.Repository.UpdateData(updateDetailList); + _stockService.StockInfoDetailService.Repository.DeleteData(deleteDetailList); BaseDal.UpdateData(outStockLockInfos); - + _unitOfWorkManage.BeginTran(); return WebResponseContent.Instance.OK(); } catch (Exception ex) { + _unitOfWorkManage.RollbackTran(); return WebResponseContent.Instance.Error(ex.Message); } } -- Gitblit v1.9.3