| | |
| | | .Where(x => x.LocationCode == param.Value.ToString()); |
| | | } |
| | | break; |
| | | case var name when name == nameof(Dt_StockInfo.PalletCode).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.PalletCode == param.Value.ToString()); |
| | | } |
| | | break; |
| | | |
| | | case var name when name == nameof(Dt_StockInfo.CreateDate).FirstLetterToLower(): |
| | | if (DateTime.TryParse(param.Value?.ToString(), out DateTime minDate)) |
| | |
| | | |
| | | |
| | | } |
| | | } |
| | | break; |
| | | case "inventoryage": |
| | | int inventoryage = param.Value.ObjToInt(); |
| | | if (inventoryage > 0) |
| | | { |
| | | DateTime dateTime = DateTime.Now.AddDays(-inventoryage); |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.CreateDate >= dateTime); |
| | | } |
| | | break; |
| | | case "inventoryage1": |
| | | int inventoryage1 = param.Value.ObjToInt(); |
| | | if (inventoryage1 > 0) |
| | | { |
| | | DateTime dateTime = DateTime.Now.AddDays(-inventoryage1); |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.CreateDate <= dateTime); |
| | | } |
| | | break; |
| | | } |
| | |
| | | ISugarQueryable<Dt_LocationInfo> sugarQueryable = _dbBase.Queryable<Dt_LocationInfo>().Where(whereLo); |
| | | |
| | | EntityProperties.ValidatePageOptions(options, ref sugarQueryable); |
| | | |
| | | List<Dt_Warehouse> warehouses = _dbBase.Queryable<Dt_Warehouse>().ToList(); |
| | | ISugarQueryable<StockViewDTO> list = sugarQueryable1.InnerJoin(sugarQueryable, (b, a) => a.LocationCode == b.LocationCode).Select((b, a) |
| | | => new StockViewDTO |
| | | { |
| | |
| | | stockViewDTOs.AddRange(pklist.ToList()); |
| | | stockViewDTOs.ForEach(x => |
| | | { |
| | | |
| | | Dt_Warehouse? warehouse = warehouses.FirstOrDefault(t => t.WarehouseId == x.WarehouseId); |
| | | if (warehouse!=null) |
| | | { |
| | | x.WarehouseName= warehouse.WarehouseName; |
| | | } |
| | | x.MaterielCode = (string.Join(",", x.Details.Select(x => x.MaterielCode).Distinct())) ?? "空箱"; |
| | | x.BatchNo = (string.Join(",", x.Details.Select(x => x.BatchNo).Distinct())) ?? "æ "; |
| | | x.StockCounts = Math.Round(x.Details.Sum(x => x.StockQuantity),3).ToString() + x.Details.FirstOrDefault()?.Unit; |