|
@@ -42,6 +42,9 @@ using XF.Domain.Repository;
|
|
using XF.Utility.EnumExtensions;
|
|
using XF.Utility.EnumExtensions;
|
|
using DocumentFormat.OpenXml.Drawing;
|
|
using DocumentFormat.OpenXml.Drawing;
|
|
using DocumentFormat.OpenXml.Bibliography;
|
|
using DocumentFormat.OpenXml.Bibliography;
|
|
|
|
+using NPOI.SS.Formula.Functions;
|
|
|
|
+using Hotline.Share.Dtos.File;
|
|
|
|
+using Hotline.File;
|
|
|
|
|
|
namespace Hotline.Api.Controllers.Bi
|
|
namespace Hotline.Api.Controllers.Bi
|
|
{
|
|
{
|
|
@@ -81,7 +84,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
private readonly IWorkflowApplication _workflowApplication;
|
|
private readonly IWorkflowApplication _workflowApplication;
|
|
private readonly ISystemOrganizeRepository _organizeRepository;
|
|
private readonly ISystemOrganizeRepository _organizeRepository;
|
|
private readonly IRepository<CallNative> _callNativeRepository;
|
|
private readonly IRepository<CallNative> _callNativeRepository;
|
|
- private readonly IOptionsSnapshot<AppConfiguration> _appOptions;
|
|
|
|
|
|
+ private readonly IOptionsSnapshot<AppConfiguration> _appOptions;
|
|
private readonly IRepository<OrderTsDetails> _orderTsDetailsRepository;
|
|
private readonly IRepository<OrderTsDetails> _orderTsDetailsRepository;
|
|
|
|
|
|
public BiOrderController(
|
|
public BiOrderController(
|
|
@@ -1885,81 +1888,82 @@ namespace Hotline.Api.Controllers.Bi
|
|
if (callData != null)
|
|
if (callData != null)
|
|
callData.InvalidCount = callData.InvalidCount - callData.QueueByeCount - callData.IvrByeCount;
|
|
callData.InvalidCount = callData.InvalidCount - callData.QueueByeCount - callData.IvrByeCount;
|
|
centerReportStatisticsDto.CenterReportCall = callData;
|
|
centerReportStatisticsDto.CenterReportCall = callData;
|
|
- #endregion
|
|
|
|
-
|
|
|
|
- #region 语音分类
|
|
|
|
- var callTypeDto = await _trCallRecordRepository.Queryable()
|
|
|
|
- .Where(x => x.CreatedTime >= StartTime && x.CreatedTime <= EndTime && SqlFunc.Length(x.Gateway) > 4 && x.CallDirection == ECallDirection.In)
|
|
|
|
- .GroupBy(x => x.CreatedTime.ToString("yyyy-MM-dd"))
|
|
|
|
- .Select(x => new IVRCallTypeDto()
|
|
|
|
- {
|
|
|
|
- PersonCallInCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.IvrDtmf.Substring(x.IvrDtmf.Length - 1, 1) == "1", 1, 0)),
|
|
|
|
- EnterpriseCallInCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.IvrDtmf.Substring(x.IvrDtmf.Length - 1, 1) == "2", 1, 0)),
|
|
|
|
- AiCallInCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Gateway == "82826886", 1, 0)),
|
|
|
|
- }).FirstAsync();
|
|
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
|
|
+ #region 语音分类
|
|
|
|
+ var callTypeDto = await _trCallRecordRepository.Queryable()
|
|
|
|
+ .Where(x => x.CreatedTime >= StartTime && x.CreatedTime <= EndTime && SqlFunc.Length(x.Gateway) > 4 && x.CallDirection == ECallDirection.In)
|
|
|
|
+ .GroupBy(x => x.CreatedTime.ToString("yyyy-MM-dd"))
|
|
|
|
+ .Select(x => new IVRCallTypeDto()
|
|
|
|
+ {
|
|
|
|
+ PersonCallInCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.IvrDtmf.Substring(x.IvrDtmf.Length - 1, 1) == "1", 1, 0)),
|
|
|
|
+ EnterpriseCallInCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.IvrDtmf.Substring(x.IvrDtmf.Length - 1, 1) == "2", 1, 0)),
|
|
|
|
+ AiCallInCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Gateway == "82826886", 1, 0)),
|
|
|
|
+ }).FirstAsync();
|
|
centerReportStatisticsDto.iVRCallTypeDto = callTypeDto;
|
|
centerReportStatisticsDto.iVRCallTypeDto = callTypeDto;
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region 工单
|
|
#region 工单
|
|
//工单 信件情况
|
|
//工单 信件情况
|
|
var orderData = await _orderRepository.Queryable()
|
|
var orderData = await _orderRepository.Queryable()
|
|
- .LeftJoin<SystemOrganize>((x,so) => x.ActualHandleOrgCode == so.Id)
|
|
|
|
|
|
+ .LeftJoin<SystemOrganize>((x, so) => x.ActualHandleOrgCode == so.Id)
|
|
.Where((x, so) => x.CreationTime >= StartTime && x.CreationTime <= EndTime)
|
|
.Where((x, so) => x.CreationTime >= StartTime && x.CreationTime <= EndTime)
|
|
.Select((x, so) => new CenterReportOrderDto
|
|
.Select((x, so) => new CenterReportOrderDto
|
|
- {
|
|
|
|
|
|
+ {
|
|
EffectiveCount = SqlFunc.AggregateSum(SqlFunc.IIF(true, 1, 0)),
|
|
EffectiveCount = SqlFunc.AggregateSum(SqlFunc.IIF(true, 1, 0)),
|
|
InvalidCount = 0,
|
|
InvalidCount = 0,
|
|
CompletedCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed, 1, 0)),
|
|
CompletedCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed, 1, 0)),
|
|
InProgressCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status < EOrderStatus.Filed, 1, 0)),
|
|
InProgressCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status < EOrderStatus.Filed, 1, 0)),
|
|
- CityAccept = SqlFunc.AggregateSum(SqlFunc.IIF(so.OrgType == EOrgType.City, 1, 0)),
|
|
|
|
- CountyAccept = SqlFunc.AggregateSum(SqlFunc.IIF(so.OrgType == EOrgType.County, 1, 0)),
|
|
|
|
- CenterAccept = SqlFunc.AggregateSum(SqlFunc.IIF(so.IsCenter, 1, 0)),
|
|
|
|
- })
|
|
|
|
|
|
+ CityAccept = SqlFunc.AggregateSum(SqlFunc.IIF(so.OrgType == EOrgType.City, 1, 0)),
|
|
|
|
+ CountyAccept = SqlFunc.AggregateSum(SqlFunc.IIF(so.OrgType == EOrgType.County, 1, 0)),
|
|
|
|
+ CenterAccept = SqlFunc.AggregateSum(SqlFunc.IIF(so.IsCenter, 1, 0)),
|
|
|
|
+ })
|
|
.FirstAsync();
|
|
.FirstAsync();
|
|
centerReportStatisticsDto.CenterReportOrder = orderData;
|
|
centerReportStatisticsDto.CenterReportOrder = orderData;
|
|
|
|
|
|
|
|
|
|
- //工单按时办结情况
|
|
|
|
- var orderCompletedData = await _orderRepository.Queryable()
|
|
|
|
- .LeftJoin<SystemOrganize>((x, so) => x.FileUserOrgId == so.Id)
|
|
|
|
- .Where((x, so) => x.CreationTime >= StartTime && x.CreationTime <= EndTime && x.Status >= EOrderStatus.Filed)
|
|
|
|
- .Select((x, so) => new OrderCompletedDto
|
|
|
|
- {
|
|
|
|
- CompletedCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed, 1, 0)),
|
|
|
|
- ExpiredTimeCompletedCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed && x.ExpiredTime > x.ActualHandleTime, 1, 0)),//超期已办
|
|
|
|
- CityExpiredTimeCompletedCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed && x.ExpiredTime > x.ActualHandleTime && so.OrgType == EOrgType.City, 1, 0)),//市级超期已办
|
|
|
|
- CountyExpiredTimeCompletedCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed && x.ExpiredTime > x.ActualHandleTime && so.OrgType == EOrgType.County, 1, 0)),//区县超期已办
|
|
|
|
- CenterExpiredTimeCompletedCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed && x.ExpiredTime > x.ActualHandleTime && so.IsCenter, 1, 0)),//中心超期已办
|
|
|
|
- CityCompletedCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed && so.OrgType == EOrgType.City, 1, 0)),
|
|
|
|
- CountyCompletedCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed && so.OrgType == EOrgType.County, 1, 0)),
|
|
|
|
- CenterCompletedCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed && so.IsCenter, 1, 0)),
|
|
|
|
- })
|
|
|
|
- .FirstAsync();
|
|
|
|
|
|
+ //工单按时办结情况
|
|
|
|
+ var orderCompletedData = await _orderRepository.Queryable()
|
|
|
|
+ .LeftJoin<SystemOrganize>((x, so) => x.FileUserOrgId == so.Id)
|
|
|
|
+ .Where((x, so) => x.CreationTime >= StartTime && x.CreationTime <= EndTime && x.Status >= EOrderStatus.Filed)
|
|
|
|
+ .Select((x, so) => new OrderCompletedDto
|
|
|
|
+ {
|
|
|
|
+ CompletedCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed, 1, 0)),
|
|
|
|
+ ExpiredTimeCompletedCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed && x.ExpiredTime > x.ActualHandleTime, 1, 0)),//超期已办
|
|
|
|
+ CityExpiredTimeCompletedCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed && x.ExpiredTime > x.ActualHandleTime && so.OrgType == EOrgType.City, 1, 0)),//市级超期已办
|
|
|
|
+ CountyExpiredTimeCompletedCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed && x.ExpiredTime > x.ActualHandleTime && so.OrgType == EOrgType.County, 1, 0)),//区县超期已办
|
|
|
|
+ CenterExpiredTimeCompletedCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed && x.ExpiredTime > x.ActualHandleTime && so.IsCenter, 1, 0)),//中心超期已办
|
|
|
|
+ CityCompletedCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed && so.OrgType == EOrgType.City, 1, 0)),
|
|
|
|
+ CountyCompletedCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed && so.OrgType == EOrgType.County, 1, 0)),
|
|
|
|
+ CenterCompletedCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed && so.IsCenter, 1, 0)),
|
|
|
|
+ })
|
|
|
|
+ .FirstAsync();
|
|
centerReportStatisticsDto.orderCompletedDto = orderCompletedData;
|
|
centerReportStatisticsDto.orderCompletedDto = orderCompletedData;
|
|
|
|
|
|
//工单办理时效
|
|
//工单办理时效
|
|
var orderAgingData = await _orderRepository.Queryable()
|
|
var orderAgingData = await _orderRepository.Queryable()
|
|
- .LeftJoin<SystemOrganize>((x, so) => x.FileUserOrgId == so.Id)
|
|
|
|
- .Where((x, so) => x.CreationTime >= StartTime && x.CreationTime <= EndTime && x.Status >= EOrderStatus.Filed)
|
|
|
|
- .Select((x, so) => new {
|
|
|
|
- FileOrgIsCenter = x.FileOrgIsCenter.Value,
|
|
|
|
- CreationTimeHandleDurationWorkday = x.CreationTimeHandleDurationWorkday.HasValue? x.CreationTimeHandleDurationWorkday : 0,
|
|
|
|
- CenterToOrgHandleDurationWorkday = x.CenterToOrgHandleDurationWorkday.HasValue ? x.CenterToOrgHandleDurationWorkday : 0,
|
|
|
|
- OrgType = so.OrgType
|
|
|
|
- })
|
|
|
|
|
|
+ .LeftJoin<SystemOrganize>((x, so) => x.FileUserOrgId == so.Id)
|
|
|
|
+ .Where((x, so) => x.CreationTime >= StartTime && x.CreationTime <= EndTime && x.Status >= EOrderStatus.Filed)
|
|
|
|
+ .Select((x, so) => new
|
|
|
|
+ {
|
|
|
|
+ FileOrgIsCenter = x.FileOrgIsCenter.Value,
|
|
|
|
+ CreationTimeHandleDurationWorkday = x.CreationTimeHandleDurationWorkday.HasValue ? x.CreationTimeHandleDurationWorkday : 0,
|
|
|
|
+ CenterToOrgHandleDurationWorkday = x.CenterToOrgHandleDurationWorkday.HasValue ? x.CenterToOrgHandleDurationWorkday : 0,
|
|
|
|
+ OrgType = so.OrgType
|
|
|
|
+ })
|
|
.MergeTable()
|
|
.MergeTable()
|
|
- .Select(temp => new OrderAgingDto
|
|
|
|
- {
|
|
|
|
- OrderCount = SqlFunc.AggregateSum(SqlFunc.IIF(true, 1, 0)),
|
|
|
|
- CompletedAging = SqlFunc.AggregateSum(SqlFunc.IIF(temp.FileOrgIsCenter, temp.CreationTimeHandleDurationWorkday, temp.CenterToOrgHandleDurationWorkday)),
|
|
|
|
- CityOrderCount = SqlFunc.AggregateSum(SqlFunc.IIF(temp.FileOrgIsCenter == false && temp.OrgType == EOrgType.City, 1, 0)),//市级
|
|
|
|
- CityCompletedAging = SqlFunc.AggregateSum(SqlFunc.IIF(temp.FileOrgIsCenter == false && temp.OrgType == EOrgType.City, temp.CenterToOrgHandleDurationWorkday,0)),
|
|
|
|
- CountyOrderCount = SqlFunc.AggregateSum(SqlFunc.IIF(temp.FileOrgIsCenter == false && temp.OrgType == EOrgType.County, 1, 0)),//区县
|
|
|
|
- CountyCompletedAging = SqlFunc.AggregateSum(SqlFunc.IIF(temp.FileOrgIsCenter == false && temp.OrgType == EOrgType.County, temp.CenterToOrgHandleDurationWorkday, 0)),
|
|
|
|
- CenterOrderCount = SqlFunc.AggregateSum(SqlFunc.IIF(temp.FileOrgIsCenter, 1, 0)),//中心
|
|
|
|
- CenterCompletedAging = SqlFunc.AggregateSum(SqlFunc.IIF(temp.FileOrgIsCenter, temp.CreationTimeHandleDurationWorkday, 0)),
|
|
|
|
- })
|
|
|
|
- .FirstAsync();
|
|
|
|
|
|
+ .Select(temp => new OrderAgingDto
|
|
|
|
+ {
|
|
|
|
+ OrderCount = SqlFunc.AggregateSum(SqlFunc.IIF(true, 1, 0)),
|
|
|
|
+ CompletedAging = SqlFunc.AggregateSum(SqlFunc.IIF(temp.FileOrgIsCenter, temp.CreationTimeHandleDurationWorkday, temp.CenterToOrgHandleDurationWorkday)),
|
|
|
|
+ CityOrderCount = SqlFunc.AggregateSum(SqlFunc.IIF(temp.FileOrgIsCenter == false && temp.OrgType == EOrgType.City, 1, 0)),//市级
|
|
|
|
+ CityCompletedAging = SqlFunc.AggregateSum(SqlFunc.IIF(temp.FileOrgIsCenter == false && temp.OrgType == EOrgType.City, temp.CenterToOrgHandleDurationWorkday, 0)),
|
|
|
|
+ CountyOrderCount = SqlFunc.AggregateSum(SqlFunc.IIF(temp.FileOrgIsCenter == false && temp.OrgType == EOrgType.County, 1, 0)),//区县
|
|
|
|
+ CountyCompletedAging = SqlFunc.AggregateSum(SqlFunc.IIF(temp.FileOrgIsCenter == false && temp.OrgType == EOrgType.County, temp.CenterToOrgHandleDurationWorkday, 0)),
|
|
|
|
+ CenterOrderCount = SqlFunc.AggregateSum(SqlFunc.IIF(temp.FileOrgIsCenter, 1, 0)),//中心
|
|
|
|
+ CenterCompletedAging = SqlFunc.AggregateSum(SqlFunc.IIF(temp.FileOrgIsCenter, temp.CreationTimeHandleDurationWorkday, 0)),
|
|
|
|
+ })
|
|
|
|
+ .FirstAsync();
|
|
centerReportStatisticsDto.orderAgingDto = orderAgingData;
|
|
centerReportStatisticsDto.orderAgingDto = orderAgingData;
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
@@ -2032,8 +2036,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
Name = item.DicDataName,
|
|
Name = item.DicDataName,
|
|
Code = item.DicTypeCode,
|
|
Code = item.DicTypeCode,
|
|
CountNum = acceptTypeData.Find(p => p.Code == item.DicDataValue)?.CountNum ?? 0,
|
|
CountNum = acceptTypeData.Find(p => p.Code == item.DicDataValue)?.CountNum ?? 0,
|
|
- CompletedAging = acceptTypeData.Find(p => p.Code == item.DicDataValue)?.CompletedAging ?? 0
|
|
|
|
- });
|
|
|
|
|
|
+ CompletedAging = acceptTypeData.Find(p => p.Code == item.DicDataValue)?.CompletedAging ?? 0
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
centerReportStatisticsDto.CenterReportOrderAcceptTypes = acceptType;
|
|
centerReportStatisticsDto.CenterReportOrderAcceptTypes = acceptType;
|
|
@@ -2070,79 +2074,79 @@ namespace Hotline.Api.Controllers.Bi
|
|
if (data.Satisfied > 0)
|
|
if (data.Satisfied > 0)
|
|
{
|
|
{
|
|
var count = data.Satisfied + data.Dissatisfied;
|
|
var count = data.Satisfied + data.Dissatisfied;
|
|
- centerReportVisitd.AllRate = Math.Round((data.Satisfied / (double)count) * 100, 2);
|
|
|
|
- }
|
|
|
|
- if (data.OrgSatisfied > 0)
|
|
|
|
- {
|
|
|
|
- var count = data.OrgSatisfied + data.OrgDissatisfied;
|
|
|
|
- centerReportVisitd.OrgRate = Math.Round((data.OrgSatisfied / (double)count) * 100, 2);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (data.CitySatisfied > 0)
|
|
|
|
- {
|
|
|
|
- var count = data.CitySatisfied + data.CityDissatisfied;
|
|
|
|
- centerReportVisitd.CityRate = Math.Round((data.CitySatisfied / (double)count) * 100, 2);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (data.CountySatisfied > 0)
|
|
|
|
- {
|
|
|
|
- var count = data.CountySatisfied + data.CountyDissatisfied;
|
|
|
|
- centerReportVisitd.CountyRate = Math.Round((data.CountySatisfied / (double)count) * 100, 2);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (data.CenterSatisfied > 0)
|
|
|
|
- {
|
|
|
|
- var count = data.CenterSatisfied + data.CenterDissatisfied;
|
|
|
|
- centerReportVisitd.CenterRate = Math.Round((data.CenterSatisfied / (double)count) * 100, 2);
|
|
|
|
- }
|
|
|
|
|
|
+ centerReportVisitd.AllRate = Math.Round((data.Satisfied / (double)count) * 100, 2);
|
|
|
|
+ }
|
|
|
|
+ if (data.OrgSatisfied > 0)
|
|
|
|
+ {
|
|
|
|
+ var count = data.OrgSatisfied + data.OrgDissatisfied;
|
|
|
|
+ centerReportVisitd.OrgRate = Math.Round((data.OrgSatisfied / (double)count) * 100, 2);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (data.CitySatisfied > 0)
|
|
|
|
+ {
|
|
|
|
+ var count = data.CitySatisfied + data.CityDissatisfied;
|
|
|
|
+ centerReportVisitd.CityRate = Math.Round((data.CitySatisfied / (double)count) * 100, 2);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (data.CountySatisfied > 0)
|
|
|
|
+ {
|
|
|
|
+ var count = data.CountySatisfied + data.CountyDissatisfied;
|
|
|
|
+ centerReportVisitd.CountyRate = Math.Round((data.CountySatisfied / (double)count) * 100, 2);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (data.CenterSatisfied > 0)
|
|
|
|
+ {
|
|
|
|
+ var count = data.CenterSatisfied + data.CenterDissatisfied;
|
|
|
|
+ centerReportVisitd.CenterRate = Math.Round((data.CenterSatisfied / (double)count) * 100, 2);
|
|
|
|
+ }
|
|
centerReportVisitd.Dissatisfied = data.Dissatisfied;
|
|
centerReportVisitd.Dissatisfied = data.Dissatisfied;
|
|
centerReportVisitd.CityDissatisfied = data.CityDissatisfied;
|
|
centerReportVisitd.CityDissatisfied = data.CityDissatisfied;
|
|
centerReportVisitd.CountyDissatisfied = data.CountyDissatisfied;
|
|
centerReportVisitd.CountyDissatisfied = data.CountyDissatisfied;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- //部门
|
|
|
|
- //var listOrg = await _orderVisitDetailRepository.Queryable()
|
|
|
|
- // .LeftJoin<OrderVisit>((it, o) => it.VisitId == o.Id)
|
|
|
|
- // .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)),
|
|
|
|
- // Satisfied = SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "1") || SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "2"), 0, 1)),
|
|
|
|
- // })
|
|
|
|
- // .ToListAsync();
|
|
|
|
-
|
|
|
|
- //if (listOrg != null && listOrg.Count > 0)
|
|
|
|
- //{
|
|
|
|
- // var SatisfiedCount = listOrg[0].Satisfied + listOrg[0].Satisfied;
|
|
|
|
- // if (SatisfiedCount > 0 && listOrg[0].Satisfied > 0)
|
|
|
|
- // centerReportVisitd.OrgRate = Math.Round((listOrg[0].Satisfied / (double)SatisfiedCount) * 100, 2);
|
|
|
|
- //}
|
|
|
|
-
|
|
|
|
- ////if (centerReportVisitd.Visitd > 0 && listOrg != null && listOrg.Count > 0 && listOrg[0].Satisfied > 0)
|
|
|
|
- ////centerReportVisitd.OrgRate = Math.Round((listOrg[0].Satisfied / (double)centerReportVisitd.Visitd) * 100, 2);
|
|
|
|
-
|
|
|
|
- ////坐席
|
|
|
|
- //var listSet = await _orderVisitDetailRepository.Queryable()
|
|
|
|
- // .LeftJoin<OrderVisit>((it, o) => it.VisitId == o.Id)
|
|
|
|
- // .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)),
|
|
|
|
- // Satisfied = SqlFunc.AggregateSum(SqlFunc.IIF(it.SeatEvaluate != ESeatEvaluate.NoSatisfied, 1, 0)),
|
|
|
|
- // }).ToListAsync();
|
|
|
|
-
|
|
|
|
- //if (listSet != null && listSet.Count > 0)
|
|
|
|
- //{
|
|
|
|
- // var SatisfiedCount = listSet[0].Satisfied + listSet[0].Satisfied;
|
|
|
|
- // if (SatisfiedCount > 0 && listSet[0].Satisfied > 0)
|
|
|
|
- // centerReportVisitd.OrgRate = Math.Round((listSet[0].Satisfied / (double)SatisfiedCount) * 100, 2);
|
|
|
|
- //}
|
|
|
|
-
|
|
|
|
- //if (centerReportVisitd.Visitd > 0 && listSet != null && listSet.Count > 0 && listSet[0].Satisfied > 0)
|
|
|
|
- // centerReportVisitd.SeatsRate = Math.Round((listSet[0].Satisfied / (double)centerReportVisitd.Visitd) * 100, 2);
|
|
|
|
-
|
|
|
|
- centerReportStatisticsDto.CenterReportVisitd = centerReportVisitd;
|
|
|
|
|
|
+ //部门
|
|
|
|
+ //var listOrg = await _orderVisitDetailRepository.Queryable()
|
|
|
|
+ // .LeftJoin<OrderVisit>((it, o) => it.VisitId == o.Id)
|
|
|
|
+ // .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)),
|
|
|
|
+ // Satisfied = SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "1") || SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "2"), 0, 1)),
|
|
|
|
+ // })
|
|
|
|
+ // .ToListAsync();
|
|
|
|
+
|
|
|
|
+ //if (listOrg != null && listOrg.Count > 0)
|
|
|
|
+ //{
|
|
|
|
+ // var SatisfiedCount = listOrg[0].Satisfied + listOrg[0].Satisfied;
|
|
|
|
+ // if (SatisfiedCount > 0 && listOrg[0].Satisfied > 0)
|
|
|
|
+ // centerReportVisitd.OrgRate = Math.Round((listOrg[0].Satisfied / (double)SatisfiedCount) * 100, 2);
|
|
|
|
+ //}
|
|
|
|
+
|
|
|
|
+ ////if (centerReportVisitd.Visitd > 0 && listOrg != null && listOrg.Count > 0 && listOrg[0].Satisfied > 0)
|
|
|
|
+ ////centerReportVisitd.OrgRate = Math.Round((listOrg[0].Satisfied / (double)centerReportVisitd.Visitd) * 100, 2);
|
|
|
|
+
|
|
|
|
+ ////坐席
|
|
|
|
+ //var listSet = await _orderVisitDetailRepository.Queryable()
|
|
|
|
+ // .LeftJoin<OrderVisit>((it, o) => it.VisitId == o.Id)
|
|
|
|
+ // .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)),
|
|
|
|
+ // Satisfied = SqlFunc.AggregateSum(SqlFunc.IIF(it.SeatEvaluate != ESeatEvaluate.NoSatisfied, 1, 0)),
|
|
|
|
+ // }).ToListAsync();
|
|
|
|
+
|
|
|
|
+ //if (listSet != null && listSet.Count > 0)
|
|
|
|
+ //{
|
|
|
|
+ // var SatisfiedCount = listSet[0].Satisfied + listSet[0].Satisfied;
|
|
|
|
+ // if (SatisfiedCount > 0 && listSet[0].Satisfied > 0)
|
|
|
|
+ // centerReportVisitd.OrgRate = Math.Round((listSet[0].Satisfied / (double)SatisfiedCount) * 100, 2);
|
|
|
|
+ //}
|
|
|
|
+
|
|
|
|
+ //if (centerReportVisitd.Visitd > 0 && listSet != null && listSet.Count > 0 && listSet[0].Satisfied > 0)
|
|
|
|
+ // centerReportVisitd.SeatsRate = Math.Round((listSet[0].Satisfied / (double)centerReportVisitd.Visitd) * 100, 2);
|
|
|
|
+
|
|
|
|
+ centerReportStatisticsDto.CenterReportVisitd = centerReportVisitd;
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region 信件分布情况
|
|
#region 信件分布情况
|
|
@@ -2227,35 +2231,35 @@ namespace Hotline.Api.Controllers.Bi
|
|
})
|
|
})
|
|
.FirstAsync();
|
|
.FirstAsync();
|
|
|
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto = enterpriseOrderDto;
|
|
|
|
- var enterpriseOrderDto2 = await _orderVisitDetailRepository.Queryable()
|
|
|
|
- .Includes(it=>it.OrderVisit,ov=>ov.Order)
|
|
|
|
- .LeftJoin<SystemOrganize>((it, so) => it.VisitOrgCode == so.Id)
|
|
|
|
- .Where((it, so) => it.VisitTarget == EVisitTarget.Org && it.OrderVisit.VisitTime >= StartTime && it.OrderVisit.VisitTime <= EndTime && it.OrderVisit.VisitState == EVisitState.Visited)
|
|
|
|
- .GroupBy((it,so)=>it.Id)
|
|
|
|
- .Select((it, so) => new EnterpriseOrderDto
|
|
|
|
- {
|
|
|
|
- VisitdCount = SqlFunc.AggregateSum(SqlFunc.IIF(true, 1, 0)),
|
|
|
|
- Dissatisfied = SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "1") || SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "2"), 1, 0)),
|
|
|
|
- Satisfied = SqlFunc.AggregateSum(SqlFunc.IIF(!SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "1") && !SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "2"), 1, 0)),
|
|
|
|
- CityDissatisfied = SqlFunc.AggregateSum(SqlFunc.IIF((SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "1") || SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "2")) && so.OrgType == EOrgType.City, 1, 0)),
|
|
|
|
- CitySatisfied = SqlFunc.AggregateSum(SqlFunc.IIF(!SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "1") && !SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "2") && so.OrgType == EOrgType.City, 1, 0)),
|
|
|
|
- CountyDissatisfied = SqlFunc.AggregateSum(SqlFunc.IIF((SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "1") || SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "2")) && so.OrgType == EOrgType.County, 1, 0)),
|
|
|
|
- CountySatisfied = SqlFunc.AggregateSum(SqlFunc.IIF(!SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "1") && !SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "2") && so.OrgType == EOrgType.County, 1, 0)),
|
|
|
|
- })
|
|
|
|
- .FirstAsync();
|
|
|
|
|
|
+ centerReportStatisticsDto.enterpriseOrderDto = enterpriseOrderDto;
|
|
|
|
+ var enterpriseOrderDto2 = await _orderVisitDetailRepository.Queryable()
|
|
|
|
+ .Includes(it => it.OrderVisit, ov => ov.Order)
|
|
|
|
+ .LeftJoin<SystemOrganize>((it, so) => it.VisitOrgCode == so.Id)
|
|
|
|
+ .Where((it, so) => it.VisitTarget == EVisitTarget.Org && it.OrderVisit.VisitTime >= StartTime && it.OrderVisit.VisitTime <= EndTime && it.OrderVisit.VisitState == EVisitState.Visited)
|
|
|
|
+ .GroupBy((it, so) => it.Id)
|
|
|
|
+ .Select((it, so) => new EnterpriseOrderDto
|
|
|
|
+ {
|
|
|
|
+ VisitdCount = SqlFunc.AggregateSum(SqlFunc.IIF(true, 1, 0)),
|
|
|
|
+ Dissatisfied = SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "1") || SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "2"), 1, 0)),
|
|
|
|
+ Satisfied = SqlFunc.AggregateSum(SqlFunc.IIF(!SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "1") && !SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "2"), 1, 0)),
|
|
|
|
+ CityDissatisfied = SqlFunc.AggregateSum(SqlFunc.IIF((SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "1") || SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "2")) && so.OrgType == EOrgType.City, 1, 0)),
|
|
|
|
+ CitySatisfied = SqlFunc.AggregateSum(SqlFunc.IIF(!SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "1") && !SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "2") && so.OrgType == EOrgType.City, 1, 0)),
|
|
|
|
+ CountyDissatisfied = SqlFunc.AggregateSum(SqlFunc.IIF((SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "1") || SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "2")) && so.OrgType == EOrgType.County, 1, 0)),
|
|
|
|
+ CountySatisfied = SqlFunc.AggregateSum(SqlFunc.IIF(!SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "1") && !SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "2") && so.OrgType == EOrgType.County, 1, 0)),
|
|
|
|
+ })
|
|
|
|
+ .FirstAsync();
|
|
|
|
|
|
centerReportStatisticsDto.enterpriseOrderDto.VisitdCount = enterpriseOrderDto2.VisitdCount;
|
|
centerReportStatisticsDto.enterpriseOrderDto.VisitdCount = enterpriseOrderDto2.VisitdCount;
|
|
- centerReportStatisticsDto.enterpriseOrderDto.Dissatisfied = enterpriseOrderDto2.Dissatisfied;
|
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto.CityDissatisfied = enterpriseOrderDto2.CityDissatisfied;
|
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto.CountyDissatisfied = enterpriseOrderDto2.CountyDissatisfied;
|
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto.Satisfied = enterpriseOrderDto2.Satisfied;
|
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto.CitySatisfied = enterpriseOrderDto2.CitySatisfied;
|
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto.CountySatisfied = enterpriseOrderDto2.CountySatisfied;
|
|
|
|
|
|
+ centerReportStatisticsDto.enterpriseOrderDto.Dissatisfied = enterpriseOrderDto2.Dissatisfied;
|
|
|
|
+ centerReportStatisticsDto.enterpriseOrderDto.CityDissatisfied = enterpriseOrderDto2.CityDissatisfied;
|
|
|
|
+ centerReportStatisticsDto.enterpriseOrderDto.CountyDissatisfied = enterpriseOrderDto2.CountyDissatisfied;
|
|
|
|
+ centerReportStatisticsDto.enterpriseOrderDto.Satisfied = enterpriseOrderDto2.Satisfied;
|
|
|
|
+ centerReportStatisticsDto.enterpriseOrderDto.CitySatisfied = enterpriseOrderDto2.CitySatisfied;
|
|
|
|
+ centerReportStatisticsDto.enterpriseOrderDto.CountySatisfied = enterpriseOrderDto2.CountySatisfied;
|
|
|
|
|
|
- #endregion
|
|
|
|
|
|
+ #endregion
|
|
|
|
|
|
- return centerReportStatisticsDto;
|
|
|
|
|
|
+ return centerReportStatisticsDto;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -4557,7 +4561,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
var (total, items) = await _orderApplication.HotspotAndAcceptTypeStatisticsDetail(dto).ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
var (total, items) = await _orderApplication.HotspotAndAcceptTypeStatisticsDetail(dto).ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
return new PagedDto<OrderDto>(total, _mapper.Map<IReadOnlyList<OrderDto>>(items));
|
|
return new PagedDto<OrderDto>(total, _mapper.Map<IReadOnlyList<OrderDto>>(items));
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 热点受理类型明细导出
|
|
/// 热点受理类型明细导出
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -4921,7 +4925,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
});
|
|
});
|
|
return items;
|
|
return items;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 中心受理统计导出
|
|
/// 中心受理统计导出
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -4975,7 +4979,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
var (total, items) = await _orderApplication.OrderCenterAcceptUser(dto).ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
var (total, items) = await _orderApplication.OrderCenterAcceptUser(dto).ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
return new PagedDto<OrderCenterAcceptUserVo>(total, items);
|
|
return new PagedDto<OrderCenterAcceptUserVo>(total, items);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 中心受理值班坐席统计导出
|
|
/// 中心受理值班坐席统计导出
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -5017,7 +5021,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
var items = await _orderRepository.OrderCenterAcceptHour(dto).ToListAsync(HttpContext.RequestAborted);
|
|
var items = await _orderRepository.OrderCenterAcceptHour(dto).ToListAsync(HttpContext.RequestAborted);
|
|
return items;
|
|
return items;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 中心受理时间段统计导出
|
|
/// 中心受理时间段统计导出
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -5205,7 +5209,66 @@ namespace Hotline.Api.Controllers.Bi
|
|
return new PagedDto<OrderDelayDto>(total, _mapper.Map<IReadOnlyList<OrderDelayDto>>(items));
|
|
return new PagedDto<OrderDelayDto>(total, _mapper.Map<IReadOnlyList<OrderDelayDto>>(items));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 工单热词分析
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpGet("query_order_ts_details_list")]
|
|
|
|
+ public async Task<PagedDto<OrderTsDetailsDto>> QueryOrderTsDetailsList([FromQuery] PagedKeywordRequest dto)
|
|
|
|
+ {
|
|
|
|
+ var (total, items) = await _orderApplication.QueryOrderTsDetailslList(dto).ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
|
+
|
|
|
|
+ return new PagedDto<OrderTsDetailsDto>(total, _mapper.Map<IReadOnlyList<OrderTsDetailsDto>>(items));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 工单热词分析导出
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpPost("query_order_ts_details_list/export")]
|
|
|
|
+ public async Task<FileStreamResult> ExportQueryOrderTsDetailsList([FromQuery] ExportExcelDto<PagedKeywordRequest> dto)
|
|
|
|
+ {
|
|
|
|
+ var query = _orderApplication.QueryOrderTsDetailslList(dto.QueryDto);
|
|
|
|
+
|
|
|
|
+ List<OrderTsDetailsDto> lists;
|
|
|
|
+ if (dto.IsExportAll)
|
|
|
|
+ {
|
|
|
|
+ lists = await query.ToListAsync(HttpContext.RequestAborted);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ var (_, items) = await query.ToPagedListAsync(dto.QueryDto, HttpContext.RequestAborted);
|
|
|
|
+ lists = items;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var listDtos = _mapper.Map<ICollection<OrderTsDetailsDto>>(lists);
|
|
|
|
+
|
|
|
|
+ dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(dto.ColumnInfos);
|
|
|
|
+
|
|
|
|
+ var dtos = listDtos
|
|
|
|
+ .Select(stu => _mapper.Map(stu, typeof(OrderTsDetailsDto), dynamicClass))
|
|
|
|
+ .Cast<object>()
|
|
|
|
+ .ToList();
|
|
|
|
+
|
|
|
|
+ var stream = ExcelHelper.CreateStream(dtos);
|
|
|
|
+
|
|
|
|
+ return ExcelStreamResult(stream, "工单热词分析数据");
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 根据热词查询工单
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="KeyWord"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpGet("get_query_order_ts_details_order_list")]
|
|
|
|
+ public async Task<List<OrderTsDetails>> GetQueryOrderTsDetailslOrderList(string KeyWord)
|
|
|
|
+ {
|
|
|
|
+ return await _orderTsDetailsRepository.Queryable()
|
|
|
|
+ .Where(p => p.Terms == KeyWord)
|
|
|
|
+ .ToListAsync(HttpContext.RequestAborted);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|