|
@@ -1,7 +1,6 @@
|
|
|
using Amazon.Runtime.Internal.Transform;
|
|
|
using Hotline.Application.ExportExcel;
|
|
|
using Hotline.Application.FlowEngine;
|
|
|
-using Hotline.Application.Orders;
|
|
|
using Hotline.Application.StatisticalReport;
|
|
|
using Hotline.Application.Systems;
|
|
|
using Hotline.Caching.Interfaces;
|
|
@@ -48,6 +47,7 @@ using Hotline.Share.Dtos.File;
|
|
|
using Hotline.File;
|
|
|
using Hotline.KnowledgeBase;
|
|
|
using DocumentFormat.OpenXml.Vml.Spreadsheet;
|
|
|
+using Hotline.Application.OrderApp;
|
|
|
using Hotline.Share.Tools;
|
|
|
using MediatR;
|
|
|
using static Hotline.AppDefaults;
|
|
@@ -3181,7 +3181,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 部门受理类型统计(宜宾原始功能)
|
|
|
+ /// 部门受理类型统计(宜宾功能)
|
|
|
/// </summary>
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
@@ -3301,6 +3301,192 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
return new { DataList = items, CountySumModel = countySumModel, CitySumModel = citySumModel, SumModel = sumModel };
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 部门受理类型统计(宜宾功能)---导出
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("department_acceptance_type_statistics_export_v1")]
|
|
|
+ public async Task<FileStreamResult> ExportDepartmentAcceptanceTypeStatisticsV1([FromBody] ExportExcelDto<DepartmentKeyWordRequest> dto)
|
|
|
+ {
|
|
|
+ var query = _orderReportApplication.DepartmentAcceptanceTypeStatisticsV1(dto.QueryDto);
|
|
|
+ List<DepartmentAcceptanceTypeStatisticsV1Dto> list;
|
|
|
+ if (dto.IsExportAll)
|
|
|
+ {
|
|
|
+ list = await query.ToListAsync(HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var (_, items) = await query.ToPagedListAsync(dto.QueryDto, HttpContext.RequestAborted);
|
|
|
+ list = items;
|
|
|
+ }
|
|
|
+
|
|
|
+ list.Add(new DepartmentAcceptanceTypeStatisticsV1Dto
|
|
|
+ {
|
|
|
+ OrgName = "区县合计",
|
|
|
+ OrgCode = "",
|
|
|
+ OrgTypeText = "",
|
|
|
+ ZxAllCount = list.Where(x => x.OrgType == EOrgType.County).Sum(p => p.ZxAllCount),
|
|
|
+ ZxAcceptanceTypeCode = "10",
|
|
|
+
|
|
|
+ JyAllCount = list.Where(x => x.OrgType == EOrgType.County).Sum(p => p.JyAllCount),
|
|
|
+ JyAcceptanceTypeCode = "15",
|
|
|
+
|
|
|
+ QzAllCount = list.Where(x => x.OrgType == EOrgType.County).Sum(p => p.QzAllCount),
|
|
|
+ QzAcceptanceTypeCode = "20",
|
|
|
+
|
|
|
+ ByAllCount = list.Where(x => x.OrgType == EOrgType.County).Sum(p => p.ByAllCount),
|
|
|
+ ByAcceptanceTypeCode = "25",
|
|
|
+
|
|
|
+ JbAllCount = list.Where(x => x.OrgType == EOrgType.County).Sum(p => p.JbAllCount),
|
|
|
+ JbAcceptanceTypeCode = "30",
|
|
|
+
|
|
|
+ TsAllCount = list.Where(x => x.OrgType == EOrgType.County).Sum(p => p.TsAllCount),
|
|
|
+ TsAcceptanceTypeCode = "35",
|
|
|
+
|
|
|
+ QtAllCount = list.Where(x => x.OrgType == EOrgType.County).Sum(p => p.QtAllCount),
|
|
|
+ QtAcceptanceTypeCode = "40",
|
|
|
+
|
|
|
+ YjAllCount = list.Where(x => x.OrgType == EOrgType.County).Sum(p => p.YjAllCount),
|
|
|
+ YjAcceptanceTypeCode = "1",
|
|
|
+
|
|
|
+ HmAllCount = list.Where(x => x.OrgType == EOrgType.County).Sum(p => p.HmAllCount),
|
|
|
+ HmAcceptanceTypeCode = "2",
|
|
|
+
|
|
|
+ DqAllCount = list.Where(x => x.OrgType == EOrgType.County).Sum(p => p.DqAllCount),
|
|
|
+ DqAcceptanceTypeCode = "3"
|
|
|
+ });
|
|
|
+
|
|
|
+ list.Add(new DepartmentAcceptanceTypeStatisticsV1Dto
|
|
|
+ {
|
|
|
+ OrgName = "市直合计",
|
|
|
+ OrgCode = "",
|
|
|
+ OrgTypeText = "",
|
|
|
+ ZxAllCount = list.Where(x => x.OrgType == EOrgType.City && x.OrgCode != "001").Sum(p => p.ZxAllCount),
|
|
|
+ ZxAcceptanceTypeCode = "10",
|
|
|
+
|
|
|
+ JyAllCount = list.Where(x => x.OrgType == EOrgType.City && x.OrgCode != "001").Sum(p => p.JyAllCount),
|
|
|
+ JyAcceptanceTypeCode = "15",
|
|
|
+
|
|
|
+ QzAllCount = list.Where(x => x.OrgType == EOrgType.City && x.OrgCode != "001").Sum(p => p.QzAllCount),
|
|
|
+ QzAcceptanceTypeCode = "20",
|
|
|
+
|
|
|
+ ByAllCount = list.Where(x => x.OrgType == EOrgType.City && x.OrgCode != "001").Sum(p => p.ByAllCount),
|
|
|
+ ByAcceptanceTypeCode = "25",
|
|
|
+
|
|
|
+ JbAllCount = list.Where(x => x.OrgType == EOrgType.City && x.OrgCode != "001").Sum(p => p.JbAllCount),
|
|
|
+ JbAcceptanceTypeCode = "30",
|
|
|
+
|
|
|
+ TsAllCount = list.Where(x => x.OrgType == EOrgType.City && x.OrgCode != "001").Sum(p => p.TsAllCount),
|
|
|
+ TsAcceptanceTypeCode = "35",
|
|
|
+
|
|
|
+ QtAllCount = list.Where(x => x.OrgType == EOrgType.City && x.OrgCode != "001").Sum(p => p.QtAllCount),
|
|
|
+ QtAcceptanceTypeCode = "40",
|
|
|
+
|
|
|
+ YjAllCount = list.Where(x => x.OrgType == EOrgType.City && x.OrgCode != "001").Sum(p => p.YjAllCount),
|
|
|
+ YjAcceptanceTypeCode = "1",
|
|
|
+
|
|
|
+ HmAllCount = list.Where(x => x.OrgType == EOrgType.City && x.OrgCode != "001").Sum(p => p.HmAllCount),
|
|
|
+ HmAcceptanceTypeCode = "2",
|
|
|
+
|
|
|
+ DqAllCount = list.Where(x => x.OrgType == EOrgType.City && x.OrgCode != "001").Sum(p => p.DqAllCount),
|
|
|
+ DqAcceptanceTypeCode = "3"
|
|
|
+ });
|
|
|
+
|
|
|
+ list.Add(new DepartmentAcceptanceTypeStatisticsV1Dto
|
|
|
+ {
|
|
|
+ OrgName = "总计",
|
|
|
+ OrgCode = "",
|
|
|
+ OrgTypeText = "",
|
|
|
+ ZxAllCount = list.Sum(p => p.ZxAllCount),
|
|
|
+ ZxAcceptanceTypeCode = "10",
|
|
|
+
|
|
|
+ JyAllCount = list.Sum(p => p.JyAllCount),
|
|
|
+ JyAcceptanceTypeCode = "15",
|
|
|
+
|
|
|
+ QzAllCount = list.Sum(p => p.QzAllCount),
|
|
|
+ QzAcceptanceTypeCode = "20",
|
|
|
+
|
|
|
+ ByAllCount = list.Sum(p => p.ByAllCount),
|
|
|
+ ByAcceptanceTypeCode = "25",
|
|
|
+
|
|
|
+ JbAllCount = list.Sum(p => p.JbAllCount),
|
|
|
+ JbAcceptanceTypeCode = "30",
|
|
|
+
|
|
|
+ TsAllCount = list.Sum(p => p.TsAllCount),
|
|
|
+ TsAcceptanceTypeCode = "35",
|
|
|
+
|
|
|
+ QtAllCount = list.Sum(p => p.QtAllCount),
|
|
|
+ QtAcceptanceTypeCode = "40",
|
|
|
+
|
|
|
+ YjAllCount = list.Sum(p => p.YjAllCount),
|
|
|
+ YjAcceptanceTypeCode = "1",
|
|
|
+
|
|
|
+ HmAllCount = list.Sum(p => p.HmAllCount),
|
|
|
+ HmAcceptanceTypeCode = "2",
|
|
|
+
|
|
|
+ DqAllCount = list.Sum(p => p.DqAllCount),
|
|
|
+ DqAcceptanceTypeCode = "3"
|
|
|
+ });
|
|
|
+
|
|
|
+ var orderDtos = _mapper.Map<ICollection<DepartmentAcceptanceTypeStatisticsV1Dto>>(list);
|
|
|
+ dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass<DepartmentAcceptanceTypeStatisticsV1Dto>(dto.ColumnInfos);
|
|
|
+ var dtos = orderDtos
|
|
|
+ .Select(stu => _mapper.Map(stu, typeof(DepartmentAcceptanceTypeStatisticsV1Dto), dynamicClass))
|
|
|
+ .Cast<object>()
|
|
|
+ .ToList();
|
|
|
+
|
|
|
+ var stream = ExcelHelper.CreateStream(dtos);
|
|
|
+
|
|
|
+ return ExcelStreamResult(stream, "部门受理类型统计数据");
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 部门受理类型统计(宜宾功能)--明细列表
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("department_acceptance_type_order_list_v1")]
|
|
|
+ public async Task<PagedDto<OrderDto>> DepartmentAcceptanceTypeOrderListV1([FromQuery] DepartmentKeyWordRequest dto)
|
|
|
+ {
|
|
|
+ var (total, items) = await _orderReportApplication.DepartmentAcceptanceTypeOrderListV1(dto)
|
|
|
+ .ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
+ return new PagedDto<OrderDto>(total, _mapper.Map<IReadOnlyList<OrderDto>>(items));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 部门受理类型统计(宜宾功能)--明细列表---导出
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("department_acceptance_type_order_list_export_v1")]
|
|
|
+ public async Task<FileStreamResult> ExportDepartmentAcceptanceTypeOrderListV1([FromBody] ExportExcelDto<DepartmentKeyWordRequest> dto)
|
|
|
+ {
|
|
|
+ var query = _orderReportApplication.DepartmentAcceptanceTypeOrderListV1(dto.QueryDto);
|
|
|
+ List<Order> list;
|
|
|
+ if (dto.IsExportAll)
|
|
|
+ {
|
|
|
+ list = await query.ToListAsync(HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var (_, items) = await query.ToPagedListAsync(dto.QueryDto, HttpContext.RequestAborted);
|
|
|
+ list = items;
|
|
|
+ }
|
|
|
+
|
|
|
+ var orderDtos = _mapper.Map<ICollection<OrderDto>>(list);
|
|
|
+
|
|
|
+ dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass<OrderDto>(dto.ColumnInfos);
|
|
|
+
|
|
|
+ var dtos = orderDtos
|
|
|
+ .Select(stu => _mapper.Map(stu, typeof(OrderDto), dynamicClass))
|
|
|
+ .Cast<object>()
|
|
|
+ .ToList();
|
|
|
+
|
|
|
+ var stream = ExcelHelper.CreateStream(dtos);
|
|
|
+
|
|
|
+ return ExcelStreamResult(stream, "部门受理类型统计数据");
|
|
|
+ }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 部门办件统计表
|