修改我的任务台账查询

optimize
jianghaiqing 2 years ago
parent 2deb39c434
commit f35e7f3895

@ -106,5 +106,10 @@ namespace Myshipping.Application.Entity
/// 反馈结果
/// </summary>
public string RESULT_NOTE { get; set; }
/// <summary>
/// 开船日期
/// </summary>
public Nullable<DateTime> ETD { get; set; }
}
}

@ -0,0 +1,66 @@
using Furion.FriendlyException;
using Mapster;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application.Helper
{
public static class MapsterExtHelper
{
/// <summary>
/// 动态获取属性对应关系
/// </summary>
/// <typeparam name="TDto"></typeparam>
/// <typeparam name="TEntity"></typeparam>
/// <param name="property">字段代码</param>
/// <returns>返回对应的字段代码</returns>
public static string GetAdaptProperty<TDto, TEntity>(string property)
where TDto : class
where TEntity : class
{
try
{
var adapt = default(TDto).BuildAdapter().CreateMapExpression<TEntity>().Body as BlockExpression;
var tryInfo = adapt.Expressions.FirstOrDefault(a => a.NodeType.ToString() == "Try");
if (tryInfo == null)
throw Oops.Oh($"{nameof(GetAdaptProperty)} 读取TRY异常");
var block = ((TryExpression)tryInfo).Body as BlockExpression;
if (block == null)
throw Oops.Oh($"{nameof(GetAdaptProperty)} 读取BlockExpression异常");
var blockNode = block.Expressions.FirstOrDefault(t => t.NodeType.ToString() == "Block");
var member = (blockNode as BlockExpression).Expressions.Where(t => {
var right = ((t as BinaryExpression).Right as MemberExpression);
if (right == null)
return false;
var currInfo = right.Member;
return currInfo.Name.Equals(property, StringComparison.OrdinalIgnoreCase);
}).FirstOrDefault();
if (member != null)
return ((member as BinaryExpression).Left as MemberExpression).Member.Name;
}
catch (Exception ex)
{
throw Oops.Oh($"{nameof(GetAdaptProperty)} 读取BlockExpression异常");
}
return string.Empty;
}
}
}

