轨迹订单参数提交

This commit is contained in:
moyongzhen 2024-03-13 10:16:27 +08:00
parent 6bea8224f0
commit 953bca93f5
3 changed files with 21 additions and 6 deletions

View File

@ -22,11 +22,6 @@ public class GetPageTrackOrderInput : PageInfoInput
/// </summary> /// </summary>
public int TabType { get; set; } public int TabType { get; set; }
///// <summary>
///// 当tab选中 0 默认不传 1 直接写死传值 [1,4] 2 传 [2,4]
///// </summary>
//public List<int>? QuestionTypeIds { get; set; }
/// <summary> /// <summary>
/// 订单类型 /// 订单类型
/// </summary> /// </summary>
@ -37,6 +32,11 @@ public class GetPageTrackOrderInput : PageInfoInput
/// </summary> /// </summary>
public int? CustomerId { get; set; } public int? CustomerId { get; set; }
///// <summary>
///// 当tab选中 0 默认不传 1 直接写死传值 [1,4] 2 传 [2,4]
///// </summary>
//public List<int>? QuestionTypeIds { get; set; }
/// <summary> /// <summary>
/// 创建时间开始 /// 创建时间开始
/// </summary> /// </summary>

View File

@ -28,6 +28,16 @@ namespace SJZY.Track.Domain.Dtos.Order
///// </summary> ///// </summary>
//public List<int>? QuestionTypeIds { get; set; } //public List<int>? QuestionTypeIds { get; set; }
/// <summary>
/// 订单类型
/// </summary>
public int? TrackOrderType { get; set; }
/// <summary>
/// 客户id
/// </summary>
public int? CustomerId { get; set; }
/// <summary> /// <summary>
/// 单号 /// 单号
/// </summary> /// </summary>

View File

@ -123,6 +123,7 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
{ {
List<string> orderNoList = new List<string>(); List<string> orderNoList = new List<string>();
List<int> questionTypeIds = new List<int>(); List<int> questionTypeIds = new List<int>();
int ques = 0;
if (!input.OrderNos.IsNullOrWhiteSpace()) if (!input.OrderNos.IsNullOrWhiteSpace())
{ {
orderNoList = input.OrderNos.Split(new char[] { ',', ',', ':', ':' }).ToList(); orderNoList = input.OrderNos.Split(new char[] { ',', ',', ':', ':' }).ToList();
@ -130,10 +131,12 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
if (input.TabType==1) if (input.TabType==1)
{ {
questionTypeIds= new List<int> { 1, 4 }; questionTypeIds= new List<int> { 1, 4 };
ques = questionTypeIds.Sum();
} }
else if (input.TabType==2) else if (input.TabType==2)
{ {
questionTypeIds= new List<int> { 2, 4 }; questionTypeIds= new List<int> { 2, 4 };
ques = questionTypeIds.Sum();
} }
var pageList = await Context.Queryable<OrderEntity>() var pageList = await Context.Queryable<OrderEntity>()
@ -147,7 +150,9 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
(a, b, c) => a.CreateTime >= input.CreateTimeStart) (a, b, c) => a.CreateTime >= input.CreateTimeStart)
.WhereIF((!input.CreateTimeStart.HasValue) && input.CreateTimeEnd.HasValue, .WhereIF((!input.CreateTimeStart.HasValue) && input.CreateTimeEnd.HasValue,
(a, b, c) => a.CreateTime <= input.CreateTimeEnd) (a, b, c) => a.CreateTime <= input.CreateTimeEnd)
.WhereIF(input.TabType>0 && (!questionTypeIds.IsNullOrEmpty()), (a, b, c) => questionTypeIds.Contains(a.QuestionType)) .WhereIF(input.CustomerId>0, (a, b, c) => a.CustomId==input.CustomerId)
.WhereIF(input.TrackOrderType>0, (a, b, c) => a.OrderType==input.TrackOrderType)
.WhereIF(input.TabType>0 && (!questionTypeIds.IsNullOrEmpty()), (a, b, c) => (a.QuestionType&ques)>0)
.OrderByDescending((a, b, c) => a.CreateTime) .OrderByDescending((a, b, c) => a.CreateTime)
.Select((a, b, c) => new TrackOrderVO .Select((a, b, c) => new TrackOrderVO
{ {