using SqlSugar; using System.Linq.Expressions; using WIDESEA_Core; using WIDESEA_Core.BaseRepository; using WIDESEA_Core.BaseServices; using WIDESEA_Core.Helper; using WIDESEA_IOrderRepository; using WIDESEA_IOrderServices; using WIDESEA_IStorageTaskRepository; using WIDESEA_IStorageTaskServices; using WIDESEA_Model.Models; using WIDESEA_Model.Models.Order; namespace WIDESEA_OrderServices { public class Dt_InventoryOutboundOrderDetailService : ServiceBase, IDt_InventoryOutboundOrderDetailService { private readonly IUnitOfWorkManage _unitOfWorkManage; public Dt_InventoryOutboundOrderDetailService(IDt_InventoryOutboundOrderDetailRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) { _unitOfWorkManage = unitOfWorkManage; } 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() .WhereIF(!wheres.IsNullOrEmpty(), wheres) .OrderBy(orderByModels) .ToPageList(options.Page, options.Rows, ref totalCount); var x=new PageGridData(totalCount, data); return new PageGridData(totalCount, data); } } }