推拉做不了,临时提交
This commit is contained in:
parent
51fe08f607
commit
4b46eb92bd
@ -68,6 +68,11 @@
|
||||
"RemoteServices": {
|
||||
"UserCenter": {
|
||||
"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>
|
||||
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
|
||||
{
|
||||
private readonly IOrderRepository _orderRepository;
|
||||
private readonly ITrackQueries _trackQueries;
|
||||
private readonly IProvideQueries _provideQueries;
|
||||
private readonly ITrackDetailsRepository _trackDetailsRepository;
|
||||
private readonly ITrackPushCacheService _trackPushCacheService;
|
||||
private readonly ICapPublisher _capPublisher;
|
||||
|
||||
public TrackUpsertEventHandler(IOrderRepository orderRepository, ICapPublisher capPublisher,
|
||||
ITrackQueries trackQueries, ITrackDetailsRepository trackDetailsRepository,
|
||||
IProvideQueries provideQueries, ITrackDetailsRepository trackDetailsRepository,
|
||||
ITrackPushCacheService trackPushCacheService)
|
||||
{
|
||||
_orderRepository = orderRepository;
|
||||
_capPublisher = capPublisher;
|
||||
_trackQueries = trackQueries;
|
||||
_provideQueries = provideQueries;
|
||||
_trackDetailsRepository = trackDetailsRepository;
|
||||
_trackPushCacheService = trackPushCacheService;
|
||||
}
|
||||
@ -35,7 +35,7 @@ public class TrackUpsertEventHandler : ITransientDependency, ICapSubscribe
|
||||
// 不同子系统需要做内容映射
|
||||
if (@event.UpSubSystemId != @event.SubSystemId)
|
||||
{
|
||||
var mapCode = await _trackQueries
|
||||
var mapCode = await _provideQueries
|
||||
.MapTrackContentCodeAsync(@event.UpSubSystemId, @event.SubSystemId, @event.TrackCode);
|
||||
|
||||
if (mapCode == default)
|
||||
@ -59,7 +59,7 @@ public class TrackUpsertEventHandler : ITransientDependency, ICapSubscribe
|
||||
if (track == default)
|
||||
{
|
||||
// 根据轨迹code在订单模板内容中寻找匹配的
|
||||
var trackContent = await _trackQueries.MatchTrackContentAsync(@event.OrderId, @event.TrackCode);
|
||||
var trackContent = await _provideQueries.MatchTrackContentAsync(@event.OrderId, @event.TrackCode);
|
||||
if (trackContent == default)
|
||||
{
|
||||
//throw new BusinessException(message: $"订单:{@event.OrderNo} 所绑定的模板,没有一条内容可以匹配轨迹代码:{@event.TrackCode}");
|
||||
|
||||
@ -21,14 +21,15 @@ public class UpdateOrderTrackEventHandler : ITransientDependency, ICapSubscribe
|
||||
if (order == default) return;
|
||||
|
||||
if (order.IsCompleted) return;
|
||||
|
||||
if (order.LatestTrackTime > @event.TrackTime) return;
|
||||
|
||||
order.LatestTrackContent = @event.TrackContent;
|
||||
order.LatestTrackEnContent = @event.TrackEnContent;
|
||||
order.LatestTrackPlace = @event.TrackPlace;
|
||||
order.LatestTrackTime = @event.TrackTime;
|
||||
order.LatestTrackTimeZone = @event.TrackTimeZone;
|
||||
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
|
||||
{
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<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.FluentValidation" Version="7.0.2" />
|
||||
<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
|
||||
{
|
||||
private readonly ITrackDetailsRepository _trackDetailsRepository;
|
||||
private readonly ITrackQueries _trackQueries;
|
||||
private readonly IProvideQueries _provideQueries;
|
||||
|
||||
public TrackQueryService(ITrackDetailsRepository trackDetailsRepository,
|
||||
ITrackQueries trackQueries)
|
||||
IProvideQueries provideQueries)
|
||||
{
|
||||
_trackDetailsRepository = trackDetailsRepository;
|
||||
_trackQueries = trackQueries;
|
||||
_provideQueries = provideQueries;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -75,10 +75,10 @@ public class TrackQueryService : ApplicationService
|
||||
list.ForEach(item => item.TrackDetails.Sort((a, b) => b.Time.CompareTo(a.Time)));
|
||||
break;
|
||||
case SortMethod.ByTemplate:
|
||||
var orderTemplates = await _trackQueries
|
||||
var orderTemplates = await _provideQueries
|
||||
.GetOrderTemplateLinksAsync(input.OrderType, input.OrderNos);
|
||||
var distinctTemplateIds = orderTemplates.Select(x => x.TemplateId).Distinct().ToList();
|
||||
var templateContent = await _trackQueries.GetOrderedTrackCodesAsync(distinctTemplateIds);
|
||||
var templateContent = await _provideQueries.GetOrderedTrackCodesAsync(distinctTemplateIds);
|
||||
list.ForEach(item =>
|
||||
{
|
||||
var codes = new List<string>();
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using SJZY.Expand.ABP.Core.Localization;
|
||||
using SJZY.InterfaceRelay.Application.Contracts;
|
||||
using SJZY.Track.Application.Contract;
|
||||
using SJZY.Track.Application.Localization;
|
||||
using SJZY.UserCenter.Contracts;
|
||||
@ -21,6 +22,7 @@ namespace SJZY.Track.Application
|
||||
typeof(AbpVirtualFileSystemModule),
|
||||
typeof(AbpHttpClientModule),
|
||||
typeof(SjzyUserCenterHttpApiModule),
|
||||
typeof(SJZYInterfaceRelayApplicationContractsModule),
|
||||
typeof(SjzyTrackDomainModule),
|
||||
typeof(SjzyTrackApplicationContractModule)
|
||||
)]
|
||||
@ -58,6 +60,11 @@ namespace SJZY.Track.Application
|
||||
|
||||
//用户中心
|
||||
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)
|
||||
|
||||
@ -59,4 +59,12 @@ public interface IOrderRepository : IBasicRepository<OrderEntity>
|
||||
Task UnLinkByIdsAsync(List<int> linkIds);
|
||||
|
||||
#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>
|
||||
[SugarColumn(ColumnName = "LatestTrackTime")]
|
||||
public DateTime? LatestTrackTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最新轨迹时区(异步维护)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "LatestTrackTimeZone")]
|
||||
public float? LatestTrackTimeZone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最新轨迹发生地(异步维护)
|
||||
|
||||
@ -16,7 +16,7 @@ public class TrackPullContentConfigEntity : IFullAuditedBasicEntitys, IEntity
|
||||
/// 服务商轨迹代码参数值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackContentCodeValue")]
|
||||
public string TrackContentCodeValue { get; set; }
|
||||
public string? TrackContentCodeValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容id
|
||||
@ -28,19 +28,19 @@ public class TrackPullContentConfigEntity : IFullAuditedBasicEntitys, IEntity
|
||||
/// 服务商轨迹内容参数值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackContentValue")]
|
||||
public string TrackContentValue { get; set; }
|
||||
public string? TrackContentValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹关键词(正向),多个逗分隔
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackKeyword")]
|
||||
public string TrackKeyword { get; set; }
|
||||
public string? TrackKeyword { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹关键词(反向),多个逗分隔
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackKeywordReverse")]
|
||||
public string TrackKeywordReverse { get; set; }
|
||||
public string? TrackKeywordReverse { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹发生地参数值(主数据枚举)
|
||||
@ -58,11 +58,11 @@ public class TrackPullContentConfigEntity : IFullAuditedBasicEntitys, IEntity
|
||||
/// 服务商轨迹状态参数值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackStatusValue")]
|
||||
public string TrackStatusValue { get; set; }
|
||||
public string? TrackStatusValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹时区GMT
|
||||
/// </summary>
|
||||
[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>
|
||||
public const string TrackUpsertSubscribe = "SJZY.Track.TrackUpsert";
|
||||
|
||||
/// <summary>
|
||||
/// 接口通批量轨迹刷新订阅
|
||||
/// </summary>
|
||||
public const string InterfaceRelayTrackRefreshSubscribe = "SJZY.Track.TrackRefresh";
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹新增/更新后触发更新订单轨迹 mq订阅名称
|
||||
/// </summary>
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||
using SJZY.Track.Domain.Dtos.Order;
|
||||
using SJZY.Track.Domain.Dtos.TrackDetails;
|
||||
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||
@ -7,7 +8,7 @@ namespace SJZY.Track.Domain.Queries;
|
||||
/// <summary>
|
||||
/// 提供接口专用查询
|
||||
/// </summary>
|
||||
public interface ITrackQueries
|
||||
public interface IProvideQueries
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据订单号,获取订单模板
|
||||
@ -40,4 +41,11 @@ public interface ITrackQueries
|
||||
/// <param name="trackCode"></param>
|
||||
/// <returns></returns>
|
||||
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.TrackContentAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackFlagAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||
using SJZY.Track.Domain.Dtos.Order;
|
||||
@ -10,12 +11,12 @@ using SJZY.Track.Domain.Queries;
|
||||
|
||||
namespace SJZY.Track.Repository.Queries;
|
||||
|
||||
public class TrackQueries : ISugarRepository, ITrackQueries,
|
||||
public class ProvideQueries : ISugarRepository, IProvideQueries,
|
||||
ITransientDependency
|
||||
{
|
||||
public ISqlSugarClient Context { get; set; }
|
||||
|
||||
public TrackQueries()
|
||||
public ProvideQueries()
|
||||
{
|
||||
Context = SqlsugarScopeBasic.GetContextSafely("default");
|
||||
}
|
||||
@ -87,4 +88,22 @@ public class TrackQueries : ISugarRepository, ITrackQueries,
|
||||
.Select(x => x.MapTrackContentCode)
|
||||
.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)
|
||||
{
|
||||
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)
|
||||
.Where(a => a.Id == orderId)
|
||||
.Select((a, b,c) => new LinkedOrderVO
|
||||
.Select((a, b, c) => new LinkedOrderVO
|
||||
{
|
||||
OrderId = c.Id,
|
||||
OrderType = c.OrderType,
|
||||
@ -109,7 +109,7 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
||||
List<string> orderNoList = new List<string>();
|
||||
if (!input.OrderNos.IsNullOrWhiteSpace())
|
||||
{
|
||||
orderNoList = input.OrderNos.Split(new char[] { ',', ',', ':', ':' }).ToList();
|
||||
orderNoList = input.OrderNos.Split(new char[] { ',', ',', ':', ':' }).ToList();
|
||||
}
|
||||
|
||||
var pageList = await Context.Queryable<OrderEntity>()
|
||||
@ -129,7 +129,8 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
||||
Id = a.Id,
|
||||
OrderNumber = a.OrderNo,
|
||||
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(""),
|
||||
CustomerShortName = b.Abbreviation,
|
||||
CustomerCode = b.Code,
|
||||
@ -173,4 +174,20 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
||||
}
|
||||
|
||||
#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