From fe256a7afaa132910875d3dc73783d9ab2d7ace5 Mon Sep 17 00:00:00 2001
From: liulijun <liulijun@hnkhzn.com>
Date: 星期四, 12 三月 2026 18:57:44 +0800
Subject: [PATCH] 老厂排程单页面增加用纸顺序号和是否缺料
---
项目代码/WMS/WMSServices/WIDESEA_StockRepository/ProStockInfoRepository.cs | 71 ++++-------------------------------
1 files changed, 8 insertions(+), 63 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_StockRepository/ProStockInfoRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_StockRepository/ProStockInfoRepository.cs"
index 2675255..d1f0c0c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_StockRepository/ProStockInfoRepository.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_StockRepository/ProStockInfoRepository.cs"
@@ -21,70 +21,15 @@
{
_basicRepository = basicRepository;
}
- //鏍规嵁鏄庣粏鏁版嵁鏌ユ壘鍙敤搴撳瓨搴撳瓨
- public List<Dt_ProStockInfo> GetProStocks(Dt_ProOutOrderDetail proOutOrderDetail,List<string> locationInfos)
+ public List<Dt_ProStockInfo> GetStockInfos(string materielCode, List<string> locationCodes)
{
- List<Dt_ProStockInfo>? proStockInfos = null;
- bool isCanLot= string.IsNullOrEmpty(proOutOrderDetail.PLot);
- bool isCanDate = string.IsNullOrEmpty(proOutOrderDetail.DateCode);
- bool isCanVer = string.IsNullOrEmpty(proOutOrderDetail.OutSpecifyVer);
- ////鍒ゆ柇瀹㈡埛鍑哄叆瑙勫垯
- //Dt_CustomerInfo customerInfo = _basicRepository.CustomerInfoRepository.QueryFirst(x=>x.Code== proOutOrderDetail.Customer);
- //if (customerInfo==null)
- //{
- // throw new Exception("鏈壘鍒板鎴蜂俊鎭�");
- //}
- //if (customerInfo.OutRule==CustomerOutRuleEnum.SaleOrderRule.ObjToInt())
- //{
- // proStockInfos = Db.Queryable<Dt_ProStockInfo>().Where(x => locationInfos.Contains(x.LocationCode) && x.ProStockAttribute == ProStockAttributeEnum.鎴愬搧.ObjToInt())
- // .Includes(x => x.proStockInfoDetails)
- // .Where(x => x.proStockInfoDetails
- // .Any(v =>
- // v.SaleOrder==proOutOrderDetail.SaleOrder
- // && v.ProductCode == proOutOrderDetail.PCode
- // && v.ProductVersion == proOutOrderDetail.PVer
- // && (isCanLot ? isCanLot : v.BagNo == proOutOrderDetail.PLot)
- // && (isCanDate ? isCanDate : v.DateCode == proOutOrderDetail.DateCode)
- // ))
- // .ToList();
- //}
- //else
- //{
- proStockInfos = Db.Queryable<Dt_ProStockInfo>().Where(x => locationInfos.Contains(x.LocationCode) && x.ProStockAttribute == ProStockAttributeEnum.鎴愬搧.ObjToInt())
- .Includes(x => x.proStockInfoDetails)
- .Where(x => x.proStockInfoDetails
- .Any(v =>
- v.ProductCode == proOutOrderDetail.PCode
- && v.ProductVersion.StartsWith(proOutOrderDetail.PVer.Substring(0,1))
- && (isCanLot ? isCanLot : v.BagNo == proOutOrderDetail.PLot)
- && (isCanDate ? isCanDate : v.DateCode == proOutOrderDetail.DateCode)
- ))
- .ToList();
- //}
- proStockInfos = proStockInfos?.OrderBy(x => x.proStockInfoDetails.FirstOrDefault()?.DateCode).ThenBy(x=>x.CreateDate).ThenBy(x=>x.proStockInfoDetails.Sum(x=>x.StockPcsQty)).ToList();
- return proStockInfos;
- }
- /// <summary>
- /// 鑾峰彇MES鎻愬簱搴撳瓨(灏炬暟浠�)
- /// </summary>
- /// <param name="mesRworkOutboundOrder"></param>
- /// <param name="locationInfos"></param>
- /// <returns></returns>
- public List<Dt_ProStockInfo> GetProStocks(Dt_MesRworkOutboundOrder mesRworkOutboundOrder, List<string> locationInfos)
- {
- List<Dt_ProStockInfo>? proStockInfos = null;
- bool isCanDate = string.IsNullOrEmpty(mesRworkOutboundOrder.DateCode);
- proStockInfos = Db.Queryable<Dt_ProStockInfo>().Where(x => locationInfos.Contains(x.LocationCode) && x.ProStockAttribute==ProStockAttributeEnum.灏炬暟.ObjToInt())
- .Includes(x => x.proStockInfoDetails)
- .Where(x => x.proStockInfoDetails
- .Any(v => v.SaleOrder == mesRworkOutboundOrder.SaleOrder
- && v.ProductCode == mesRworkOutboundOrder.ProductCode
- && v.ProductVersion == mesRworkOutboundOrder.ProductVersion
- && (isCanDate ? isCanDate : v.DateCode == mesRworkOutboundOrder.DateCode)
- ))
- .ToList();
- proStockInfos = proStockInfos.OrderBy(x => x.proStockInfoDetails.FirstOrDefault()?.DateCode).ThenBy(x => x.proStockInfoDetails.Sum(x => x.StockPcsQty)).ToList();
- return proStockInfos;
+ List<Dt_ProStockInfo> stockInfos = Db.Queryable<Dt_ProStockInfo>().Where(x => locationCodes.Contains(x.LocationCode) && x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt()).Includes(x => x.proStockInfoDetails)
+ .Where(x => x.proStockInfoDetails
+ .Any(v =>
+ v.ProductCode == materielCode &&
+ v.OutboundQuantity<=0)
+ ).OrderBy(x=>x.CreateDate).ToList();
+ return stockInfos;
}
}
}
--
Gitblit v1.9.3