|
@@ -1,6 +1,7 @@
|
|
using FluentValidation.Results;
|
|
using FluentValidation.Results;
|
|
using Hotline.FlowEngine.Workflows;
|
|
using Hotline.FlowEngine.Workflows;
|
|
using Hotline.Orders;
|
|
using Hotline.Orders;
|
|
|
|
+using Hotline.Share.Attributes;
|
|
using Hotline.Share.Dtos.Snapshot;
|
|
using Hotline.Share.Dtos.Snapshot;
|
|
using Hotline.Share.Enums.FlowEngine;
|
|
using Hotline.Share.Enums.FlowEngine;
|
|
using Hotline.Share.Enums.Order;
|
|
using Hotline.Share.Enums.Order;
|
|
@@ -45,9 +46,10 @@ public class BiSnapshotApplication : IBiSnapshotApplication, IScopeDependency
|
|
/// <param name="requestAborted"></param>
|
|
/// <param name="requestAborted"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
/// <exception cref="NotImplementedException"></exception>
|
|
/// <exception cref="NotImplementedException"></exception>
|
|
- public async Task<IList<RedPackStatisticsOutDto>> GetRedPackAuditStatisticsAsync(RedPackStatisticsInDto dto, CancellationToken requestAborted)
|
|
|
|
|
|
+ [ExportExcel("市民红包审核统计")]
|
|
|
|
+ public IList<RedPackStatisticsOutDto> GetRedPackAuditStatistics(RedPackStatisticsInDto dto)
|
|
{
|
|
{
|
|
- var industries = await _industryRepository.Queryable(includeDeleted: true)
|
|
|
|
|
|
+ var industries = _industryRepository.Queryable(includeDeleted: true)
|
|
.LeftJoin<IndustryCase>((industry, industryCase) => industry.Id == industryCase.IndustryId && industryCase.IsEnable == true)
|
|
.LeftJoin<IndustryCase>((industry, industryCase) => industry.Id == industryCase.IndustryId && industryCase.IsEnable == true)
|
|
.Select((industry, industryCase) => new RedPackStatisticsOutDto
|
|
.Select((industry, industryCase) => new RedPackStatisticsOutDto
|
|
{
|
|
{
|
|
@@ -56,9 +58,9 @@ public class BiSnapshotApplication : IBiSnapshotApplication, IScopeDependency
|
|
CaseId = industryCase.Id,
|
|
CaseId = industryCase.Id,
|
|
CaseName = industryCase.Name,
|
|
CaseName = industryCase.Name,
|
|
ShouldAmount = industryCase.CitizenReadPackAmount == null ? industry.CitizenReadPackAmount : industryCase.CitizenReadPackAmount,
|
|
ShouldAmount = industryCase.CitizenReadPackAmount == null ? industry.CitizenReadPackAmount : industryCase.CitizenReadPackAmount,
|
|
- }).ToListAsync();
|
|
|
|
|
|
+ }).ToList();
|
|
|
|
|
|
- var redPackOutDto = await _redPackAuditRepository.Queryable(includeDeleted: true)
|
|
|
|
|
|
+ var redPackOutDto = _redPackAuditRepository.Queryable(includeDeleted: true)
|
|
.LeftJoin<OrderSnapshot>((audit, snapshot) => audit.OrderId == snapshot.Id)
|
|
.LeftJoin<OrderSnapshot>((audit, snapshot) => audit.OrderId == snapshot.Id)
|
|
.LeftJoin<RedPackRecord>((audit, snapshot, record) => record.RedPackAuditId == audit.Id)
|
|
.LeftJoin<RedPackRecord>((audit, snapshot, record) => record.RedPackAuditId == audit.Id)
|
|
.LeftJoin<SupplementRecord>((audit, snapshot, record, supplement) => supplement.RedPackAuditId == audit.Id)
|
|
.LeftJoin<SupplementRecord>((audit, snapshot, record, supplement) => supplement.RedPackAuditId == audit.Id)
|
|
@@ -79,7 +81,7 @@ public class BiSnapshotApplication : IBiSnapshotApplication, IScopeDependency
|
|
PendingCount = SqlFunc.AggregateSum(SqlFunc.IIF(record.DistributionState == EReadPackSendStatus.Unsend, 1, 0)), // 待发个数
|
|
PendingCount = SqlFunc.AggregateSum(SqlFunc.IIF(record.DistributionState == EReadPackSendStatus.Unsend, 1, 0)), // 待发个数
|
|
SupplementAmount = SqlFunc.AggregateSum(supplement.ReplenishAmount), // 补充红包金额
|
|
SupplementAmount = SqlFunc.AggregateSum(supplement.ReplenishAmount), // 补充红包金额
|
|
SupplementCount = SqlFunc.AggregateCount(supplement.Id), // 补充红包数
|
|
SupplementCount = SqlFunc.AggregateCount(supplement.Id), // 补充红包数
|
|
- }).ToListAsync();
|
|
|
|
|
|
+ }).ToList();
|
|
|
|
|
|
foreach (var industry in industries)
|
|
foreach (var industry in industries)
|
|
{
|
|
{
|
|
@@ -98,10 +100,12 @@ public class BiSnapshotApplication : IBiSnapshotApplication, IScopeDependency
|
|
{
|
|
{
|
|
industry.IndustryName = $"{industry.Name}({industry.ShouldAmount?.ToString("f2")})";
|
|
industry.IndustryName = $"{industry.Name}({industry.ShouldAmount?.ToString("f2")})";
|
|
industry.IndustryType = 1;
|
|
industry.IndustryType = 1;
|
|
|
|
+ industry.IndustryId = industry.Id;
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
industry.IndustryType = 2;
|
|
industry.IndustryType = 2;
|
|
|
|
+ industry.IndustryId = industry.CaseId;
|
|
if (industry.CaseName == industry.Name)
|
|
if (industry.CaseName == industry.Name)
|
|
industry.IndustryName = $"{industry.Name}({industry.ShouldAmount?.ToString("f2")})";
|
|
industry.IndustryName = $"{industry.Name}({industry.ShouldAmount?.ToString("f2")})";
|
|
else
|
|
else
|