| | |
| | | 锘縰sing AutoMapper; |
| | | 锘縰sing Autofac.Core; |
| | | using AutoMapper; |
| | | using SqlSugar; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | |
| | | public List<Dt_StockInfo> GetStockInfos(string materielCode, string lotNo, string supplyCode, List<string> locationCodes) |
| | | { |
| | | var query = Db.Queryable<Dt_StockInfo>() |
| | | .Where(x => locationCodes.Contains(x.LocationCode) |
| | | .Where(x => locationCodes.Contains(x.LocationCode) && x.StockStatus==StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt() |
| | | // && x.StockStatus == (int)StockStatusEmun.姝e父) |
| | | ).Includes(x => x.Details); |
| | | |
| | |
| | | // } |
| | | |
| | | //} |
| | | public List<StockSelectViewDTO> GetSelectViewDTOs(string orderNo,string materielCode) |
| | | { |
| | | var outboundOrder = SqlSugarHelper.DbWMS.Queryable<Dt_OutboundOrder>().Where(x => x.UpperOrderNo == orderNo).First(); |
| | | return GetStockSelectViews(outboundOrder.Id, materielCode); |
| | | } |
| | | |
| | | public List<StockSelectViewDTO> GetStockSelectViews(int orderId, string materielCode) |
| | | { |
| | |
| | | // 鎵ц鏌ヨ骞舵寜鍏堣繘鍏堝嚭鎺掑簭 |
| | | var stocks = stockQuery.ToList() |
| | | .Where(x => x.Details.Any(d => |
| | | d.MaterielCode == materielCode && |
| | | d.BatchNo == orderDetail.BatchNo && |
| | | d.SupplyCode == orderDetail.SupplyCode && |
| | | d.MaterielCode == materielCode && |
| | | string.IsNullOrEmpty(orderDetail.BatchNo)?true: d.BatchNo == orderDetail.BatchNo&& |
| | | string.IsNullOrEmpty(orderDetail.BatchNo)?true:d.SupplyCode == orderDetail.SupplyCode && |
| | | d.StockQuantity > d.OutboundQuantity |
| | | )) |
| | | .OrderBy(x => x.CreateDate) |
| | |
| | | { |
| | | var relevantDetails = stock.Details |
| | | .Where(d => d.MaterielCode == materielCode && |
| | | d.BatchNo == orderDetail.BatchNo && |
| | | d.SupplyCode == orderDetail.SupplyCode && |
| | | string.IsNullOrEmpty(orderDetail.BatchNo) ? true : d.BatchNo == orderDetail.BatchNo && |
| | | string.IsNullOrEmpty(orderDetail.BatchNo) ? true : d.SupplyCode == orderDetail.SupplyCode && |
| | | d.StockQuantity > d.OutboundQuantity) |
| | | .ToList(); |
| | | |