| | |
| | | .SelectMany(x => x.Details) |
| | | .Where(x => x.MaterielCode == materielCode && |
| | | x.StockQuantity > x.OutboundQuantity) // æå¯ç¨åºå |
| | | .OrderBy(x => x.ProductionDate) // æçäº§æ¥ææåºï¼å
è¿å
åº |
| | | .OrderBy(x => x.CreateDate) // ææ¥ææåºï¼å
è¿å
åº |
| | | .ThenBy(x => x.StockId) // ç¸åçäº§æ¥ææåºåIDæåº |
| | | .ToList(); |
| | | |
| | |
| | | query = query.Where(x => x.BatchNo == batchNo); |
| | | } |
| | | |
| | | return await query.OrderBy(x => x.ProductionDate).ToListAsync(); |
| | | return await query.OrderBy(x => x.CreateDate).ToListAsync(); |
| | | } |
| | | public List<Dt_StockInfo> GetStockInfos(string materielCode, string lotNo, string supplyCode, List<string> locationCodes) |
| | | { |
| | |
| | | return Db.Queryable<Dt_StockInfo>().Where(x => x.StockStatus == StockStatusEmun.å
¥åºå®æ.ObjToInt() && SqlFunc.Subqueryable<Dt_LocationInfo>().Where(v => v.LocationCode == x.LocationCode && v.LocationType == locationType && v.LocationStatus == LocationStatusEnum.Pallet.ObjToInt() && (v.EnableStatus == EnableStatusEnum.OnlyOut.ObjToInt() || EnableStatusEnum.Normal.ObjToInt() == v.EnableStatus)).Any()).OrderBy(x => x.ModifyDate).First(); |
| | | } |
| | | |
| | | public List<Dt_StockInfo> GetStockInfosByPalletCodes(List<string> palletCodes) |
| | | { |
| | | return Db.Queryable<Dt_StockInfo>().Where(x => palletCodes.Contains(x.PalletCode)).Includes(x => x.Details).ToList(); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | |
| | | LocationCode = a.LocationCode, |
| | | MaterielCode = b.MaterielCode, |
| | | MaterielName = b.MaterielName, |
| | | Barcode=b.Barcode, |
| | | PalletCode = a.PalletCode, |
| | | UseableQuantity = b.StockQuantity - b.OutboundQuantity |
| | | }, a => locationCodes.Contains(a.LocationCode), b => b.StockQuantity > b.OutboundQuantity && b.MaterielCode == materielCode, x => true).GroupBy(x => x.PalletCode).Select(x => new StockSelectViewDTO |
| | |
| | | LocationCode = x.FirstOrDefault()?.LocationCode ?? "", |
| | | MaterielCode = x.FirstOrDefault()?.MaterielCode ?? "", |
| | | MaterielName = x.FirstOrDefault()?.MaterielName ?? "", |
| | | Barcode=x.FirstOrDefault()?.Barcode??"", |
| | | PalletCode = x.Key, |
| | | UseableQuantity = x.Sum(x => x.UseableQuantity) |
| | | }).ToList(); |