|
@@ -218,21 +218,22 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
dto.EndTime = dto.EndTime.Value.AddDays(1).AddSeconds(-1);
|
|
|
|
|
|
var query = _orderRepository.Queryable(false, false, false)
|
|
|
- .WhereIF(dto.StartTime.HasValue, x => x.CreationTime >= dto.StartTime)
|
|
|
- .WhereIF(dto.EndTime.HasValue, x => x.CreationTime <= dto.EndTime)
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.Keyword), x => x.AcceptorName.Contains(dto.Keyword!))
|
|
|
- .GroupBy(x => new { x.AcceptorId, x.AcceptorName })
|
|
|
- .Select(x => new OrderBiCentreDataListVo
|
|
|
+ .WhereIF(dto.StartTime.HasValue, it => it.CreationTime >= dto.StartTime)
|
|
|
+ .WhereIF(dto.EndTime.HasValue, it => it.CreationTime <= dto.EndTime)
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Keyword), it => it.SignerName.Contains(dto.Keyword!))
|
|
|
+ .GroupBy(it => new { it.SignerId, it.SignerName })
|
|
|
+ .Select(it => new OrderBiCentreDataListVo
|
|
|
{
|
|
|
- UserName = x.AcceptorName,
|
|
|
- UserId = x.AcceptorId,
|
|
|
+ UserName = it.SignerName,
|
|
|
+ UserId = it.SignerId,
|
|
|
//Subtotal = SqlFunc.AggregateCount(x.AcceptorId),
|
|
|
- CentreArchive = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed && x.ProcessType == EProcessType.Zhiban, 1, 0)),
|
|
|
- CentreCareOf = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed && x.ProcessType == EProcessType.Jiaoban, 1, 0)),
|
|
|
+ CentreArchive = SqlFunc.AggregateSum(SqlFunc.IIF(it.Status >= EOrderStatus.Filed && it.ProcessType == EProcessType.Zhiban, 1, 0)),
|
|
|
+ //CentreCareOf = SqlFunc.AggregateSum(SqlFunc.IIF(it.Status >= EOrderStatus.Filed && it.ProcessType == EProcessType.Jiaoban, 1, 0)),
|
|
|
+ CentreCareOf = SqlFunc.AggregateSum(SqlFunc.IIF((it.Status >= EOrderStatus.Filed && it.ProcessType == EProcessType.Jiaoban),1,0)),
|
|
|
//NoCentreCareOf = SqlFunc.AggregateSum(SqlFunc.IIF((int)x.Status < 300 && x.ExpiredTime > x.FiledTime, 1, 0)),
|
|
|
- Invalid = SqlFunc.AggregateSum(SqlFunc.IIF(x.AcceptType == "无效", 1, 0)),
|
|
|
- Repeat = SqlFunc.AggregateSum(SqlFunc.IIF(x.DuplicateIds != null && SqlFunc.JsonArrayLength(x.DuplicateIds) > 0, 1, 0)),
|
|
|
- Subtotal = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed || x.AcceptType == "无效" || (x.DuplicateIds != null && SqlFunc.JsonArrayLength(x.DuplicateIds) > 0), 1, 0))
|
|
|
+ Invalid = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptType == "无效", 1, 0)),
|
|
|
+ Repeat = SqlFunc.AggregateSum(SqlFunc.IIF(it.DuplicateIds != null && SqlFunc.JsonArrayLength(it.DuplicateIds) > 0, 1, 0)),
|
|
|
+ Subtotal = SqlFunc.AggregateSum(SqlFunc.IIF(it.Status >= EOrderStatus.Filed || it.AcceptType == "无效" || (it.DuplicateIds != null && SqlFunc.JsonArrayLength(it.DuplicateIds) > 0), 1, 0))
|
|
|
}).MergeTable();
|
|
|
switch (dto.SortField)
|
|
|
{
|