From 7fac5342ba360584d730b04f88a09265a7d7ca1d Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期五, 10 一月 2025 14:35:51 +0800 Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs | 42 +++++++++++++++++++++++++++++++++++++----- 1 files changed, 37 insertions(+), 5 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs" index 5f7d14d..f81227e 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs" @@ -5,6 +5,7 @@ using System.Threading.Tasks; using WIDESEA_Common.StockEnum; using WIDESEA_Core; +using WIDESEA_Core.BaseRepository; using WIDESEA_Core.BaseServices; using WIDESEA_Core.Enums; using WIDESEA_Core.Helper; @@ -22,12 +23,13 @@ private readonly IRecordService _recordService; public IOutStockLockInfoRepository Repository => BaseDal; + public IUnitOfWorkManage _unitOfWorkManage; - - public OutStockLockInfoService(IOutStockLockInfoRepository BaseDal, IStockService stockService, IRecordService recordService) : base(BaseDal) + public OutStockLockInfoService(IOutStockLockInfoRepository BaseDal, IStockService stockService, IRecordService recordService, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) { _recordService = recordService; _stockService = stockService; + _unitOfWorkManage = unitOfWorkManage; } public List<Dt_OutStockLockInfo> GetOutStockLockInfos(Dt_OutboundOrder outboundOrder, Dt_OutboundOrderDetail outboundOrderDetail, List<Dt_StockInfo> outStocks, int? taskNum = null) @@ -66,7 +68,7 @@ PalletCode = outStock.PalletCode, AssignQuantity = assignQuantity, MaterielCode = outboundOrderDetail.MaterielCode, - BatchNo = outboundOrderDetail.BatchNo, + BatchNo = outboundOrderDetail.BatchNo ?? outStock.Details.FirstOrDefault()?.BatchNo, LocationCode = outStock.LocationCode, MaterielName = outboundOrderDetail.MaterielName, OrderDetailId = outboundOrderDetail.Id, @@ -76,7 +78,33 @@ Status = taskNum == null ? OutLockStockStatusEnum.宸插垎閰�.ObjToInt() : OutLockStockStatusEnum.鍑哄簱涓�.ObjToInt(), StockId = outStock.Id, TaskNum = taskNum, - OrderQuantity = outboundOrderDetail.OrderQuantity + OrderQuantity = outboundOrderDetail.OrderQuantity, + Unit=outboundOrderDetail.Unit, + }; + + return outStockLockInfo; + } + + public Dt_OutStockLockInfo GetOutStockLockInfo(Dt_MesOutboundOrder mesOutboundOrder, Dt_StockInfo outStock, float assignQuantity, int? taskNum = null) + { + + Dt_OutStockLockInfo outStockLockInfo = new Dt_OutStockLockInfo() + { + PalletCode = outStock.PalletCode, + AssignQuantity = assignQuantity, + MaterielCode = mesOutboundOrder.MaterialCode, + BatchNo = outStock.Details.FirstOrDefault()?.BatchNo ?? "", + LocationCode = outStock.LocationCode, + MaterielName = mesOutboundOrder.MaterialName, + OrderDetailId = mesOutboundOrder.Id, + OrderNo = mesOutboundOrder.OrderNo, + OrderType = mesOutboundOrder.OrderType, + OriginalQuantity = outStock.Details.Where(x => x.MaterielCode == mesOutboundOrder.MaterialCode).Sum(x => x.StockQuantity), + Status = taskNum == null ? OutLockStockStatusEnum.宸插垎閰�.ObjToInt() : OutLockStockStatusEnum.鍑哄簱涓�.ObjToInt(), + StockId = outStock.Id, + TaskNum = taskNum, + OrderQuantity = mesOutboundOrder.OrderQuantity, + Unit = mesOutboundOrder.Unit }; return outStockLockInfo; @@ -94,6 +122,10 @@ var palletCode = saveModel.MainData["barcode"].ToString(); var warehouseId = saveModel.MainData["warehouseId"].ObjToInt(); Dt_StockInfo stockInfo = BaseDal.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode && x.WarehouseId == warehouseId).Includes(x => x.Details).First(); + if (stockInfo.StockStatus != StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt()) + { + throw new Exception($"璇ユ墭鐩樿繕鏈嚭搴撳畬鎴�"); + } if (stockInfo == null) { throw new Exception($"鏈壘鍒板簱瀛樹俊鎭�"); @@ -103,7 +135,7 @@ { throw new Exception($"鏈壘鍒板簱瀛樿鎯�"); } - List<Dt_OutStockLockInfo> stockLockInfos = BaseDal.QueryData(x => x.StockId == stockInfo.Id&&x.Status< OutLockStockStatusEnum.鍑哄簱瀹屾垚.ObjToInt()); + List<Dt_OutStockLockInfo> stockLockInfos = BaseDal.QueryData(x => x.StockId == stockInfo.Id && x.Status == OutLockStockStatusEnum.鍑哄簱瀹屾垚.ObjToInt()); return stockLockInfos; } catch (Exception ex) -- Gitblit v1.9.3