using AngleSharp.Dom; using Mapster; using Masuit.Tools; using SqlSugar; using System.Collections.Generic; using System.Drawing.Printing; using System.Linq.Expressions; using WIDESEA_Core; using WIDESEA_Core.Enums; using WIDESEA_DTO; namespace WIDESEA_StorageBasicService; public class Dt_PalletStockInfoService : ServiceBase, IDt_PalletStockInfoService { public Dt_PalletStockInfoService(IDt_PalletStockInfoRepository BaseDal) : base(BaseDal) { } public override PageGridData GetPageData(PageDataOptions options) { string wheres = ValidatePageOptions(options); //获取排序字段 Dictionary orderbyDic = GetPageDataSort(options, TProperties); List orderByModels = new List(); foreach (var item in orderbyDic) { OrderByModel orderByModel = new() { FieldName = item.Key, OrderByType = item.Value }; orderByModels.Add(orderByModel); } int totalCount = 0; List searchParametersList = new List(); if (!string.IsNullOrEmpty(options.Wheres)) { try { searchParametersList = options.Wheres.DeserializeObject>(); options.Filter = searchParametersList; } catch { } } var data = BaseDal.Db.Queryable() .Includes(x => x.CarBodyInfo) //.Includes(x => x.LocationInfo) //.WhereIF(!wheres.IsNullOrEmpty(), wheres) //.WhereIF(locationStatus != null, locationStatus) //.WhereIF(roadwayNo != null, roadwayNo) //.WhereIF(materielCode != null, materielCode) .OrderBy(orderByModels) .ToPageList(options.Page, options.Rows, ref totalCount); //new PageGridData(totalCount, data); return new PageGridData(totalCount, data); } }