Merge branch 'S07' into test

This commit is contained in:
hardstylewyl 2025-04-30 10:56:15 +08:00
commit 903a44ceaa
3 changed files with 10 additions and 9 deletions

View File

@ -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
};

View File

@ -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>
/// 创建订单

View File

@ -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)