@ -3761,6 +3761,11 @@
反馈结果
</summary>
</member>
<member name="P:Myshipping.Application.Entity.TaskBaseInfo.ETD">
<summary>
开船日期
</summary>
</member>
<member name="T:Myshipping.Application.Entity.TaskBillFeeDetailInfo">
<summary>
任务账单费用明细
@ -4776,6 +4781,15 @@
已挂起
</summary>
</member>
<member name="M:Myshipping.Application.Helper.MapsterExtHelper.GetAdaptProperty``2(System.String)">
<summary>
动态获取属性对应关系
</summary>
<typeparam name="TDto"></typeparam>
<typeparam name="TEntity"></typeparam>
<param name="property">字段代码</param>
<returns>返回对应的字段代码</returns>
</member>
<member name="T:Myshipping.Application.Helper.YardDataHelper">
<summary>
获取场站数据辅助类(调用爬虫新运踪接口)
@ -10794,6 +10808,233 @@
<param name="BusinessMsg"></param>
<returns></returns>
</member>
<member name="T:Myshipping.Application.QueryTaskManageDto">
<summary>
我的任务查询
</summary>
</member>
<member name="P:Myshipping.Application.QueryTaskManageDto.MBlNo">
<summary>
提单号
</summary>
<example></example>
</member>
<member name="P:Myshipping.Application.QueryTaskManageDto.ETDBegin">
<summary>
开船日期起始
</summary>
<example></example>
</member>
<member name="P:Myshipping.Application.QueryTaskManageDto.ETDEnd">
<summary>
开船日期结束
</summary>
<example></example>
</member>
<member name="P:Myshipping.Application.QueryTaskManageDto.TaskDateBegin">
<summary>
任务起始日期
</summary>
<example>2022-12-01</example>
</member>
<member name="P:Myshipping.Application.QueryTaskManageDto.TaskDateEnd">
<summary>
任务起始结束
</summary>
<example></example>
</member>
<member name="P:Myshipping.Application.QueryTaskManageDto.TaskType">
<summary>
任务类型
</summary>
<example></example>
</member>
<member name="P:Myshipping.Application.QueryTaskManageDto.TaskSource">
<summary>
任务来源
</summary>
<example></example>
</member>
<member name="P:Myshipping.Application.QueryTaskManageDto.TaskRecvName">
<summary>
接收人
</summary>
<example></example>
</member>
<member name="P:Myshipping.Application.QueryTaskManageDto.PageNo">
<summary>
当前页码
</summary>
<example>1</example>
</member>
<member name="P:Myshipping.Application.QueryTaskManageDto.PageSize">
<summary>
页码容量
</summary>
<example>20</example>
</member>
<member name="P:Myshipping.Application.QueryTaskManageDto.SortField">
<summary>
排序字段
</summary>
<example>TaskType</example>
</member>
<member name="P:Myshipping.Application.QueryTaskManageDto.descSort">
<summary>
排序方法,默认降序
</summary>
<example>true</example>
</member>
<member name="T:Myshipping.Application.TaskBaseInfoDto">
<summary>
任务
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.PKId">
<summary>
主键
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.TaskNo">
<summary>
任务流水号
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.TaskType">
<summary>
任务类型
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.TaskSource">
<summary>
任务来源
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.Status">
<summary>
状态 Create-待处理Retransmit-已转发Complete-已完成Cancel-已取消Pending-已挂起
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.TaskTitle">
<summary>
任务标题
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.TaskDesp">
<summary>
任务描述
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.OutBusiNo">
<summary>
外业务编号
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.OutBusiType">
<summary>
外业务类型 BOOK_ORDER-订舱 MAIL_RECV-邮件接收
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.TaskBaseType">
<summary>
基础业务类型
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.CarrierId">
<summary>
船公司代号
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.MblNo">
<summary>
主单号
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.Remark">
<summary>
备注
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.IsExcept">
<summary>
是否异常 1-异常 0-未异常
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.IsPublic">
<summary>
是否公共 0-非公共 1-公共(当无法确认任务所属人的情况被默认为公共)
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.IsComplete">
<summary>
是否完成 1-已完成 0-未完成
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.BeginDate">
<summary>
任务启动时间
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.CompleteDate">
<summary>
任务完成时间
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.BookOrderNo">
<summary>
订舱业务主键
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.ResultNote">
<summary>
反馈结果
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.ETD">
<summary>
开船日期
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.CreatedTime">
<summary>
创建时间
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.UpdatedTime">
<summary>
修改时间
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.CreatedUserId">
<summary>
创建人ID
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.CreatedUserName">
<summary>
创建人名称
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.UpdatedUserId">
<summary>
修改人ID
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.UpdatedUserName">
<summary>
修改人名称
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.TenantId">
<summary>
租户id
</summary>
</member>
<member name="P:Myshipping.Application.TaskBaseInfoDto.TenantName">
<summary>
租户名称
</summary>
</member>
<member name="T:Myshipping.Application.TaskManageOrderFeeInfo">
<summary>
费用明细
@ -11444,6 +11685,13 @@
<param name="isReCalc">是否强制计算</param>
<returns>返回回执</returns>
</member>
<member name="M:Myshipping.Application.ITaskManageService.GetPageAsync(Myshipping.Application.QueryTaskManageDto)">
<summary>
任务台账查询
</summary>
<param name="QuerySearch">任务台账查询请求</param>
<returns>返回结果</returns>
</member>
<member name="T:Myshipping.Application.TaskManageService">
<summary>
任务管理
@ -11478,5 +11726,12 @@
<param name="isReCalc">是否强制计算</param>
<returns>返回回执</returns>
</member>
<member name="M:Myshipping.Application.TaskManageService.GetPageAsync(Myshipping.Application.QueryTaskManageDto)">
<summary>
任务台账查询
</summary>
<param name="QuerySearch">任务台账查询请求</param>
<returns>返回结果</returns>
</member>
</members>
</doc>

@ -0,0 +1,86 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 我的任务查询
/// </summary>
public class QueryTaskManageDto
{
/// <summary>
/// 提单号
/// </summary>
/// <example></example>
public string MBlNo { get; set; }
/// <summary>
/// 开船日期起始
/// </summary>
/// <example></example>
public string ETDBegin { get; set; }
/// <summary>
/// 开船日期结束
/// </summary>
/// <example></example>
public string ETDEnd { get; set; }
/// <summary>
/// 任务起始日期
/// </summary>
/// <example>2022-12-01</example>
public string TaskDateBegin { get; set; }
/// <summary>
/// 任务起始结束
/// </summary>
/// <example></example>
public string TaskDateEnd { get; set; }
/// <summary>
/// 任务类型
/// </summary>
/// <example></example>
public string TaskType { get; set; }
/// <summary>
/// 任务来源
/// </summary>
/// <example></example>
public string TaskSource { get; set; }
/// <summary>
/// 接收人
/// </summary>
/// <example></example>
public string TaskRecvName { get; set; }
/// <summary>
/// 当前页码
/// </summary>
/// <example>1</example>
public int PageNo { get; set; } = 1;
/// <summary>
/// 页码容量
/// </summary>
/// <example>20</example>
public int PageSize { get; set; } = 20;
/// <summary>
/// 排序字段
/// </summary>
/// <example>TaskType</example>
public string SortField { get; set; }
/// <summary>
/// 排序方法,默认降序
/// </summary>
/// <example>true</example>
public bool descSort { get; set; } = true;
}
}

