fix: 修复查询轨迹通过订单号+子系统id查询失败

This commit is contained in:
云龙 王 2024-12-04 09:55:13 +08:00
parent 01c4503158
commit ac5028587f

View File

@ -127,13 +127,13 @@ public class TrackOrderService : ApplicationService
if (whereExpression == default) if (whereExpression == default)
throw new BusinessException(message: "请求参数异常"); throw new BusinessException(message: "请求参数异常");
var subSystemId = await _orderRepository.GetFirstAsync(whereExpression, x => x.SubSystemId); var order = await _orderRepository.GetFirstAsync(whereExpression);
if (subSystemId == default) if (order == default)
{ {
throw new BusinessException(message: "订单不存在"); throw new BusinessException(message: "订单不存在");
} }
var trackDetails = await _trackDetailsEsRepository.GetListAsync(orderId ?? 0); var trackDetails = await _trackDetailsEsRepository.GetListAsync(order.Id);
if (trackDetails.IsNullOrEmpty()) if (trackDetails.IsNullOrEmpty())
{ {
return new List<TrackOrderDetailDto>(); return new List<TrackOrderDetailDto>();
@ -150,7 +150,7 @@ public class TrackOrderService : ApplicationService
if (!trackCodes.IsNullOrEmpty()) if (!trackCodes.IsNullOrEmpty())
{ {
var trackContents = await _trackContentRepository.GetListAsync(x => var trackContents = await _trackContentRepository.GetListAsync(x =>
x.SubSystemId == subSystemId && trackCodes.Contains(x.Code), x => new x.SubSystemId == order.SubSystemId && trackCodes.Contains(x.Code), x => new
{ {
x.Code, x.Code,
x.IsExternal x.IsExternal