|
@@ -1,4 +1,5 @@
|
|
|
-using Hotline.Caching.Interfaces;
|
|
|
+using Hotline.Application.Orders;
|
|
|
+using Hotline.Caching.Interfaces;
|
|
|
using Hotline.CallCenter.Calls;
|
|
|
using Hotline.FlowEngine.WorkflowModules;
|
|
|
using Hotline.FlowEngine.Workflows;
|
|
@@ -17,6 +18,7 @@ using Hotline.Share.Enums.CallCenter;
|
|
|
using Hotline.Share.Enums.FlowEngine;
|
|
|
using Hotline.Share.Enums.Order;
|
|
|
using Hotline.Share.Requests;
|
|
|
+using Hotline.Tools;
|
|
|
using MapsterMapper;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using NPOI.SS.Formula.Functions;
|
|
@@ -49,8 +51,9 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
private readonly IRepository<OrderSpecialDetail> _orderSpecialDetailRepository;
|
|
|
private readonly IRepository<WorkflowTrace> _workflowTraceRepository;
|
|
|
private readonly IRepository<OrderScreen> _orderScreenRepository;
|
|
|
+ private readonly IOrderSecondaryHandlingApplication _orderSecondaryHandlingApplication;
|
|
|
|
|
|
- public BiOrderController(
|
|
|
+ public BiOrderController(
|
|
|
IOrderRepository orderRepository,
|
|
|
IRepository<Hotspot> hotspotTypeRepository,
|
|
|
ISystemDicDataCacheManager sysDicDataCacheManager,
|
|
@@ -69,8 +72,9 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
IRepository<OrderSpecialDetail> orderSpecialDetailRepository,
|
|
|
IRepository<WorkflowTrace> workflowTraceRepository,
|
|
|
IRepository<OrderScreen> orderScreenRepository,
|
|
|
- IRepository<WorkflowStepHandler> workflowStepHandleRepository
|
|
|
- )
|
|
|
+ IRepository<WorkflowStepHandler> workflowStepHandleRepository,
|
|
|
+ IOrderSecondaryHandlingApplication orderSecondaryHandlingApplication
|
|
|
+ )
|
|
|
{
|
|
|
_orderRepository = orderRepository;
|
|
|
_hotspotTypeRepository = hotspotTypeRepository;
|
|
@@ -91,7 +95,9 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
_workflowTraceRepository = workflowTraceRepository;
|
|
|
_orderScreenRepository = orderScreenRepository;
|
|
|
_workflowStepHandleRepository = workflowStepHandleRepository;
|
|
|
- }
|
|
|
+ _orderSecondaryHandlingApplication = orderSecondaryHandlingApplication;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 部门超期统计明细
|
|
@@ -2845,17 +2851,245 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
}
|
|
|
|
|
|
|
|
|
- ///// <summary>
|
|
|
- ///// 派单量统计明细
|
|
|
- ///// </summary>
|
|
|
- ///// <param name="dto"></param>
|
|
|
- ///// <returns></returns>
|
|
|
- //[HttpGet("send_order_detail_report")]
|
|
|
- //public async Task<List<SecondaryHandlingVo>> SecondaryHandling([FromQuery] QuerySecondaryHandlingRequest dto) {
|
|
|
-
|
|
|
-
|
|
|
- //}
|
|
|
-
|
|
|
+ /// <summary>
|
|
|
+ /// 二次办理统计
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("secondary_handling_report")]
|
|
|
+ public async Task<List<SecondaryHandlingVo>> SecondaryHandlingReport([FromQuery] QuerySecondaryHandlingRequest dto)
|
|
|
+ {
|
|
|
+ var query = _orderSecondaryHandlingApplication.SecondaryHandlingReport(dto, HttpContext.RequestAborted);
|
|
|
+ return await query.ToListAsync();
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 二次办理统计导出
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("secondary_handling_report/_export")]
|
|
|
+ public async Task<FileStreamResult> SecondaryHandlingReportExport([FromBody] ExportExcelDto<QuerySecondaryHandlingRequest> dto)
|
|
|
+ {
|
|
|
+ var query = _orderSecondaryHandlingApplication.SecondaryHandlingReport(dto.QueryDto, HttpContext.RequestAborted);
|
|
|
+ List<SecondaryHandlingVo> secondaryHandling;
|
|
|
+ secondaryHandling = await query.ToListAsync(HttpContext.RequestAborted);
|
|
|
+ dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(dto.ColumnInfos);
|
|
|
+ var dtos = secondaryHandling
|
|
|
+ .Select(stu => _mapper.Map(stu, typeof(SecondaryHandlingVo), dynamicClass))
|
|
|
+ .Cast<object>()
|
|
|
+ .ToList();
|
|
|
+
|
|
|
+ var stream = ExcelHelper.CreateStream(dtos);
|
|
|
+
|
|
|
+ return ExcelStreamResult(stream, "二次办理统计数据");
|
|
|
+ }
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 二次办理明细
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("secondary_handling_detail_report")]
|
|
|
+ public async Task<PagedDto<OrderSecondaryHandlingDto>> SecondaryHandlingDetailReport([FromQuery] QuerySecondaryHandlingRequest dto)
|
|
|
+ {
|
|
|
+ var query = _orderSecondaryHandlingApplication.SecondaryHandlingDetailReport(dto, HttpContext.RequestAborted);
|
|
|
+ var (total, items) = await query.ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
+
|
|
|
+ return new PagedDto<OrderSecondaryHandlingDto>(total, _mapper.Map<IReadOnlyList<OrderSecondaryHandlingDto>>(items));
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 二次办理明细导出
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("secondary_handling_detail_report/_export")]
|
|
|
+ public async Task<FileStreamResult> SecondaryHandlingDetailReportExport([FromBody] ExportExcelDto<QuerySecondaryHandlingRequest> dto)
|
|
|
+ {
|
|
|
+ var query = _orderSecondaryHandlingApplication.SecondaryHandlingDetailReport(dto.QueryDto, HttpContext.RequestAborted);
|
|
|
+ List<OrderSecondaryHandling> secondaryHandling;
|
|
|
+ if (dto.IsExportAll)
|
|
|
+ {
|
|
|
+ secondaryHandling = await query.ToListAsync(HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var (_, items) = await query.ToPagedListAsync(dto.QueryDto, HttpContext.RequestAborted);
|
|
|
+ secondaryHandling = items;
|
|
|
+ }
|
|
|
+
|
|
|
+ var secondaryHandlingDtos = _mapper.Map<ICollection<OrderSecondaryHandlingDto>>(secondaryHandling);
|
|
|
+
|
|
|
+ dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(dto.ColumnInfos);
|
|
|
+
|
|
|
+ var dtos = secondaryHandlingDtos
|
|
|
+ .Select(stu => _mapper.Map(stu, typeof(OrderSecondaryHandlingDto), dynamicClass))
|
|
|
+ .Cast<object>()
|
|
|
+ .ToList();
|
|
|
+
|
|
|
+ var stream = ExcelHelper.CreateStream(dtos);
|
|
|
+
|
|
|
+ return ExcelStreamResult(stream, "二次办理列表数据");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 二次办理满意度统计
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("secondary_handling_satisfaction_report")]
|
|
|
+ public async Task<List<SecondaryHandlingSatisfactionVo>> SecondaryHandlingSatisfactionReport([FromQuery] QuerySecondaryHandlingRequest dto)
|
|
|
+ {
|
|
|
+ var query = _orderSecondaryHandlingApplication.SecondaryHandlingSatisfactionReport(dto, HttpContext.RequestAborted);
|
|
|
+ var list = await query.ToListAsync();
|
|
|
+ //总计
|
|
|
+ var total = new SecondaryHandlingSatisfactionVo
|
|
|
+ {
|
|
|
+ TotalSumCount = list.Select(x => x.TotalSumCount).Sum(),
|
|
|
+ VerySatisfiedCount = list.Select(x => x.VerySatisfiedCount).Sum(),
|
|
|
+ SatisfiedCount = list.Select(x => x.SatisfiedCount).Sum(),
|
|
|
+ RegardedAsSatisfiedCount = list.Select(x => x.RegardedAsSatisfiedCount).Sum(),
|
|
|
+ DefaultSatisfiedCount = list.Select(x => x.DefaultSatisfiedCount).Sum(),
|
|
|
+ NoSatisfiedCount = list.Select(x => x.NoSatisfiedCount).Sum(),
|
|
|
+ NoEvaluateCount = list.Select(x => x.NoEvaluateCount).Sum(),
|
|
|
+ NoPutThroughCount = list.Select(x => x.NoPutThroughCount).Sum()
|
|
|
+ };
|
|
|
+ list.Add(total);
|
|
|
+ //区县合计
|
|
|
+ var countyList = list.Where(x => x.OrgType == EOrgType.County).ToList();
|
|
|
+ var countyTotal = new SecondaryHandlingSatisfactionVo
|
|
|
+ {
|
|
|
+ TotalSumCount = countyList.Select(x => x.TotalSumCount).Sum(),
|
|
|
+ VerySatisfiedCount = countyList.Select(x => x.VerySatisfiedCount).Sum(),
|
|
|
+ SatisfiedCount = countyList.Select(x => x.SatisfiedCount).Sum(),
|
|
|
+ RegardedAsSatisfiedCount = countyList.Select(x => x.RegardedAsSatisfiedCount).Sum(),
|
|
|
+ DefaultSatisfiedCount = countyList.Select(x => x.DefaultSatisfiedCount).Sum(),
|
|
|
+ NoSatisfiedCount = countyList.Select(x => x.NoSatisfiedCount).Sum(),
|
|
|
+ NoEvaluateCount = countyList.Select(x => x.NoEvaluateCount).Sum(),
|
|
|
+ NoPutThroughCount = countyList.Select(x => x.NoPutThroughCount).Sum()
|
|
|
+ };
|
|
|
+ list.Add(countyTotal);
|
|
|
+ //市直合计
|
|
|
+ var cityList = list.Where(x => x.OrgType == EOrgType.City).ToList();
|
|
|
+ var cityTotal = new SecondaryHandlingSatisfactionVo
|
|
|
+ {
|
|
|
+ TotalSumCount = cityList.Select(x => x.TotalSumCount).Sum(),
|
|
|
+ VerySatisfiedCount = cityList.Select(x => x.VerySatisfiedCount).Sum(),
|
|
|
+ SatisfiedCount = cityList.Select(x => x.SatisfiedCount).Sum(),
|
|
|
+ RegardedAsSatisfiedCount = cityList.Select(x => x.RegardedAsSatisfiedCount).Sum(),
|
|
|
+ DefaultSatisfiedCount = cityList.Select(x => x.DefaultSatisfiedCount).Sum(),
|
|
|
+ NoSatisfiedCount = cityList.Select(x => x.NoSatisfiedCount).Sum(),
|
|
|
+ NoEvaluateCount = cityList.Select(x => x.NoEvaluateCount).Sum(),
|
|
|
+ NoPutThroughCount = cityList.Select(x => x.NoPutThroughCount).Sum()
|
|
|
+ };
|
|
|
+ list.Add(cityTotal);
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 二次办理满意度统计导出
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("secondary_handling_satisfaction_report/_export")]
|
|
|
+ public async Task<FileStreamResult> SecondaryHandlingSatisfactionReportExport([FromBody] ExportExcelDto<QuerySecondaryHandlingRequest> dto)
|
|
|
+ {
|
|
|
+ var query = _orderSecondaryHandlingApplication.SecondaryHandlingSatisfactionReport(dto.QueryDto, HttpContext.RequestAborted);
|
|
|
+ List<SecondaryHandlingSatisfactionVo> secondaryHandling;
|
|
|
+ secondaryHandling = await query.ToListAsync(HttpContext.RequestAborted);
|
|
|
+ //总计
|
|
|
+ var total = new SecondaryHandlingSatisfactionVo
|
|
|
+ {
|
|
|
+ TotalSumCount = secondaryHandling.Select(x => x.TotalSumCount).Sum(),
|
|
|
+ VerySatisfiedCount = secondaryHandling.Select(x => x.VerySatisfiedCount).Sum(),
|
|
|
+ SatisfiedCount = secondaryHandling.Select(x => x.SatisfiedCount).Sum(),
|
|
|
+ RegardedAsSatisfiedCount = secondaryHandling.Select(x => x.RegardedAsSatisfiedCount).Sum(),
|
|
|
+ DefaultSatisfiedCount = secondaryHandling.Select(x => x.DefaultSatisfiedCount).Sum(),
|
|
|
+ NoSatisfiedCount = secondaryHandling.Select(x => x.NoSatisfiedCount).Sum(),
|
|
|
+ NoEvaluateCount = secondaryHandling.Select(x => x.NoEvaluateCount).Sum(),
|
|
|
+ NoPutThroughCount = secondaryHandling.Select(x => x.NoPutThroughCount).Sum()
|
|
|
+ };
|
|
|
+ secondaryHandling.Add(total);
|
|
|
+ //区县合计
|
|
|
+ var countyList = secondaryHandling.Where(x => x.OrgType == EOrgType.County).ToList();
|
|
|
+ var countyTotal = new SecondaryHandlingSatisfactionVo
|
|
|
+ {
|
|
|
+ TotalSumCount = countyList.Select(x => x.TotalSumCount).Sum(),
|
|
|
+ VerySatisfiedCount = countyList.Select(x => x.VerySatisfiedCount).Sum(),
|
|
|
+ SatisfiedCount = countyList.Select(x => x.SatisfiedCount).Sum(),
|
|
|
+ RegardedAsSatisfiedCount = countyList.Select(x => x.RegardedAsSatisfiedCount).Sum(),
|
|
|
+ DefaultSatisfiedCount = countyList.Select(x => x.DefaultSatisfiedCount).Sum(),
|
|
|
+ NoSatisfiedCount = countyList.Select(x => x.NoSatisfiedCount).Sum(),
|
|
|
+ NoEvaluateCount = countyList.Select(x => x.NoEvaluateCount).Sum(),
|
|
|
+ NoPutThroughCount = countyList.Select(x => x.NoPutThroughCount).Sum()
|
|
|
+ };
|
|
|
+ secondaryHandling.Add(countyTotal);
|
|
|
+ //市直合计
|
|
|
+ var cityList = secondaryHandling.Where(x => x.OrgType == EOrgType.City).ToList();
|
|
|
+ var cityTotal = new SecondaryHandlingSatisfactionVo
|
|
|
+ {
|
|
|
+ TotalSumCount = cityList.Select(x => x.TotalSumCount).Sum(),
|
|
|
+ VerySatisfiedCount = cityList.Select(x => x.VerySatisfiedCount).Sum(),
|
|
|
+ SatisfiedCount = cityList.Select(x => x.SatisfiedCount).Sum(),
|
|
|
+ RegardedAsSatisfiedCount = cityList.Select(x => x.RegardedAsSatisfiedCount).Sum(),
|
|
|
+ DefaultSatisfiedCount = cityList.Select(x => x.DefaultSatisfiedCount).Sum(),
|
|
|
+ NoSatisfiedCount = cityList.Select(x => x.NoSatisfiedCount).Sum(),
|
|
|
+ NoEvaluateCount = cityList.Select(x => x.NoEvaluateCount).Sum(),
|
|
|
+ NoPutThroughCount = cityList.Select(x => x.NoPutThroughCount).Sum()
|
|
|
+ };
|
|
|
+ secondaryHandling.Add(cityTotal);
|
|
|
+
|
|
|
+ dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(dto.ColumnInfos);
|
|
|
+ var dtos = secondaryHandling
|
|
|
+ .Select(stu => _mapper.Map(stu, typeof(SecondaryHandlingSatisfactionVo), dynamicClass))
|
|
|
+ .Cast<object>()
|
|
|
+ .ToList();
|
|
|
+
|
|
|
+ var stream = ExcelHelper.CreateStream(dtos);
|
|
|
+
|
|
|
+ return ExcelStreamResult(stream, "二次办理满意度统计数据");
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 二次办理满意度明细
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("secondary_handling_satisfaction_detail_report")]
|
|
|
+ public async Task<PagedDto<OrderSecondaryHandlingDto>> SecondaryHandlingSatisfactionDetailReport([FromQuery] QuerySecondaryHandlingRequest dto)
|
|
|
+ {
|
|
|
+ var query = _orderSecondaryHandlingApplication.SecondaryHandlingSatisfactionDetailReport(dto, HttpContext.RequestAborted);
|
|
|
+ var (total, items) = await query.ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
+
|
|
|
+ return new PagedDto<OrderSecondaryHandlingDto>(total, _mapper.Map<IReadOnlyList<OrderSecondaryHandlingDto>>(items));
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 二次办理满意度明细导出
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("secondary_handling_satisfaction_detail_report/_export")]
|
|
|
+ public async Task<FileStreamResult> SecondaryHandlingSatisfactionDetailReport([FromBody] ExportExcelDto<QuerySecondaryHandlingRequest> dto)
|
|
|
+ {
|
|
|
+ var query = _orderSecondaryHandlingApplication.SecondaryHandlingSatisfactionDetailReport(dto.QueryDto, HttpContext.RequestAborted);
|
|
|
+ List<OrderSecondaryHandling> secondaryHandling;
|
|
|
+ if (dto.IsExportAll)
|
|
|
+ {
|
|
|
+ secondaryHandling = await query.ToListAsync(HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var (_, items) = await query.ToPagedListAsync(dto.QueryDto, HttpContext.RequestAborted);
|
|
|
+ secondaryHandling = items;
|
|
|
+ }
|
|
|
+
|
|
|
+ var secondaryHandlingDtos = _mapper.Map<ICollection<OrderSecondaryHandlingDto>>(secondaryHandling);
|
|
|
+
|
|
|
+ dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(dto.ColumnInfos);
|
|
|
+
|
|
|
+ var dtos = secondaryHandlingDtos
|
|
|
+ .Select(stu => _mapper.Map(stu, typeof(OrderSecondaryHandlingDto), dynamicClass))
|
|
|
+ .Cast<object>()
|
|
|
+ .ToList();
|
|
|
+
|
|
|
+ var stream = ExcelHelper.CreateStream(dtos);
|
|
|
+
|
|
|
+ return ExcelStreamResult(stream, "二次办理满意度列表数据");
|
|
|
+ }
|
|
|
}
|
|
|
}
|