@ -0,0 +1,159 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 任务
/// </summary>
public class TaskBaseInfoDto
{
/// <summary>
/// 主键
/// </summary>
public string PKId { get; set; }
/// <summary>
/// 任务流水号
/// </summary>
public string TaskNo { get; set; }
/// <summary>
/// 任务类型
/// </summary>
public string TaskType { get; set; }
/// <summary>
/// 任务来源
/// </summary>
public string TaskSource { get; set; }
/// <summary>
/// 状态 Create-待处理Retransmit-已转发Complete-已完成Cancel-已取消Pending-已挂起
/// </summary>
public string Status { get; set; }
/// <summary>
/// 任务标题
/// </summary>
public string TaskTitle { get; set; }
/// <summary>
/// 任务描述
/// </summary>
public string TaskDesp { get; set; }
/// <summary>
/// 外业务编号
/// </summary>
public string OutBusiNo { get; set; }
/// <summary>
/// 外业务类型 BOOK_ORDER-订舱 MAIL_RECV-邮件接收
/// </summary>
public string OutBusiType { get; set; }
/// <summary>
/// 基础业务类型
/// </summary>
public string TaskBaseType { get; set; }
/// <summary>
/// 船公司代号
/// </summary>
public string CarrierId { get; set; }
/// <summary>
/// 主单号
/// </summary>
public string MblNo { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 是否异常 1-异常 0-未异常
/// </summary>
public int IsExcept { get; set; }
/// <summary>
/// 是否公共 0-非公共 1-公共(当无法确认任务所属人的情况被默认为公共)
/// </summary>
public int IsPublic { get; set; }
/// <summary>
/// 是否完成 1-已完成 0-未完成
/// </summary>
public int IsComplete { get; set; }
/// <summary>
/// 任务启动时间
/// </summary>
public string BeginDate { get; set; }
/// <summary>
/// 任务完成时间
/// </summary>
public string CompleteDate { get; set; }
/// <summary>
/// 订舱业务主键
/// </summary>
public string BookOrderNo { get; set; }
/// <summary>
/// 反馈结果
/// </summary>
public string ResultNote { get; set; }
/// <summary>
/// 开船日期
/// </summary>
public string ETD { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreatedTime { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public Nullable<DateTime> UpdatedTime { get; set; }
/// <summary>
/// 创建人ID
/// </summary>
public long CreatedUserId { get; set; }
/// <summary>
/// 创建人名称
/// </summary>
public string CreatedUserName { get; set; }
/// <summary>
/// 修改人ID
/// </summary>
public long UpdatedUserId { get; set; }
/// <summary>
/// 修改人名称
/// </summary>
public string UpdatedUserName { get; set; }
/// <summary>
/// 租户id
/// </summary>
public string TenantId { get; set; }
/// <summary>
/// 租户名称
/// </summary>
public string TenantName { get; set; }
}
}

@ -72,6 +72,63 @@ namespace Myshipping.Application
.Map(dest => dest.TAREWEIGHT, src => src.TAREWEIGHT)
.Map(dest => dest.WEIGHKGS, src => src.WEIGHKGS)
.Map(dest => dest.WEIGHTYPE, src => src.WEIGHTYPE);
config.ForType<TaskBaseInfo, TaskBaseInfoDto>()
.Map(dest => dest.PKId, src => src.PK_ID)
.Map(dest => dest.TaskNo, src => src.TASK_NO)
.Map(dest => dest.TaskType, src => src.TASK_TYPE)
.Map(dest => dest.TaskSource, src => src.TASK_SOURCE)
.Map(dest => dest.Status, src => src.STATUS)
.Map(dest => dest.TaskTitle, src => src.TASK_TITLE)
.Map(dest => dest.TaskDesp, src => src.TASK_DESP)
.Map(dest => dest.OutBusiNo, src => src.OUT_BUSI_NO)
.Map(dest => dest.OutBusiType, src => src.OUT_BUSI_TYPE)
.Map(dest => dest.CarrierId, src => src.CARRIER_ID)
.Map(dest => dest.MblNo, src => src.MBL_NO)
.Map(dest => dest.Remark, src => src.REMARK)
.Map(dest => dest.IsExcept, src => src.IS_EXCEPT)
.Map(dest => dest.IsPublic, src => src.IS_PUBLIC)
.Map(dest => dest.IsComplete, src => src.IS_COMPLETE)
.Map(dest => dest.BeginDate, src => src.BEGIN_DATE)
.Map(dest => dest.CompleteDate, src => src.COMPLETE_DATE)
.Map(dest => dest.BookOrderNo, src => src.BOOK_ORDER_NO)
.Map(dest => dest.ResultNote, src => src.RESULT_NOTE)
.Map(dest => dest.ETD, src => src.ETD)
.Map(dest => dest.CreatedTime, src => src.CreatedTime)
.Map(dest => dest.UpdatedTime, src => src.UpdatedTime)
.Map(dest => dest.CreatedUserId, src => src.CreatedUserId)
.Map(dest => dest.CreatedUserName, src => src.CreatedUserName)
.Map(dest => dest.UpdatedUserId, src => src.UpdatedUserId)
.Map(dest => dest.UpdatedUserName, src => src.UpdatedUserName);
config.ForType<TaskBaseInfoDto, TaskBaseInfo>()
.Map(dest => dest.PK_ID, src => src.PKId)
.Map(dest => dest.TASK_NO, src => src.TaskNo)
.Map(dest => dest.TASK_TYPE, src => src.TaskType)
.Map(dest => dest.TASK_SOURCE, src => src.TaskSource)
.Map(dest => dest.STATUS, src => src.Status)
.Map(dest => dest.TASK_TITLE, src => src.TaskTitle)
.Map(dest => dest.TASK_DESP, src => src.TaskDesp)
.Map(dest => dest.OUT_BUSI_NO, src => src.OutBusiNo)
.Map(dest => dest.OUT_BUSI_TYPE, src => src.OutBusiType)
.Map(dest => dest.CARRIER_ID, src => src.CarrierId)
.Map(dest => dest.MBL_NO, src => src.MblNo)
.Map(dest => dest.REMARK, src => src.Remark)
.Map(dest => dest.IS_EXCEPT, src => src.IsExcept)
.Map(dest => dest.IS_PUBLIC, src => src.IsPublic)
.Map(dest => dest.IS_COMPLETE, src => src.IsComplete)
.Map(dest => dest.BEGIN_DATE, src => src.BeginDate)
.Map(dest => dest.COMPLETE_DATE, src => src.CompleteDate)
.Map(dest => dest.BOOK_ORDER_NO, src => src.BookOrderNo)
.Map(dest => dest.RESULT_NOTE, src => src.ResultNote)
.Map(dest => dest.ETD, src => src.ETD)
.Map(dest => dest.CreatedTime, src => src.CreatedTime)
.Map(dest => dest.UpdatedTime, src => src.UpdatedTime)
.Map(dest => dest.CreatedUserId, src => src.CreatedUserId)
.Map(dest => dest.CreatedUserName, src => src.CreatedUserName)
.Map(dest => dest.UpdatedUserId, src => src.UpdatedUserId)
.Map(dest => dest.UpdatedUserName, src => src.UpdatedUserName);
}
}
}

