feat 1.12 works
This commit is contained in:
parent
ad50087f04
commit
8c0693b6f8
@ -213,7 +213,7 @@ public class OrderServiceV2(
|
|||||||
};
|
};
|
||||||
|
|
||||||
var config = await trackPullConfigRepository
|
var config = await trackPullConfigRepository
|
||||||
.FirstOrDefaultAsync(x => x.AppKey == input.ApiCode
|
.FirstOrDefaultAsync(x => x.AppKey == AppKey
|
||||||
&& x.ServiceProviderCode == input.ApiCode);
|
&& x.ServiceProviderCode == input.ApiCode);
|
||||||
|
|
||||||
if (config == null) throw new BusinessException(message: "没有一个拉取配置可以适用,请配置,否则无法拉取轨迹");
|
if (config == null) throw new BusinessException(message: "没有一个拉取配置可以适用,请配置,否则无法拉取轨迹");
|
||||||
@ -241,7 +241,7 @@ public class OrderServiceV2(
|
|||||||
// tips: 2025-11-29 zzh 大包没有轨迹拉取能力
|
// tips: 2025-11-29 zzh 大包没有轨迹拉取能力
|
||||||
|
|
||||||
// var config = await trackPullConfigRepository
|
// var config = await trackPullConfigRepository
|
||||||
// .FirstOrDefaultAsync(x => x.AppKey == input.ApiCode
|
// .FirstOrDefaultAsync(x => x.AppKey == AppKey
|
||||||
// && x.ServiceProviderCode == input.ApiCode);
|
// && x.ServiceProviderCode == input.ApiCode);
|
||||||
//
|
//
|
||||||
// if (config == null) throw new BusinessException(message: "没有一个拉取配置可以适用,请配置,否则无法拉取轨迹");
|
// if (config == null) throw new BusinessException(message: "没有一个拉取配置可以适用,请配置,否则无法拉取轨迹");
|
||||||
@ -267,7 +267,7 @@ public class OrderServiceV2(
|
|||||||
order.OrderFlights = new List<OrderFlightEntity>();
|
order.OrderFlights = new List<OrderFlightEntity>();
|
||||||
|
|
||||||
var config = await trackPullConfigRepository
|
var config = await trackPullConfigRepository
|
||||||
.FirstOrDefaultAsync(x => x.AppKey == input.ApiCode
|
.FirstOrDefaultAsync(x => x.AppKey == AppKey
|
||||||
&& x.ServiceProviderCode == input.ApiCode);
|
&& x.ServiceProviderCode == input.ApiCode);
|
||||||
|
|
||||||
if (config == null) throw new BusinessException(message: "没有一个拉取配置可以适用,请配置,否则无法拉取轨迹");
|
if (config == null) throw new BusinessException(message: "没有一个拉取配置可以适用,请配置,否则无法拉取轨迹");
|
||||||
|
|||||||
@ -50,13 +50,11 @@ public class TrackOrderService : ApplicationServiceBase
|
|||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost("GetTrackOrderList")]
|
[HttpPost("GetTrackOrderList")]
|
||||||
public async Task<PagedResult<TrackOrderDto>> GetTrackOrderPagedList(GetPageTrackOrderInput input)
|
public async Task<PagedResult<TrackOrderVO>> GetTrackOrderPagedList(GetPageTrackOrderInput input)
|
||||||
{
|
{
|
||||||
var vo = ObjectMapper.Map<GetPageTrackOrderInput, GetPageTrackOrderInputVO>(input);
|
var vo = ObjectMapper.Map<GetPageTrackOrderInput, GetPageTrackOrderInputVO>(input);
|
||||||
var pageList = await _orderRepository.GetTrackOrderPagedList(vo);
|
var pageList = await _orderRepository.GetTrackOrderPagedList(vo);
|
||||||
var pageResultDto =
|
return pageList;
|
||||||
ObjectMapper.Map<PagedResult<TrackOrderVO>, PagedResult<TrackOrderDto>>(pageList);
|
|
||||||
return pageResultDto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@ -73,10 +73,55 @@ public class TrackOrderVO
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string Customer { get; set; }
|
public string Customer { get; set; }
|
||||||
|
|
||||||
///// <summary>
|
/// <summary>
|
||||||
///// 订单明细(json)
|
/// 轨迹单号
|
||||||
///// </summary>
|
/// </summary>
|
||||||
//public string? OrderDetails { get; set; }
|
public string? TrackNo { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 其他单号
|
||||||
|
/// </summary>
|
||||||
|
public string? OtherNo { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 渠道
|
||||||
|
/// </summary>
|
||||||
|
public string? Channel { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品
|
||||||
|
/// </summary>
|
||||||
|
public string? Product { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// API编码
|
||||||
|
/// </summary>
|
||||||
|
public string? ApiCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 国家编码
|
||||||
|
/// </summary>
|
||||||
|
public string? CountryCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 州省
|
||||||
|
/// </summary>
|
||||||
|
public string? Province { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 邮编
|
||||||
|
/// </summary>
|
||||||
|
public string? Postcode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 城市
|
||||||
|
/// </summary>
|
||||||
|
public string? City { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 邮箱
|
||||||
|
/// </summary>
|
||||||
|
public string? Email { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 最新轨迹状态
|
/// 最新轨迹状态
|
||||||
@ -118,11 +163,6 @@ public class TrackOrderVO
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime? CreateTime { get; set; }
|
public DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 应用
|
|
||||||
/// </summary>
|
|
||||||
public string? App { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 应用
|
/// 应用
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -147,9 +187,4 @@ public class TrackOrderVO
|
|||||||
/// 目的地时区
|
/// 目的地时区
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public float? DestinationTimeZone { get; set; }
|
public float? DestinationTimeZone { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 第三方单号,服务商-轨迹0000000、轨迹服务商-0000000
|
|
||||||
/// </summary>
|
|
||||||
public string? ThirdPartyOrderNumber { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,13 +5,11 @@ using TrackCenter.Domain.Consts;
|
|||||||
using TrackCenter.Domain.Dtos.Order;
|
using TrackCenter.Domain.Dtos.Order;
|
||||||
using TrackCenter.Domain.Enums;
|
using TrackCenter.Domain.Enums;
|
||||||
using TrackCenter.Domain.Extensions;
|
using TrackCenter.Domain.Extensions;
|
||||||
using TrackCenter.Domain.VEntities;
|
|
||||||
|
|
||||||
namespace TrackCenter.Repository.Repositories;
|
namespace TrackCenter.Repository.Repositories;
|
||||||
|
|
||||||
public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, ITransientDependency
|
public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, ITransientDependency
|
||||||
{
|
{
|
||||||
|
|
||||||
public async Task<PagedResult<TrackOrderVO>> GetTrackOrderPagedList(GetPageTrackOrderInputVO input)
|
public async Task<PagedResult<TrackOrderVO>> GetTrackOrderPagedList(GetPageTrackOrderInputVO input)
|
||||||
{
|
{
|
||||||
//查询完去重
|
//查询完去重
|
||||||
@ -20,20 +18,19 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
|||||||
if (input.OrderNos.IsNullOrEmpty())
|
if (input.OrderNos.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
pageList = await Context.Queryable<OrderEntity>()
|
pageList = await Context.Queryable<OrderEntity>()
|
||||||
.LeftJoin<VAppEntity>((a, c) => a.AppKey == c.AppKey && c.IsDeleted == false)
|
.WhereIF(!input.AppKey.IsNullOrWhiteSpace(), a => a.AppKey == input.AppKey)
|
||||||
.WhereIF(!input.AppKey.IsNullOrWhiteSpace(), (a, c) => a.AppKey == input.AppKey)
|
|
||||||
.WhereIF(input.CreateTimeStart.HasValue && input.CreateTimeEnd.HasValue,
|
.WhereIF(input.CreateTimeStart.HasValue && input.CreateTimeEnd.HasValue,
|
||||||
(a, c) => a.CreateTime >= input.CreateTimeStart && a.CreateTime <= input.CreateTimeEnd)
|
a => a.CreateTime >= input.CreateTimeStart && a.CreateTime <= input.CreateTimeEnd)
|
||||||
.WhereIF(input.CreateTimeStart.HasValue && (!input.CreateTimeEnd.HasValue),
|
.WhereIF(input.CreateTimeStart.HasValue && (!input.CreateTimeEnd.HasValue),
|
||||||
(a, c) => a.CreateTime >= input.CreateTimeStart)
|
a => a.CreateTime >= input.CreateTimeStart)
|
||||||
.WhereIF((!input.CreateTimeStart.HasValue) && input.CreateTimeEnd.HasValue,
|
.WhereIF((!input.CreateTimeStart.HasValue) && input.CreateTimeEnd.HasValue,
|
||||||
(a, c) => a.CreateTime <= input.CreateTimeEnd)
|
a => a.CreateTime <= input.CreateTimeEnd)
|
||||||
.WhereIF(!input.Customer.IsNullOrWhiteSpace(), (a, c) => a.Customer.Contains(input.Customer!))
|
.WhereIF(!input.Customer.IsNullOrWhiteSpace(), a => a.Customer.Contains(input.Customer!))
|
||||||
.WhereIF(input.TrackOrderType > 0, (a, c) => a.OrderType == input.TrackOrderType)
|
.WhereIF(input.TrackOrderType > 0, a => a.OrderType == input.TrackOrderType)
|
||||||
.WhereIF(input.TabType > 0, (a, c) => a.QuestionType == input.TabType)
|
.WhereIF(input.TabType > 0, a => a.QuestionType == input.TabType)
|
||||||
.WhereIF(input.TabType == TrackProblemType.Warn, (a , c) => !a.IsCompleted)
|
.WhereIF(input.TabType == TrackProblemType.Warn, a => !a.IsCompleted)
|
||||||
.OrderByDescending((a, c) => a.CreateTime)
|
.OrderByDescending(a => a.CreateTime)
|
||||||
.Select((a, c) => new TrackOrderVO
|
.Select(a => new TrackOrderVO
|
||||||
{
|
{
|
||||||
Id = a.Id,
|
Id = a.Id,
|
||||||
OrderNumber = a.OrderNo,
|
OrderNumber = a.OrderNo,
|
||||||
@ -48,11 +45,19 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
|||||||
NewestTrackTimeZone = a.LatestTrackTimeZone,
|
NewestTrackTimeZone = a.LatestTrackTimeZone,
|
||||||
IsFinish = a.IsCompleted,
|
IsFinish = a.IsCompleted,
|
||||||
CreateTime = a.CreateTime,
|
CreateTime = a.CreateTime,
|
||||||
App = c.Name,
|
AppKey = a.AppKey,
|
||||||
AppKey = c.AppKey,
|
|
||||||
DestinationTimeZone = a.DestinationTimeZone,
|
DestinationTimeZone = a.DestinationTimeZone,
|
||||||
EstimatedDeliveryDate = a.EstimatedDeliveryDate,
|
EstimatedDeliveryDate = a.EstimatedDeliveryDate,
|
||||||
ThirdPartyOrderNumber = a.ThirdPartyOrderNumber
|
TrackNo = a.TrackNo,
|
||||||
|
OtherNo = a.ThirdPartyOrderNumber,
|
||||||
|
Channel = a.Channel,
|
||||||
|
Product = a.ProductCode,
|
||||||
|
ApiCode = a.ServiceProviderCode,
|
||||||
|
CountryCode = a.ArrivalCountry,
|
||||||
|
Province = a.ArrivalProvince,
|
||||||
|
Postcode = a.ArrivalPostCode,
|
||||||
|
City = a.ArrivalCity,
|
||||||
|
Email = a.ArrivalEmail
|
||||||
})
|
})
|
||||||
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
}
|
}
|
||||||
@ -84,21 +89,20 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
|||||||
}
|
}
|
||||||
|
|
||||||
pageList = await Context.Queryable<OrderEntity>()
|
pageList = await Context.Queryable<OrderEntity>()
|
||||||
.Where(x => orderIds.Contains(x.Id))
|
.Where(a => orderIds.Contains(a.Id))
|
||||||
.LeftJoin<VAppEntity>((a, c) => a.AppKey == c.AppKey && c.IsDeleted == false)
|
.WhereIF(!input.AppKey.IsNullOrWhiteSpace(), a => a.AppKey == input.AppKey)
|
||||||
.WhereIF(!input.AppKey.IsNullOrWhiteSpace(), (a, c) => a.AppKey == input.AppKey)
|
|
||||||
.WhereIF(input.CreateTimeStart.HasValue && input.CreateTimeEnd.HasValue,
|
.WhereIF(input.CreateTimeStart.HasValue && input.CreateTimeEnd.HasValue,
|
||||||
(a, c) => a.CreateTime >= input.CreateTimeStart && a.CreateTime <= input.CreateTimeEnd)
|
a => a.CreateTime >= input.CreateTimeStart && a.CreateTime <= input.CreateTimeEnd)
|
||||||
.WhereIF(input.CreateTimeStart.HasValue && (!input.CreateTimeEnd.HasValue),
|
.WhereIF(input.CreateTimeStart.HasValue && (!input.CreateTimeEnd.HasValue),
|
||||||
(a, c) => a.CreateTime >= input.CreateTimeStart)
|
a => a.CreateTime >= input.CreateTimeStart)
|
||||||
.WhereIF((!input.CreateTimeStart.HasValue) && input.CreateTimeEnd.HasValue,
|
.WhereIF((!input.CreateTimeStart.HasValue) && input.CreateTimeEnd.HasValue,
|
||||||
(a, c) => a.CreateTime <= input.CreateTimeEnd)
|
a => a.CreateTime <= input.CreateTimeEnd)
|
||||||
.WhereIF(!input.Customer.IsNullOrWhiteSpace(), (a, c) => a.Customer.Contains(input.Customer!))
|
.WhereIF(!input.Customer.IsNullOrWhiteSpace(), a => a.Customer.Contains(input.Customer!))
|
||||||
.WhereIF(input.TrackOrderType > 0, (a, c) => a.OrderType == input.TrackOrderType)
|
.WhereIF(input.TrackOrderType > 0, a => a.OrderType == input.TrackOrderType)
|
||||||
.WhereIF(input.TabType > 0, (a, c) => a.QuestionType == input.TabType)
|
.WhereIF(input.TabType > 0, a => a.QuestionType == input.TabType)
|
||||||
.WhereIF(input.TabType == TrackProblemType.Warn, (a, c) => !a.IsCompleted)
|
.WhereIF(input.TabType == TrackProblemType.Warn, a => !a.IsCompleted)
|
||||||
.OrderByDescending((a, c) => a.CreateTime)
|
.OrderByDescending(a => a.CreateTime)
|
||||||
.Select((a, c) => new TrackOrderVO
|
.Select(a => new TrackOrderVO
|
||||||
{
|
{
|
||||||
Id = a.Id,
|
Id = a.Id,
|
||||||
OrderNumber = a.OrderNo,
|
OrderNumber = a.OrderNo,
|
||||||
@ -113,11 +117,19 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
|||||||
NewestTrackTimeZone = a.LatestTrackTimeZone,
|
NewestTrackTimeZone = a.LatestTrackTimeZone,
|
||||||
IsFinish = a.IsCompleted,
|
IsFinish = a.IsCompleted,
|
||||||
CreateTime = a.CreateTime,
|
CreateTime = a.CreateTime,
|
||||||
App = c.Name,
|
AppKey = a.AppKey,
|
||||||
AppKey = c.AppKey,
|
|
||||||
DestinationTimeZone = a.DestinationTimeZone,
|
DestinationTimeZone = a.DestinationTimeZone,
|
||||||
EstimatedDeliveryDate = a.EstimatedDeliveryDate,
|
EstimatedDeliveryDate = a.EstimatedDeliveryDate,
|
||||||
ThirdPartyOrderNumber = a.ThirdPartyOrderNumber
|
TrackNo = a.TrackNo,
|
||||||
|
OtherNo = a.ThirdPartyOrderNumber,
|
||||||
|
Channel = a.Channel,
|
||||||
|
Product = a.ProductCode,
|
||||||
|
ApiCode = a.ServiceProviderCode,
|
||||||
|
CountryCode = a.ArrivalCountry,
|
||||||
|
Province = a.ArrivalProvince,
|
||||||
|
Postcode = a.ArrivalPostCode,
|
||||||
|
City = a.ArrivalCity,
|
||||||
|
Email = a.ArrivalEmail
|
||||||
})
|
})
|
||||||
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user