From d23edffffc77a2c12b7f32c6d098de61d552c869 Mon Sep 17 00:00:00 2001 From: moyongzhen <2534173414@qq.com> Date: Tue, 12 Mar 2024 21:13:20 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=BD=A8=E8=BF=B9=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=97=AE=E9=A2=98=E7=B1=BB=E5=9E=8B=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=92=8C=E9=97=AE=E9=A2=98=E6=8F=8F=E8=BF=B0=E8=BF=94?= =?UTF-8?q?=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProvideServices/GetPageTrackOrderInput.cs | 33 +++++++++++++++++++ .../ProvideServices/TrackPushPullService.cs | 4 +-- .../Aggregates/OrderAggregate/OrderEntity.cs | 12 +++++++ .../Dtos/Order/GetPageTrackOrderInputVO.cs | 29 ++++++++++++++++ .../Repositories/OrderRepository.cs | 7 +++- 5 files changed, 82 insertions(+), 3 deletions(-) diff --git a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs index 81aa553e..64191392 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs @@ -17,6 +17,16 @@ public class GetPageTrackOrderInput : PageInfoInput /// public string? OrderNos { get; set; } + /// + /// tab标签类型 0 全部, 1 异常 2 预警 + /// + public int TabType { get; set; } + + /// + /// 当tab选中 0 默认不传 1 直接写死传值 [1,4] 2 传 [2,4] + /// + public List? QuestionTypeIds { get; set; } + /// /// 创建时间开始 /// @@ -113,5 +123,28 @@ public class TrackOrderDto /// public string SubSystem { get; set; } + /// + /// 子系统id + /// public int SubSystemId { get; set; } + + /// + /// 问题类型(主数据枚举TrackQuestionType) + /// + public int QuestionType { get; set; } + + /// + /// 问题类型名称 + /// + public string? QuestionTypeName { get; set; } + + /// + /// 问题描述(主数据枚举TrackProblemDescription) + /// + public int ProblemDescription { get; set; } + + /// + /// 问题描述名称 + /// + public string? ProblemDescriptionName { get; set; } } \ No newline at end of file diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackPushPullService.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackPushPullService.cs index 2e1dd08b..53b71e31 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/TrackPushPullService.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackPushPullService.cs @@ -49,9 +49,9 @@ public class TrackPushPullService : ApplicationService x.OrderNo }).ToList(); - // 批量获取轨迹 + // 批量获取轨迹 这里报错了,我先随便给个 写死的主体值 await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync( - "A012", group.Key.ServiceProviderCode, data, + "A012", group.Key.ServiceProviderCode, 42, data, GlobalConst.TrackRefreshSubscribe, JsonConvert.SerializeObject(group.Key)); } diff --git a/src/SJZY.Track.Domain/Aggregates/OrderAggregate/OrderEntity.cs b/src/SJZY.Track.Domain/Aggregates/OrderAggregate/OrderEntity.cs index 69d5f706..66f704a3 100644 --- a/src/SJZY.Track.Domain/Aggregates/OrderAggregate/OrderEntity.cs +++ b/src/SJZY.Track.Domain/Aggregates/OrderAggregate/OrderEntity.cs @@ -108,6 +108,18 @@ public class OrderEntity : IFullAuditedBasicEntitys, IAggregateRoot [SugarColumn(ColumnName = "LeaveCountry")] public string LeaveCountry { get; set; } = null!; + /// + /// 问题类型(主数据枚举TrackQuestionType) + /// + [SugarColumn(ColumnName = "QuestionType")] + public int QuestionType { get; set; } + + /// + /// 问题描述(主数据枚举TrackProblemDescription) + /// + [SugarColumn(ColumnName = "ProblemDescription")] + public int ProblemDescription { get; set; } + /// /// 起运港口 /// diff --git a/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs b/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs index c1b97cc5..99a8d068 100644 --- a/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs +++ b/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs @@ -18,6 +18,15 @@ namespace SJZY.Track.Domain.Dtos.Order ///// //public List? OrderNos { get; set; } + /// + /// 当tab选中 0 默认不传 1 直接写死传值 [1,4] 2 传 [2,4] + /// + public int TabType { get; set; } + + /// + /// 当tab选中 1 直接写死传值 [1,4] 2 传 [2,4] + /// + public List? QuestionTypeIds { get; set; } /// /// 单号 @@ -124,5 +133,25 @@ namespace SJZY.Track.Domain.Dtos.Order /// 轨迹模板Id数组 /// public List? TrackTemplateIds { get; set; } + + /// + /// 问题类型(主数据枚举TrackQuestionType) + /// + public int QuestionType { get; set; } + + /// + /// 问题类型名称 + /// + public string? QuestionTypeName { get; set; } + + /// + /// 问题描述(主数据枚举TrackProblemDescription) + /// + public int ProblemDescription { get; set; } + + /// + /// 问题描述名称 + /// + public string? ProblemDescriptionName { get; set; } } } diff --git a/src/SJZY.Track.Repository/Repositories/OrderRepository.cs b/src/SJZY.Track.Repository/Repositories/OrderRepository.cs index be9cc648..eeeeeb14 100644 --- a/src/SJZY.Track.Repository/Repositories/OrderRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/OrderRepository.cs @@ -137,6 +137,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)) .OrderByDescending((a, b, c) => a.CreateTime) .Select((a, b, c) => new TrackOrderVO { @@ -148,6 +149,10 @@ public class OrderRepository : BasicRepository, IOrderRepository, I .Return("箱/袋单").ElseIF(a.OrderType == 4).Return("FBA订单").End(""), CustomerShortName = b.Abbreviation, CustomerCode = b.Code, + QuestionType = a.QuestionType, + QuestionTypeName = SqlFunc.IF(a.QuestionType == 1).Return("异常").ElseIF(a.QuestionType == 2).Return("预警").End(""), + ProblemDescription = a.ProblemDescription, + ProblemDescriptionName =SqlFunc.IF(a.ProblemDescription == 1).Return("推送异常").ElseIF(a.ProblemDescription == 2).Return("推送预警").End(""), //TrackTemplateNames = SqlFunc.Subqueryable() // .LeftJoin((aa, bb) => aa.TrackTemplateId == bb.Id) // .Where((aa, bb) => a.Id == aa.OrderId).SelectStringJoin((aa, bb) => bb.Name, ","), @@ -206,7 +211,7 @@ public class OrderRepository : BasicRepository, IOrderRepository, I a.TrackTemplateNames = trackTemplateList.Where(b => b.OrderId == a.Id).Select(a => a.Name) .JoinAsString(","); - a.TrackTemplateIds = trackTemplateList.Where(b => b.OrderId == a.Id).Select(a => a.TemplateId).ToList(); + a.TrackTemplateIds = trackTemplateList.Where(b => b.OrderId == a.Id).Where(b => b.TemplateId>0).Select(a => a.TemplateId).ToList(); }); } From 10a68b817af4deac4a2a5bddbcdba2c227ca5303 Mon Sep 17 00:00:00 2001 From: moyongzhen <2534173414@qq.com> Date: Tue, 12 Mar 2024 21:23:47 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E9=87=8D=E6=96=B0=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/ProvideServices/TrackPushPullService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackPushPullService.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackPushPullService.cs index 53b71e31..8e32d1c1 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/TrackPushPullService.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackPushPullService.cs @@ -51,7 +51,7 @@ public class TrackPushPullService : ApplicationService // 批量获取轨迹 这里报错了,我先随便给个 写死的主体值 await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync( - "A012", group.Key.ServiceProviderCode, 42, data, + "A012", group.Key.ServiceProviderCode, data, GlobalConst.TrackRefreshSubscribe, JsonConvert.SerializeObject(group.Key)); } 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 3/4] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E8=B0=83=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, From 953bca93f54b51dcf3768ba14bfa2e37f23df645 Mon Sep 17 00:00:00 2001 From: moyongzhen <2534173414@qq.com> Date: Wed, 13 Mar 2024 10:16:27 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=BD=A8=E8=BF=B9=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/ProvideServices/GetPageTrackOrderInput.cs | 10 +++++----- .../Dtos/Order/GetPageTrackOrderInputVO.cs | 10 ++++++++++ .../Repositories/OrderRepository.cs | 7 ++++++- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs index 9bd8fcc9..c6a143df 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs @@ -22,11 +22,6 @@ public class GetPageTrackOrderInput : PageInfoInput /// public int TabType { get; set; } - ///// - ///// 当tab选中 0 默认不传 1 直接写死传值 [1,4] 2 传 [2,4] - ///// - //public List? QuestionTypeIds { get; set; } - /// /// 订单类型 /// @@ -37,6 +32,11 @@ public class GetPageTrackOrderInput : PageInfoInput /// public int? CustomerId { get; set; } + ///// + ///// 当tab选中 0 默认不传 1 直接写死传值 [1,4] 2 传 [2,4] + ///// + //public List? QuestionTypeIds { get; set; } + /// /// 创建时间开始 /// diff --git a/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs b/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs index b0abd5b0..788c9fb8 100644 --- a/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs +++ b/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs @@ -28,6 +28,16 @@ namespace SJZY.Track.Domain.Dtos.Order ///// //public List? QuestionTypeIds { get; set; } + /// + /// 订单类型 + /// + public int? TrackOrderType { get; set; } + + /// + /// 客户id + /// + public int? CustomerId { get; set; } + /// /// 单号 /// diff --git a/src/SJZY.Track.Repository/Repositories/OrderRepository.cs b/src/SJZY.Track.Repository/Repositories/OrderRepository.cs index 43de6ccb..e160ec0b 100644 --- a/src/SJZY.Track.Repository/Repositories/OrderRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/OrderRepository.cs @@ -123,6 +123,7 @@ public class OrderRepository : BasicRepository, IOrderRepository, I { List orderNoList = new List(); List questionTypeIds = new List(); + int ques = 0; if (!input.OrderNos.IsNullOrWhiteSpace()) { orderNoList = input.OrderNos.Split(new char[] { ',', ',', ':', ':' }).ToList(); @@ -130,10 +131,12 @@ public class OrderRepository : BasicRepository, IOrderRepository, I if (input.TabType==1) { questionTypeIds= new List { 1, 4 }; + ques = questionTypeIds.Sum(); } else if (input.TabType==2) { questionTypeIds= new List { 2, 4 }; + ques = questionTypeIds.Sum(); } var pageList = await Context.Queryable() @@ -147,7 +150,9 @@ 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 && (!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) .Select((a, b, c) => new TrackOrderVO {