@ -1,4 +1,6 @@
using System;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -31,5 +33,12 @@ namespace Myshipping.Application
/// <param name="isReCalc">是否强制计算</param>
/// <returns>返回回执</returns>
Task<TaskUserStatResultInfo> GetCurrentTotalStat(bool isReCalc = false);
/// <summary>
/// 任务台账查询
/// </summary>
/// <param name="QuerySearch">任务台账查询请求</param>
/// <returns>返回结果</returns>
Task<dynamic> GetPageAsync(QueryTaskManageDto QuerySearch);
}
}

@ -6,18 +6,23 @@ using Furion.RemoteRequest;
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.Extensions.Logging;
using Myshipping.Application.Entity;
using Myshipping.Application.Helper;
using Myshipping.Core;
using Myshipping.Core.Entity;
using MySqlX.XDevAPI.Common;
using NPOI.SS.Formula.Functions;
using SqlSugar;
using StackExchange.Profiling.Internal;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Xml.Linq;
@ -522,5 +527,89 @@ namespace Myshipping.Application
return resultInfo;
}
/// <summary>
/// 任务台账查询
/// </summary>
/// <param name="QuerySearch">任务台账查询请求</param>
/// <returns>返回结果</returns>
[HttpPost("/TaskManage/GetPage")]
public async Task<dynamic> GetPageAsync(QueryTaskManageDto QuerySearch)
{
List<string> mblList = new List<string>();
if(!string.IsNullOrWhiteSpace(QuerySearch.MBlNo))
{
if (Regex.IsMatch(QuerySearch.MBlNo, "(\\t|\\n\\r|\\n)"))
{
mblList = Regex.Replace(QuerySearch.MBlNo, "(\\t |\\n\\r |\\n)", "#").Split(new char[] { '#' }).Select(t=>t?.Trim()).ToList();
}
else
{
mblList.Add(QuerySearch.MBlNo.Trim());
}
}
DateTime etdBegin = DateTime.MinValue;
DateTime etdEnd = DateTime.MinValue;
DateTime taskDateBegin = DateTime.MinValue;
DateTime taskDateEnd = DateTime.MinValue;
if (!string.IsNullOrWhiteSpace(QuerySearch.ETDBegin))
{
if(!DateTime.TryParse(QuerySearch.ETDBegin, out etdBegin))
throw Oops.Oh($"开船起始日期格式错误,{QuerySearch.ETDBegin}");
}
if (!string.IsNullOrWhiteSpace(QuerySearch.ETDEnd))
{
if (!DateTime.TryParse(QuerySearch.ETDEnd, out etdEnd))
throw Oops.Oh($"开船结束日期格式错误,{QuerySearch.ETDEnd}");
etdEnd = etdEnd.AddDays(1);
}
if (!string.IsNullOrWhiteSpace(QuerySearch.TaskDateBegin))
{
if (!DateTime.TryParse(QuerySearch.TaskDateBegin, out taskDateBegin))
throw Oops.Oh($"任务起始日期格式错误,{QuerySearch.TaskDateBegin}");
}
if (!string.IsNullOrWhiteSpace(QuerySearch.TaskDateEnd))
{
if (!DateTime.TryParse(QuerySearch.TaskDateEnd, out taskDateEnd))
throw Oops.Oh($"任务结束日期格式错误,{QuerySearch.TaskDateEnd}");
etdEnd = etdEnd.AddDays(1);
}
string entityOrderCol = "CreatedTime";
//这里因为返回给前端的台账数据是DTO所以这里排序时候需要转换成Entity对应的字段
if (!string.IsNullOrWhiteSpace(QuerySearch.SortField))
entityOrderCol = MapsterExtHelper.GetAdaptProperty<TaskBaseInfoDto, TaskBaseInfo>(QuerySearch.SortField);
var entities = await _taskBaseInfoRepository.AsQueryable().Filter(null, true)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.MBlNo), t => mblList.Any(p => p.Contains(t.MBL_NO, StringComparison.OrdinalIgnoreCase)))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskRecvName), t => t.CreatedUserName.Contains(QuerySearch.TaskRecvName.Trim(), StringComparison.OrdinalIgnoreCase))
.WhereIF(etdBegin != DateTime.MinValue, t => t.ETD.HasValue && t.ETD.Value >= etdBegin)
.WhereIF(etdEnd != DateTime.MinValue, t => t.ETD.HasValue && t.ETD.Value < etdEnd)
.WhereIF(taskDateBegin != DateTime.MinValue, t => t.CreatedTime >= taskDateBegin)
.WhereIF(taskDateEnd != DateTime.MinValue, t => t.CreatedTime < taskDateEnd)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskType), t => t.TASK_TYPE.Equals(QuerySearch.TaskType, StringComparison.OrdinalIgnoreCase))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskSource), t => t.TASK_SOURCE.Equals(QuerySearch.TaskSource, StringComparison.OrdinalIgnoreCase))
.OrderBy(entityOrderCol + (QuerySearch.descSort ? " asc " : " desc "))
.ToPagedListAsync(QuerySearch.PageNo, QuerySearch.PageSize);
return new
{
PageNo = entities.PageIndex,
PageSize = entities.PageSize,
TotalPage = entities.TotalPages,
TotalRows = entities.TotalCount,
Rows = entities.Items.Select(t => t.Adapt<TaskBaseInfoDto>()).ToList()
};
}
}
}

Loading…
Cancel
Save