From 636f189e50de0c4207efc88309c473182dda1598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Wed, 10 Apr 2024 15:22:17 +0800 Subject: [PATCH 1/7] =?UTF-8?q?version=EF=BC=9A7.0.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SJZY.Track.Application.Contract.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj b/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj index 1b129506..7f1f52a3 100644 --- a/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj +++ b/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj @@ -5,7 +5,7 @@ net7.0 True - 7.0.0 + 7.0.1 True From 8e9f5931e4916d3751a8ed0703090a6b362deabc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Wed, 10 Apr 2024 15:27:52 +0800 Subject: [PATCH 2/7] =?UTF-8?q?opt=EF=BC=9A=E8=BD=A8=E8=BF=B9=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E5=90=8E=E6=9B=B4=E6=96=B0=E8=AE=A2=E5=8D=95=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E5=88=B0=E6=8E=A8=E9=80=81=E5=A4=84=E7=90=86=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TrackPushAfterUpdateOrderEventHandler.cs | 50 ------------------- 1 file changed, 50 deletions(-) delete mode 100644 src/SJZY.Track.Application/EventHandlers/TrackPushAfterUpdateOrderEventHandler.cs diff --git a/src/SJZY.Track.Application/EventHandlers/TrackPushAfterUpdateOrderEventHandler.cs b/src/SJZY.Track.Application/EventHandlers/TrackPushAfterUpdateOrderEventHandler.cs deleted file mode 100644 index a6c65fdd..00000000 --- a/src/SJZY.Track.Application/EventHandlers/TrackPushAfterUpdateOrderEventHandler.cs +++ /dev/null @@ -1,50 +0,0 @@ -using DotNetCore.CAP; -using SJZY.Track.Application.Contract.Dtos.TrackPush; -using SJZY.Track.Domain.Aggregates.OrderAggregate; -using SJZY.Track.Domain.Consts; -using SJZY.Track.Domain.Enums; -using Volo.Abp.DependencyInjection; - -namespace SJZY.Track.Application.EventHandlers; - -public class TrackPushAfterUpdateOrderEventHandler : ITransientDependency, ICapSubscribe -{ - private readonly IOrderRepository _orderRepository; - - public TrackPushAfterUpdateOrderEventHandler(IOrderRepository orderRepository) - { - _orderRepository = orderRepository; - } - - [CapSubscribe(GlobalConst.TrackPushAfterUpdateOrderSubscribe)] - public async Task ConsumerAsync(TrackPushAfterUpdateOrderDto dto) - { - var order = await _orderRepository.GetFirstAsync(x => x.Id == dto.OrderId); - if (order == default) return; - - /* - * 异常:最近一条推送是失败 - */ - if (!dto.IsSuccess) - { - order.QuestionType = (int)TrackProblemType.Error; - order.LatestPushError = dto.Message; - } - else - { - order.QuestionType = (int)TrackProblemType.None; - order.LatestPushError = null; - if (dto.OptionType == OptionType.新增) - { - // tips:只有新增会影响推送进度 - order.LatestPushTrackCode = dto.TrackCode; - order.LatestPushTime = DateTime.Now; - } - } - - await _orderRepository.UpdateColumnAsync(order, x => new - { - x.LatestPushTrackCode, x.QuestionType, x.LatestPushError, x.LatestPushTime - }); - } -} \ No newline at end of file From 6ef5ba86cf9f0e6cdc34807bb1910d8dd9a679b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Wed, 10 Apr 2024 19:18:18 +0800 Subject: [PATCH 3/7] =?UTF-8?q?opt=EF=BC=9A=E5=BC=80=E5=90=AFcap=E5=A4=9A?= =?UTF-8?q?=E7=BA=BF=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SJZY.Track.Application/SjzyTrackApplicationModule.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs b/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs index f9f5633a..26725fbd 100644 --- a/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs +++ b/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs @@ -84,7 +84,13 @@ namespace SJZY.Track.Application configure.UserName = configuration["RabbitMQ:UserName"]!; configure.Password = configuration["RabbitMQ:Password"]!; configure.Port = configuration.GetValue("RabbitMQ:Port"); + configure.BasicQosOptions = + new RabbitMQOptions.BasicQos(configuration.GetValue("CAP:PrefetchCount")); }); + options.FailedRetryInterval = configuration.GetValue("CAP:FailedRetryInterval"); + options.FailedRetryCount = configuration.GetValue("CAP:FailedRetryCount"); + options.UseDispatchingPerGroup = configuration.GetValue("CAP:UseDispatchingPerGroup"); + options.ConsumerThreadCount = configuration.GetValue("CAP:ConsumerThreadCount"); // options.TopicNamePrefix = "v1"; options.SucceedMessageExpiredAfter = 6 * 60 * 60; From 80e1db40b2a0a1d17c027bed214eb0c50577d383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Wed, 10 Apr 2024 19:21:37 +0800 Subject: [PATCH 4/7] attach --- src/SJZY.Track.Application/SjzyTrackApplicationModule.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs b/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs index 26725fbd..c7be9ea2 100644 --- a/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs +++ b/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs @@ -87,15 +87,13 @@ namespace SJZY.Track.Application configure.BasicQosOptions = new RabbitMQOptions.BasicQos(configuration.GetValue("CAP:PrefetchCount")); }); + // options.TopicNamePrefix = "v1"; options.FailedRetryInterval = configuration.GetValue("CAP:FailedRetryInterval"); options.FailedRetryCount = configuration.GetValue("CAP:FailedRetryCount"); options.UseDispatchingPerGroup = configuration.GetValue("CAP:UseDispatchingPerGroup"); options.ConsumerThreadCount = configuration.GetValue("CAP:ConsumerThreadCount"); + options.SucceedMessageExpiredAfter = configuration.GetValue("CAP:SucceedMessageExpiredAfter"); - // options.TopicNamePrefix = "v1"; - options.SucceedMessageExpiredAfter = 6 * 60 * 60; - options.FailedRetryInterval = 60; - options.FailedRetryCount = 3; options.UseDashboard(dashboardOptions => { dashboardOptions.PathBase = System.Diagnostics.Debugger.IsAttached From 8c81406e6e2a669156b8170f10f44c3007d74884 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Wed, 10 Apr 2024 19:51:07 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E6=B5=8B=E8=AF=95cap=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SJZY.Track.Application/SjzyTrackApplicationModule.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs b/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs index c7be9ea2..d479f7f8 100644 --- a/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs +++ b/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs @@ -93,6 +93,8 @@ namespace SJZY.Track.Application options.UseDispatchingPerGroup = configuration.GetValue("CAP:UseDispatchingPerGroup"); options.ConsumerThreadCount = configuration.GetValue("CAP:ConsumerThreadCount"); options.SucceedMessageExpiredAfter = configuration.GetValue("CAP:SucceedMessageExpiredAfter"); + options.UseDispatchingPerGroup = true; + options.EnableConsumerPrefetch = true; options.UseDashboard(dashboardOptions => { From 93417db5229975eb5c84a1e6b3978be884dc83ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Wed, 10 Apr 2024 19:51:46 +0800 Subject: [PATCH 6/7] 1 --- src/SJZY.Track.Application/SjzyTrackApplicationModule.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs b/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs index d479f7f8..4e8f5fff 100644 --- a/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs +++ b/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs @@ -90,7 +90,6 @@ namespace SJZY.Track.Application // options.TopicNamePrefix = "v1"; options.FailedRetryInterval = configuration.GetValue("CAP:FailedRetryInterval"); options.FailedRetryCount = configuration.GetValue("CAP:FailedRetryCount"); - options.UseDispatchingPerGroup = configuration.GetValue("CAP:UseDispatchingPerGroup"); options.ConsumerThreadCount = configuration.GetValue("CAP:ConsumerThreadCount"); options.SucceedMessageExpiredAfter = configuration.GetValue("CAP:SucceedMessageExpiredAfter"); options.UseDispatchingPerGroup = true; From 3aecf92eb7ddf56b1684fedfa271933dbbd8ef15 Mon Sep 17 00:00:00 2001 From: moyongzhen <2534173414@qq.com> Date: Thu, 11 Apr 2024 15:14:01 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E8=BD=A8=E8=BF=B9=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=85=B3=E7=B3=BB=E5=AF=B9=E5=A4=96=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../QueryTrackPullMappingsInput.cs | 60 +++++++++++++++++++ .../TrackPushConfigAutoMapperProfile.cs | 22 +++++++ .../ProvideServices/TrackPushConfigService.cs | 44 ++++++++++++++ .../ITrackPushConfigRepository.cs | 1 + .../TrackPush/QueryTrackPullMappingsInfoVO.cs | 60 +++++++++++++++++++ .../Repositories/TrackPushConfigRepository.cs | 25 ++++++++ 6 files changed, 212 insertions(+) create mode 100644 src/SJZY.Track.Application.Contract/Dtos/ProvideServices/QueryTrackPullMappingsInput.cs create mode 100644 src/SJZY.Track.Application/AutoMapper/TrackPushConfigAutoMapperProfile.cs create mode 100644 src/SJZY.Track.Application/Services/ProvideServices/TrackPushConfigService.cs create mode 100644 src/SJZY.Track.Domain/Dtos/TrackPush/QueryTrackPullMappingsInfoVO.cs diff --git a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/QueryTrackPullMappingsInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/QueryTrackPullMappingsInput.cs new file mode 100644 index 00000000..ed0e9da4 --- /dev/null +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/QueryTrackPullMappingsInput.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SJZY.Track.Application.Contract.Dtos.ProvideServices +{ + /// + /// 查询轨迹推送映射关系入参 + /// + public class QueryTrackPullMappingsInput + { + /// + /// 子系统id + /// + public int SubsystemsId { get; set; } + + /// + /// 客户id + /// + public int CustomerId { get; set; } + } + + /// + /// 查询轨迹推送映射关系返参项 + /// + public class QueryTrackPullMappingsInfo + { + /// + /// 轨迹代码 + /// + public string? Code { get; set; } + + /// + /// 订单类型 + /// + public int OrderType { get; set; } + + /// + /// 服务商轨迹代码 + /// + public string? ServiceCode { get; set; } + + /// + /// 服务商轨迹状态 + /// + public string? Status { get; set; } + + /// + /// 服务商轨迹内容 + /// + public string? Content { get; set; } + + /// + /// 服务商轨迹内容英文 + /// + public string? ContentEn { get; set; } + } +} diff --git a/src/SJZY.Track.Application/AutoMapper/TrackPushConfigAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/TrackPushConfigAutoMapperProfile.cs new file mode 100644 index 00000000..7cb8ccd2 --- /dev/null +++ b/src/SJZY.Track.Application/AutoMapper/TrackPushConfigAutoMapperProfile.cs @@ -0,0 +1,22 @@ +using AutoMapper; +using SJZY.Track.Application.Contract.Dtos.ProvideServices; +using SJZY.Track.Application.Contract.Dtos.TrackPush; +using SJZY.Track.Domain.Aggregates.TrackPushAggregate; +using SJZY.Track.Domain.Dtos.TrackPush; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SJZY.Track.Application.AutoMapper +{ + public class TrackPushConfigAutoMapperProfile : Profile + { + public TrackPushConfigAutoMapperProfile() + { + CreateMap(MemberList.None); + CreateMap(MemberList.None); + } + } +} diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackPushConfigService.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackPushConfigService.cs new file mode 100644 index 00000000..4a575526 --- /dev/null +++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackPushConfigService.cs @@ -0,0 +1,44 @@ +using SJZY.Track.Application.Contract.Dtos.ProvideServices; +using SJZY.Track.Domain.Aggregates.TrackPushAggregate; +using SJZY.Track.Domain.Dtos.TrackPush; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.ObjectMapping; + +namespace SJZY.Track.Application.Services.ProvideServices +{ + /// + /// 轨迹推送配置服务 + /// + [ApiExplorerSettings(GroupName = "提供接口")] + [Route("/ProviderService")] + public class TrackPushConfigService : ApplicationService + { + private readonly ITrackPushConfigRepository _trackPushConfigRepository; + + public TrackPushConfigService( + ITrackPushConfigRepository trackPushConfigRepository + ) + { + _trackPushConfigRepository = trackPushConfigRepository; + } + + /// + /// 查询轨迹推送配置关系 + /// + /// + /// + [HttpPost("Track/QueryTrackPullMappings")] + public async Task QueryTrackPullMappingsAsync(QueryTrackPullMappingsInput input) + { + var vo = ObjectMapper.Map(input); + var result = await _trackPushConfigRepository.QueryTrackPullMappingsAsync(vo); + var output = ObjectMapper.Map, List>(result); + + return new UnifyResultDto(true, output, "操作成功"); + } + } +} diff --git a/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs b/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs index 641fb386..3983cd7c 100644 --- a/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs +++ b/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs @@ -35,4 +35,5 @@ public interface ITrackPushConfigRepository : IBasicRepository UpdateContentAsync(Expression> columns, Expression> whereExpression); + Task> QueryTrackPullMappingsAsync(QueryTrackPullMappingsInputVO input); } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Dtos/TrackPush/QueryTrackPullMappingsInfoVO.cs b/src/SJZY.Track.Domain/Dtos/TrackPush/QueryTrackPullMappingsInfoVO.cs new file mode 100644 index 00000000..26f7b4a8 --- /dev/null +++ b/src/SJZY.Track.Domain/Dtos/TrackPush/QueryTrackPullMappingsInfoVO.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SJZY.Track.Domain.Dtos.TrackPush +{ + /// + /// 查询轨迹推送关系入参 + /// + public class QueryTrackPullMappingsInfoVO + { + /// + /// 轨迹代码 + /// + public string? Code { get; set; } + + /// + /// 订单类型 + /// + public int OrderType { get; set; } + + /// + /// 服务商轨迹代码 + /// + public string? ServiceCode { get; set; } + + /// + /// 服务商轨迹状态 + /// + public string? Status { get; set; } + + /// + /// 服务商轨迹内容 + /// + public string? Content { get; set; } + + /// + /// 服务商轨迹内容英文 + /// + public string? ContentEn { get; set; } + } + + /// + /// 查询轨迹推送关系返参项 + /// + public class QueryTrackPullMappingsInputVO + { + /// + /// 子系统id + /// + public int SubsystemsId { get; set; } + + /// + /// 客户id + /// + public int CustomerId { get; set; } + } +} diff --git a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs index 43bbae70..c7e21820 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs @@ -166,4 +166,29 @@ public class TrackPushConfigRepository : BasicRepository, return await Context.Updateable().SetColumns(columns).Where(whereExpression) .ExecuteCommandHasChangeAsync(); } + + /// + /// 查询轨迹推送关系 + /// + /// + /// + public async Task> QueryTrackPullMappingsAsync(QueryTrackPullMappingsInputVO input) + { + var result = await Context.Queryable().LeftJoin((a, b) => a.Id == b.TrackPushConfigId && !b.IsDeleted) + .LeftJoin((a, b, c) => b.TrackContentId == c.Id && !c.IsDeleted) + .Where((a, b, c) => !a.IsDeleted) + .Where((a, b, c) => a.SubSystemId == input.SubsystemsId && a.CustomId == input.CustomerId) + .Select((a, b, c) => new QueryTrackPullMappingsInfoVO + { + Code = c.Code, + OrderType = b.OrderNoType, + ServiceCode = b.TrackContentCodeValue, + Status = b.TrackStatusValue, + Content = b.TrackContentValue, + ContentEn = b.TrackEnContentValue + }) + .ToListAsync(); + + return result; + } } \ No newline at end of file