fix:调整订单拉取成功添加轨迹时轨迹明细存储的第三方单号改为主单单号
This commit is contained in:
parent
ca60feccb5
commit
3c202c2a1f
@ -123,11 +123,11 @@ public class TrackRefreshEventHandler : ITransientDependency, IRabbitHandler
|
||||
var context = new TrackRefreshContext
|
||||
{
|
||||
OrderId = order.MainOrderId,
|
||||
OrderType = attach.OrderType,
|
||||
OrderNo = orderNo!,
|
||||
ServiceProviderCode = attach.ServiceProviderCode,
|
||||
OrderNo = order.OrderNo,
|
||||
CustomId = order.CustomId,
|
||||
SubSystemId = attach.SubSystemId
|
||||
OrderType = attach.OrderType,
|
||||
SubSystemId = attach.SubSystemId,
|
||||
ServiceProviderCode = attach.ServiceProviderCode
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,8 @@ public interface IOrderRepository : IBasicRepository<OrderEntity>
|
||||
/// </summary>
|
||||
/// <param name="serviceProviderCode">三方平台</param>
|
||||
/// <param name="orderNo">三方平台单号</param>
|
||||
/// <returns>(主单号id,客户id)</returns>
|
||||
Task<(int MainOrderId, int CustomId)> GetTrackOrderByProviderAndOrderNo(string serviceProviderCode, string orderNo);
|
||||
/// <returns>(主单id,主单号,客户id)</returns>
|
||||
Task<(int MainOrderId, string OrderNo, int CustomId)> GetTrackOrderByProviderAndOrderNo(string serviceProviderCode, string orderNo);
|
||||
|
||||
/// <summary>
|
||||
/// 创建订单
|
||||
|
||||
@ -236,7 +236,7 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
||||
return pageList;
|
||||
}
|
||||
|
||||
public async Task<(int MainOrderId, int CustomId)> GetTrackOrderByProviderAndOrderNo(string serviceProviderCode, string orderNo)
|
||||
public async Task<(int MainOrderId, string OrderNo, int CustomId)> GetTrackOrderByProviderAndOrderNo(string serviceProviderCode, string orderNo)
|
||||
{
|
||||
var orderList = await Context.Queryable<OrderEntity>()
|
||||
.LeftJoin<OrderPlatformNumberEntity>((a, b) => a.Id == b.OrderId && b.IsDeleted == false)
|
||||
@ -246,6 +246,7 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
||||
{
|
||||
a.Id,
|
||||
a.CustomId,
|
||||
a.OrderNo,
|
||||
b.Platform,
|
||||
b.OrderNumber
|
||||
})
|
||||
@ -260,8 +261,8 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
||||
//当出现了多条记录匹配,优先使用外部单匹配提升精确度
|
||||
var matchOrder = orderList.FirstOrDefault(x => x.Platform == serviceProviderCode && x.OrderNumber == orderNo);
|
||||
return matchOrder != null
|
||||
? (matchOrder.Id, matchOrder.CustomId)
|
||||
: (order.Id, order.CustomId);
|
||||
? (matchOrder.Id, matchOrder.OrderNo, matchOrder.CustomId)
|
||||
: (order.Id, order.OrderNo, order.CustomId);
|
||||
}
|
||||
|
||||
public async Task<int> CreateOrderAsync(OrderEntity order)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user