调整参数必填
This commit is contained in:
parent
99bf506ab7
commit
aa6b269f21
@ -113,22 +113,25 @@ public class TrackOrderService : ApplicationService
|
||||
/// <param name="systemId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("GetDetails")]
|
||||
public async Task<List<TrackOrderDetailDto>> GetTracksAsync(int orderId, string? orderNo, int systemId)
|
||||
public async Task<List<TrackOrderDetailDto>> GetTracksAsync(int? orderId, string? orderNo, int? systemId)
|
||||
{
|
||||
Expression<Func<OrderEntity, bool>> whereExpression = null;
|
||||
if (orderId > 0)
|
||||
if (orderId != null && orderId > 0)
|
||||
whereExpression = m => m.Id == orderId;
|
||||
|
||||
if (string.IsNullOrEmpty(orderNo) && systemId > 0)
|
||||
if (string.IsNullOrEmpty(orderNo) && systemId != null && systemId > 0)
|
||||
whereExpression = m => m.OrderNo == orderNo && m.SubSystemId == systemId;
|
||||
|
||||
if (orderId == default && orderNo == default && systemId == default)
|
||||
throw new BusinessException(message: "请求参数异常");
|
||||
|
||||
var subSystemId = await _orderRepository.GetFirstAsync(whereExpression, x => x.SubSystemId);
|
||||
if (subSystemId == default)
|
||||
{
|
||||
throw new BusinessException(message: "订单不存在");
|
||||
}
|
||||
|
||||
var trackDetails = await _trackDetailsEsRepository.GetListAsync(orderId);
|
||||
var trackDetails = await _trackDetailsEsRepository.GetListAsync(orderId ?? 0);
|
||||
if (trackDetails.IsNullOrEmpty())
|
||||
{
|
||||
return new List<TrackOrderDetailDto>();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user