diff --git a/src/SJZY.Track.Application.Contract/Services/ProvideServices/ITrackPushService.cs b/src/SJZY.Track.Application.Contract/Services/ProvideServices/ITrackPushService.cs
index a108aac2..4ddeb81d 100644
--- a/src/SJZY.Track.Application.Contract/Services/ProvideServices/ITrackPushService.cs
+++ b/src/SJZY.Track.Application.Contract/Services/ProvideServices/ITrackPushService.cs
@@ -1,4 +1,5 @@
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
+using SJZY.Track.Application.Contract.Dtos.TrackOrder;
using SJZY.Track.Application.Contract.Dtos.TrackPush;
using Volo.Abp;
@@ -20,4 +21,11 @@ public interface ITrackPushService : IRemoteService
/// 子系统id
/// 客户id
public Task> GetTrackPushContentListAsync(int subSystemId, int customerId);
+
+ ///
+ /// 获取轨迹推送记录
+ ///
+ ///
+ ///
+ public Task> GetTrackPushRecordsAsync(OrderNoInfo input);
}
diff --git a/src/SJZY.Track.Application/BackgroundServices/OrderPullStatusScanner.cs b/src/SJZY.Track.Application/BackgroundServices/OrderPullStatusScanner.cs
deleted file mode 100644
index 6875fd82..00000000
--- a/src/SJZY.Track.Application/BackgroundServices/OrderPullStatusScanner.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System.Diagnostics;
-using Microsoft.Extensions.Hosting;
-using Microsoft.Extensions.Options;
-using SJZY.Expand.ABP.Core.Logger;
-using SJZY.Track.Application.Options;
-using SJZY.Track.Domain.Aggregates.OrderAggregate;
-
-namespace SJZY.Track.Application.BackgroundServices;
-
-///
-/// 订单拉取状态扫描
-///
-public class OrderPullStatusScanner : BackgroundService
-{
- private readonly IOptionsMonitor _options;
- private readonly IOrderRepository _orderRepository;
-
- public OrderPullStatusScanner(IOrderRepository orderRepository, IOptionsMonitor options)
- {
- _orderRepository = orderRepository;
- _options = options;
- }
-
- protected override async Task ExecuteAsync(CancellationToken stoppingToken)
- {
- while (true)
- {
- await Task.Delay(TimeSpan.FromSeconds(_options.CurrentValue.OrderPullStatusScanInterval), stoppingToken);
-
- var stopwatch = Stopwatch.StartNew();
- var count1 = await _orderRepository.UpdatePullStatusBySilenceAsync();
- // real del
- var count2 = await _orderRepository.ClearPullStatusAsync();
- stopwatch.Stop();
- LogHelper.Info(
- $"{nameof(OrderPullStatusScanner)}本次扫描更新了{count1}条,删除了{count2}条订单拉取状态,耗时{stopwatch.ElapsedMilliseconds}ms");
- }
- }
-}
diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackPullService.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackPullService.cs
index 6ed62ad9..28b082fd 100644
--- a/src/SJZY.Track.Application/Services/ProvideServices/TrackPullService.cs
+++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackPullService.cs
@@ -1,16 +1,13 @@
using Microsoft.AspNetCore.Authorization;
-using SJZY.Expand.ABP.Core;
using SJZY.Expand.ABP.Core.Logger;
using SJZY.Expand.ABP.Core.PublicMethords;
using SJZY.InterfaceRelay.Application.Contracts;
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
using SJZY.Track.Application.Contract.Dtos.TrackPull;
-using SJZY.Track.Application.Contract.Services;
using SJZY.Track.Application.Contract.Services.ProvideServices;
using SJZY.Track.Application.Helpers;
using SJZY.Track.Application.Rabbit;
using SJZY.Track.Application.Track2InterfaceRelay;
-using SJZY.Track.Domain.Dtos.TrackPull;
using SJZY.Track.Domain.Queries;
using Volo.Abp.Http.Client.DynamicProxying;
@@ -25,15 +22,13 @@ public class TrackPullService : ApplicationService, ITrackPullService
{
private readonly IHttpClientProxy _httpClientProxy;
private readonly IProvideQueries _provideQueries;
- private readonly ITrackPullCacheService _trackPullCacheService;
+
public TrackPullService(IProvideQueries provideQueries,
- IHttpClientProxy httpClientProxy,
- ITrackPullCacheService trackPullCacheService)
+ IHttpClientProxy httpClientProxy)
{
_provideQueries = provideQueries;
_httpClientProxy = httpClientProxy;
- _trackPullCacheService = trackPullCacheService;
}
///
@@ -93,23 +88,6 @@ public class TrackPullService : ApplicationService, ITrackPullService
return true;
}
- ///
- /// 定时任务刷新轨迹
- ///
- ///
- [AllowAnonymous]
- [HttpPost("Track/RefreshForTask")]
- public async Task RefreshForTaskAsync()
- {
- var configs = await _provideQueries.GetAllPullConfigsAsync();
-
- foreach (var config in configs)
- {
- await RefreshForConfigAsync(config);
- }
-
- return true;
- }
///
/// 轨迹刷新测试
@@ -128,60 +106,4 @@ public class TrackPullService : ApplicationService, ITrackPullService
return true;
}
-
- private async Task RefreshForConfigAsync(TrackPullConfigVo config)
- {
- var redisKey = _trackPullCacheService.TrackPullKey(config.SubSystemId, config.ServiceProviderCode);
- if (await RedisHelper.Client.ExistsAsync(redisKey))
- {
- return;
- }
-
- _ = Task.Run(async () =>
- {
- try
- {
- using (Track2InterfaceRelaySubSystemContext.Use(
- new Track2InterfaceRelaySubSystemContext(config.SubSystemCode)))
- {
- var page = 1;
- var orders =
- await _provideQueries.FindOrderWithServiceProviderAsync(config.ServiceProviderCode, page);
- while (orders.Any())
- {
- var serviceProviderCode = orders.FirstOrDefault()?.ServiceProviderCode;
-
- foreach (var group in orders.GroupBy(x => x.OrderType))
- {
- var data = new List