Merge branch 'test' into S06
This commit is contained in:
commit
c11615775b
@ -22,6 +22,13 @@ namespace SJZY.Track.Application.Services.TimerTaskss;
|
|||||||
[ApiExplorerSettings(GroupName = "定时任务")]
|
[ApiExplorerSettings(GroupName = "定时任务")]
|
||||||
public class TrackPullTask : ApplicationService, ISingletonDependency
|
public class TrackPullTask : ApplicationService, ISingletonDependency
|
||||||
{
|
{
|
||||||
|
private readonly IServiceScopeFactory _serviceScopeFactory;
|
||||||
|
|
||||||
|
public TrackPullTask(IServiceScopeFactory serviceScopeFactory)
|
||||||
|
{
|
||||||
|
_serviceScopeFactory = serviceScopeFactory;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 定时任务刷新轨迹
|
/// 定时任务刷新轨迹
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -30,7 +37,7 @@ public class TrackPullTask : ApplicationService, ISingletonDependency
|
|||||||
[HttpPost("/TimerTask/Refresh")]
|
[HttpPost("/TimerTask/Refresh")]
|
||||||
public async Task<bool> RefreshForTaskAsync()
|
public async Task<bool> RefreshForTaskAsync()
|
||||||
{
|
{
|
||||||
using var serviceScope = LazyServiceProvider.CreateScope();
|
using var serviceScope = _serviceScopeFactory.CreateScope();
|
||||||
|
|
||||||
var provideQueries = serviceScope.ServiceProvider.GetRequiredService<IProvideQueries>();
|
var provideQueries = serviceScope.ServiceProvider.GetRequiredService<IProvideQueries>();
|
||||||
var configs = await provideQueries.GetAllPullConfigsAsync();
|
var configs = await provideQueries.GetAllPullConfigsAsync();
|
||||||
|
|||||||
@ -13,6 +13,13 @@ namespace SJZY.Track.Application.Services.TimerTaskss;
|
|||||||
[ApiExplorerSettings(GroupName = "定时任务")]
|
[ApiExplorerSettings(GroupName = "定时任务")]
|
||||||
public class TrackPushTask : ApplicationService
|
public class TrackPushTask : ApplicationService
|
||||||
{
|
{
|
||||||
|
private readonly IServiceScopeFactory _serviceScopeFactory;
|
||||||
|
|
||||||
|
public TrackPushTask(IServiceScopeFactory serviceScopeFactory)
|
||||||
|
{
|
||||||
|
_serviceScopeFactory = serviceScopeFactory;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 定时任务推送预警(》12小时没有推送的)
|
/// 定时任务推送预警(》12小时没有推送的)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -21,7 +28,7 @@ public class TrackPushTask : ApplicationService
|
|||||||
[HttpPost("/TimerTask/PushWarn")]
|
[HttpPost("/TimerTask/PushWarn")]
|
||||||
public async Task<string> PushWarnForTaskAsync()
|
public async Task<string> PushWarnForTaskAsync()
|
||||||
{
|
{
|
||||||
using var serviceScope = LazyServiceProvider.CreateScope();
|
using var serviceScope = _serviceScopeFactory.CreateScope();
|
||||||
|
|
||||||
var configs = serviceScope.ServiceProvider.GetRequiredService<IOptionsSnapshot<Track2InterfaceRelayOptions>>()
|
var configs = serviceScope.ServiceProvider.GetRequiredService<IOptionsSnapshot<Track2InterfaceRelayOptions>>()
|
||||||
.Value;
|
.Value;
|
||||||
|
|||||||
@ -5,6 +5,7 @@ using SJZY.Expand.ABP.Core.Logger;
|
|||||||
using SJZY.Track.Application.Contract.Services;
|
using SJZY.Track.Application.Contract.Services;
|
||||||
using SJZY.Track.Application.Track2InterfaceRelay;
|
using SJZY.Track.Application.Track2InterfaceRelay;
|
||||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||||
|
using Volo.Abp.DependencyInjection;
|
||||||
|
|
||||||
namespace SJZY.Track.Application.Services.TimerTaskss;
|
namespace SJZY.Track.Application.Services.TimerTaskss;
|
||||||
|
|
||||||
@ -12,15 +13,18 @@ namespace SJZY.Track.Application.Services.TimerTaskss;
|
|||||||
/// 轨迹运输时效预警定时任务
|
/// 轨迹运输时效预警定时任务
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(GroupName = "定时任务")]
|
[ApiExplorerSettings(GroupName = "定时任务")]
|
||||||
public class TrackWarningTask : ApplicationService
|
public class TrackWarningTask : ApplicationService, ISingletonDependency
|
||||||
{
|
{
|
||||||
private readonly IOptionsSnapshot<Track2InterfaceRelayOptions> _options;
|
private readonly IOptionsSnapshot<Track2InterfaceRelayOptions> _options;
|
||||||
private readonly IOrderRepository _orderRepository;
|
private readonly IOrderRepository _orderRepository;
|
||||||
|
private readonly IServiceScopeFactory _serviceScopeFactory;
|
||||||
|
|
||||||
public TrackWarningTask(IOrderRepository orderRepository, IOptionsSnapshot<Track2InterfaceRelayOptions> options)
|
public TrackWarningTask(IOrderRepository orderRepository, IOptionsSnapshot<Track2InterfaceRelayOptions> options,
|
||||||
|
IServiceScopeFactory serviceScopeFactory)
|
||||||
{
|
{
|
||||||
_orderRepository = orderRepository;
|
_orderRepository = orderRepository;
|
||||||
_options = options;
|
_options = options;
|
||||||
|
_serviceScopeFactory = serviceScopeFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -63,7 +67,7 @@ public class TrackWarningTask : ApplicationService
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using var serviceScope = LazyServiceProvider.CreateScope();
|
using var serviceScope = _serviceScopeFactory.CreateScope();
|
||||||
|
|
||||||
var forewarningNotifyService =
|
var forewarningNotifyService =
|
||||||
serviceScope.ServiceProvider.GetRequiredService<IForewarningNotifyService>();
|
serviceScope.ServiceProvider.GetRequiredService<IForewarningNotifyService>();
|
||||||
|
|||||||
@ -8,6 +8,7 @@ using SJZY.Track.Application.Localization;
|
|||||||
using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||||
using SJZY.Track.Domain.Dtos.Common;
|
using SJZY.Track.Domain.Dtos.Common;
|
||||||
using SJZY.Track.Domain.Dtos.TrackPush;
|
using SJZY.Track.Domain.Dtos.TrackPush;
|
||||||
|
using Volo.Abp.DependencyInjection;
|
||||||
|
|
||||||
namespace SJZY.Track.Application.Services.TrackPush;
|
namespace SJZY.Track.Application.Services.TrackPush;
|
||||||
|
|
||||||
@ -16,7 +17,7 @@ namespace SJZY.Track.Application.Services.TrackPush;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(GroupName = "轨迹推送")]
|
[ApiExplorerSettings(GroupName = "轨迹推送")]
|
||||||
[Route("/Track/PushConfig")]
|
[Route("/Track/PushConfig")]
|
||||||
public class TrackPushService : ApplicationService
|
public class TrackPushService : ApplicationService, ISingletonDependency
|
||||||
{
|
{
|
||||||
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
|
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
|
||||||
private readonly ITrackPushCacheService _trackPushCacheService;
|
private readonly ITrackPushCacheService _trackPushCacheService;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user