|
@@ -41,9 +41,9 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
private readonly IRepository<AiOrderVisitDetail> _aiOrderVisitDetailRepository;
|
|
|
private readonly ISessionContext _sessionContext;
|
|
|
private readonly ISystemSettingCacheManager _systemSettingCacheManager;
|
|
|
+ private readonly IRepository<OrderSpecialDetail> _orderSpecialDetailRepository;
|
|
|
|
|
|
-
|
|
|
- public BiOrderController(
|
|
|
+ public BiOrderController(
|
|
|
IOrderRepository orderRepository,
|
|
|
IRepository<Hotspot> hotspotTypeRepository,
|
|
|
ISystemDicDataCacheManager sysDicDataCacheManager,
|
|
@@ -58,8 +58,9 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
IRepository<SystemOrganize> systemOrganizeRepository,
|
|
|
IRepository<AiOrderVisitDetail> aiOrderVisitDetailRepository,
|
|
|
ISessionContext sessionContext,
|
|
|
- ISystemSettingCacheManager systemSettingCacheManager
|
|
|
- )
|
|
|
+ ISystemSettingCacheManager systemSettingCacheManager,
|
|
|
+ IRepository<OrderSpecialDetail> orderSpecialDetailRepository
|
|
|
+ )
|
|
|
{
|
|
|
_orderRepository = orderRepository;
|
|
|
_hotspotTypeRepository = hotspotTypeRepository;
|
|
@@ -76,7 +77,9 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
_aiOrderVisitDetailRepository = aiOrderVisitDetailRepository;
|
|
|
_sessionContext = sessionContext;
|
|
|
_systemSettingCacheManager = systemSettingCacheManager;
|
|
|
- }
|
|
|
+ _orderSpecialDetailRepository = orderSpecialDetailRepository;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
//public async Task OrgDataListDetail([FromQuery] OrgDataListDetailRequest dto)
|
|
|
//{
|
|
@@ -1552,5 +1555,56 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
return new PagedDto<OrderDto>(total, _mapper.Map<IReadOnlyList<OrderDto>>(items));
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 回退错件
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("reTransact")]
|
|
|
+ public async Task<PagedDto<OrderReTransactVo>> OrderReTransact([FromQuery] ReportPagedRequest dto)
|
|
|
+ {
|
|
|
+ if (!dto.StartTime.HasValue || !dto.EndTime.HasValue)
|
|
|
+ throw UserFriendlyException.SameMessage("请选择时间!");
|
|
|
+
|
|
|
+ var (total, items) = await _orderSpecialDetailRepository.Queryable()
|
|
|
+ .Includes(x=>x.OrderSpecial)
|
|
|
+ .Where(x => x.OrderSpecial.ESpecialType == ESpecialType.ReTransact)
|
|
|
+ .Where(x => x.OrderSpecial.CreationTime >= dto.StartTime)
|
|
|
+ .Where(x => x.OrderSpecial.CreationTime <= dto.EndTime)
|
|
|
+ .GroupBy(x => new { x.OrgId, x.OrgName })
|
|
|
+ .Select(x => new OrderReTransactVo
|
|
|
+ {
|
|
|
+ OrgId = x.OrgId,
|
|
|
+ OrgName = x.OrgName,
|
|
|
+ Num = SqlFunc.AggregateCount(1)
|
|
|
+ }).MergeTable()
|
|
|
+ .OrderByIF(dto.SortRule == 0, x => x.Num, OrderByType.Asc)
|
|
|
+ .OrderByIF(dto.SortRule == 1, x => x.Num, OrderByType.Desc)
|
|
|
+ .ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
+ return new PagedDto<OrderReTransactVo>(total, _mapper.Map<IReadOnlyList<OrderReTransactVo>>(items));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 回退错件明细
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("reTransact_detail")]
|
|
|
+ public async Task<PagedDto<OrderSpecialDto>> OrderReTransactDetail([FromQuery] QueryOrderReTransactDetailRequest dto)
|
|
|
+ {
|
|
|
+ if (!dto.StartTime.HasValue || !dto.EndTime.HasValue)
|
|
|
+ throw UserFriendlyException.SameMessage("请选择时间!");
|
|
|
+ var (total, items) = await _orderSpecialDetailRepository.Queryable()
|
|
|
+ .Includes(x => x.OrderSpecial)
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.OrgName),x=>x.OrgName.Contains(dto.OrgName!))
|
|
|
+ .Where(x => x.OrderSpecial.ESpecialType == ESpecialType.ReTransact)
|
|
|
+ .Where(x => x.OrderSpecial.CreationTime >= dto.StartTime)
|
|
|
+ .Where(x => x.OrderSpecial.CreationTime <= dto.EndTime)
|
|
|
+ .ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
+ return new PagedDto<OrderSpecialDto>(total, _mapper.Map<IReadOnlyList<OrderSpecialDto>>(items));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|