Merge branch 'refs/heads/S06' into test

This commit is contained in:
eli 2024-11-20 17:27:05 +08:00
commit 66dc3c0be0
6 changed files with 19 additions and 19 deletions

View File

@ -26,9 +26,12 @@ public class TrackPushCompletedEventHandler : ITransientDependency, IRabbitHandl
_trackPushRecordEsRepository = trackPushRecordEsRepository; _trackPushRecordEsRepository = trackPushRecordEsRepository;
} }
public bool Enable(ConsumeOptions options) public ConsumeOptions Options()
{ {
return options.Queue == GlobalConst.TrackPushCompletedSubscribe; return new ConsumeOptions()
{
Queue = GlobalConst.TrackPushCompletedSubscribe
};
} }
public async Task Handle(IServiceProvider sp, BasicDeliverEventArgs args, ConsumeOptions options) public async Task Handle(IServiceProvider sp, BasicDeliverEventArgs args, ConsumeOptions options)

View File

@ -39,10 +39,12 @@ public class TrackRefreshEventHandler : ITransientDependency, IRabbitHandler
_logger = logger; _logger = logger;
} }
public ConsumeOptions Options()
public bool Enable(ConsumeOptions options)
{ {
return options.Queue == GlobalConst.TrackRefreshSubscribe; return new ConsumeOptions()
{
Queue = GlobalConst.TrackRefreshSubscribe,
};
} }
public async Task Handle(IServiceProvider sp, BasicDeliverEventArgs args, ConsumeOptions options) public async Task Handle(IServiceProvider sp, BasicDeliverEventArgs args, ConsumeOptions options)

View File

@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="BSI.Stack.Rabbit" Version="2.0.9" /> <PackageReference Include="BSI.Stack.Rabbit" Version="2.1.3" />
<PackageReference Include="Savorboard.CAP.InMemoryMessageQueue" Version="8.2.1"/> <PackageReference Include="Savorboard.CAP.InMemoryMessageQueue" Version="8.2.1"/>
<PackageReference Include="SJZY.Expand.AliyunOSS" Version="7.0.17" /> <PackageReference Include="SJZY.Expand.AliyunOSS" Version="7.0.17" />
<PackageReference Include="SJZY.InterfaceRelay.Application.Contracts" Version="7.2.3"/> <PackageReference Include="SJZY.InterfaceRelay.Application.Contracts" Version="7.2.3"/>

View File

@ -256,6 +256,7 @@ public class TrackOrderService : ApplicationService
}); });
} }
res.Data = res.Data?.OrderBy(m => m.TrackTime).ToList();
return res; return res;
} }

View File

@ -140,6 +140,10 @@ public class SjzyTrackApplicationModule : AbpModule
options.ConnectionString = options.ConnectionString =
$"amqp://{configuration["RabbitMQ:UserName"]}:{configuration["RabbitMQ:Password"]}@{configuration["RabbitMQ:HostName"]}:{configuration["RabbitMQ:Port"]}"; $"amqp://{configuration["RabbitMQ:UserName"]}:{configuration["RabbitMQ:Password"]}@{configuration["RabbitMQ:HostName"]}:{configuration["RabbitMQ:Port"]}";
options.PoolSize = configuration.GetValue<int>("RabbitMQ:PoolSize"); options.PoolSize = configuration.GetValue<int>("RabbitMQ:PoolSize");
options.Declarations = new List<Action<IDeclaration>>()
{
o=>o.ExchangeDeclare(GlobalConst.TrackChangeExchange, ExchangeType.Topic, true),
};
options.Consumes = new List<ConsumeOptions> options.Consumes = new List<ConsumeOptions>
{ {
new() new()
@ -154,17 +158,6 @@ public class SjzyTrackApplicationModule : AbpModule
o.QueueBind(GlobalConst.TrackRefreshSubscribe, GlobalConst.InterfaceRelayExchange, o.QueueBind(GlobalConst.TrackRefreshSubscribe, GlobalConst.InterfaceRelayExchange,
GlobalConst.TrackRefreshSubscribe); GlobalConst.TrackRefreshSubscribe);
} }
},
new()
{
//广播轨迹
Queue = GlobalConst.TrackRefreshSubscribe,
FetchCount = configuration.GetValue<ushort>("TrackApp:TrackRefreshFetchCount"),
FailedRequeue = false,
Declaration = o =>
{
o.ExchangeDeclare(GlobalConst.TrackChangeExchange, ExchangeType.Topic, true);
}
} }
}; };
}, typeof(SjzyTrackApplicationModule).Assembly); }, typeof(SjzyTrackApplicationModule).Assembly);

View File

@ -202,7 +202,7 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
/// <summary> /// <summary>
/// 拼接多个三方单号,默认使用分隔符默认(、) /// 拼接多个三方单号,默认使用分隔符默认(、)
/// 第三方单号,服务商-轨迹0000000、轨迹服务商-0000000 /// 第三方单号展示: 0000000(服务商)、0000000(服务商)
/// </summary> /// </summary>
/// <param name="orderPlatformNumberEntities"></param> /// <param name="orderPlatformNumberEntities"></param>
/// <returns></returns> /// <returns></returns>
@ -210,7 +210,8 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
{ {
const string separator = "、"; const string separator = "、";
var thirdPartyOrderNumbers = orderPlatformNumberEntities var thirdPartyOrderNumbers = orderPlatformNumberEntities
.Select(x => $"{x.Platform}-{x.OrderNumber}").ToList(); .Where(x => !string.IsNullOrWhiteSpace(x.OrderNumber))
.Select(x => $"{x.OrderNumber}({x.Platform})").ToList();
return string.Join(separator, thirdPartyOrderNumbers); return string.Join(separator, thirdPartyOrderNumbers);
} }