|
@@ -23,6 +23,7 @@ using Hotline.Tools;
|
|
|
using MapsterMapper;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
+using Org.BouncyCastle.Utilities;
|
|
|
using SqlSugar;
|
|
|
using XF.Domain.Authentications;
|
|
|
using XF.Domain.Constants;
|
|
@@ -3263,7 +3264,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
var count = await _orderApplication.QueryOrderSource(dto).CountAsync();
|
|
|
var query = _orderApplication.QueryOrderSource(dto);
|
|
|
var items = await query.GroupBy(d=>d.SourceChannel).Select(d => new OrderSourceVo { Source = d.SourceChannel, Num = SqlFunc.AggregateCount(d.Id), TotalSumCount = count }).ToListAsync(HttpContext.RequestAborted);
|
|
|
- return items;
|
|
|
+ items.Add(new OrderSourceVo { Source = "合计", Num = count, TotalSumCount = count });
|
|
|
+ return items;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 信件来源统计导出
|
|
@@ -3274,7 +3276,6 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
{
|
|
|
var count = await _orderApplication.QueryOrderSource(dto.QueryDto).CountAsync();
|
|
|
var query = _orderApplication.QueryOrderSource(dto.QueryDto).GroupBy(d => d.SourceChannel).Select(d => new OrderSourceVo { Source = d.SourceChannel, Num = SqlFunc.AggregateCount(d.Id), TotalSumCount = count });
|
|
|
-
|
|
|
List<OrderSourceVo> orderSources;
|
|
|
if (dto.IsExportAll)
|
|
|
{
|
|
@@ -3285,15 +3286,13 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
var (_, items) = await query.ToPagedListAsync(dto.QueryDto, HttpContext.RequestAborted);
|
|
|
orderSources = items;
|
|
|
}
|
|
|
+ orderSources.Add(new OrderSourceVo { Source = "合计", Num = count, TotalSumCount = count });
|
|
|
dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(dto.ColumnInfos);
|
|
|
-
|
|
|
var dtos = orderSources
|
|
|
.Select(stu => _mapper.Map(stu, typeof(OrderSourceVo), dynamicClass))
|
|
|
.Cast<object>()
|
|
|
.ToList();
|
|
|
-
|
|
|
var stream = ExcelHelper.CreateStream(dtos);
|
|
|
-
|
|
|
return ExcelStreamResult(stream, "信件来源统计列表数据");
|
|
|
}
|
|
|
}
|