推拉做不了,临时提交
This commit is contained in:
parent
51fe08f607
commit
4b46eb92bd
@ -68,6 +68,11 @@
|
|||||||
"RemoteServices": {
|
"RemoteServices": {
|
||||||
"UserCenter": {
|
"UserCenter": {
|
||||||
"BaseUrl": "http://192.168.80.55:5020/"
|
"BaseUrl": "http://192.168.80.55:5020/"
|
||||||
|
},
|
||||||
|
"InterfaceForward": {
|
||||||
|
"BaseUrl": "http://192.168.80.55:5041/", //开发环境80.55,测试环境80.57
|
||||||
|
"AppKey": "从接口通应用获取",
|
||||||
|
"AppSecret": "从接口通应用获取"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,9 @@
|
|||||||
|
namespace SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||||
|
|
||||||
|
public class RefreshTrackInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 订单号
|
||||||
|
/// </summary>
|
||||||
|
public List<string> OrderNos { get; set; } = new();
|
||||||
|
}
|
||||||
@ -31,4 +31,9 @@ public class UpdateOrderTrackEvent
|
|||||||
/// 轨迹发生时间
|
/// 轨迹发生时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime TrackTime { get; set; }
|
public DateTime TrackTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹时区
|
||||||
|
/// </summary>
|
||||||
|
public float TrackTimeZone { get; set; }
|
||||||
}
|
}
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
using DotNetCore.CAP;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using SJZY.InterfaceRelay.Application.Contracts;
|
||||||
|
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||||
|
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||||
|
using SJZY.Track.Domain.Queries;
|
||||||
|
using Volo.Abp.DependencyInjection;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Application.EventHandlers;
|
||||||
|
|
||||||
|
public class InterfaceRelayTrackRefreshEventHandler : ITransientDependency, ICapSubscribe
|
||||||
|
{
|
||||||
|
private readonly IOrderRepository _orderRepository;
|
||||||
|
private readonly IProvideQueries _provideQueries;
|
||||||
|
|
||||||
|
public InterfaceRelayTrackRefreshEventHandler(IOrderRepository orderRepository, IProvideQueries provideQueries)
|
||||||
|
{
|
||||||
|
_orderRepository = orderRepository;
|
||||||
|
_provideQueries = provideQueries;
|
||||||
|
}
|
||||||
|
|
||||||
|
[CapSubscribe(GlobalConst.InterfaceRelayTrackRefreshSubscribe)]
|
||||||
|
public async Task ConsumerAsync(InterfaceRelayTrackRefreshEvent @event)
|
||||||
|
{
|
||||||
|
if (@event.RequestParams is List<OrderNoInfo> requestParams)
|
||||||
|
{
|
||||||
|
var orderNos = requestParams.Select(x => x.OrderNo).ToList();
|
||||||
|
|
||||||
|
// tips:attach返回的是服务商id,必有
|
||||||
|
var pullContentConfigs = await _provideQueries.GetPullContentConfigsAsync(int.Parse(@event.Attach));
|
||||||
|
|
||||||
|
// 轨迹清洗入库
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -13,18 +13,18 @@ namespace SJZY.Track.Application.EventHandlers;
|
|||||||
public class TrackUpsertEventHandler : ITransientDependency, ICapSubscribe
|
public class TrackUpsertEventHandler : ITransientDependency, ICapSubscribe
|
||||||
{
|
{
|
||||||
private readonly IOrderRepository _orderRepository;
|
private readonly IOrderRepository _orderRepository;
|
||||||
private readonly ITrackQueries _trackQueries;
|
private readonly IProvideQueries _provideQueries;
|
||||||
private readonly ITrackDetailsRepository _trackDetailsRepository;
|
private readonly ITrackDetailsRepository _trackDetailsRepository;
|
||||||
private readonly ITrackPushCacheService _trackPushCacheService;
|
private readonly ITrackPushCacheService _trackPushCacheService;
|
||||||
private readonly ICapPublisher _capPublisher;
|
private readonly ICapPublisher _capPublisher;
|
||||||
|
|
||||||
public TrackUpsertEventHandler(IOrderRepository orderRepository, ICapPublisher capPublisher,
|
public TrackUpsertEventHandler(IOrderRepository orderRepository, ICapPublisher capPublisher,
|
||||||
ITrackQueries trackQueries, ITrackDetailsRepository trackDetailsRepository,
|
IProvideQueries provideQueries, ITrackDetailsRepository trackDetailsRepository,
|
||||||
ITrackPushCacheService trackPushCacheService)
|
ITrackPushCacheService trackPushCacheService)
|
||||||
{
|
{
|
||||||
_orderRepository = orderRepository;
|
_orderRepository = orderRepository;
|
||||||
_capPublisher = capPublisher;
|
_capPublisher = capPublisher;
|
||||||
_trackQueries = trackQueries;
|
_provideQueries = provideQueries;
|
||||||
_trackDetailsRepository = trackDetailsRepository;
|
_trackDetailsRepository = trackDetailsRepository;
|
||||||
_trackPushCacheService = trackPushCacheService;
|
_trackPushCacheService = trackPushCacheService;
|
||||||
}
|
}
|
||||||
@ -35,7 +35,7 @@ public class TrackUpsertEventHandler : ITransientDependency, ICapSubscribe
|
|||||||
// 不同子系统需要做内容映射
|
// 不同子系统需要做内容映射
|
||||||
if (@event.UpSubSystemId != @event.SubSystemId)
|
if (@event.UpSubSystemId != @event.SubSystemId)
|
||||||
{
|
{
|
||||||
var mapCode = await _trackQueries
|
var mapCode = await _provideQueries
|
||||||
.MapTrackContentCodeAsync(@event.UpSubSystemId, @event.SubSystemId, @event.TrackCode);
|
.MapTrackContentCodeAsync(@event.UpSubSystemId, @event.SubSystemId, @event.TrackCode);
|
||||||
|
|
||||||
if (mapCode == default)
|
if (mapCode == default)
|
||||||
@ -59,7 +59,7 @@ public class TrackUpsertEventHandler : ITransientDependency, ICapSubscribe
|
|||||||
if (track == default)
|
if (track == default)
|
||||||
{
|
{
|
||||||
// 根据轨迹code在订单模板内容中寻找匹配的
|
// 根据轨迹code在订单模板内容中寻找匹配的
|
||||||
var trackContent = await _trackQueries.MatchTrackContentAsync(@event.OrderId, @event.TrackCode);
|
var trackContent = await _provideQueries.MatchTrackContentAsync(@event.OrderId, @event.TrackCode);
|
||||||
if (trackContent == default)
|
if (trackContent == default)
|
||||||
{
|
{
|
||||||
//throw new BusinessException(message: $"订单:{@event.OrderNo} 所绑定的模板,没有一条内容可以匹配轨迹代码:{@event.TrackCode}");
|
//throw new BusinessException(message: $"订单:{@event.OrderNo} 所绑定的模板,没有一条内容可以匹配轨迹代码:{@event.TrackCode}");
|
||||||
|
|||||||
@ -21,14 +21,15 @@ public class UpdateOrderTrackEventHandler : ITransientDependency, ICapSubscribe
|
|||||||
if (order == default) return;
|
if (order == default) return;
|
||||||
|
|
||||||
if (order.IsCompleted) return;
|
if (order.IsCompleted) return;
|
||||||
|
|
||||||
if (order.LatestTrackTime > @event.TrackTime) return;
|
|
||||||
|
|
||||||
order.LatestTrackContent = @event.TrackContent;
|
order.LatestTrackContent = @event.TrackContent;
|
||||||
order.LatestTrackEnContent = @event.TrackEnContent;
|
order.LatestTrackEnContent = @event.TrackEnContent;
|
||||||
order.LatestTrackPlace = @event.TrackPlace;
|
order.LatestTrackPlace = @event.TrackPlace;
|
||||||
order.LatestTrackTime = @event.TrackTime;
|
order.LatestTrackTime = @event.TrackTime;
|
||||||
|
order.LatestTrackTimeZone = @event.TrackTimeZone;
|
||||||
if (@event.IsCompleted) order.IsCompleted = true;
|
if (@event.IsCompleted) order.IsCompleted = true;
|
||||||
|
else if (order.LatestTrackTime != null &&
|
||||||
|
order.LatestTrackTime.Value.Subtract(TimeSpan.FromHours(order.LatestTrackTimeZone ?? 0)) >
|
||||||
|
@event.TrackTime.Subtract(TimeSpan.FromHours(@event.TrackTimeZone))) return;
|
||||||
|
|
||||||
await _orderRepository.UpdateColumnAsync(order, x => new
|
await _orderRepository.UpdateColumnAsync(order, x => new
|
||||||
{
|
{
|
||||||
|
|||||||
@ -8,6 +8,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="SJZY.InterfaceRelay.Application.Contracts" Version="7.1.2" />
|
||||||
<PackageReference Include="Volo.Abp.Http.Client" Version="7.0.2" />
|
<PackageReference Include="Volo.Abp.Http.Client" Version="7.0.2" />
|
||||||
<PackageReference Include="Volo.Abp.FluentValidation" Version="7.0.2" />
|
<PackageReference Include="Volo.Abp.FluentValidation" Version="7.0.2" />
|
||||||
<PackageReference Include="SJZY.UserCenter.HttpApi" Version="3.0.3-alpha8" />
|
<PackageReference Include="SJZY.UserCenter.HttpApi" Version="3.0.3-alpha8" />
|
||||||
|
|||||||
@ -0,0 +1,56 @@
|
|||||||
|
using SJZY.InterfaceRelay.Application.Contracts;
|
||||||
|
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||||
|
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||||
|
using Volo.Abp.Http.Client.DynamicProxying;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Application.Services.ProvideServices;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹拉取服务
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(GroupName = "提供接口")]
|
||||||
|
public class TrackPullService : ApplicationService
|
||||||
|
{
|
||||||
|
private readonly IOrderRepository _orderRepository;
|
||||||
|
private readonly IHttpClientProxy<IInterfaceForwardService> _httpClientProxy;
|
||||||
|
|
||||||
|
public TrackPullService(IOrderRepository orderRepository,
|
||||||
|
IHttpClientProxy<IInterfaceForwardService> httpClientProxy)
|
||||||
|
{
|
||||||
|
_orderRepository = orderRepository;
|
||||||
|
_httpClientProxy = httpClientProxy;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 刷新轨迹
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("Track/Refresh")]
|
||||||
|
public async Task<bool> RefreshTrackAsync(RefreshTrackInput input)
|
||||||
|
{
|
||||||
|
if (input.OrderNos.Count == 0)
|
||||||
|
{
|
||||||
|
throw new BusinessException(message: "订单号数组不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
input.OrderNos = input.OrderNos.Distinct().ToList();
|
||||||
|
|
||||||
|
var orderTemplates = await _orderRepository.GetOrderTemplatesAsync(input.OrderNos);
|
||||||
|
|
||||||
|
foreach (var group in orderTemplates.GroupBy(x => x.ServiceProviderId))
|
||||||
|
{
|
||||||
|
var data = group.Select(x => new OrderNoInfo
|
||||||
|
{
|
||||||
|
OrderType = x.OrderType,
|
||||||
|
OrderNo = x.OrderNo
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync(
|
||||||
|
"A012", "yicang", 42, data, GlobalConst.InterfaceRelayTrackRefreshSubscribe
|
||||||
|
, group.Key.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -11,13 +11,13 @@ namespace SJZY.Track.Application.Services.ProvideServices;
|
|||||||
public class TrackQueryService : ApplicationService
|
public class TrackQueryService : ApplicationService
|
||||||
{
|
{
|
||||||
private readonly ITrackDetailsRepository _trackDetailsRepository;
|
private readonly ITrackDetailsRepository _trackDetailsRepository;
|
||||||
private readonly ITrackQueries _trackQueries;
|
private readonly IProvideQueries _provideQueries;
|
||||||
|
|
||||||
public TrackQueryService(ITrackDetailsRepository trackDetailsRepository,
|
public TrackQueryService(ITrackDetailsRepository trackDetailsRepository,
|
||||||
ITrackQueries trackQueries)
|
IProvideQueries provideQueries)
|
||||||
{
|
{
|
||||||
_trackDetailsRepository = trackDetailsRepository;
|
_trackDetailsRepository = trackDetailsRepository;
|
||||||
_trackQueries = trackQueries;
|
_provideQueries = provideQueries;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -75,10 +75,10 @@ public class TrackQueryService : ApplicationService
|
|||||||
list.ForEach(item => item.TrackDetails.Sort((a, b) => b.Time.CompareTo(a.Time)));
|
list.ForEach(item => item.TrackDetails.Sort((a, b) => b.Time.CompareTo(a.Time)));
|
||||||
break;
|
break;
|
||||||
case SortMethod.ByTemplate:
|
case SortMethod.ByTemplate:
|
||||||
var orderTemplates = await _trackQueries
|
var orderTemplates = await _provideQueries
|
||||||
.GetOrderTemplateLinksAsync(input.OrderType, input.OrderNos);
|
.GetOrderTemplateLinksAsync(input.OrderType, input.OrderNos);
|
||||||
var distinctTemplateIds = orderTemplates.Select(x => x.TemplateId).Distinct().ToList();
|
var distinctTemplateIds = orderTemplates.Select(x => x.TemplateId).Distinct().ToList();
|
||||||
var templateContent = await _trackQueries.GetOrderedTrackCodesAsync(distinctTemplateIds);
|
var templateContent = await _provideQueries.GetOrderedTrackCodesAsync(distinctTemplateIds);
|
||||||
list.ForEach(item =>
|
list.ForEach(item =>
|
||||||
{
|
{
|
||||||
var codes = new List<string>();
|
var codes = new List<string>();
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using SJZY.Expand.ABP.Core.Localization;
|
using SJZY.Expand.ABP.Core.Localization;
|
||||||
|
using SJZY.InterfaceRelay.Application.Contracts;
|
||||||
using SJZY.Track.Application.Contract;
|
using SJZY.Track.Application.Contract;
|
||||||
using SJZY.Track.Application.Localization;
|
using SJZY.Track.Application.Localization;
|
||||||
using SJZY.UserCenter.Contracts;
|
using SJZY.UserCenter.Contracts;
|
||||||
@ -21,6 +22,7 @@ namespace SJZY.Track.Application
|
|||||||
typeof(AbpVirtualFileSystemModule),
|
typeof(AbpVirtualFileSystemModule),
|
||||||
typeof(AbpHttpClientModule),
|
typeof(AbpHttpClientModule),
|
||||||
typeof(SjzyUserCenterHttpApiModule),
|
typeof(SjzyUserCenterHttpApiModule),
|
||||||
|
typeof(SJZYInterfaceRelayApplicationContractsModule),
|
||||||
typeof(SjzyTrackDomainModule),
|
typeof(SjzyTrackDomainModule),
|
||||||
typeof(SjzyTrackApplicationContractModule)
|
typeof(SjzyTrackApplicationContractModule)
|
||||||
)]
|
)]
|
||||||
@ -58,6 +60,11 @@ namespace SJZY.Track.Application
|
|||||||
|
|
||||||
//用户中心
|
//用户中心
|
||||||
context.Services.AddHttpClientProxies(typeof(SjzyUserCenterHttpApiModule).Assembly, "UserCenter", false);
|
context.Services.AddHttpClientProxies(typeof(SjzyUserCenterHttpApiModule).Assembly, "UserCenter", false);
|
||||||
|
context.Services.AddHttpClient("InterfaceForward").AddHttpMessageHandler<InterfaceForwardHeaderHandler>();
|
||||||
|
context.Services.AddHttpClientProxy<IInterfaceForwardService>(
|
||||||
|
remoteServiceConfigurationName: "InterfaceForward",
|
||||||
|
asDefaultService: false
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void PreConfigureServices(ServiceConfigurationContext context)
|
public override void PreConfigureServices(ServiceConfigurationContext context)
|
||||||
|
|||||||
@ -59,4 +59,12 @@ public interface IOrderRepository : IBasicRepository<OrderEntity>
|
|||||||
Task UnLinkByIdsAsync(List<int> linkIds);
|
Task UnLinkByIdsAsync(List<int> linkIds);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取订单模板列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="orderNos"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<OrderTemplateVO>> GetOrderTemplatesAsync(List<string> orderNos);
|
||||||
}
|
}
|
||||||
@ -65,6 +65,12 @@ public class OrderEntity : IFullAuditedBasicEntitys, IAggregateRoot
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "LatestTrackTime")]
|
[SugarColumn(ColumnName = "LatestTrackTime")]
|
||||||
public DateTime? LatestTrackTime { get; set; }
|
public DateTime? LatestTrackTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 最新轨迹时区(异步维护)
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "LatestTrackTimeZone")]
|
||||||
|
public float? LatestTrackTimeZone { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 最新轨迹发生地(异步维护)
|
/// 最新轨迹发生地(异步维护)
|
||||||
|
|||||||
@ -16,7 +16,7 @@ public class TrackPullContentConfigEntity : IFullAuditedBasicEntitys, IEntity
|
|||||||
/// 服务商轨迹代码参数值
|
/// 服务商轨迹代码参数值
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "TrackContentCodeValue")]
|
[SugarColumn(ColumnName = "TrackContentCodeValue")]
|
||||||
public string TrackContentCodeValue { get; set; }
|
public string? TrackContentCodeValue { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹内容id
|
/// 轨迹内容id
|
||||||
@ -28,19 +28,19 @@ public class TrackPullContentConfigEntity : IFullAuditedBasicEntitys, IEntity
|
|||||||
/// 服务商轨迹内容参数值
|
/// 服务商轨迹内容参数值
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "TrackContentValue")]
|
[SugarColumn(ColumnName = "TrackContentValue")]
|
||||||
public string TrackContentValue { get; set; }
|
public string? TrackContentValue { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹关键词(正向),多个逗分隔
|
/// 轨迹关键词(正向),多个逗分隔
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "TrackKeyword")]
|
[SugarColumn(ColumnName = "TrackKeyword")]
|
||||||
public string TrackKeyword { get; set; }
|
public string? TrackKeyword { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹关键词(反向),多个逗分隔
|
/// 轨迹关键词(反向),多个逗分隔
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "TrackKeywordReverse")]
|
[SugarColumn(ColumnName = "TrackKeywordReverse")]
|
||||||
public string TrackKeywordReverse { get; set; }
|
public string? TrackKeywordReverse { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹发生地参数值(主数据枚举)
|
/// 轨迹发生地参数值(主数据枚举)
|
||||||
@ -58,11 +58,11 @@ public class TrackPullContentConfigEntity : IFullAuditedBasicEntitys, IEntity
|
|||||||
/// 服务商轨迹状态参数值
|
/// 服务商轨迹状态参数值
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "TrackStatusValue")]
|
[SugarColumn(ColumnName = "TrackStatusValue")]
|
||||||
public string TrackStatusValue { get; set; }
|
public string? TrackStatusValue { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹时区GMT
|
/// 轨迹时区GMT
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "TrackTimeZone")]
|
[SugarColumn(ColumnName = "TrackTimeZone")]
|
||||||
public double? TrackTimeZone { get; set; }
|
public float? TrackTimeZone { get; set; }
|
||||||
}
|
}
|
||||||
15
src/SJZY.Track.Domain/Dtos/Order/OrderTemplateVO.cs
Normal file
15
src/SJZY.Track.Domain/Dtos/Order/OrderTemplateVO.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
namespace SJZY.Track.Domain.Dtos.Order;
|
||||||
|
|
||||||
|
public class OrderTemplateVO
|
||||||
|
{
|
||||||
|
public string OrderNo { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 订单类型(主数据枚举TrackOrderType)
|
||||||
|
/// </summary>
|
||||||
|
public int OrderType { get; set; }
|
||||||
|
|
||||||
|
public int TemplateId { get; set; }
|
||||||
|
|
||||||
|
public int ServiceProviderId { get; set; }
|
||||||
|
}
|
||||||
44
src/SJZY.Track.Domain/Dtos/Order/TrackPullContentConfigVO.cs
Normal file
44
src/SJZY.Track.Domain/Dtos/Order/TrackPullContentConfigVO.cs
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
namespace SJZY.Track.Domain.Dtos.Order;
|
||||||
|
|
||||||
|
public class TrackPullContentConfigVO
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容id
|
||||||
|
/// </summary>
|
||||||
|
public int TrackContentId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 服务商轨迹代码参数值
|
||||||
|
/// </summary>
|
||||||
|
public string? TrackContentCodeValue { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 服务商轨迹内容参数值
|
||||||
|
/// </summary>
|
||||||
|
public string? TrackContentValue { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹关键词(正向),多个逗分隔
|
||||||
|
/// </summary>
|
||||||
|
public string? TrackKeyword { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹关键词(反向),多个逗分隔
|
||||||
|
/// </summary>
|
||||||
|
public string? TrackKeywordReverse { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹发生地参数值(主数据枚举)
|
||||||
|
/// </summary>
|
||||||
|
public int? TrackPlaceValue { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 服务商轨迹状态参数值
|
||||||
|
/// </summary>
|
||||||
|
public string? TrackStatusValue { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹时区GMT
|
||||||
|
/// </summary>
|
||||||
|
public double? TrackTimeZone { get; set; }
|
||||||
|
}
|
||||||
@ -12,6 +12,11 @@ public class GlobalConst
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public const string TrackUpsertSubscribe = "SJZY.Track.TrackUpsert";
|
public const string TrackUpsertSubscribe = "SJZY.Track.TrackUpsert";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 接口通批量轨迹刷新订阅
|
||||||
|
/// </summary>
|
||||||
|
public const string InterfaceRelayTrackRefreshSubscribe = "SJZY.Track.TrackRefresh";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹新增/更新后触发更新订单轨迹 mq订阅名称
|
/// 轨迹新增/更新后触发更新订单轨迹 mq订阅名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||||
using SJZY.Track.Domain.Dtos.Order;
|
using SJZY.Track.Domain.Dtos.Order;
|
||||||
using SJZY.Track.Domain.Dtos.TrackDetails;
|
using SJZY.Track.Domain.Dtos.TrackDetails;
|
||||||
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||||
@ -7,7 +8,7 @@ namespace SJZY.Track.Domain.Queries;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 提供接口专用查询
|
/// 提供接口专用查询
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface ITrackQueries
|
public interface IProvideQueries
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 根据订单号,获取订单模板
|
/// 根据订单号,获取订单模板
|
||||||
@ -40,4 +41,11 @@ public interface ITrackQueries
|
|||||||
/// <param name="trackCode"></param>
|
/// <param name="trackCode"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<string?> MapTrackContentCodeAsync(int upSubSystemId, int subSystemId, string trackCode);
|
Task<string?> MapTrackContentCodeAsync(int upSubSystemId, int subSystemId, string trackCode);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取服务商模板配置
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="serviceProviderId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<TrackPullContentConfigVO>> GetPullContentConfigsAsync(int serviceProviderId);
|
||||||
}
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackFlagAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackFlagAggregate;
|
||||||
|
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||||
using SJZY.Track.Domain.Dtos.Order;
|
using SJZY.Track.Domain.Dtos.Order;
|
||||||
@ -10,12 +11,12 @@ using SJZY.Track.Domain.Queries;
|
|||||||
|
|
||||||
namespace SJZY.Track.Repository.Queries;
|
namespace SJZY.Track.Repository.Queries;
|
||||||
|
|
||||||
public class TrackQueries : ISugarRepository, ITrackQueries,
|
public class ProvideQueries : ISugarRepository, IProvideQueries,
|
||||||
ITransientDependency
|
ITransientDependency
|
||||||
{
|
{
|
||||||
public ISqlSugarClient Context { get; set; }
|
public ISqlSugarClient Context { get; set; }
|
||||||
|
|
||||||
public TrackQueries()
|
public ProvideQueries()
|
||||||
{
|
{
|
||||||
Context = SqlsugarScopeBasic.GetContextSafely("default");
|
Context = SqlsugarScopeBasic.GetContextSafely("default");
|
||||||
}
|
}
|
||||||
@ -87,4 +88,22 @@ public class TrackQueries : ISugarRepository, ITrackQueries,
|
|||||||
.Select(x => x.MapTrackContentCode)
|
.Select(x => x.MapTrackContentCode)
|
||||||
.FirstAsync();
|
.FirstAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<List<TrackPullContentConfigVO>> GetPullContentConfigsAsync(int serviceProviderId)
|
||||||
|
{
|
||||||
|
return await Context.Queryable<TrackPullConfigEntity>()
|
||||||
|
.LeftJoin<TrackPullContentConfigEntity>((a, b) => a.Id == b.TrackPullConfigId)
|
||||||
|
.Where(a => a.ServiceProviderId == serviceProviderId)
|
||||||
|
.Select(x => new TrackPullContentConfigVO
|
||||||
|
{
|
||||||
|
TrackContentId = 0,
|
||||||
|
TrackContentCodeValue = null,
|
||||||
|
TrackContentValue = null,
|
||||||
|
TrackKeyword = null,
|
||||||
|
TrackKeywordReverse = null,
|
||||||
|
TrackPlaceValue = null,
|
||||||
|
TrackStatusValue = null,
|
||||||
|
TrackTimeZone = null
|
||||||
|
}).ToListAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -56,10 +56,10 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
|||||||
public async Task<List<LinkedOrderVO>> GetLinkedOrdersAsync(int orderId)
|
public async Task<List<LinkedOrderVO>> GetLinkedOrdersAsync(int orderId)
|
||||||
{
|
{
|
||||||
return await Context.Queryable<OrderLinkEntity>()
|
return await Context.Queryable<OrderLinkEntity>()
|
||||||
.LeftJoin<OrderLinkEntity>((a , b) => a.Id == b.OrderId)
|
.LeftJoin<OrderLinkEntity>((a, b) => a.Id == b.OrderId)
|
||||||
.LeftJoin<OrderEntity>((a, b, c) => b.LinkOrderId == c.Id)
|
.LeftJoin<OrderEntity>((a, b, c) => b.LinkOrderId == c.Id)
|
||||||
.Where(a => a.Id == orderId)
|
.Where(a => a.Id == orderId)
|
||||||
.Select((a, b,c) => new LinkedOrderVO
|
.Select((a, b, c) => new LinkedOrderVO
|
||||||
{
|
{
|
||||||
OrderId = c.Id,
|
OrderId = c.Id,
|
||||||
OrderType = c.OrderType,
|
OrderType = c.OrderType,
|
||||||
@ -109,7 +109,7 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
|||||||
List<string> orderNoList = new List<string>();
|
List<string> orderNoList = new List<string>();
|
||||||
if (!input.OrderNos.IsNullOrWhiteSpace())
|
if (!input.OrderNos.IsNullOrWhiteSpace())
|
||||||
{
|
{
|
||||||
orderNoList = input.OrderNos.Split(new char[] { ',', ',', ':', ':' }).ToList();
|
orderNoList = input.OrderNos.Split(new char[] { ',', ',', ':', ':' }).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
var pageList = await Context.Queryable<OrderEntity>()
|
var pageList = await Context.Queryable<OrderEntity>()
|
||||||
@ -129,7 +129,8 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
|||||||
Id = a.Id,
|
Id = a.Id,
|
||||||
OrderNumber = a.OrderNo,
|
OrderNumber = a.OrderNo,
|
||||||
OrderType = a.OrderType,
|
OrderType = a.OrderType,
|
||||||
OrderTypeName = SqlFunc.IF(a.OrderType == 1).Return("干线提单").ElseIF(a.OrderType == 2).Return("小包运单").ElseIF(a.OrderType == 3)
|
OrderTypeName = SqlFunc.IF(a.OrderType == 1).Return("干线提单").ElseIF(a.OrderType == 2).Return("小包运单")
|
||||||
|
.ElseIF(a.OrderType == 3)
|
||||||
.Return("箱/袋单").ElseIF(a.OrderType == 4).Return("FBA订单").End(""),
|
.Return("箱/袋单").ElseIF(a.OrderType == 4).Return("FBA订单").End(""),
|
||||||
CustomerShortName = b.Abbreviation,
|
CustomerShortName = b.Abbreviation,
|
||||||
CustomerCode = b.Code,
|
CustomerCode = b.Code,
|
||||||
@ -173,4 +174,20 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<List<OrderTemplateVO>> GetOrderTemplatesAsync(List<string> orderNos)
|
||||||
|
{
|
||||||
|
return await Context.Queryable<OrderEntity>()
|
||||||
|
.LeftJoin<OrderTemplateEntity>((a, b) => a.Id == b.OrderId)
|
||||||
|
.Where(a => orderNos.Contains(a.OrderNo))
|
||||||
|
.Select((a, b) => new OrderTemplateVO
|
||||||
|
{
|
||||||
|
OrderNo = a.OrderNo,
|
||||||
|
OrderType = a.OrderType,
|
||||||
|
TemplateId = b.TrackTemplateId,
|
||||||
|
ServiceProviderId = b.ServiceProviderId
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user