From 6bea8224f09417457199af70b09f2e5ced7eb63e Mon Sep 17 00:00:00 2001
From: moyongzhen <2534173414@qq.com>
Date: Wed, 13 Mar 2024 09:34:42 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=8F=82=E6=95=B0=E8=B0=83?=
=?UTF-8?q?=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ProvideServices/GetPageTrackOrderInput.cs | 19 +++++++++++++++++--
.../Dtos/Order/GetPageTrackOrderInputVO.cs | 13 +++++++++----
.../Repositories/OrderRepository.cs | 13 ++++++++++++-
3 files changed, 38 insertions(+), 7 deletions(-)
diff --git a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs
index 64191392..9bd8fcc9 100644
--- a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs
+++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs
@@ -22,10 +22,20 @@ public class GetPageTrackOrderInput : PageInfoInput
///
public int TabType { get; set; }
+ /////
+ ///// 当tab选中 0 默认不传 1 直接写死传值 [1,4] 2 传 [2,4]
+ /////
+ //public List? QuestionTypeIds { get; set; }
+
///
- /// 当tab选中 0 默认不传 1 直接写死传值 [1,4] 2 传 [2,4]
+ /// 订单类型
///
- public List? QuestionTypeIds { get; set; }
+ public int? TrackOrderType { get; set; }
+
+ ///
+ /// 客户id
+ ///
+ public int? CustomerId { get; set; }
///
/// 创建时间开始
@@ -83,6 +93,11 @@ public class TrackOrderDto
///
public string? CustomerCode { get; set; }
+ ///
+ /// 客户id
+ ///
+ public int CustomerId { get; set; }
+
///
/// 订单明细(json)
///
diff --git a/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs b/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs
index 99a8d068..b0abd5b0 100644
--- a/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs
+++ b/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs
@@ -23,10 +23,10 @@ namespace SJZY.Track.Domain.Dtos.Order
///
public int TabType { get; set; }
- ///
- /// 当tab选中 1 直接写死传值 [1,4] 2 传 [2,4]
- ///
- public List? QuestionTypeIds { get; set; }
+ /////
+ ///// 当tab选中 1 直接写死传值 [1,4] 2 传 [2,4]
+ /////
+ //public List? QuestionTypeIds { get; set; }
///
/// 单号
@@ -84,6 +84,11 @@ namespace SJZY.Track.Domain.Dtos.Order
///
public string? CustomerCode { get; set; }
+ ///
+ /// 客户id
+ ///
+ public int CustomerId { get; set; }
+
/////
///// 订单明细(json)
/////
diff --git a/src/SJZY.Track.Repository/Repositories/OrderRepository.cs b/src/SJZY.Track.Repository/Repositories/OrderRepository.cs
index eeeeeb14..43de6ccb 100644
--- a/src/SJZY.Track.Repository/Repositories/OrderRepository.cs
+++ b/src/SJZY.Track.Repository/Repositories/OrderRepository.cs
@@ -5,6 +5,7 @@ using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
using SJZY.Track.Domain.Dtos.Order;
using SJZY.Track.Domain.VEntities;
using SJZY.Track.Repository.VData.Entitys;
+using SqlSugar;
namespace SJZY.Track.Repository.Repositories;
@@ -121,10 +122,19 @@ public class OrderRepository : BasicRepository, IOrderRepository, I
public async Task> GetPageTrackOrder(GetPageTrackOrderInputVO input)
{
List orderNoList = new List();
+ List questionTypeIds = new List();
if (!input.OrderNos.IsNullOrWhiteSpace())
{
orderNoList = input.OrderNos.Split(new char[] { ',', ',', ':', ':' }).ToList();
}
+ if (input.TabType==1)
+ {
+ questionTypeIds= new List { 1, 4 };
+ }
+ else if (input.TabType==2)
+ {
+ questionTypeIds= new List { 2, 4 };
+ }
var pageList = await Context.Queryable()
.LeftJoin((a, b) => a.CustomId == b.Id && b.IsDeleted == false)
@@ -137,7 +147,7 @@ public class OrderRepository : BasicRepository, IOrderRepository, I
(a, b, c) => a.CreateTime >= input.CreateTimeStart)
.WhereIF((!input.CreateTimeStart.HasValue) && input.CreateTimeEnd.HasValue,
(a, b, c) => a.CreateTime <= input.CreateTimeEnd)
- .WhereIF(input.TabType>0 && (!input.QuestionTypeIds.IsNullOrEmpty()), (a, b, c) => input.QuestionTypeIds.Contains(a.QuestionType))
+ .WhereIF(input.TabType>0 && (!questionTypeIds.IsNullOrEmpty()), (a, b, c) => questionTypeIds.Contains(a.QuestionType))
.OrderByDescending((a, b, c) => a.CreateTime)
.Select((a, b, c) => new TrackOrderVO
{
@@ -149,6 +159,7 @@ public class OrderRepository : BasicRepository, IOrderRepository, I
.Return("箱/袋单").ElseIF(a.OrderType == 4).Return("FBA订单").End(""),
CustomerShortName = b.Abbreviation,
CustomerCode = b.Code,
+ CustomerId = a.CustomId,
QuestionType = a.QuestionType,
QuestionTypeName = SqlFunc.IF(a.QuestionType == 1).Return("异常").ElseIF(a.QuestionType == 2).Return("预警").End(""),
ProblemDescription = a.ProblemDescription,