|
@@ -17,6 +17,8 @@ using XF.Domain.Exceptions;
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
using Hotline.CallCenter.Calls;
|
|
|
using Hotline.Share.Enums.CallCenter;
|
|
|
+using Org.BouncyCastle.Utilities;
|
|
|
+using Polly.Caching;
|
|
|
|
|
|
namespace Hotline.Api.Controllers.Bi
|
|
|
{
|
|
@@ -657,7 +659,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
/// <param name="StartDate"></param>
|
|
|
/// <param name="EndDate"></param>
|
|
|
/// <returns></returns>
|
|
|
- [HttpGet("Center_report_forms_statistics")]
|
|
|
+ [HttpGet("center_report_forms_statistics")]
|
|
|
public async Task<CenterReportStatisticsDto> CenterReportFormsStatistics(DateTime StartDate, DateTime EndDate)
|
|
|
{
|
|
|
EndDate = EndDate.AddDays(1).AddSeconds(-1);
|
|
@@ -881,31 +883,58 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
.Select((it, o) => new DepartmentAcceptanceTypeStatisticsDto
|
|
|
{
|
|
|
OrgName = it.OrgLevelOneCode == "001" ? "热线中心" : o.Name,
|
|
|
+ OrgCode = it.OrgLevelOneCode,
|
|
|
OrgType = (int)o.OrgType == 2 ? "区县部门" : "市直部门",
|
|
|
ZxAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "10", 1, 0)),
|
|
|
- ZxAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "10"&& it.AllDuration!=null, it.AllDuration, 0)),
|
|
|
+ ZxAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "10" && it.AllDuration != null, it.AllDuration, 0)),
|
|
|
+ ZxAcceptanceTypeCode = "10",
|
|
|
|
|
|
JyAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "15", 1, 0)),
|
|
|
JyAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "15" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
|
|
|
+ JyAcceptanceTypeCode = "15",
|
|
|
|
|
|
QzAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "20", 1, 0)),
|
|
|
QzAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "20" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
|
|
|
+ QzAcceptanceTypeCode = "20",
|
|
|
|
|
|
ByAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "25", 1, 0)),
|
|
|
ByAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "25" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
|
|
|
+ ByAcceptanceTypeCode = "25",
|
|
|
|
|
|
JbAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "30", 1, 0)),
|
|
|
JbAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "30" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
|
|
|
+ JbAcceptanceTypeCode = "30",
|
|
|
|
|
|
TsAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "35", 1, 0)),
|
|
|
TsAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "35" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
|
|
|
+ TsAcceptanceTypeCode = "35",
|
|
|
|
|
|
QtAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "40", 1, 0)),
|
|
|
QtAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "40" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
|
|
|
+ QtAcceptanceTypeCode = "40"
|
|
|
})
|
|
|
.ToListAsync();
|
|
|
|
|
|
return orderData;
|
|
|
}
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ ///
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("department_acceptance_type_order_list")]
|
|
|
+ public async Task<PagedDto<OrderDto>> DepartmentAcceptanceTypeOrderList([FromQuery] DepartmentKeyWordRequest dto)
|
|
|
+ {
|
|
|
+ dto.EndDate = dto.EndDate.AddDays(1).AddSeconds(-1);
|
|
|
+ var (total, items) = await _orderRepository.Queryable()
|
|
|
+ .Where(p => p.CreationTime >= dto.StartDate && p.CreationTime <= dto.EndDate && (int)p.Status >= 300)
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.OrgLevelOneCode), p => p.OrgLevelOneCode == dto.OrgLevelOneCode)
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.AcceptTypeCode), p => p.AcceptTypeCode == dto.AcceptTypeCode)
|
|
|
+ .OrderByDescending(d => d.CreationTime)
|
|
|
+ .ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
+
|
|
|
+ return new PagedDto<OrderDto>(total, _mapper.Map<IReadOnlyList<OrderDto>>(items));
|
|
|
+ }
|
|
|
}
|
|
|
}
|