Merge remote-tracking branch 'origin/S03-轨迹中台优化项' into test
This commit is contained in:
commit
b6ce2db553
@ -58,11 +58,11 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 选中的轨迹标记id
|
/// 选中的轨迹标记id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<int>? SelectIds { get; set; }
|
public List<int>? SelectIds { get; set; }
|
||||||
|
|
||||||
///// <summary>
|
/// <summary>
|
||||||
///// 关键字
|
/// 关键字
|
||||||
///// </summary>
|
/// </summary>
|
||||||
//public string Keywords { get; set; }
|
public string? Keywords { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -88,32 +88,36 @@ public class TrackPullService : ApplicationService
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var orders = await _provideQueries.FindOrderWithServiceProviderAsync(config.ServiceProviderId);
|
var page = 1;
|
||||||
var serviceProviderCode = orders.FirstOrDefault()?.ServiceProviderCode;
|
var orders = await _provideQueries.FindOrderWithServiceProviderAsync(config.ServiceProviderId, page);
|
||||||
var serviceProviderName = orders.FirstOrDefault()?.ServiceProviderName;
|
while (orders.Any())
|
||||||
|
|
||||||
foreach (var group in orders.GroupBy(x =>
|
|
||||||
new { x.SubSystemId, x.OrderType }))
|
|
||||||
{
|
{
|
||||||
var data = group.Select(x => new
|
var serviceProviderCode = orders.FirstOrDefault()?.ServiceProviderCode;
|
||||||
{
|
var serviceProviderName = orders.FirstOrDefault()?.ServiceProviderName;
|
||||||
x.OrderNo
|
|
||||||
}).ToList();
|
|
||||||
|
|
||||||
var attach = Base64Helper.SerializeObject(new TrackRefreshAttach(config.ServiceProviderId,
|
foreach (var group in orders.GroupBy(x =>
|
||||||
serviceProviderName!,
|
new { x.SubSystemId, x.OrderType }))
|
||||||
group.Key.SubSystemId, group.Key.OrderType));
|
{
|
||||||
// 批量获取轨迹
|
var data = group.Select(x => new
|
||||||
await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync(
|
{
|
||||||
InterfaceRelayConst.GetTrackInterfaceCode, serviceProviderCode, data,
|
x.OrderNo
|
||||||
GlobalConst.TrackRefreshSubscribe, attach);
|
}).ToList();
|
||||||
|
|
||||||
|
var attach = Base64Helper.SerializeObject(new TrackRefreshAttach(config.ServiceProviderId,
|
||||||
|
serviceProviderName!,
|
||||||
|
group.Key.SubSystemId, group.Key.OrderType));
|
||||||
|
// 批量获取轨迹
|
||||||
|
await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync(
|
||||||
|
InterfaceRelayConst.GetTrackInterfaceCode, serviceProviderCode, data,
|
||||||
|
GlobalConst.TrackRefreshSubscribe, attach);
|
||||||
|
}
|
||||||
|
|
||||||
|
orders = await _provideQueries.FindOrderWithServiceProviderAsync(config.ServiceProviderId, ++page);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.PullInterval < 60) config.PullInterval = 60;
|
|
||||||
await RedisHelper.Client.SetExAsync(redisKey, config.PullInterval * 60, orders.Count);
|
await RedisHelper.Client.SetExAsync(redisKey, config.PullInterval * 60, orders.Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -86,6 +86,8 @@ public class TrackPullService : ApplicationService
|
|||||||
[HttpPost("Edit")]
|
[HttpPost("Edit")]
|
||||||
public async Task<bool> EditAsync([FromBody] EditTrackPullConfigInput input)
|
public async Task<bool> EditAsync([FromBody] EditTrackPullConfigInput input)
|
||||||
{
|
{
|
||||||
|
if (input.PullInterval < 60) input.PullInterval = 60;
|
||||||
|
|
||||||
if (input.Options != OptionTypeNoNull.删除)
|
if (input.Options != OptionTypeNoNull.删除)
|
||||||
{
|
{
|
||||||
Expression<Func<TrackPullConfigEntity, bool>> isAnyExp = x =>
|
Expression<Func<TrackPullConfigEntity, bool>> isAnyExp = x =>
|
||||||
|
|||||||
@ -18,10 +18,10 @@ namespace SJZY.Track.Domain.Dtos.TrackFlags
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public List<int>? SelectIds { get; set; }
|
public List<int>? SelectIds { get; set; }
|
||||||
|
|
||||||
///// <summary>
|
/// <summary>
|
||||||
///// 关键字
|
/// 关键字
|
||||||
///// </summary>
|
/// </summary>
|
||||||
//public string Keywords { get; set; }
|
public string? Keywords { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GetTrackFlagListVO
|
public class GetTrackFlagListVO
|
||||||
|
|||||||
@ -60,6 +60,9 @@ public interface IProvideQueries
|
|||||||
/// 获取服务商下所有单(未完成的)
|
/// 获取服务商下所有单(未完成的)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="serviceProvider"></param>
|
/// <param name="serviceProvider"></param>
|
||||||
|
/// <param name="pageIndex"></param>
|
||||||
|
/// <param name="pageSize"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<List<OrderWithServiceProviderVO>> FindOrderWithServiceProviderAsync(int serviceProvider);
|
Task<List<OrderWithServiceProviderVO>> FindOrderWithServiceProviderAsync(int serviceProvider, int pageIndex,
|
||||||
|
int pageSize = 1000);
|
||||||
}
|
}
|
||||||
@ -113,7 +113,8 @@ public class ProvideQueries : ISugarRepository, IProvideQueries,
|
|||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<OrderWithServiceProviderVO>> FindOrderWithServiceProviderAsync(int serviceProvider)
|
public async Task<List<OrderWithServiceProviderVO>> FindOrderWithServiceProviderAsync(int serviceProvider,
|
||||||
|
int pageIndex, int pageSize = 1000)
|
||||||
{
|
{
|
||||||
return await Context.Queryable<OrderEntity>()
|
return await Context.Queryable<OrderEntity>()
|
||||||
.RightJoin<OrderTemplateEntity>((a, b) => a.Id == b.OrderId)
|
.RightJoin<OrderTemplateEntity>((a, b) => a.Id == b.OrderId)
|
||||||
@ -128,6 +129,8 @@ public class ProvideQueries : ISugarRepository, IProvideQueries,
|
|||||||
ServiceProviderName = c.Name,
|
ServiceProviderName = c.Name,
|
||||||
SubSystemId = a.SubSystemId
|
SubSystemId = a.SubSystemId
|
||||||
})
|
})
|
||||||
|
.Skip((pageIndex - 1) * pageSize)
|
||||||
|
.Take(pageSize)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -46,8 +46,9 @@ public class TrackFlagRepository : BasicRepository<TrackFlagEntity>, ITrackFlagR
|
|||||||
.LeftJoin<VUserEntity>((a, b, c) => a.CreateUserId == c.Id && c.IsDeleted == false)
|
.LeftJoin<VUserEntity>((a, b, c) => a.CreateUserId == c.Id && c.IsDeleted == false)
|
||||||
.LeftJoin<VUserEntity>((a, b, c, d) => a.UpdateUserId == d.Id && d.IsDeleted == false)
|
.LeftJoin<VUserEntity>((a, b, c, d) => a.UpdateUserId == d.Id && d.IsDeleted == false)
|
||||||
.WhereIF(input.SubSystemId > 0, (a, b, c, d) => a.SubSystemId == input.SubSystemId)
|
.WhereIF(input.SubSystemId > 0, (a, b, c, d) => a.SubSystemId == input.SubSystemId)
|
||||||
|
.WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (a, b, c, d) => SqlFunc.Contains(a.Code, input.Keywords))
|
||||||
.OrderByIF(input.SelectIds.IsNullOrEmpty(), (a, b, c, d) => a.CreateTime, OrderByType.Desc)
|
.OrderByIF(input.SelectIds.IsNullOrEmpty(), (a, b, c, d) => a.CreateTime, OrderByType.Desc)
|
||||||
.OrderByIF(!input.SelectIds.IsNullOrEmpty(), (a, b, c, d) => SqlFunc.IIF(input.SelectIds.Contains(a.Id), SqlFunc.DateAdd(SqlFunc.GetDate(), 1), a.CreateTime), OrderByType.Desc)
|
.OrderByIF(!input.SelectIds.IsNullOrEmpty(), (a, b, c, d) => SqlFunc.IIF(input.SelectIds!.Contains(a.Id), SqlFunc.DateAdd(SqlFunc.GetDate(), 1), a.CreateTime), OrderByType.Desc)
|
||||||
.Select((a, b, c, d) => new GetTrackFlagListVO
|
.Select((a, b, c, d) => new GetTrackFlagListVO
|
||||||
{
|
{
|
||||||
Id = a.Id,
|
Id = a.Id,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user