|
@@ -1,6 +1,7 @@
|
|
|
using Hotline.Orders;
|
|
|
using Hotline.Repository.SqlSugar.Extensions;
|
|
|
using Hotline.Share.Dtos;
|
|
|
+using Hotline.Share.Dtos.Order;
|
|
|
using Hotline.Share.Dtos.ProvinceStatistics;
|
|
|
using Hotline.Share.Enums.Order;
|
|
|
using MapsterMapper;
|
|
@@ -24,6 +25,8 @@ namespace Hotline.Api.Controllers
|
|
|
private readonly IRepository<OrderUrge> _orderUrgeRepository;
|
|
|
private readonly IRepository<OrderComplement> _orderComplementRepository;
|
|
|
private readonly IRepository<OrderSupervise> _orderSuperviseRepository;
|
|
|
+ private readonly IOrderRepository _orderRepository;
|
|
|
+ private readonly IRepository<OrderExtension> _orderExtensionRepository;
|
|
|
|
|
|
|
|
|
public ProvinceStatisticsController(IMapper mapper,
|
|
@@ -35,7 +38,9 @@ namespace Hotline.Api.Controllers
|
|
|
IRepository<OrderWarning> orderWarningRepository,
|
|
|
IRepository<OrderUrge> orderUrgeRepository,
|
|
|
IRepository<OrderComplement> orderComplementRepository,
|
|
|
- IRepository<OrderSupervise> orderSuperviseRepository)
|
|
|
+ IRepository<OrderSupervise> orderSuperviseRepository,
|
|
|
+ IOrderRepository orderRepository,
|
|
|
+ IRepository<OrderExtension> orderExtensionRepository)
|
|
|
{
|
|
|
_mapper = mapper;
|
|
|
_sessionContext = sessionContext;
|
|
@@ -47,6 +52,8 @@ namespace Hotline.Api.Controllers
|
|
|
_orderUrgeRepository = orderUrgeRepository;
|
|
|
_orderComplementRepository = orderComplementRepository;
|
|
|
_orderSuperviseRepository = orderSuperviseRepository;
|
|
|
+ _orderRepository = orderRepository;
|
|
|
+ _orderExtensionRepository = orderExtensionRepository;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -411,5 +418,39 @@ namespace Hotline.Api.Controllers
|
|
|
return data;
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 查询省拓展信息
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("get_province_order_extension")]
|
|
|
+ public async Task<PagedDto<OrderDto>> GetProvinceOrderExtension([FromQuery] QueryProvinceSendBackDto dto)
|
|
|
+ {
|
|
|
+ var (total, items) = await _orderRepository.Queryable()
|
|
|
+ .Includes(p => p.OrderExtension)
|
|
|
+ .Where(p => p.OrderExtension.Id != null && p.Source != ESource.ProvinceStraight)
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.No), p => p.No == dto.No)
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Title), p => p.Title == dto.Title)
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.ProvinceNo), p => p.ProvinceNo == dto.ProvinceNo)
|
|
|
+ .WhereIF(dto.ApplyStartTime.HasValue, p => p.CreationTime >= dto.ApplyStartTime.Value)
|
|
|
+ .WhereIF(dto.ApplyEndTime.HasValue, p => p.CreationTime <= dto.ApplyEndTime.Value)
|
|
|
+ .OrderByDescending(p => p.CreationTime)
|
|
|
+ .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
+ return new PagedDto<OrderDto>(total, _mapper.Map<IReadOnlyList<OrderDto>>(items));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 查询拓展信息详情
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="id"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("get_order_extension_info")]
|
|
|
+ public async Task<OrderExtension> GetOrderExtensionInfo(string id)
|
|
|
+ {
|
|
|
+ var data = await _orderExtensionRepository.GetAsync(p => p.Id == id, HttpContext.RequestAborted);
|
|
|
+ if (data == null)
|
|
|
+ throw UserFriendlyException.SameMessage("拓展信息查询失败");
|
|
|
+ return data;
|
|
|
+ }
|
|
|
}
|
|
|
}
|