using SqlSugar;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using WIDESEA_Core;
|
using WIDESEA_Core.BaseRepository;
|
using WIDESEA_Core.BaseServices;
|
using WIDESEA_Core.Helper;
|
using WIDESEA_IAllocateService;
|
using WIDESEA_Model.Models;
|
|
namespace WIDESEA_AllocateService
|
{
|
public class AllocateDetailService : ServiceBase<Dt_AllocateOrderDetail, IRepository<Dt_AllocateOrderDetail>>, IAllocateDetailService
|
{
|
public AllocateDetailService(IRepository<Dt_AllocateOrderDetail> BaseDal) : base(BaseDal)
|
{
|
}
|
|
IRepository<Dt_AllocateOrderDetail> IAllocateDetailService.Repository => BaseDal;
|
|
public override PageGridData<Dt_AllocateOrderDetail> GetPageData(PageDataOptions options)
|
{
|
|
ISugarQueryable<Dt_AllocateOrderDetail> sugarQueryable1 = BaseDal.Db.Queryable<Dt_AllocateOrderDetail>();
|
if (!string.IsNullOrEmpty(options.Wheres))
|
{
|
|
List<SearchParameters> searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>();
|
int totalCount = 0;
|
if (searchParametersList.Count > 0)
|
{
|
{
|
SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_AllocateOrderDetail.OrderId).FirstLetterToLower());
|
if (searchParameters != null)
|
{
|
sugarQueryable1 = sugarQueryable1.Where(x => x.OrderId == searchParameters.Value.ObjToInt());
|
var dataList = sugarQueryable1.ToPageList(options.Page, options.Rows, ref totalCount);
|
return new PageGridData<Dt_AllocateOrderDetail>(totalCount, dataList);
|
}
|
}
|
|
|
}
|
}
|
return new PageGridData<Dt_AllocateOrderDetail>();
|
}
|
}
|
}
|