|
@@ -43,6 +43,10 @@ using XF.Utility.EnumExtensions;
|
|
|
using Hotline.Statistics;
|
|
|
using DocumentFormat.OpenXml.Drawing;
|
|
|
using DocumentFormat.OpenXml.Bibliography;
|
|
|
+using NPOI.SS.Formula.Functions;
|
|
|
+using Hotline.Share.Dtos.File;
|
|
|
+using Hotline.File;
|
|
|
+using Hotline.KnowledgeBase;
|
|
|
using DocumentFormat.OpenXml.Vml.Spreadsheet;
|
|
|
|
|
|
namespace Hotline.Api.Controllers.Bi
|
|
@@ -84,6 +88,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
private readonly ISystemOrganizeRepository _organizeRepository;
|
|
|
private readonly IRepository<CallNative> _callNativeRepository;
|
|
|
private readonly IOptionsSnapshot<AppConfiguration> _appOptions;
|
|
|
+ private readonly IRepository<OrderTsDetails> _orderTsDetailsRepository;
|
|
|
+ private readonly IRepository<KnowledgeQuote> _knowledgeQuoteRepository;
|
|
|
|
|
|
public BiOrderController(
|
|
|
IOrderRepository orderRepository,
|
|
@@ -120,7 +126,9 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
IExportApplication exportApplication,
|
|
|
IOrderVisitApplication orderVisitApplication,
|
|
|
IRepository<CallNative> callNativeRepository,
|
|
|
- IOptionsSnapshot<AppConfiguration> appOptions)
|
|
|
+ IOptionsSnapshot<AppConfiguration> appOptions,
|
|
|
+ IRepository<OrderTsDetails> orderTsDetailsRepository,
|
|
|
+ IRepository<KnowledgeQuote> knowledgeQuoteRepository)
|
|
|
{
|
|
|
_orderRepository = orderRepository;
|
|
|
_hotspotTypeRepository = hotspotTypeRepository;
|
|
@@ -157,6 +165,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
_orderVisitApplication = orderVisitApplication;
|
|
|
_callNativeRepository = callNativeRepository;
|
|
|
_appOptions = appOptions;
|
|
|
+ _orderTsDetailsRepository = orderTsDetailsRepository;
|
|
|
+ _knowledgeQuoteRepository = knowledgeQuoteRepository;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -1583,6 +1593,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
NoSatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoSatisfiedCount),
|
|
|
NoEvaluateCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoEvaluateCount),
|
|
|
NoPutThroughCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoPutThroughCount),
|
|
|
+ NormalCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NormalCount),
|
|
|
+ VeryNoSatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.VeryNoSatisfiedCount),
|
|
|
};
|
|
|
|
|
|
var citySumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
@@ -1596,6 +1608,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
NoSatisfiedCount = data.Where(x => x.OrgType == EOrgType.City && x.OrgCode != "001").Sum(x => x.NoSatisfiedCount),
|
|
|
NoEvaluateCount = data.Where(x => x.OrgType == EOrgType.City && x.OrgCode != "001").Sum(x => x.NoEvaluateCount),
|
|
|
NoPutThroughCount = data.Where(x => x.OrgType == EOrgType.City && x.OrgCode != "001").Sum(x => x.NoPutThroughCount),
|
|
|
+ NormalCount = data.Where(x => x.OrgType == EOrgType.City && x.OrgCode != "001").Sum(x => x.NormalCount),
|
|
|
+ VeryNoSatisfiedCount = data.Where(x => x.OrgType == EOrgType.City && x.OrgCode != "001").Sum(x => x.VeryNoSatisfiedCount),
|
|
|
};
|
|
|
|
|
|
var sumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
@@ -1609,6 +1623,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
NoSatisfiedCount = data.Sum(x => x.NoSatisfiedCount),
|
|
|
NoEvaluateCount = data.Sum(x => x.NoEvaluateCount),
|
|
|
NoPutThroughCount = data.Sum(x => x.NoPutThroughCount),
|
|
|
+ NormalCount = data.Sum(x => x.NormalCount),
|
|
|
+ VeryNoSatisfiedCount = data.Sum(x => x.VeryNoSatisfiedCount),
|
|
|
};
|
|
|
|
|
|
|
|
@@ -1635,6 +1651,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
NoSatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoSatisfiedCount),
|
|
|
NoEvaluateCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoEvaluateCount),
|
|
|
NoPutThroughCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoPutThroughCount),
|
|
|
+ NormalCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NormalCount),
|
|
|
+ VeryNoSatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.VeryNoSatisfiedCount),
|
|
|
};
|
|
|
var citySumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
{
|
|
@@ -1647,6 +1665,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
NoSatisfiedCount = data.Where(x => x.OrgType == EOrgType.City && x.OrgCode != "001").Sum(x => x.NoSatisfiedCount),
|
|
|
NoEvaluateCount = data.Where(x => x.OrgType == EOrgType.City && x.OrgCode != "001").Sum(x => x.NoEvaluateCount),
|
|
|
NoPutThroughCount = data.Where(x => x.OrgType == EOrgType.City && x.OrgCode != "001").Sum(x => x.NoPutThroughCount),
|
|
|
+ NormalCount = data.Where(x => x.OrgType == EOrgType.City && x.OrgCode != "001").Sum(x => x.NormalCount),
|
|
|
+ VeryNoSatisfiedCount = data.Where(x => x.OrgType == EOrgType.City && x.OrgCode != "001").Sum(x => x.VeryNoSatisfiedCount),
|
|
|
};
|
|
|
var sumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
{
|
|
@@ -1659,6 +1679,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
NoSatisfiedCount = data.Sum(x => x.NoSatisfiedCount),
|
|
|
NoEvaluateCount = data.Sum(x => x.NoEvaluateCount),
|
|
|
NoPutThroughCount = data.Sum(x => x.NoPutThroughCount),
|
|
|
+ NormalCount = data.Sum(x => x.NormalCount),
|
|
|
+ VeryNoSatisfiedCount = data.Sum(x => x.VeryNoSatisfiedCount),
|
|
|
};
|
|
|
data.Add(countySumModel);
|
|
|
data.Add(citySumModel);
|
|
@@ -1694,6 +1716,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
NoSatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoSatisfiedCount),
|
|
|
NoEvaluateCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoEvaluateCount),
|
|
|
NoPutThroughCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoPutThroughCount),
|
|
|
+ NormalCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NormalCount),
|
|
|
+ VeryNoSatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.VeryNoSatisfiedCount),
|
|
|
};
|
|
|
|
|
|
var citySumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
@@ -1707,6 +1731,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
NoSatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoSatisfiedCount),
|
|
|
NoEvaluateCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoEvaluateCount),
|
|
|
NoPutThroughCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoPutThroughCount),
|
|
|
+ NormalCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NormalCount),
|
|
|
+ VeryNoSatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.VeryNoSatisfiedCount),
|
|
|
};
|
|
|
|
|
|
var sumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
@@ -1720,6 +1746,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
NoSatisfiedCount = list.Sum(x => x.NoSatisfiedCount),
|
|
|
NoEvaluateCount = list.Sum(x => x.NoEvaluateCount),
|
|
|
NoPutThroughCount = list.Sum(x => x.NoPutThroughCount),
|
|
|
+ NormalCount = list.Sum(x => x.NormalCount),
|
|
|
+ VeryNoSatisfiedCount = list.Sum(x => x.VeryNoSatisfiedCount),
|
|
|
};
|
|
|
|
|
|
return new VisitAndOrgSatisfactionStatisticsResultDto { DataList = list, CountySumModel = countySumModel, CitySumModel = citySumModel, SumModel = sumModel };
|
|
@@ -1745,6 +1773,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
NoSatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoSatisfiedCount),
|
|
|
NoEvaluateCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoEvaluateCount),
|
|
|
NoPutThroughCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoPutThroughCount),
|
|
|
+ NormalCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NormalCount),
|
|
|
+ VeryNoSatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.VeryNoSatisfiedCount),
|
|
|
};
|
|
|
var citySumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
{
|
|
@@ -1757,6 +1787,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
NoSatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoSatisfiedCount),
|
|
|
NoEvaluateCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoEvaluateCount),
|
|
|
NoPutThroughCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoPutThroughCount),
|
|
|
+ NormalCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NormalCount),
|
|
|
+ VeryNoSatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.VeryNoSatisfiedCount),
|
|
|
};
|
|
|
var sumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
{
|
|
@@ -1769,6 +1801,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
NoSatisfiedCount = list.Sum(x => x.NoSatisfiedCount),
|
|
|
NoEvaluateCount = list.Sum(x => x.NoEvaluateCount),
|
|
|
NoPutThroughCount = list.Sum(x => x.NoPutThroughCount),
|
|
|
+ NormalCount = list.Sum(x => x.NormalCount),
|
|
|
+ VeryNoSatisfiedCount = list.Sum(x => x.VeryNoSatisfiedCount),
|
|
|
};
|
|
|
list.Add(countySumModel);
|
|
|
list.Add(citySumModel);
|
|
@@ -1877,7 +1911,11 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
.Select(o => new CenterReportCallDto
|
|
|
{
|
|
|
EffectiveCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.OnState == EOnState.On, 1, 0)),//有效
|
|
|
- InvalidCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.OnState == EOnState.NoOn /*&& o.BeginIvrTime.HasValue && o.BeginQueueTime.HasValue && o.BeginRingTime.HasValue*/, 1, 0)), //无效(排除队列挂断和IVR挂断)
|
|
|
+ InTotal = SqlFunc.AggregateSum(SqlFunc.IIF(o.CallDirection == ECallDirection.In, 1, 0)),//呼入总量
|
|
|
+ OutTotal = SqlFunc.AggregateSum(SqlFunc.IIF(o.CallDirection == ECallDirection.Out, 1, 0)),//呼出总量
|
|
|
+ InConnectionQuantity = SqlFunc.AggregateSum(SqlFunc.IIF(o.CallDirection == ECallDirection.In && o.AnsweredTime != null, 1, 0)),//呼入接通量
|
|
|
+ OutConnectionQuantity = SqlFunc.AggregateSum(SqlFunc.IIF(o.TelNo != "0" && o.CallDirection == ECallDirection.Out && o.AnsweredTime != null, 1, 0)),//呼出接通量
|
|
|
+ InvalidCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.OnState == EOnState.NoOn /*&& o.BeginIvrTime.HasValue && o.BeginQueueTime.HasValue && o.BeginRingTime.HasValue*/, 1, 0)), //无效(排除队列挂断和IVR挂断)
|
|
|
QueueByeCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.CallDirection == ECallDirection.In && o.QueueTims > 0 && o.RingTimes == 0 && o.OnState == EOnState.NoOn, 1, 0)), //队列挂断
|
|
|
IvrByeCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.CallDirection == ECallDirection.In && o.BeginIvrTime.HasValue && !o.BeginQueueTime.HasValue && !o.BeginRingTime.HasValue && o.OnState == EOnState.NoOn, 1, 0)), //IVR挂断
|
|
|
})
|
|
@@ -1885,7 +1923,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
if (callData != null)
|
|
|
callData.InvalidCount = callData.InvalidCount - callData.QueueByeCount - callData.IvrByeCount;
|
|
|
|
|
|
- if (listOld != null && callData != null)
|
|
|
+ if (listOld != null && listOld.Rows.Count > 0 && callData != null)
|
|
|
{
|
|
|
callData.EffectiveCount = callData.EffectiveCount + Convert.ToInt32(listOld.Rows[0]["CallInConn"]); // 有效
|
|
|
callData.InvalidCount = callData.InvalidCount + Convert.ToInt32(listOld.Rows[0]["CallInNotConn"]); // 无效
|
|
@@ -1926,14 +1964,14 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
})
|
|
|
.FirstAsync();
|
|
|
|
|
|
- if (listOld != null && orderData != null)
|
|
|
+ if (listOld != null && listOld.Rows.Count > 0 && orderData != null)
|
|
|
{
|
|
|
orderData.EffectiveCount = orderData.EffectiveCount + Convert.ToInt32(listOld.Rows[0]["OrderNormalNum"]); // 有效
|
|
|
orderData.InvalidCount = orderData.InvalidCount + Convert.ToInt32(listOld.Rows[0]["OrderInvalidNum"]); // 无效
|
|
|
orderData.CompletedCount = orderData.CompletedCount + Convert.ToInt32(listOld.Rows[0]["OrderEndNum"]); // 已办
|
|
|
orderData.InProgressCount = orderData.InProgressCount + Convert.ToInt32(listOld.Rows[0]["OrderWaitNum"]); // 在办
|
|
|
}
|
|
|
- if (listInfo != null && orderData != null)
|
|
|
+ if (listInfo != null && listOld.Rows.Count > 0 && orderData != null)
|
|
|
{
|
|
|
orderData.CityAccept = orderData.CityAccept + Convert.ToInt32(listInfo.Rows[0]["OrderCityCount"]); // 市级部门受理
|
|
|
orderData.CountyAccept = orderData.CountyAccept + Convert.ToInt32(listInfo.Rows[0]["OrderCountyCount"]); // 县(区)受理
|
|
@@ -1960,7 +1998,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
})
|
|
|
.FirstAsync();
|
|
|
|
|
|
- if (listInfo != null && orderCompletedData != null)
|
|
|
+ if (listInfo != null && listInfo.Rows.Count > 0 && orderCompletedData != null)
|
|
|
{
|
|
|
orderCompletedData.ExpiredTimeCompletedCount = orderCompletedData.ExpiredTimeCompletedCount + Convert.ToInt32(listInfo.Rows[0]["OrderAlready"]) - Convert.ToInt32(listInfo.Rows[0]["CompleteOnTime"]);
|
|
|
orderCompletedData.CityExpiredTimeCompletedCount = orderCompletedData.CityExpiredTimeCompletedCount + Convert.ToInt32(listInfo.Rows[0]["CityAlready"]) - Convert.ToInt32(listInfo.Rows[0]["CityCompleteOnTime"]);
|
|
@@ -1971,7 +2009,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
orderCompletedData.CenterCompletedCount = orderCompletedData.CenterCompletedCount + Convert.ToInt32(listInfo.Rows[0]["CenterAlready"]);
|
|
|
}
|
|
|
|
|
|
- centerReportStatisticsDto.orderCompletedDto = orderCompletedData;
|
|
|
+ centerReportStatisticsDto.OrderCompletedDto = orderCompletedData;
|
|
|
|
|
|
//工单办理时效
|
|
|
var orderAgingData = await _orderRepository.Queryable()
|
|
@@ -1998,7 +2036,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
})
|
|
|
.FirstAsync();
|
|
|
|
|
|
- if (listInfo != null && orderAgingData != null)
|
|
|
+ if (listInfo != null && listInfo.Rows.Count > 0 && orderAgingData != null)
|
|
|
{
|
|
|
orderAgingData.OrderCount = orderAgingData.OrderCount + Convert.ToInt32(listInfo.Rows[0]["AllCount"]);
|
|
|
orderAgingData.CompletedAging = orderAgingData.CompletedAging + Convert.ToInt32(listInfo.Rows[0]["OrderWorkTime"]);
|
|
@@ -2010,7 +2048,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
orderAgingData.CenterCompletedAging = orderAgingData.CenterCompletedAging + Convert.ToInt32(listInfo.Rows[0]["CenterWorkTime"]);
|
|
|
}
|
|
|
|
|
|
- centerReportStatisticsDto.orderAgingDto = orderAgingData;
|
|
|
+ centerReportStatisticsDto.OrderAgingDto = orderAgingData;
|
|
|
#endregion
|
|
|
|
|
|
#region 信件来源
|
|
@@ -2049,7 +2087,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- if (listOld != null && sourceChannel != null)
|
|
|
+ if (listOld != null && listOld.Rows.Count > 0 && sourceChannel != null)
|
|
|
{
|
|
|
foreach (var item in sourceChannel)
|
|
|
{
|
|
@@ -2133,7 +2171,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- if (listPurOld != null && acceptType != null)
|
|
|
+ if (listPurOld != null && listPurOld.Rows.Count > 0 && acceptType != null)
|
|
|
{
|
|
|
foreach (var item in acceptType)
|
|
|
{
|
|
@@ -2215,7 +2253,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
centerReportVisitd.CityDissatisfied = data.CityDissatisfied;
|
|
|
centerReportVisitd.CountyDissatisfied = data.CountyDissatisfied;
|
|
|
|
|
|
- if (listOld != null && centerReportVisitd != null)
|
|
|
+ if (listOld != null && listOld.Rows.Count > 0 && centerReportVisitd != null)
|
|
|
{
|
|
|
centerReportVisitd.Visitd = centerReportVisitd.Visitd + Convert.ToInt32(listOld.Rows[0]["VisitAlreadyNum"]); // 已回访
|
|
|
centerReportVisitd.WaitVisitd = centerReportVisitd.WaitVisitd + Convert.ToInt32(listOld.Rows[0]["VisitWaitNum"]); // 待回访
|
|
@@ -2223,7 +2261,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
centerReportVisitd.OrgRate = Math.Round((centerReportVisitd.OrgRate + Convert.ToDouble(listOld.Rows[0]["SatisfactionDepartment"])) / 2, 2); // 部门满意度
|
|
|
}
|
|
|
|
|
|
- if (listInfo != null && centerReportVisitd != null)
|
|
|
+ if (listInfo != null && listInfo.Rows.Count > 0 && centerReportVisitd != null)
|
|
|
{
|
|
|
//总体满意率
|
|
|
centerReportVisitd.AllRate = Math.Round(centerReportVisitd.AllRate + Convert.ToDouble(listInfo.Rows[0]["SatisfactionRate"]) / 2, 2);
|
|
@@ -2431,7 +2469,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
})
|
|
|
.FirstAsync();
|
|
|
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto = enterpriseOrderDto;
|
|
|
+ centerReportStatisticsDto.EnterpriseOrderDto = enterpriseOrderDto;
|
|
|
var enterpriseOrderDto2 = await _orderVisitDetailRepository.Queryable()
|
|
|
.Includes(it => it.OrderVisit, ov => ov.Order)
|
|
|
.LeftJoin<SystemOrganize>((it, so) => it.VisitOrgCode == so.Id)
|
|
@@ -2449,492 +2487,99 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
})
|
|
|
.FirstAsync();
|
|
|
|
|
|
- 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;
|
|
|
+ if (enterpriseOrderDto2 != null)
|
|
|
+ {
|
|
|
+ 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;
|
|
|
+ }
|
|
|
|
|
|
- if (listInfo != null && centerReportStatisticsDto.enterpriseOrderDto != null)
|
|
|
+ if (listInfo != null && listInfo.Rows.Count > 0 && centerReportStatisticsDto.EnterpriseOrderDto != null)
|
|
|
{
|
|
|
// 企业办件
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto.OrderCount = centerReportStatisticsDto.enterpriseOrderDto.OrderCount + Convert.ToInt32(listInfo.Rows[0]["EnterpriseAllCount"]);
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto.CompletedAging = centerReportStatisticsDto.enterpriseOrderDto.CompletedAging + Convert.ToInt32(listInfo.Rows[0]["EnterpriseWorkTime"]);
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto.CityOrderCount = centerReportStatisticsDto.enterpriseOrderDto.CityOrderCount + Convert.ToInt32(listInfo.Rows[0]["EnterpriseCity"]);
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto.CityCompletedAging = centerReportStatisticsDto.enterpriseOrderDto.CityCompletedAging + Convert.ToInt32(listInfo.Rows[0]["EnterpriseCityWorkTime"]);
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto.CountyOrderCount = centerReportStatisticsDto.enterpriseOrderDto.CountyOrderCount + Convert.ToInt32(listInfo.Rows[0]["EnterpriseCounty"]);
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto.CountyCompletedAging = centerReportStatisticsDto.enterpriseOrderDto.CountyCompletedAging + Convert.ToInt32(listInfo.Rows[0]["EnterpriseCountyWorkTime"]);
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto.CenterOrderCount = centerReportStatisticsDto.enterpriseOrderDto.CenterOrderCount + Convert.ToInt32(listInfo.Rows[0]["EnterpriseCenter"]);
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto.CenterCompletedAging = centerReportStatisticsDto.enterpriseOrderDto.CenterCompletedAging + Convert.ToInt32(listInfo.Rows[0]["EnterpriseCenterWorkTime"]);
|
|
|
+ centerReportStatisticsDto.EnterpriseOrderDto.OrderCount = centerReportStatisticsDto.EnterpriseOrderDto.OrderCount + Convert.ToInt32(listInfo.Rows[0]["EnterpriseAllCount"]);
|
|
|
+ centerReportStatisticsDto.EnterpriseOrderDto.CompletedAging = centerReportStatisticsDto.EnterpriseOrderDto.CompletedAging + Convert.ToInt32(listInfo.Rows[0]["EnterpriseWorkTime"]);
|
|
|
+ centerReportStatisticsDto.EnterpriseOrderDto.CityOrderCount = centerReportStatisticsDto.EnterpriseOrderDto.CityOrderCount + Convert.ToInt32(listInfo.Rows[0]["EnterpriseCity"]);
|
|
|
+ centerReportStatisticsDto.EnterpriseOrderDto.CityCompletedAging = centerReportStatisticsDto.EnterpriseOrderDto.CityCompletedAging + Convert.ToInt32(listInfo.Rows[0]["EnterpriseCityWorkTime"]);
|
|
|
+ centerReportStatisticsDto.EnterpriseOrderDto.CountyOrderCount = centerReportStatisticsDto.EnterpriseOrderDto.CountyOrderCount + Convert.ToInt32(listInfo.Rows[0]["EnterpriseCounty"]);
|
|
|
+ centerReportStatisticsDto.EnterpriseOrderDto.CountyCompletedAging = centerReportStatisticsDto.EnterpriseOrderDto.CountyCompletedAging + Convert.ToInt32(listInfo.Rows[0]["EnterpriseCountyWorkTime"]);
|
|
|
+ centerReportStatisticsDto.EnterpriseOrderDto.CenterOrderCount = centerReportStatisticsDto.EnterpriseOrderDto.CenterOrderCount + Convert.ToInt32(listInfo.Rows[0]["EnterpriseCenter"]);
|
|
|
+ centerReportStatisticsDto.EnterpriseOrderDto.CenterCompletedAging = centerReportStatisticsDto.EnterpriseOrderDto.CenterCompletedAging + Convert.ToInt32(listInfo.Rows[0]["EnterpriseCenterWorkTime"]);
|
|
|
// 企业满意度
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto.VisitdCount = centerReportStatisticsDto.enterpriseOrderDto.VisitdCount + Convert.ToInt32(listInfo.Rows[0]["EnterpriseVisit"]);
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto.Dissatisfied = centerReportStatisticsDto.enterpriseOrderDto.Dissatisfied + Convert.ToInt32(listInfo.Rows[0]["EnterpriseDisSatisfaction"]);
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto.CityDissatisfied = centerReportStatisticsDto.enterpriseOrderDto.CityDissatisfied + Convert.ToInt32(listInfo.Rows[0]["CityCount"]) - Convert.ToInt32(listInfo.Rows[0]["CitySatisfactionCount"]);
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto.CountyDissatisfied = centerReportStatisticsDto.enterpriseOrderDto.CountyDissatisfied + Convert.ToInt32(listInfo.Rows[0]["CountyCount"]) - Convert.ToInt32(listInfo.Rows[0]["CountySatisfactionCount"]);
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto.Satisfied = centerReportStatisticsDto.enterpriseOrderDto.Satisfied + Convert.ToInt32(listInfo.Rows[0]["AllCount"]) - Convert.ToInt32(listInfo.Rows[0]["SatisfactionCount"]);
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto.CitySatisfied = centerReportStatisticsDto.enterpriseOrderDto.CitySatisfied + Convert.ToInt32(listInfo.Rows[0]["EnterpriseCitySatisfaction"]);
|
|
|
- centerReportStatisticsDto.enterpriseOrderDto.CountySatisfied = centerReportStatisticsDto.enterpriseOrderDto.CountySatisfied + Convert.ToInt32(listInfo.Rows[0]["EnterpriseCountySatisfaction"]);
|
|
|
+ centerReportStatisticsDto.EnterpriseOrderDto.VisitdCount = centerReportStatisticsDto.EnterpriseOrderDto.VisitdCount + Convert.ToInt32(listInfo.Rows[0]["EnterpriseVisit"]);
|
|
|
+ centerReportStatisticsDto.EnterpriseOrderDto.Dissatisfied = centerReportStatisticsDto.EnterpriseOrderDto.Dissatisfied + Convert.ToInt32(listInfo.Rows[0]["EnterpriseDisSatisfaction"]);
|
|
|
+ centerReportStatisticsDto.EnterpriseOrderDto.CityDissatisfied = centerReportStatisticsDto.EnterpriseOrderDto.CityDissatisfied + Convert.ToInt32(listInfo.Rows[0]["CityCount"]) - Convert.ToInt32(listInfo.Rows[0]["CitySatisfactionCount"]);
|
|
|
+ centerReportStatisticsDto.EnterpriseOrderDto.CountyDissatisfied = centerReportStatisticsDto.EnterpriseOrderDto.CountyDissatisfied + Convert.ToInt32(listInfo.Rows[0]["CountyCount"]) - Convert.ToInt32(listInfo.Rows[0]["CountySatisfactionCount"]);
|
|
|
+ centerReportStatisticsDto.EnterpriseOrderDto.Satisfied = centerReportStatisticsDto.EnterpriseOrderDto.Satisfied + Convert.ToInt32(listInfo.Rows[0]["AllCount"]) - Convert.ToInt32(listInfo.Rows[0]["SatisfactionCount"]);
|
|
|
+ centerReportStatisticsDto.EnterpriseOrderDto.CitySatisfied = centerReportStatisticsDto.EnterpriseOrderDto.CitySatisfied + Convert.ToInt32(listInfo.Rows[0]["EnterpriseCitySatisfaction"]);
|
|
|
+ centerReportStatisticsDto.EnterpriseOrderDto.CountySatisfied = centerReportStatisticsDto.EnterpriseOrderDto.CountySatisfied + Convert.ToInt32(listInfo.Rows[0]["EnterpriseCountySatisfaction"]);
|
|
|
}
|
|
|
|
|
|
- #endregion
|
|
|
-
|
|
|
- return centerReportStatisticsDto;
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 企业信件分类
|
|
|
+ //信件来源
|
|
|
+ var enterpriseAcceptTypeData = await _orderRepository.Queryable(false, false, false)
|
|
|
+ .Where(p => p.CreationTime >= StartTime && p.CreationTime <= EndTime && p.IdentityType == EIdentityType.Enterprise)
|
|
|
+ .Select(it => new
|
|
|
+ {
|
|
|
+ AcceptTypeCode = SqlFunc.IIF(SqlFunc.IsNullOrEmpty(it.AcceptTypeCode), "40", it.AcceptTypeCode),
|
|
|
+ FileOrgIsCenter = it.FileOrgIsCenter.HasValue ? it.FileOrgIsCenter : true,
|
|
|
+ CreationTimeHandleDurationWorkday = it.CreationTimeHandleDurationWorkday.HasValue ? it.CenterToOrgHandleDurationWorkday : 0,
|
|
|
+ CenterToOrgHandleDurationWorkday = it.CenterToOrgHandleDurationWorkday.HasValue ? it.CenterToOrgHandleDurationWorkday : 0,
|
|
|
+ })
|
|
|
+ .MergeTable()//将查询出来的结果合并成一个新表
|
|
|
+ .GroupBy(temp => new { temp.AcceptTypeCode })//对新表进行分组
|
|
|
+ .Select(temp => new CenterReportOrderSourceChannelDto
|
|
|
+ {
|
|
|
+ Code = temp.AcceptTypeCode,
|
|
|
+ CountNum = SqlFunc.AggregateCount(temp.AcceptTypeCode),
|
|
|
+ CompletedAging = SqlFunc.AggregateSum(SqlFunc.IIF(temp.FileOrgIsCenter == true, temp.CreationTimeHandleDurationWorkday, temp.CenterToOrgHandleDurationWorkday))
|
|
|
+ })
|
|
|
+ .ToListAsync();
|
|
|
+ List<CenterReportOrderSourceChannelDto> enterpriseAcceptType = new();
|
|
|
+ var enterpriseAcceptTypeDic = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.AcceptType);
|
|
|
+ foreach (var item in enterpriseAcceptTypeDic)
|
|
|
+ {
|
|
|
+ enterpriseAcceptType.Add(new CenterReportOrderSourceChannelDto
|
|
|
+ {
|
|
|
+ AllCountNum = sourceChannelCount,
|
|
|
+ Name = item.DicDataName,
|
|
|
+ Code = item.DicTypeCode,
|
|
|
+ CountNum = enterpriseAcceptTypeData.Find(p => p.Code == item.DicDataValue)?.CountNum ?? 0,
|
|
|
+ CompletedAging = enterpriseAcceptTypeData.Find(p => p.Code == item.DicDataValue)?.CompletedAging ?? 0
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ if (listPurOld != null && listPurOld.Rows.Count > 0 && enterpriseAcceptType != null)
|
|
|
+ {
|
|
|
+ foreach (var item in enterpriseAcceptType)
|
|
|
+ {
|
|
|
+ if (item.Code == "10")
|
|
|
+ item.CountNum = item.CountNum + Convert.ToInt32(listPurOld.Rows[0]["Consult"]); // 咨询
|
|
|
+ else if (item.Code == "15")
|
|
|
+ item.CountNum = item.CountNum + Convert.ToInt32(listPurOld.Rows[0]["Suggest"]); // 建议
|
|
|
+ else if (item.Code == "20")
|
|
|
+ item.CountNum = item.CountNum + Convert.ToInt32(listPurOld.Rows[0]["SeekHelp"]); // 求助
|
|
|
+ else if (item.Code == "25")
|
|
|
+ item.CountNum = item.CountNum + Convert.ToInt32(listPurOld.Rows[0]["Praise"]); // 表扬
|
|
|
+ else if (item.Code == "30")
|
|
|
+ item.CountNum = item.CountNum + Convert.ToInt32(listPurOld.Rows[0]["Report"]); // 举报
|
|
|
+ else if (item.Code == "35")
|
|
|
+ item.CountNum = item.CountNum + Convert.ToInt32(listPurOld.Rows[0]["Complaint"]); // 投诉
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ centerReportStatisticsDto.EnterpriseCenterReportOrderAcceptTypes = enterpriseAcceptType;
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ return centerReportStatisticsDto;
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 中心报表统计--宜宾
|
|
|
- /// </summary>
|
|
|
- /// <param name="StartTime"></param>
|
|
|
- /// <param name="EndTime"></param>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpGet("center_report_forms_statistics_v1")]
|
|
|
- public async Task<CenterReportStatisticsDto> CenterReportFormsStatisticsV1(DateTime StartTime, DateTime EndTime)
|
|
|
- {
|
|
|
- CenterReportStatisticsDto centerReportStatisticsDto = new();
|
|
|
-
|
|
|
- // 查询工单老数据
|
|
|
- var listOld = await _orderRepository.CenterReportFormsStatistics(StartTime, EndTime);
|
|
|
- // 查询类型老数据
|
|
|
- var listPurOld = await _orderRepository.CenterReportPurTypeStatistics(StartTime, EndTime);
|
|
|
- // 查询部门老数据
|
|
|
- var listCity = await _orderRepository.CenterReportDepartStatistics(StartTime, EndTime, "市直部门");
|
|
|
- var listCounty = await _orderRepository.CenterReportDepartStatistics(StartTime, EndTime, "区县部门");
|
|
|
-
|
|
|
- // 查询老数据详情
|
|
|
- //var listTest = await _orderRepository.CenterReportNewStatistics(StartTime, EndTime);
|
|
|
-
|
|
|
- //信件总量
|
|
|
- int sourceChannelCount = await _orderRepository.Queryable().Where(p => p.CreationTime >= StartTime && p.CreationTime <= EndTime).CountAsync();
|
|
|
-
|
|
|
- #region 通话记录
|
|
|
- //通话记录
|
|
|
- var callData = await _trCallRecordRepository.Queryable()
|
|
|
- .Where(p => p.CreatedTime >= StartTime && p.CreatedTime <= EndTime && p.Gateway != "82826886" && SqlFunc.Length(p.Gateway) != 4)
|
|
|
- .Select(o => new CenterReportCallDto
|
|
|
- {
|
|
|
- EffectiveCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.OnState == EOnState.On, 1, 0)),//有效
|
|
|
- InvalidCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.OnState == EOnState.NoOn /*&& o.BeginIvrTime.HasValue && o.BeginQueueTime.HasValue && o.BeginRingTime.HasValue*/, 1, 0)), //无效(排除队列挂断和IVR挂断)
|
|
|
- QueueByeCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.CallDirection == ECallDirection.In && o.QueueTims > 0 && o.RingTimes == 0 && o.OnState == EOnState.NoOn, 1, 0)), //队列挂断
|
|
|
- IvrByeCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.CallDirection == ECallDirection.In && o.BeginIvrTime.HasValue && !o.BeginQueueTime.HasValue && !o.BeginRingTime.HasValue && o.OnState == EOnState.NoOn, 1, 0)), //IVR挂断
|
|
|
- })
|
|
|
- .FirstAsync();
|
|
|
- if (callData != null)
|
|
|
- callData.InvalidCount = callData.InvalidCount - callData.QueueByeCount - callData.IvrByeCount;
|
|
|
-
|
|
|
- if (listOld != null && callData != null)
|
|
|
- {
|
|
|
- callData.EffectiveCount = callData.EffectiveCount + Convert.ToInt32(listOld.Rows[0]["CallInConn"]); // 有效
|
|
|
- callData.InvalidCount = callData.InvalidCount + Convert.ToInt32(listOld.Rows[0]["CallInNotConn"]); // 无效
|
|
|
- callData.QueueByeCount = callData.QueueByeCount + Convert.ToInt32(listOld.Rows[0]["CallInQueue"]); // 队列挂断
|
|
|
- callData.IvrByeCount = callData.IvrByeCount + Convert.ToInt32(listOld.Rows[0]["CallInIVR"]); // IVR挂断
|
|
|
- }
|
|
|
-
|
|
|
- centerReportStatisticsDto.CenterReportCall = callData;
|
|
|
-
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 工单
|
|
|
- //工单
|
|
|
- var orderData = await _orderRepository.Queryable()
|
|
|
- .Where(p => p.CreationTime >= StartTime && p.CreationTime <= EndTime)
|
|
|
- .Select(x => new CenterReportOrderDto
|
|
|
- {
|
|
|
- EffectiveCount = SqlFunc.AggregateSum(SqlFunc.IIF(true, 1, 0)),
|
|
|
- InvalidCount = 0,
|
|
|
- CompletedCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status >= EOrderStatus.Filed, 1, 0)),
|
|
|
- InProgressCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.Status < EOrderStatus.Filed, 1, 0))
|
|
|
- })
|
|
|
- .FirstAsync();
|
|
|
-
|
|
|
- if (listOld != null && orderData != null)
|
|
|
- {
|
|
|
- orderData.EffectiveCount = orderData.EffectiveCount + Convert.ToInt32(listOld.Rows[0]["OrderNormalNum"]); // 有效
|
|
|
- orderData.InvalidCount = orderData.InvalidCount + Convert.ToInt32(listOld.Rows[0]["OrderInvalidNum"]); // 无效
|
|
|
- orderData.CompletedCount = orderData.CompletedCount + Convert.ToInt32(listOld.Rows[0]["OrderEndNum"]); // 已办
|
|
|
- orderData.InProgressCount = orderData.InProgressCount + Convert.ToInt32(listOld.Rows[0]["OrderWaitNum"]); // 在办
|
|
|
- }
|
|
|
-
|
|
|
- centerReportStatisticsDto.CenterReportOrder = orderData;
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 信件来源
|
|
|
- //信件来源
|
|
|
- var sourceChannelData = await _orderRepository.Queryable()
|
|
|
- .Where(p => p.CreationTime >= StartTime && p.CreationTime <= EndTime)
|
|
|
- .Select(it => new
|
|
|
- {
|
|
|
- SourceChannelCode = SqlFunc.IIF(SqlFunc.IsNullOrEmpty(it.SourceChannelCode), "QT", it.SourceChannelCode)
|
|
|
- })
|
|
|
- .MergeTable()//将查询出来的结果合并成一个新表
|
|
|
- .GroupBy(it => new { it.SourceChannelCode })//对新表进行分组
|
|
|
- .Select(it => new CenterReportOrderSourceChannelDto
|
|
|
- {
|
|
|
- Code = it.SourceChannelCode,
|
|
|
- CountNum = SqlFunc.AggregateCount(it.SourceChannelCode)
|
|
|
- })
|
|
|
- .ToListAsync();
|
|
|
- List<CenterReportOrderSourceChannelDto> sourceChannel = new()
|
|
|
- {
|
|
|
- new CenterReportOrderSourceChannelDto
|
|
|
- {
|
|
|
- Name = "来源总量",
|
|
|
- Code = "All",
|
|
|
- CountNum = sourceChannelCount
|
|
|
- }
|
|
|
- };
|
|
|
- var sourceChannelDic = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.SourceChannel);
|
|
|
- foreach (var item in sourceChannelDic)
|
|
|
- {
|
|
|
- sourceChannel.Add(new CenterReportOrderSourceChannelDto
|
|
|
- {
|
|
|
- Name = item.DicDataName,
|
|
|
- Code = item.DicDataValue,
|
|
|
- CountNum = sourceChannelData.Find(p => p.Code == item.DicDataValue)?.CountNum ?? 0
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- if (listOld != null && sourceChannel != null)
|
|
|
- {
|
|
|
- foreach (var item in sourceChannel)
|
|
|
- {
|
|
|
- if (item.Code == "All")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listOld.Rows[0]["FromAllNum"]); //总量
|
|
|
- else if (item.Code == "YTW")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listOld.Rows[0]["FromInternet"]); // 英特网
|
|
|
- else if (item.Code == "RGDH")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listOld.Rows[0]["FromPhone"]); // 电话
|
|
|
- else if (item.Code == "YBS")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listOld.Rows[0]["FromPlatformYBS"]); // 宜办事
|
|
|
- else if (item.Code == "QT")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listOld.Rows[0]["FromOther"]); // 其他
|
|
|
- else if (item.Code == "ZJ")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listOld.Rows[0]["FromSelfBuild"]); // 自建
|
|
|
- else if (item.Code == "WX")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listOld.Rows[0]["FromWeChat"]); // 微信
|
|
|
- else if (item.Code == "WB")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listOld.Rows[0]["FromWeibo"]); // 微博
|
|
|
- else if (item.Code == "AP")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listOld.Rows[0]["FromApp"]); // APP
|
|
|
- else if (item.Code == "ZHYB")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listOld.Rows[0]["FromSmartYibin"]); // 智慧宜宾
|
|
|
- else if (item.Code == "ZZPT")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listOld.Rows[0]["FromPlatformZZ"]); // 综治平台
|
|
|
- else if (item.Code == "S12328")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listOld.Rows[0]["FromPlatform12328"]); // 省12328平台
|
|
|
- else if (item.Code == "SZYSM")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listOld.Rows[0]["FromMayorNetizen"]); // 市长与市民
|
|
|
- else if (item.Code == "YBRMT")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listOld.Rows[0]["FromPlatformRMT"]); // 宜宾融媒体
|
|
|
- else if (item.Code == "S12345")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listOld.Rows[0]["FromPlatformProvince"]); // 省12345平台
|
|
|
- else if (item.Code == "SZMHD")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listOld.Rows[0]["FromPlatformZMHD"]); // 省政民互动
|
|
|
- else if (item.Code == "SZHZ")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listOld.Rows[0]["FromPlatformSZHZ"]); // 市州互转
|
|
|
- else if (item.Code == "YB110")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listOld.Rows[0]["FromPlatform110"]); // 宜宾110平台
|
|
|
- else if (item.Code == "SMZXBNCS")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listOld.Rows[0]["FromPlatformBBCS"]); // 市民中心办不成事窗口
|
|
|
- else if (item.Code == "IYB")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listOld.Rows[0]["FromPlatformIYB"]); // i宜宾
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- centerReportStatisticsDto.CenterReportOrderSourceChannels = sourceChannel;
|
|
|
-
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 信件分类
|
|
|
- //信件来源
|
|
|
- var acceptTypeData = await _orderRepository.Queryable(false, false, false)
|
|
|
- .Where(p => p.CreationTime >= StartTime && p.CreationTime <= EndTime)
|
|
|
- .Select(it => new
|
|
|
- {
|
|
|
- AcceptTypeCode = SqlFunc.IIF(SqlFunc.IsNullOrEmpty(it.AcceptTypeCode), "40", it.AcceptTypeCode)
|
|
|
- })
|
|
|
- .MergeTable()//将查询出来的结果合并成一个新表
|
|
|
- .GroupBy(it => new { it.AcceptTypeCode })//对新表进行分组
|
|
|
- .Select(it => new CenterReportOrderSourceChannelDto
|
|
|
- {
|
|
|
- Code = it.AcceptTypeCode,
|
|
|
- CountNum = SqlFunc.AggregateCount(it.AcceptTypeCode)
|
|
|
- })
|
|
|
- .ToListAsync();
|
|
|
- List<CenterReportOrderSourceChannelDto> acceptType = new();
|
|
|
- var acceptTypeDic = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.AcceptType);
|
|
|
- foreach (var item in acceptTypeDic)
|
|
|
- {
|
|
|
- acceptType.Add(new CenterReportOrderSourceChannelDto
|
|
|
- {
|
|
|
- AllCountNum = sourceChannelCount,
|
|
|
- Name = item.DicDataName,
|
|
|
- Code = item.DicDataValue,
|
|
|
- CountNum = acceptTypeData.Find(p => p.Code == item.DicDataValue)?.CountNum ?? 0
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- if (listPurOld != null && acceptType != null)
|
|
|
- {
|
|
|
- foreach (var item in acceptType)
|
|
|
- {
|
|
|
- if (item.Code == "10")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listPurOld.Rows[0]["Consult"]); // 咨询
|
|
|
- else if (item.Code == "15")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listPurOld.Rows[0]["Suggest"]); // 建议
|
|
|
- else if (item.Code == "20")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listPurOld.Rows[0]["SeekHelp"]); // 求助
|
|
|
- else if (item.Code == "25")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listPurOld.Rows[0]["Praise"]); // 表扬
|
|
|
- else if (item.Code == "30")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listPurOld.Rows[0]["Report"]); // 举报
|
|
|
- else if (item.Code == "35")
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listPurOld.Rows[0]["Complaint"]); // 投诉
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- centerReportStatisticsDto.CenterReportOrderAcceptTypes = acceptType;
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 信件回访量
|
|
|
- //信件回访量
|
|
|
- CenterReportVisitdDto centerReportVisitd = new()
|
|
|
- {
|
|
|
- Visitd = await _orderVisitRepository.Queryable()
|
|
|
- .Where(x => x.VisitTime >= StartTime && x.VisitTime <= EndTime && x.VisitState == EVisitState.Visited).CountAsync(),
|
|
|
- WaitVisitd = await _orderVisitRepository.Queryable()
|
|
|
- .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 >= 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);
|
|
|
-
|
|
|
- if (listOld != null && centerReportVisitd != null)
|
|
|
- {
|
|
|
- centerReportVisitd.Visitd = centerReportVisitd.Visitd + Convert.ToInt32(listOld.Rows[0]["VisitAlreadyNum"]); // 已回访
|
|
|
- centerReportVisitd.WaitVisitd = centerReportVisitd.WaitVisitd + Convert.ToInt32(listOld.Rows[0]["VisitWaitNum"]); // 待回访
|
|
|
- centerReportVisitd.SeatsRate = Math.Round((centerReportVisitd.SeatsRate + Convert.ToDouble(listOld.Rows[0]["SatisfactionSeat"])) / 2, 2); // 坐席满意度
|
|
|
- centerReportVisitd.OrgRate = Math.Round((centerReportVisitd.OrgRate + Convert.ToDouble(listOld.Rows[0]["SatisfactionDepartment"])) / 2, 2); // 部门满意度
|
|
|
- }
|
|
|
-
|
|
|
- centerReportStatisticsDto.CenterReportVisitd = centerReportVisitd;
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 信件分布情况
|
|
|
- //市直部门
|
|
|
-
|
|
|
- var listOrgStatisticsCityAll = await _orderRepository.Queryable()
|
|
|
- .Where(o => o.CreationTime >= StartTime && o.CreationTime <= EndTime)
|
|
|
- .Select(o => new
|
|
|
- {
|
|
|
- OrgCode = o.ActualHandleOrgCode == null || o.ActualHandleOrgCode == "" ? "001" : o.ActualHandleOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")),
|
|
|
- })
|
|
|
- .MergeTable()
|
|
|
- .LeftJoin<SystemOrganize>((o, s) => o.OrgCode == s.Id)
|
|
|
- .Where((o, s) => s.OrgType == EOrgType.City || s.OrgType == EOrgType.Province)
|
|
|
- .GroupBy((o, s) => new
|
|
|
- {
|
|
|
- o.OrgCode,
|
|
|
- s.Name
|
|
|
- })
|
|
|
- .Select((o, s) => new OrgStatistics
|
|
|
- {
|
|
|
- CountNum = SqlFunc.AggregateCount(o.OrgCode),
|
|
|
- OrgCode = o.OrgCode,
|
|
|
- OrgName = s.Name
|
|
|
- }).ToListAsync();
|
|
|
-
|
|
|
- if (listCity != null && listOrgStatisticsCityAll != null)
|
|
|
- {
|
|
|
- var arrOrgCode = "";
|
|
|
- foreach (var item in listOrgStatisticsCityAll)
|
|
|
- {
|
|
|
- for (int i = 0; i < listCity.Rows.Count; i++)
|
|
|
- {
|
|
|
- var orgCode1 = item.OrgCode;
|
|
|
- var orgCode2 = listCity.Rows[i]["OrgCode"].ToString();
|
|
|
- if (orgCode1 == orgCode2)
|
|
|
- {
|
|
|
- arrOrgCode += "'" + orgCode1 + "',";
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listCity.Rows[i]["OrderAllNum"]);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- for (int i = 0; i < listCity.Rows.Count; i++)
|
|
|
- {
|
|
|
- var orgCode = listCity.Rows[i]["OrgCode"].ToString();
|
|
|
- if (arrOrgCode.IndexOf("'" + orgCode + "'") == -1)
|
|
|
- {
|
|
|
- listOrgStatisticsCityAll.Add(
|
|
|
- new OrgStatistics
|
|
|
- {
|
|
|
- OrgCode = listCity.Rows[i]["OrgCode"].ToString(),
|
|
|
- OrgName = listCity.Rows[i]["Name"].ToString(),
|
|
|
- CountNum = Convert.ToInt32(listCity.Rows[i]["OrderAllNum"])
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- centerReportStatisticsDto.OrgStatisticsCityAll = new OrgStatisticsAll
|
|
|
- {
|
|
|
- OrgStatistics = listOrgStatisticsCityAll
|
|
|
- };
|
|
|
-
|
|
|
- //区县部门
|
|
|
- var listOrgStatisticsAreaAll = await _orderRepository.Queryable()
|
|
|
- .Where(o => o.CreationTime >= StartTime && o.CreationTime <= EndTime)
|
|
|
- .Select(o => new
|
|
|
- {
|
|
|
- OrgCode = o.ActualHandleOrgCode == null || o.ActualHandleOrgCode == "" ? "001" : o.ActualHandleOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")),
|
|
|
- })
|
|
|
- .MergeTable()
|
|
|
- .LeftJoin<SystemOrganize>((o, s) => o.OrgCode == s.Id)
|
|
|
- .Where((o, s) => s.OrgType == EOrgType.County)
|
|
|
- .GroupBy((o, s) => new
|
|
|
- {
|
|
|
- o.OrgCode,
|
|
|
- s.Name
|
|
|
- })
|
|
|
- .Select((o, s) => new OrgStatistics
|
|
|
- {
|
|
|
- CountNum = SqlFunc.AggregateCount(o.OrgCode),
|
|
|
- OrgCode = o.OrgCode,
|
|
|
- OrgName = s.Name
|
|
|
- }).ToListAsync();
|
|
|
-
|
|
|
- if (listCounty != null && listOrgStatisticsAreaAll != null)
|
|
|
- {
|
|
|
- var arrOrgCode = "";
|
|
|
- foreach (var item in listOrgStatisticsAreaAll)
|
|
|
- {
|
|
|
- for (int i = 0; i < listCounty.Rows.Count; i++)
|
|
|
- {
|
|
|
- var orgCode1 = item.OrgCode;
|
|
|
- var orgCode2 = listCounty.Rows[i]["OrgCode"].ToString();
|
|
|
- if (orgCode1 == orgCode2)
|
|
|
- {
|
|
|
- arrOrgCode += "'" + orgCode1 + "',";
|
|
|
- item.CountNum = item.CountNum + Convert.ToInt32(listCounty.Rows[i]["OrderAllNum"]);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- for (int i = 0; i < listCounty.Rows.Count; i++)
|
|
|
- {
|
|
|
- var orgCode = listCounty.Rows[i]["OrgCode"].ToString();
|
|
|
- if (arrOrgCode.IndexOf("'" + orgCode + "'") == -1)
|
|
|
- {
|
|
|
- listOrgStatisticsAreaAll.Add(
|
|
|
- new OrgStatistics
|
|
|
- {
|
|
|
- OrgCode = listCounty.Rows[i]["OrgCode"].ToString(),
|
|
|
- OrgName = listCounty.Rows[i]["Name"].ToString(),
|
|
|
- CountNum = Convert.ToInt32(listCounty.Rows[i]["OrderAllNum"])
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- centerReportStatisticsDto.OrgStatisticsAreaAll = new OrgStatisticsAll
|
|
|
- {
|
|
|
- OrgStatistics = listOrgStatisticsAreaAll
|
|
|
- };
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 企业服务办件情况
|
|
|
- var enterpriseOrderDto = await _orderRepository.Queryable()
|
|
|
- .LeftJoin<SystemOrganize>((x, so) => x.ActualHandleOrgCode == so.Id)
|
|
|
- .Where((x, so) => x.CreationTime >= StartTime && x.CreationTime <= EndTime && x.IdentityType == EIdentityType.Enterprise)
|
|
|
- .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()
|
|
|
- .Select(temp => new EnterpriseOrderDto
|
|
|
- {
|
|
|
- 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.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.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
|
|
|
-
|
|
|
- return centerReportStatisticsDto;
|
|
|
- }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 中心报表统计--自贡
|
|
@@ -4243,7 +3888,9 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
DefaultSatisfiedCount = list.Select(x => x.DefaultSatisfiedCount).Sum(),
|
|
|
NoSatisfiedCount = list.Select(x => x.NoSatisfiedCount).Sum(),
|
|
|
NoEvaluateCount = list.Select(x => x.NoEvaluateCount).Sum(),
|
|
|
- NoPutThroughCount = list.Select(x => x.NoPutThroughCount).Sum()
|
|
|
+ NoPutThroughCount = list.Select(x => x.NoPutThroughCount).Sum(),
|
|
|
+ NormalCount = list.Select(x => x.NormalCount).Sum(),//未接通
|
|
|
+ VeryNoSatisfiedCount = list.Select(x => x.NormalCount).Sum(),//非常不满意
|
|
|
};
|
|
|
list.Add(total);
|
|
|
//区县合计
|
|
@@ -4259,7 +3906,10 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
DefaultSatisfiedCount = countyList.Select(x => x.DefaultSatisfiedCount).Sum(),
|
|
|
NoSatisfiedCount = countyList.Select(x => x.NoSatisfiedCount).Sum(),
|
|
|
NoEvaluateCount = countyList.Select(x => x.NoEvaluateCount).Sum(),
|
|
|
- NoPutThroughCount = countyList.Select(x => x.NoPutThroughCount).Sum()
|
|
|
+ NoPutThroughCount = countyList.Select(x => x.NoPutThroughCount).Sum(),
|
|
|
+ NormalCount = countyList.Select(x => x.NormalCount).Sum(),//未接通
|
|
|
+ VeryNoSatisfiedCount = countyList.Select(x => x.NormalCount).Sum(),//非常不满意
|
|
|
+
|
|
|
};
|
|
|
list.Add(countyTotal);
|
|
|
//市直合计
|
|
@@ -4275,7 +3925,9 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
DefaultSatisfiedCount = cityList.Select(x => x.DefaultSatisfiedCount).Sum(),
|
|
|
NoSatisfiedCount = cityList.Select(x => x.NoSatisfiedCount).Sum(),
|
|
|
NoEvaluateCount = cityList.Select(x => x.NoEvaluateCount).Sum(),
|
|
|
- NoPutThroughCount = cityList.Select(x => x.NoPutThroughCount).Sum()
|
|
|
+ NoPutThroughCount = cityList.Select(x => x.NoPutThroughCount).Sum(),
|
|
|
+ NormalCount = cityList.Select(x => x.NormalCount).Sum(),//未接通
|
|
|
+ VeryNoSatisfiedCount = cityList.Select(x => x.NormalCount).Sum(),//非常不满意
|
|
|
};
|
|
|
list.Add(cityTotal);
|
|
|
return list;
|
|
@@ -4751,17 +4403,23 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
|
|
|
var wfModule = await _workflowApplication.GetWorkflowModuleAsync(WorkflowModuleConsts.OrderHandle, HttpContext.RequestAborted);
|
|
|
var definition = wfModule.Definition;
|
|
|
+ var attitudeType = EnumExts.GetDescriptions<EAttitudeType>();
|
|
|
+ if (_appOptions.Value.IsZiGong == false)
|
|
|
+ {
|
|
|
+ attitudeType = attitudeType.Where(m => new int[] { 2 }.Contains(m.Key) == false).ToList();
|
|
|
+ }
|
|
|
return new Dictionary<string, dynamic>
|
|
|
{
|
|
|
{ "visitSatisfaction", _systemDicDataCacheManager.GetVisitSatisfaction() },
|
|
|
{ "orgsOptions", items },
|
|
|
- { "attitudeType", EnumExts.GetDescriptions<EAttitudeType>() },
|
|
|
+ { "attitudeType", attitudeType},
|
|
|
{ "visitType",EnumExts.GetDescriptions<EVisitType>() },
|
|
|
{ "channelOptions",_sysDicDataCacheManager.GetSysDicDataCache(TimeLimitBaseDataConsts.SourceChannel) },
|
|
|
{ "acceptTypeOptions",_sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.AcceptType)},
|
|
|
{ "orderStatusOptions", EnumExts.GetDescriptions<EOrderStatus>()},
|
|
|
- { "currentStepOptions",definition?.Steps.Select(x => new Kv(x.Code, x.Name))}
|
|
|
- };
|
|
|
+ { "currentStepOptions",definition?.Steps.Select(x => new Kv(x.Code, x.Name))},
|
|
|
+ { "visitMananer", _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.VisitManner) },
|
|
|
+ };
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -5227,6 +4885,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
var (total, items) = await _orderApplication.HotspotAndAcceptTypeStatisticsDetail(dto).ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
return new PagedDto<OrderDto>(total, _mapper.Map<IReadOnlyList<OrderDto>>(items));
|
|
|
}
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 热点受理类型明细导出
|
|
|
/// </summary>
|
|
@@ -5590,6 +5249,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
});
|
|
|
return items;
|
|
|
}
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 中心受理统计导出
|
|
|
/// </summary>
|
|
@@ -5643,6 +5303,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
var (total, items) = await _orderApplication.OrderCenterAcceptUser(dto).ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
return new PagedDto<OrderCenterAcceptUserVo>(total, items);
|
|
|
}
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 中心受理值班坐席统计导出
|
|
|
/// </summary>
|
|
@@ -5684,6 +5345,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
var items = await _orderRepository.OrderCenterAcceptHour(dto).ToListAsync(HttpContext.RequestAborted);
|
|
|
return items;
|
|
|
}
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 中心受理时间段统计导出
|
|
|
/// </summary>
|
|
@@ -5871,7 +5533,128 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
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.QueryOrderTsDetailsList(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([FromBody] ExportExcelDto<PagedKeywordRequest> dto)
|
|
|
+ {
|
|
|
+ var query = _orderApplication.QueryOrderTsDetailsList(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);
|
|
|
+ }
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 知识库引用
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("query_knowledge_quote_list")]
|
|
|
+ public async Task<PagedDto<OrderTsDetailsDto>> QueryKnowledgeQuoteList([FromQuery] PagedKeywordRequest dto)
|
|
|
+ {
|
|
|
+ var (total, items) = await _orderApplication.QueryKnowledgeQuoteList(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_knowledge_quote_list/export")]
|
|
|
+ public async Task<FileStreamResult> ExportQueryKnowledgeQuoteList([FromBody] ExportExcelDto<PagedKeywordRequest> dto)
|
|
|
+ {
|
|
|
+ var query = _orderApplication.QueryKnowledgeQuoteList(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_knowledge_quote_order_list")]
|
|
|
+ public async Task<List<KnowledgeQuote>> GetQueryKnowledgeQuoteOrderList(string KeyWord)
|
|
|
+ {
|
|
|
+ return await _knowledgeQuoteRepository.Queryable()
|
|
|
+ .Where(p => p.KnowledgeId == KeyWord)
|
|
|
+ .ToListAsync(HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
}
|
|
|
}
|