fix:轨迹推送子系统code未传
change:cap-filter幂等改为3分钟
This commit is contained in:
parent
3bfacc1909
commit
b9f80fa069
@ -43,7 +43,7 @@ public class CapFilter : SubscribeFilter
|
||||
context.DeliverMessage.Headers.TryGetValue("sjzy-arguments-hash", out var hash);
|
||||
if (!hash.IsNullOrEmpty())
|
||||
{
|
||||
await RedisHelper.Client.SetAsync($"CapExecuteFilter:{hash}", 1, TimeSpan.FromMinutes(10).Seconds);
|
||||
await RedisHelper.Client.SetAsync($"CapExecuteFilter:{hash}", 1, TimeSpan.FromMinutes(3));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ using SJZY.Track.Application.Contract.Services.ProvideServices;
|
||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||
using SJZY.Track.Domain.Dtos.TrackPush;
|
||||
using SJZY.Track.Domain.Queries;
|
||||
using SJZY.UserCenter.HttpApi.Services;
|
||||
using Volo.Abp.Http.Client.DynamicProxying;
|
||||
|
||||
@ -21,6 +22,7 @@ public class TrackPushService : ApplicationService, ITrackPushService
|
||||
{
|
||||
private readonly ICapPublisher _capPublisher;
|
||||
private readonly IOrderRepository _orderRepository;
|
||||
private readonly IProvideQueries _provideQueries;
|
||||
private readonly IHttpClientProxy<IRequestCurrentUserService> _requestCurrentUserService;
|
||||
private readonly ITrackPushConfigRepository _trackPushConfigRepository;
|
||||
private readonly ITrackPushRecordEsRepository _trackPushRecordEsRepository;
|
||||
@ -29,13 +31,14 @@ public class TrackPushService : ApplicationService, ITrackPushService
|
||||
, ICapPublisher capPublisher
|
||||
, ITrackPushRecordEsRepository trackPushRecordEsRepository
|
||||
, IHttpClientProxy<IRequestCurrentUserService> requestCurrentUserService
|
||||
, ITrackPushConfigRepository trackPushConfigRepository)
|
||||
, ITrackPushConfigRepository trackPushConfigRepository, IProvideQueries provideQueries)
|
||||
{
|
||||
_orderRepository = orderRepository;
|
||||
_capPublisher = capPublisher;
|
||||
_trackPushRecordEsRepository = trackPushRecordEsRepository;
|
||||
_requestCurrentUserService = requestCurrentUserService;
|
||||
_trackPushConfigRepository = trackPushConfigRepository;
|
||||
_provideQueries = provideQueries;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -48,6 +51,7 @@ public class TrackPushService : ApplicationService, ITrackPushService
|
||||
{
|
||||
input.OrderNos = input.OrderNos.Where(x => !x.IsNullOrWhiteSpace()).Distinct().ToList(); // 单号去重、去空
|
||||
|
||||
var subSystemCode = await _provideQueries.SubSystemId2CodeAsync(input.SubSystemId);
|
||||
var orders = await _orderRepository.GetArrayAsync(x =>
|
||||
x.SubSystemId == input.SubSystemId && x.OrderType == input.OrderType &&
|
||||
input.OrderNos.Contains(x.OrderNo),
|
||||
@ -76,6 +80,7 @@ public class TrackPushService : ApplicationService, ITrackPushService
|
||||
{
|
||||
OptionType = OptionType.新增,
|
||||
SubSystemId = input.SubSystemId,
|
||||
SubSystemCode = subSystemCode,
|
||||
CustomId = group.Key,
|
||||
OrderIds = group.Select(x => x.Id).ToArray(),
|
||||
TrackCode = input.TrackCode,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace SJZY.Track.Domain.Dtos.TrackPush;
|
||||
namespace SJZY.Track.Domain.Dtos.TrackPush;
|
||||
|
||||
public class GetTrackPushContentPageOutputVO
|
||||
{
|
||||
@ -7,6 +7,11 @@ public class GetTrackPushContentPageOutputVO
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容id
|
||||
/// </summary>
|
||||
public int ContentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容
|
||||
/// </summary>
|
||||
|
||||
@ -49,4 +49,11 @@ public interface IProvideQueries
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<TrackPullConfigVo>> GetAllPullConfigsAsync();
|
||||
|
||||
/// <summary>
|
||||
/// 子系统id换code
|
||||
/// </summary>
|
||||
/// <param name="subSystemId"></param>
|
||||
/// <returns></returns>
|
||||
Task<string> SubSystemId2CodeAsync(int subSystemId);
|
||||
}
|
||||
|
||||
@ -110,6 +110,14 @@ public class ProvideQueries : ISugarRepository, IProvideQueries, ITransientDepen
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<string> SubSystemId2CodeAsync(int subSystemId)
|
||||
{
|
||||
return await Context.Queryable<VSystemEntity>()
|
||||
.Where(x => x.Id == subSystemId)
|
||||
.Select(x => x.Key)
|
||||
.FirstAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// db context
|
||||
/// </summary>
|
||||
|
||||
@ -51,7 +51,8 @@ public class TrackPushConfigRepository : BasicRepository<TrackPushConfigEntity>,
|
||||
{
|
||||
Id = pushContent.Id,
|
||||
Sort = pushContent.Sort,
|
||||
OrderNoType = enumValue.Disp
|
||||
OrderNoType = enumValue.Disp,
|
||||
ContentId = pushContent.TrackContentId,
|
||||
}, true)
|
||||
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user