From d24cf3d2604cdf4b02f0f455f1cb0c93c76c46d2 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期二, 24 十二月 2024 15:32:41 +0800 Subject: [PATCH] 添加PDA库存查询和出库盘点查询接口 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 50 insertions(+), 0 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 4c9edb1..20ae206 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" @@ -4,6 +4,7 @@ using System.Text; using System.Threading.Tasks; using WIDESEA_Common.StockEnum; +using WIDESEA_Core; using WIDESEA_Core.BaseServices; using WIDESEA_Core.Enums; using WIDESEA_Core.Helper; @@ -48,9 +49,58 @@ return outStockLockInfos; } + public Dt_OutStockLockInfo GetOutStockLockInfo(Dt_OutboundOrder outboundOrder, Dt_OutboundOrderDetail outboundOrderDetail, Dt_StockInfo outStock, float assignQuantity, int? taskNum = null) + { + + Dt_OutStockLockInfo outStockLockInfo = new Dt_OutStockLockInfo() + { + PalletCode = outStock.PalletCode, + AssignQuantity = assignQuantity, + MaterielCode = outboundOrderDetail.MaterielCode, + BatchNo = outboundOrderDetail.BatchNo, + LocationCode = outStock.LocationCode, + MaterielName = outboundOrderDetail.MaterielName, + OrderDetailId = outboundOrderDetail.Id, + OrderNo = outboundOrder.OrderNo, + OrderType = outboundOrder.OrderType, + OriginalQuantity = outStock.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).Sum(x => x.StockQuantity), + Status = taskNum == null ? OutLockStockStatusEnum.宸插垎閰�.ObjToInt() : OutLockStockStatusEnum.鍑哄簱涓�.ObjToInt(), + StockId = outStock.Id, + TaskNum = taskNum, + OrderQuantity = outboundOrderDetail.OrderQuantity + }; + + return outStockLockInfo; + } + public List<Dt_OutStockLockInfo> GetByOrderDetailId(int orderDetailId, OutLockStockStatusEnum outStockStatus) { return BaseDal.QueryData(x => x.OrderDetailId == orderDetailId && x.Status == outStockStatus.ObjToInt()); } + + public List<Dt_OutStockLockInfo> GetStockOutboundOrder(SaveModel saveModel) + { + try + { + 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 == null) + { + throw new Exception($"鏈壘鍒板簱瀛樹俊鎭�"); + } + Dt_StockInfoDetail stockInfoDetail = stockInfo.Details.FirstOrDefault(); + if (stockInfoDetail == null) + { + throw new Exception($"鏈壘鍒板簱瀛樿鎯�"); + } + List<Dt_OutStockLockInfo> stockLockInfos = BaseDal.QueryData(x => x.StockId == stockInfo.Id&&x.Status< OutLockStockStatusEnum.鍑哄簱瀹屾垚.ObjToInt()); + return stockLockInfos; + } + catch (Exception ex) + { + return null; + } + } } } -- Gitblit v1.9.3