|
@@ -8,6 +8,7 @@ using Hotline.Repository.SqlSugar.Extensions;
|
|
|
using Hotline.Schedulings;
|
|
|
using Hotline.Settings;
|
|
|
using Hotline.Settings.Hotspots;
|
|
|
+using Hotline.Settings.TimeLimits;
|
|
|
using Hotline.Share.Dtos;
|
|
|
using Hotline.Share.Dtos.Bi;
|
|
|
using Hotline.Share.Dtos.Bigscreen;
|
|
@@ -52,8 +53,10 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
private readonly IRepository<WorkflowTrace> _workflowTraceRepository;
|
|
|
private readonly IRepository<OrderScreen> _orderScreenRepository;
|
|
|
private readonly IOrderSecondaryHandlingApplication _orderSecondaryHandlingApplication;
|
|
|
+ private readonly IOrderApplication _orderApplication;
|
|
|
+ private readonly ITimeLimitDomainService _timeLimitDomainService;
|
|
|
|
|
|
- public BiOrderController(
|
|
|
+ public BiOrderController(
|
|
|
IOrderRepository orderRepository,
|
|
|
IRepository<Hotspot> hotspotTypeRepository,
|
|
|
ISystemDicDataCacheManager sysDicDataCacheManager,
|
|
@@ -73,8 +76,10 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
IRepository<WorkflowTrace> workflowTraceRepository,
|
|
|
IRepository<OrderScreen> orderScreenRepository,
|
|
|
IRepository<WorkflowStepHandler> workflowStepHandleRepository,
|
|
|
- IOrderSecondaryHandlingApplication orderSecondaryHandlingApplication
|
|
|
- )
|
|
|
+ IOrderSecondaryHandlingApplication orderSecondaryHandlingApplication,
|
|
|
+ IOrderApplication orderApplication,
|
|
|
+ ITimeLimitDomainService timeLimitDomainService
|
|
|
+ )
|
|
|
{
|
|
|
_orderRepository = orderRepository;
|
|
|
_hotspotTypeRepository = hotspotTypeRepository;
|
|
@@ -96,8 +101,9 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
_orderScreenRepository = orderScreenRepository;
|
|
|
_workflowStepHandleRepository = workflowStepHandleRepository;
|
|
|
_orderSecondaryHandlingApplication = orderSecondaryHandlingApplication;
|
|
|
-
|
|
|
- }
|
|
|
+ _orderApplication = orderApplication;
|
|
|
+ _timeLimitDomainService = timeLimitDomainService;
|
|
|
+ }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 部门超期统计明细
|
|
@@ -3148,5 +3154,62 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
|
|
|
return ExcelStreamResult(stream, "二次办理满意度列表数据");
|
|
|
}
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 未签收统计
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("unsigned_order_report")]
|
|
|
+ public async Task<PagedDto<UnsignedOrderDto>> UnsignedOrderReport([FromQuery] QueryUnsignedOrdersRequest dto)
|
|
|
+ {
|
|
|
+ var query = _orderApplication.QueryUnsignedOrders(dto);
|
|
|
+ var (total, items) = await query.Select((x,ws)=> new UnsignedOrder { order = x , workflowStep = ws }).ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
+ var itemsVo = _mapper.Map<IReadOnlyList<UnsignedOrderDto>>(items);
|
|
|
+ foreach (var item in itemsVo)
|
|
|
+ {
|
|
|
+ item.UnsignedTime = _timeLimitDomainService.CalcWorkTimeToHour(item.workflowStep.CreationTime, item.workflowStep.Status == EWorkflowStepStatus.WaitForAccept ? DateTime.Now : item.workflowStep.AcceptTime!.Value, false);
|
|
|
+ }
|
|
|
+ return new PagedDto<UnsignedOrderDto>(total, itemsVo);
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 未签收统计导出
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("unsigned_order_report/_export")]
|
|
|
+ public async Task<FileStreamResult> UnsignedOrdersReportReport([FromBody] ExportExcelDto<QueryUnsignedOrdersRequest> dto)
|
|
|
+ {
|
|
|
+ var query = _orderApplication.QueryUnsignedOrders(dto.QueryDto).Select((x, ws) => new UnsignedOrder { order = x, workflowStep = ws });
|
|
|
+ List<UnsignedOrder> unsignedOrders;
|
|
|
+ if (dto.IsExportAll)
|
|
|
+ {
|
|
|
+ unsignedOrders = await query.ToListAsync(HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var (_, items) = await query.ToPagedListAsync(dto.QueryDto, HttpContext.RequestAborted);
|
|
|
+ unsignedOrders = items;
|
|
|
+ }
|
|
|
+
|
|
|
+ var secondaryHandlingDtos = _mapper.Map<ICollection<UnsignedOrderDto>>(unsignedOrders);
|
|
|
+
|
|
|
+ foreach (var item in secondaryHandlingDtos)
|
|
|
+ {
|
|
|
+ item.UnsignedTime = _timeLimitDomainService.CalcWorkTimeToHour(item.workflowStep.CreationTime, item.workflowStep.Status == EWorkflowStepStatus.WaitForAccept ? DateTime.Now : item.workflowStep.AcceptTime!.Value, false);
|
|
|
+ }
|
|
|
+
|
|
|
+ dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(dto.ColumnInfos);
|
|
|
+
|
|
|
+ var dtos = secondaryHandlingDtos
|
|
|
+ .Select(stu => _mapper.Map(stu, typeof(UnsignedOrderDto), dynamicClass))
|
|
|
+ .Cast<object>()
|
|
|
+ .ToList();
|
|
|
+
|
|
|
+ var stream = ExcelHelper.CreateStream(dtos);
|
|
|
+
|
|
|
+ return ExcelStreamResult(stream, "未签收统计列表数据");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|