feat 1.12 works
This commit is contained in:
parent
ad50087f04
commit
8c0693b6f8
@ -213,7 +213,7 @@ public class OrderServiceV2(
|
||||
};
|
||||
|
||||
var config = await trackPullConfigRepository
|
||||
.FirstOrDefaultAsync(x => x.AppKey == input.ApiCode
|
||||
.FirstOrDefaultAsync(x => x.AppKey == AppKey
|
||||
&& x.ServiceProviderCode == input.ApiCode);
|
||||
|
||||
if (config == null) throw new BusinessException(message: "没有一个拉取配置可以适用,请配置,否则无法拉取轨迹");
|
||||
@ -241,7 +241,7 @@ public class OrderServiceV2(
|
||||
// tips: 2025-11-29 zzh 大包没有轨迹拉取能力
|
||||
|
||||
// var config = await trackPullConfigRepository
|
||||
// .FirstOrDefaultAsync(x => x.AppKey == input.ApiCode
|
||||
// .FirstOrDefaultAsync(x => x.AppKey == AppKey
|
||||
// && x.ServiceProviderCode == input.ApiCode);
|
||||
//
|
||||
// if (config == null) throw new BusinessException(message: "没有一个拉取配置可以适用,请配置,否则无法拉取轨迹");
|
||||
@ -267,7 +267,7 @@ public class OrderServiceV2(
|
||||
order.OrderFlights = new List<OrderFlightEntity>();
|
||||
|
||||
var config = await trackPullConfigRepository
|
||||
.FirstOrDefaultAsync(x => x.AppKey == input.ApiCode
|
||||
.FirstOrDefaultAsync(x => x.AppKey == AppKey
|
||||
&& x.ServiceProviderCode == input.ApiCode);
|
||||
|
||||
if (config == null) throw new BusinessException(message: "没有一个拉取配置可以适用,请配置,否则无法拉取轨迹");
|
||||
|
||||
@ -50,13 +50,11 @@ public class TrackOrderService : ApplicationServiceBase
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[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 pageList = await _orderRepository.GetTrackOrderPagedList(vo);
|
||||
var pageResultDto =
|
||||
ObjectMapper.Map<PagedResult<TrackOrderVO>, PagedResult<TrackOrderDto>>(pageList);
|
||||
return pageResultDto;
|
||||
return pageList;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@ -73,10 +73,55 @@ public class TrackOrderVO
|
||||
/// </summary>
|
||||
public string Customer { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 订单明细(json)
|
||||
///// </summary>
|
||||
//public string? OrderDetails { get; set; }
|
||||
/// <summary>
|
||||
/// 轨迹单号
|
||||
/// </summary>
|
||||
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>
|
||||
/// 最新轨迹状态
|
||||
@ -118,11 +163,6 @@ public class TrackOrderVO
|
||||
/// </summary>
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 应用
|
||||
/// </summary>
|
||||
public string? App { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 应用
|
||||
/// </summary>
|
||||
@ -147,9 +187,4 @@ public class TrackOrderVO
|
||||
/// 目的地时区
|
||||
/// </summary>
|
||||
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.Enums;
|
||||
using TrackCenter.Domain.Extensions;
|
||||
using TrackCenter.Domain.VEntities;
|
||||
|
||||
namespace TrackCenter.Repository.Repositories;
|
||||
|
||||
public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, ITransientDependency
|
||||
{
|
||||
|
||||
public async Task<PagedResult<TrackOrderVO>> GetTrackOrderPagedList(GetPageTrackOrderInputVO input)
|
||||
{
|
||||
//查询完去重
|
||||
@ -20,20 +18,19 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
||||
if (input.OrderNos.IsNullOrEmpty())
|
||||
{
|
||||
pageList = await Context.Queryable<OrderEntity>()
|
||||
.LeftJoin<VAppEntity>((a, c) => a.AppKey == c.AppKey && c.IsDeleted == false)
|
||||
.WhereIF(!input.AppKey.IsNullOrWhiteSpace(), (a, c) => a.AppKey == input.AppKey)
|
||||
.WhereIF(!input.AppKey.IsNullOrWhiteSpace(), a => a.AppKey == input.AppKey)
|
||||
.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),
|
||||
(a, c) => a.CreateTime >= input.CreateTimeStart)
|
||||
a => a.CreateTime >= input.CreateTimeStart)
|
||||
.WhereIF((!input.CreateTimeStart.HasValue) && input.CreateTimeEnd.HasValue,
|
||||
(a, c) => a.CreateTime <= input.CreateTimeEnd)
|
||||
.WhereIF(!input.Customer.IsNullOrWhiteSpace(), (a, c) => a.Customer.Contains(input.Customer!))
|
||||
.WhereIF(input.TrackOrderType > 0, (a, c) => a.OrderType == input.TrackOrderType)
|
||||
.WhereIF(input.TabType > 0, (a, c) => a.QuestionType == input.TabType)
|
||||
.WhereIF(input.TabType == TrackProblemType.Warn, (a , c) => !a.IsCompleted)
|
||||
.OrderByDescending((a, c) => a.CreateTime)
|
||||
.Select((a, c) => new TrackOrderVO
|
||||
a => a.CreateTime <= input.CreateTimeEnd)
|
||||
.WhereIF(!input.Customer.IsNullOrWhiteSpace(), a => a.Customer.Contains(input.Customer!))
|
||||
.WhereIF(input.TrackOrderType > 0, a => a.OrderType == input.TrackOrderType)
|
||||
.WhereIF(input.TabType > 0, a => a.QuestionType == input.TabType)
|
||||
.WhereIF(input.TabType == TrackProblemType.Warn, a => !a.IsCompleted)
|
||||
.OrderByDescending(a => a.CreateTime)
|
||||
.Select(a => new TrackOrderVO
|
||||
{
|
||||
Id = a.Id,
|
||||
OrderNumber = a.OrderNo,
|
||||
@ -48,11 +45,19 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
||||
NewestTrackTimeZone = a.LatestTrackTimeZone,
|
||||
IsFinish = a.IsCompleted,
|
||||
CreateTime = a.CreateTime,
|
||||
App = c.Name,
|
||||
AppKey = c.AppKey,
|
||||
AppKey = a.AppKey,
|
||||
DestinationTimeZone = a.DestinationTimeZone,
|
||||
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);
|
||||
}
|
||||
@ -84,21 +89,20 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
||||
}
|
||||
|
||||
pageList = await Context.Queryable<OrderEntity>()
|
||||
.Where(x => orderIds.Contains(x.Id))
|
||||
.LeftJoin<VAppEntity>((a, c) => a.AppKey == c.AppKey && c.IsDeleted == false)
|
||||
.WhereIF(!input.AppKey.IsNullOrWhiteSpace(), (a, c) => a.AppKey == input.AppKey)
|
||||
.Where(a => orderIds.Contains(a.Id))
|
||||
.WhereIF(!input.AppKey.IsNullOrWhiteSpace(), a => a.AppKey == input.AppKey)
|
||||
.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),
|
||||
(a, c) => a.CreateTime >= input.CreateTimeStart)
|
||||
a => a.CreateTime >= input.CreateTimeStart)
|
||||
.WhereIF((!input.CreateTimeStart.HasValue) && input.CreateTimeEnd.HasValue,
|
||||
(a, c) => a.CreateTime <= input.CreateTimeEnd)
|
||||
.WhereIF(!input.Customer.IsNullOrWhiteSpace(), (a, c) => a.Customer.Contains(input.Customer!))
|
||||
.WhereIF(input.TrackOrderType > 0, (a, c) => a.OrderType == input.TrackOrderType)
|
||||
.WhereIF(input.TabType > 0, (a, c) => a.QuestionType == input.TabType)
|
||||
.WhereIF(input.TabType == TrackProblemType.Warn, (a, c) => !a.IsCompleted)
|
||||
.OrderByDescending((a, c) => a.CreateTime)
|
||||
.Select((a, c) => new TrackOrderVO
|
||||
a => a.CreateTime <= input.CreateTimeEnd)
|
||||
.WhereIF(!input.Customer.IsNullOrWhiteSpace(), a => a.Customer.Contains(input.Customer!))
|
||||
.WhereIF(input.TrackOrderType > 0, a => a.OrderType == input.TrackOrderType)
|
||||
.WhereIF(input.TabType > 0, a => a.QuestionType == input.TabType)
|
||||
.WhereIF(input.TabType == TrackProblemType.Warn, a => !a.IsCompleted)
|
||||
.OrderByDescending(a => a.CreateTime)
|
||||
.Select(a => new TrackOrderVO
|
||||
{
|
||||
Id = a.Id,
|
||||
OrderNumber = a.OrderNo,
|
||||
@ -113,11 +117,19 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
||||
NewestTrackTimeZone = a.LatestTrackTimeZone,
|
||||
IsFinish = a.IsCompleted,
|
||||
CreateTime = a.CreateTime,
|
||||
App = c.Name,
|
||||
AppKey = c.AppKey,
|
||||
AppKey = a.AppKey,
|
||||
DestinationTimeZone = a.DestinationTimeZone,
|
||||
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);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user