|
@@ -14,6 +14,7 @@ using Hotline.Share.Dtos;
|
|
|
using Hotline.Share.Dtos.Bi;
|
|
|
using Hotline.Share.Dtos.Bigscreen;
|
|
|
using Hotline.Share.Dtos.CallCenter;
|
|
|
+using Hotline.Share.Dtos.DataSharing.PusherHotlineDto;
|
|
|
using Hotline.Share.Dtos.FlowEngine.Workflow;
|
|
|
using Hotline.Share.Dtos.Order;
|
|
|
using Hotline.Share.Enums.CallCenter;
|
|
@@ -22,6 +23,7 @@ using Hotline.Share.Enums.Order;
|
|
|
using Hotline.Share.Requests;
|
|
|
using Hotline.Tools;
|
|
|
using MapsterMapper;
|
|
|
+using Microsoft.AspNetCore.Authorization;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
using Org.BouncyCastle.Utilities;
|
|
@@ -31,6 +33,7 @@ using XF.Domain.Authentications;
|
|
|
using XF.Domain.Constants;
|
|
|
using XF.Domain.Exceptions;
|
|
|
using XF.Domain.Repository;
|
|
|
+using XF.Utility.EnumExtensions;
|
|
|
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
|
|
|
|
|
|
namespace Hotline.Api.Controllers.Bi
|
|
@@ -740,13 +743,13 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("visit-measure-statistics")]
|
|
|
- public async Task<VisitMeasureStatisticsDto> VisitMeasureStatistics(DateTime StartDate, DateTime EndDate, string? VisitName)
|
|
|
+ public async Task<VisitMeasureStatisticsDto> VisitMeasureStatistics(DateTime StartTime, DateTime EndTime, string? VisitName)
|
|
|
{
|
|
|
- EndDate = EndDate.AddDays(1).AddSeconds(-1);
|
|
|
+ EndTime = EndTime.AddDays(1).AddSeconds(-1);
|
|
|
|
|
|
var list = await _orderVisitRepository.Queryable()
|
|
|
.Includes(x => x.Employee)
|
|
|
- .Where(x => x.VisitTime >= StartDate && x.VisitTime <= EndDate && x.VisitState == EVisitState.Visited)
|
|
|
+ .Where(x => x.VisitTime >= StartTime && x.VisitTime <= EndTime && x.VisitState == EVisitState.Visited)
|
|
|
.WhereIF(!string.IsNullOrEmpty(VisitName), x => x.Employee.Name.Contains(VisitName))
|
|
|
.GroupBy(x => new { x.EmployeeId, x.Employee.Name })
|
|
|
.Select(x => new VisitMeasureStatisticsModelDto()
|
|
@@ -762,18 +765,18 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
|
|
|
//查询AIVisit
|
|
|
returnModel.AiVisitCount = await _aiOrderVisitDetailRepository.Queryable()
|
|
|
- .Where(x => x.AiVisitTime >= StartDate && x.AiVisitTime <= EndDate && x.IsSuccess != null).CountAsync();
|
|
|
+ .Where(x => x.AiVisitTime >= StartTime && x.AiVisitTime <= EndTime && x.IsSuccess != null).CountAsync();
|
|
|
|
|
|
returnModel.AiVisitSatisfiedCount = await _aiOrderVisitDetailRepository.Queryable()
|
|
|
.Includes(x => x.OrderVisit)
|
|
|
- .Where(x => x.AiVisitTime >= StartDate && x.AiVisitTime <= EndDate && x.IsSuccess == true && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") != "1" && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") != "2").CountAsync();
|
|
|
+ .Where(x => x.AiVisitTime >= StartTime && x.AiVisitTime <= EndTime && x.IsSuccess == true && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") != "1" && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") != "2").CountAsync();
|
|
|
|
|
|
returnModel.AiVisitNoSatisfiedCount = await _aiOrderVisitDetailRepository.Queryable()
|
|
|
.Includes(x => x.OrderVisit)
|
|
|
- .Where(x => x.AiVisitTime >= StartDate && x.AiVisitTime <= EndDate && x.IsSuccess == true && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") == "1" && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") == "2").CountAsync();
|
|
|
+ .Where(x => x.AiVisitTime >= StartTime && x.AiVisitTime <= EndTime && x.IsSuccess == true && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") == "1" && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") == "2").CountAsync();
|
|
|
|
|
|
returnModel.AIVisitFailCount = await _aiOrderVisitDetailRepository.Queryable()
|
|
|
- .Where(x => x.AiVisitTime >= StartDate && x.AiVisitTime <= EndDate && x.IsSuccess == false).CountAsync();
|
|
|
+ .Where(x => x.AiVisitTime >= StartTime && x.AiVisitTime <= EndTime && x.IsSuccess == false).CountAsync();
|
|
|
|
|
|
|
|
|
return returnModel;
|
|
@@ -782,14 +785,14 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
/// <summary>
|
|
|
/// 热点类型小类统计
|
|
|
/// </summary>
|
|
|
- /// <param name="StartDate"></param>
|
|
|
- /// <param name="EndDate"></param>
|
|
|
+ /// <param name="StartTime"></param>
|
|
|
+ /// <param name="EndTime"></param>
|
|
|
/// <param name="TypeId">0:全部 ,1:市民,2:企业</param>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("hotspot-statistics")]
|
|
|
- public async Task<object> HotspotStatistics(DateTime StartDate, DateTime EndDate, int TypeId, string? HotspotCode)
|
|
|
+ public async Task<object> HotspotStatistics(DateTime StartTime, DateTime EndTime, int TypeId, string? HotspotCode)
|
|
|
{
|
|
|
- EndDate = EndDate.AddDays(1).AddSeconds(-1);
|
|
|
+ EndTime = EndTime.AddDays(1).AddSeconds(-1);
|
|
|
|
|
|
var IsCenter = _sessionContext.OrgIsCenter;
|
|
|
|
|
@@ -797,7 +800,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
{
|
|
|
var list = await _hotspotTypeRepository.Queryable()
|
|
|
.LeftJoin<Order>((it, o) => it.Id == o.HotspotId)
|
|
|
- .Where((it, o) => o.CreationTime >= StartDate && o.CreationTime <= EndDate && o.Id != null)
|
|
|
+ .Where((it, o) => o.CreationTime >= StartTime && o.CreationTime <= EndTime && o.Id != null)
|
|
|
.WhereIF(TypeId == 1, (it, o) => o.IdentityType == EIdentityType.Citizen)
|
|
|
.WhereIF(TypeId == 2, (it, o) => o.IdentityType == EIdentityType.Enterprise)
|
|
|
.WhereIF(IsCenter == false, (it, o) => o.ActualHandleOrgCode.StartsWith(_sessionContext.RequiredOrgId))
|
|
@@ -826,7 +829,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
string countx = HotspotCode.Length.ToString();
|
|
|
var list = await _hotspotTypeRepository.Queryable()
|
|
|
.LeftJoin<Order>((it, o) => it.Id == o.HotspotId)
|
|
|
- .Where((it, o) => o.CreationTime >= StartDate && o.CreationTime <= EndDate && it.ParentId.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>(countx)) == HotspotCode)
|
|
|
+ .Where((it, o) => o.CreationTime >= StartTime && o.CreationTime <= EndTime && it.ParentId.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>(countx)) == HotspotCode)
|
|
|
.WhereIF(TypeId == 1, (it, o) => o.IdentityType == EIdentityType.Citizen)
|
|
|
.WhereIF(TypeId == 2, (it, o) => o.IdentityType == EIdentityType.Enterprise)
|
|
|
.WhereIF(IsCenter == false, (it, o) => o.ActualHandleOrgCode.StartsWith(_sessionContext.RequiredOrgId))
|
|
@@ -854,8 +857,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
/// <summary>
|
|
|
/// 部门满意度统计
|
|
|
/// </summary>
|
|
|
- /// <param name="StartDate"></param>
|
|
|
- /// <param name="EndDate"></param>
|
|
|
+ /// <param name="StartTime"></param>
|
|
|
+ /// <param name="EndTime"></param>
|
|
|
/// <param name="OrgName"></param>
|
|
|
/// <param name="TypeId">1:办件结果 2:办件态度</param>
|
|
|
/// <param name="LineNum"></param>
|
|
@@ -970,8 +973,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
/// <summary>
|
|
|
/// 子部门满意度明细
|
|
|
/// </summary>
|
|
|
- /// <param name="StartDate"></param>
|
|
|
- /// <param name="EndDate"></param>
|
|
|
+ /// <param name="StartTime"></param>
|
|
|
+ /// <param name="EndTime"></param>
|
|
|
/// <param name="OrgCode"></param>
|
|
|
/// <param name="TypeId"></param>
|
|
|
/// <param name="LineNum"></param>
|
|
@@ -1138,14 +1141,14 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
/// <param name="EndDate"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("center_report_forms_statistics")]
|
|
|
- public async Task<CenterReportStatisticsDto> CenterReportFormsStatistics(DateTime StartDate, DateTime EndDate)
|
|
|
+ public async Task<CenterReportStatisticsDto> CenterReportFormsStatistics(DateTime StartTime, DateTime EndTime)
|
|
|
{
|
|
|
- EndDate = EndDate.AddDays(1).AddSeconds(-1);
|
|
|
+ EndTime = EndTime.AddDays(1).AddSeconds(-1);
|
|
|
|
|
|
CenterReportStatisticsDto centerReportStatisticsDto = new();
|
|
|
|
|
|
//信件总量
|
|
|
- int sourceChannelCount = await _orderRepository.Queryable().Where(p => p.CreationTime >= StartDate && p.CreationTime <= EndDate).CountAsync();
|
|
|
+ int sourceChannelCount = await _orderRepository.Queryable().Where(p => p.CreationTime >= StartTime && p.CreationTime <= EndTime).CountAsync();
|
|
|
|
|
|
#region 通话记录
|
|
|
//通话记录
|
|
@@ -1167,7 +1170,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
#region 工单
|
|
|
//工单
|
|
|
var orderData = await _orderRepository.Queryable()
|
|
|
- .Where(p => p.CreationTime >= StartDate && p.CreationTime <= EndDate)
|
|
|
+ .Where(p => p.CreationTime >= StartTime && p.CreationTime <= EndTime)
|
|
|
.Select(x => new CenterReportOrderDto
|
|
|
{
|
|
|
EffectiveCount = SqlFunc.AggregateSum(SqlFunc.IIF(true, 1, 0)),
|
|
@@ -1183,7 +1186,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
#region 信件来源
|
|
|
//信件来源
|
|
|
var sourceChannelData = await _orderRepository.Queryable()
|
|
|
- .Where(p => p.CreationTime >= StartDate && p.CreationTime <= EndDate)
|
|
|
+ .Where(p => p.CreationTime >= StartTime && p.CreationTime <= EndTime)
|
|
|
.Select(it => new
|
|
|
{
|
|
|
SourceChannelCode = SqlFunc.IIF(SqlFunc.IsNullOrEmpty(it.SourceChannelCode), "QT", it.SourceChannelCode)
|
|
@@ -1222,7 +1225,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
#region 信件分类
|
|
|
//信件来源
|
|
|
var acceptTypeData = await _orderRepository.Queryable(false, false, false)
|
|
|
- .Where(p => p.CreationTime >= StartDate && p.CreationTime <= EndDate)
|
|
|
+ .Where(p => p.CreationTime >= StartTime && p.CreationTime <= EndTime)
|
|
|
.Select(it => new
|
|
|
{
|
|
|
AcceptTypeCode = SqlFunc.IIF(SqlFunc.IsNullOrEmpty(it.AcceptTypeCode), "40", it.AcceptTypeCode)
|
|
@@ -1256,15 +1259,15 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
CenterReportVisitdDto centerReportVisitd = new()
|
|
|
{
|
|
|
Visitd = await _orderVisitRepository.Queryable()
|
|
|
- .Where(x => x.VisitTime >= StartDate && x.VisitTime <= EndDate && x.VisitState == EVisitState.Visited).CountAsync(),
|
|
|
+ .Where(x => x.VisitTime >= StartTime && x.VisitTime <= EndTime && x.VisitState == EVisitState.Visited).CountAsync(),
|
|
|
WaitVisitd = await _orderVisitRepository.Queryable()
|
|
|
- .Where(x => x.VisitTime >= StartDate && x.VisitTime <= EndDate && x.VisitState != EVisitState.None && x.VisitState != EVisitState.Visited).CountAsync()
|
|
|
+ .Where(x => x.VisitTime >= StartTime && x.VisitTime <= EndTime && x.VisitState != EVisitState.None && x.VisitState != EVisitState.Visited).CountAsync()
|
|
|
};
|
|
|
|
|
|
//部门
|
|
|
var listOrg = await _orderVisitDetailRepository.Queryable()
|
|
|
.LeftJoin<OrderVisit>((it, o) => it.VisitId == o.Id)
|
|
|
- .Where((it, o) => it.VisitTarget == EVisitTarget.Org && o.VisitTime >= StartDate && o.VisitTime <= EndDate && o.VisitState == EVisitState.Visited)
|
|
|
+ .Where((it, o) => it.VisitTarget == EVisitTarget.Org && o.VisitTime >= StartTime && o.VisitTime <= EndTime && o.VisitState == EVisitState.Visited)
|
|
|
.Select((it, o) => new Satisfaction
|
|
|
{
|
|
|
Dissatisfied = SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "1") || SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "2"), 1, 0)),
|
|
@@ -1285,7 +1288,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
//坐席
|
|
|
var listSet = await _orderVisitDetailRepository.Queryable()
|
|
|
.LeftJoin<OrderVisit>((it, o) => it.VisitId == o.Id)
|
|
|
- .Where((it, o) => it.VisitTarget == EVisitTarget.Seat && o.VisitTime >= StartDate && o.VisitTime <= EndDate && o.VisitState == EVisitState.Visited)
|
|
|
+ .Where((it, o) => it.VisitTarget == EVisitTarget.Seat && o.VisitTime >= StartTime && o.VisitTime <= EndTime && o.VisitState == EVisitState.Visited)
|
|
|
.Select((it, o) => new Satisfaction
|
|
|
{
|
|
|
Dissatisfied = SqlFunc.AggregateSum(SqlFunc.IIF(it.SeatEvaluate == ESeatEvaluate.NoSatisfied, 1, 0)),
|
|
@@ -1309,7 +1312,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
//市直部门
|
|
|
var listOrgStatisticsCityAll = await _orderRepository.Queryable()
|
|
|
.LeftJoin<SystemOrganize>((it, o) => it.OrgLevelOneCode == o.Id)
|
|
|
- .Where((it, o) => (o.OrgType == EOrgType.City || o.OrgType == EOrgType.Province) && it.CreationTime >= StartDate && it.CreationTime <= EndDate)
|
|
|
+ .Where((it, o) => (o.OrgType == EOrgType.City || o.OrgType == EOrgType.Province) && it.CreationTime >= StartTime && it.CreationTime <= EndTime)
|
|
|
.GroupBy((it, o) => new
|
|
|
{
|
|
|
it.OrgLevelOneCode,
|
|
@@ -1330,7 +1333,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
//区县部门
|
|
|
var listOrgStatisticsAreaAll = await _orderRepository.Queryable()
|
|
|
.LeftJoin<SystemOrganize>((it, o) => it.OrgLevelOneCode == o.Id)
|
|
|
- .Where((it, o) => o.OrgType == EOrgType.County && it.CreationTime >= StartDate && it.CreationTime <= EndDate)
|
|
|
+ .Where((it, o) => o.OrgType == EOrgType.County && it.CreationTime >= StartTime && it.CreationTime <= EndTime)
|
|
|
.GroupBy((it, o) => new
|
|
|
{
|
|
|
it.OrgLevelOneCode,
|
|
@@ -1359,14 +1362,14 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
/// <param name="TypeCode">0:全部,1:中心,2:部门</param>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("department_acceptance_type_statistics")]
|
|
|
- public async Task<List<DepartmentAcceptanceTypeStatisticsDto>> DepartmentAcceptanceTypeStatistics(DateTime StartDate, DateTime EndDate, int TypeCode)
|
|
|
+ public async Task<List<DepartmentAcceptanceTypeStatisticsDto>> DepartmentAcceptanceTypeStatistics(DateTime StartTime, DateTime EndTime, int TypeCode)
|
|
|
{
|
|
|
- EndDate = EndDate.AddDays(1).AddSeconds(-1);
|
|
|
+ EndTime = EndTime.AddDays(1).AddSeconds(-1);
|
|
|
|
|
|
var IsCenter = _sessionContext.OrgIsCenter;
|
|
|
|
|
|
var orderData = await _orderRepository.Queryable()
|
|
|
- .Where(it => it.CreationTime >= StartDate && it.CreationTime <= EndDate && it.Status > EOrderStatus.WaitForAccept)
|
|
|
+ .Where(it => it.CreationTime >= StartTime && it.CreationTime <= EndTime && it.Status > EOrderStatus.WaitForAccept)
|
|
|
.Select(it => new
|
|
|
{
|
|
|
OrgCode = IsCenter == true ? it.ActualHandleOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")) : it.ActualHandleOrgCode.Substring(0, _sessionContext.RequiredOrgId.Length + 3),
|
|
@@ -1437,14 +1440,14 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
/// <param name="OrgCode"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("department_acceptance_type_child_statistics")]
|
|
|
- public async Task<object> DepartmentAcceptanceTypeChildStatistics(DateTime StartDate, DateTime EndDate, int TypeCode, string OrgCode)
|
|
|
+ public async Task<object> DepartmentAcceptanceTypeChildStatistics(DateTime StartTime, DateTime EndTime, int TypeCode, string OrgCode)
|
|
|
{
|
|
|
- EndDate = EndDate.AddDays(1).AddSeconds(-1);
|
|
|
+ EndTime = EndTime.AddDays(1).AddSeconds(-1);
|
|
|
|
|
|
// var IsCenter = _sessionContext.OrgIsCenter;
|
|
|
|
|
|
var orderData = await _orderRepository.Queryable()
|
|
|
- .Where(it => it.CreationTime >= StartDate && it.CreationTime <= EndDate && it.Status > EOrderStatus.WaitForAccept)// && it.Status >= EOrderStatus.Filed
|
|
|
+ .Where(it => it.CreationTime >= StartTime && it.CreationTime <= EndTime && it.Status > EOrderStatus.WaitForAccept)// && it.Status >= EOrderStatus.Filed
|
|
|
.WhereIF(OrgCode == "001", it => it.ActualHandleOrgCode == OrgCode)
|
|
|
.WhereIF(OrgCode != "001", it => it.ActualHandleOrgCode.StartsWith(OrgCode))
|
|
|
|
|
@@ -1547,9 +1550,9 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
[HttpGet("department_acceptance_type_order_list")]
|
|
|
public async Task<PagedDto<OrderDto>> DepartmentAcceptanceTypeOrderList([FromQuery] DepartmentKeyWordRequest dto)
|
|
|
{
|
|
|
- dto.EndDate = dto.EndDate.AddDays(1).AddSeconds(-1);
|
|
|
+ dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
|
|
|
var (total, items) = await _orderRepository.Queryable()
|
|
|
- .Where(p => p.CreationTime >= dto.StartDate && p.CreationTime <= dto.EndDate && p.Status > EOrderStatus.WaitForAccept)//&& p.Status >= EOrderStatus.Filed
|
|
|
+ .Where(p => p.CreationTime >= dto.StartTime && p.CreationTime <= dto.EndTime && p.Status > EOrderStatus.WaitForAccept)//&& p.Status >= EOrderStatus.Filed
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.OrgCode) && dto.OrgCode == "001", p => p.ActualHandleOrgCode == dto.OrgCode)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.OrgCode) && dto.OrgCode != "001" && _sessionContext.RequiredOrgId != dto.OrgCode, p => p.ActualHandleOrgCode.StartsWith(dto.OrgCode))
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.OrgCode) && dto.OrgCode != "001" && _sessionContext.RequiredOrgId == dto.OrgCode, p => p.ActualHandleOrgCode == dto.OrgCode)
|
|
@@ -1856,10 +1859,10 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
[HttpGet("high_frequency_call_statistics")]
|
|
|
public async Task<PagedDto<HighFrequencyCallStatisticsDto>> HighFrequencyCallStatistics([FromQuery] HighFrequencyCallStatisticsRequest dto)
|
|
|
{
|
|
|
- if (!dto.StartDate.HasValue || !dto.EndDate.HasValue)
|
|
|
+ if (!dto.StartTime.HasValue || !dto.EndTime.HasValue)
|
|
|
throw UserFriendlyException.SameMessage("请选择时间!");
|
|
|
|
|
|
- dto.EndDate = dto.EndDate.Value.AddDays(1).AddSeconds(-1);
|
|
|
+ dto.EndTime = dto.EndTime.Value.AddDays(1).AddSeconds(-1);
|
|
|
int CallCount = 2;
|
|
|
var HighFrequencyCallStatistics = _systemSettingCacheManager.GetSetting(SettingConstants.HighFrequencyCallStatistics)?.SettingValue[0];
|
|
|
if (HighFrequencyCallStatistics != null)
|
|
@@ -1867,7 +1870,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
|
|
|
var (total, items) = await _trCallRecordRepository.Queryable()
|
|
|
.LeftJoin<Order>((p, o) => p.ExternalId == o.Id)
|
|
|
- .Where((p, o) => p.OverTime >= dto.StartDate && p.OverTime <= dto.EndDate)
|
|
|
+ .Where((p, o) => p.OverTime >= dto.StartTime && p.OverTime <= dto.EndTime)
|
|
|
.Where((p, o) => p.CallOrderType == ECallOrderType.Order)
|
|
|
.Where((p, o) => p.ExternalId != null && o.Id != null)
|
|
|
.Where((p, o) => p.CallDirection == ECallDirection.In)
|
|
@@ -1900,15 +1903,15 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
[HttpGet("high_frequency_call_statistics_order_list")]
|
|
|
public async Task<PagedDto<OrderDto>> HighFrequencyCallStatisticsOrderList([FromQuery] HighFrequencyCallStatisticsListRequest dto)
|
|
|
{
|
|
|
- if (!dto.StartDate.HasValue || !dto.EndDate.HasValue)
|
|
|
+ if (!dto.StartTime.HasValue || !dto.EndTime.HasValue)
|
|
|
throw UserFriendlyException.SameMessage("请选择时间!");
|
|
|
if (string.IsNullOrEmpty(dto.FromPhone))
|
|
|
throw UserFriendlyException.SameMessage("号码不能为空!");
|
|
|
|
|
|
- dto.EndDate = dto.EndDate.Value.AddDays(1).AddSeconds(-1);
|
|
|
+ dto.EndTime = dto.EndTime.Value.AddDays(1).AddSeconds(-1);
|
|
|
var data = await _trCallRecordRepository.Queryable()
|
|
|
.LeftJoin<Order>((p, o) => p.ExternalId == o.Id)
|
|
|
- .Where((p, o) => p.OverTime >= dto.StartDate && p.OverTime <= dto.EndDate)
|
|
|
+ .Where((p, o) => p.OverTime >= dto.StartTime && p.OverTime <= dto.EndTime)
|
|
|
.Where((p, o) => p.CallOrderType == ECallOrderType.Order)
|
|
|
.Where((p, o) => p.ExternalId != null && o.Id != null)
|
|
|
.Where((p, o) => p.CPN == dto.FromPhone)
|
|
@@ -1970,7 +1973,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
public async Task<PagedDto<HighMatterWarningDto>> HighMatterWarning([FromQuery] HighMatterWarningRequest dto)
|
|
|
{
|
|
|
|
|
|
- dto.EndDate = dto.EndDate.AddDays(1).AddSeconds(-1);
|
|
|
+ dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
|
|
|
|
|
|
List<string> filterTitle = new List<string>();
|
|
|
filterTitle.Add("无声");
|
|
@@ -1979,7 +1982,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
filterTitle.Add("测试");
|
|
|
|
|
|
var (total, items) = await _orderRepository.Queryable()
|
|
|
- .Where(x => x.CreationTime >= dto.StartDate && x.CreationTime <= dto.EndDate)
|
|
|
+ .Where(x => x.CreationTime >= dto.StartTime && x.CreationTime <= dto.EndTime)
|
|
|
.Where(x => filterTitle.Any(s => x.Title.Contains(s)) == false)
|
|
|
.LeftJoin<SystemArea>((it, o) => it.AreaCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")) == o.Id)
|
|
|
.WhereIF(dto.AreaCodes.Any(), (it, o) => dto.AreaCodes.Contains(it.AreaCode)) //区域
|
|
@@ -2034,7 +2037,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
[HttpGet("highmatter-warning-detail")]
|
|
|
public async Task<PagedDto<OrderDto>> HighMatterWarningDetail([FromQuery] HighMatterWarningDetailRequest dto)
|
|
|
{
|
|
|
- dto.EndDate = dto.EndDate.AddDays(1).AddSeconds(-1);
|
|
|
+ dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
|
|
|
List<string> filterTitle = new List<string>();
|
|
|
filterTitle.Add("无声");
|
|
|
filterTitle.Add("骚扰");
|
|
@@ -2045,8 +2048,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
.Includes(x => x.OrderScreens)
|
|
|
.Where(d => d.AcceptTypeCode == dto.AcceptTypeCode) //受理类型
|
|
|
.Where(d => d.HotspotId == dto.HotspotId) //热点类型
|
|
|
- .Where(d => d.CreationTime >= dto.StartDate) //受理时间开始
|
|
|
- .Where(d => d.CreationTime <= dto.EndDate) //受理时间结束
|
|
|
+ .Where(d => d.CreationTime >= dto.StartTime) //受理时间开始
|
|
|
+ .Where(d => d.CreationTime <= dto.EndTime) //受理时间结束
|
|
|
.Where(d => d.AreaCode == dto.AreaCode) //区域
|
|
|
.Where(x => filterTitle.Any(s => x.Title.Contains(s)) == false)
|
|
|
.OrderByDescending(d => d.CreationTime)
|