|
@@ -1916,11 +1916,11 @@ namespace Hotline.Api.Controllers.Bi
|
|
.Select(o => new CenterReportCallDto
|
|
.Select(o => new CenterReportCallDto
|
|
{
|
|
{
|
|
EffectiveCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.OnState == EOnState.On, 1, 0)),//有效
|
|
EffectiveCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.OnState == EOnState.On, 1, 0)),//有效
|
|
- 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挂断)
|
|
|
|
|
|
+ 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)), //队列挂断
|
|
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挂断
|
|
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挂断
|
|
})
|
|
})
|
|
@@ -2086,8 +2086,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
{
|
|
{
|
|
sourceChannel.Add(new CenterReportOrderSourceChannelDto
|
|
sourceChannel.Add(new CenterReportOrderSourceChannelDto
|
|
{
|
|
{
|
|
- AllCountNum = sourceChannelCount,
|
|
|
|
- Name = item.DicDataName,
|
|
|
|
|
|
+ AllCountNum = sourceChannelCount,
|
|
|
|
+ Name = item.DicDataName,
|
|
Code = item.DicTypeCode,
|
|
Code = item.DicTypeCode,
|
|
CountNum = sourceChannelData.Find(p => p.Code == item.DicDataValue)?.CountNum ?? 0
|
|
CountNum = sourceChannelData.Find(p => p.Code == item.DicDataValue)?.CountNum ?? 0
|
|
});
|
|
});
|
|
@@ -2495,14 +2495,14 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
|
|
|
if (enterpriseOrderDto2 != null)
|
|
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;
|
|
|
|
- }
|
|
|
|
|
|
+ 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 && listInfo.Rows.Count > 0 && centerReportStatisticsDto.EnterpriseOrderDto != null)
|
|
if (listInfo != null && listInfo.Rows.Count > 0 && centerReportStatisticsDto.EnterpriseOrderDto != null)
|
|
{
|
|
{
|
|
@@ -2525,65 +2525,65 @@ namespace Hotline.Api.Controllers.Bi
|
|
centerReportStatisticsDto.EnterpriseOrderDto.CountySatisfied = centerReportStatisticsDto.EnterpriseOrderDto.CountySatisfied + Convert.ToInt32(listInfo.Rows[0]["EnterpriseCountySatisfaction"]);
|
|
centerReportStatisticsDto.EnterpriseOrderDto.CountySatisfied = centerReportStatisticsDto.EnterpriseOrderDto.CountySatisfied + Convert.ToInt32(listInfo.Rows[0]["EnterpriseCountySatisfaction"]);
|
|
}
|
|
}
|
|
|
|
|
|
- #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;
|
|
|
|
|
|
+ #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;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -5597,16 +5597,16 @@ namespace Hotline.Api.Controllers.Bi
|
|
public async Task<List<OrderTsDetails>> GetQueryOrderTsDetailslOrderList(string KeyWord)
|
|
public async Task<List<OrderTsDetails>> GetQueryOrderTsDetailslOrderList(string KeyWord)
|
|
{
|
|
{
|
|
return await _orderTsDetailsRepository.Queryable()
|
|
return await _orderTsDetailsRepository.Queryable()
|
|
- .LeftJoin<Order>((ot,o)=>ot.OrderId==o.Id)
|
|
|
|
|
|
+ .LeftJoin<Order>((ot, o) => ot.OrderId == o.Id)
|
|
.Where((ot, o) => ot.Terms == KeyWord)
|
|
.Where((ot, o) => ot.Terms == KeyWord)
|
|
- .Select((ot, o)=>new OrderTsDetails
|
|
|
|
|
|
+ .Select((ot, o) => new OrderTsDetails
|
|
{
|
|
{
|
|
- Id=ot.Id,
|
|
|
|
- Terms=ot.Terms,
|
|
|
|
- OrderId=o.Id,
|
|
|
|
- Title=o.Title,
|
|
|
|
- No=ot.No
|
|
|
|
- } )
|
|
|
|
|
|
+ Id = ot.Id,
|
|
|
|
+ Terms = ot.Terms,
|
|
|
|
+ OrderId = o.Id,
|
|
|
|
+ Title = o.Title,
|
|
|
|
+ No = ot.No
|
|
|
|
+ })
|
|
.ToListAsync(HttpContext.RequestAborted);
|
|
.ToListAsync(HttpContext.RequestAborted);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -5662,21 +5662,21 @@ namespace Hotline.Api.Controllers.Bi
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 根据知识库引用查询工单
|
|
/// 根据知识库引用查询工单
|
|
/// </summary>
|
|
/// </summary>
|
|
- /// <param name="KeyWord"></param>
|
|
|
|
|
|
+ /// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
[HttpGet("get_query_knowledge_quote_order_list")]
|
|
[HttpGet("get_query_knowledge_quote_order_list")]
|
|
- public async Task<List<KnowledgeQuote>> GetQueryKnowledgeQuoteOrderList(string KeyWord)
|
|
|
|
|
|
+ public async Task<List<KnowledgeQuote>> GetQueryKnowledgeQuoteOrderList([FromQuery] PagedKeywordRequest dto)
|
|
{
|
|
{
|
|
return await _knowledgeQuoteRepository.Queryable()
|
|
return await _knowledgeQuoteRepository.Queryable()
|
|
.LeftJoin<Order>((kn, o) => kn.OrderId == o.Id)
|
|
.LeftJoin<Order>((kn, o) => kn.OrderId == o.Id)
|
|
- .Where((kn, o) => kn.KnowledgeId == KeyWord)
|
|
|
|
- .Select((kn, o)=>new KnowledgeQuote
|
|
|
|
|
|
+ .Where((kn, o) => kn.KnowledgeId == dto.Keyword && kn.CreationTime >= dto.StartTime && kn.CreationTime <= dto.EndTime)
|
|
|
|
+ .Select((kn, o) => new KnowledgeQuote
|
|
{
|
|
{
|
|
- KnowledgeId=kn.Id,
|
|
|
|
- KnowledgeTitle=o.Title,
|
|
|
|
- OrderId=o.Id,
|
|
|
|
- Title=o.Title,
|
|
|
|
- No=o.No,
|
|
|
|
|
|
+ KnowledgeId = kn.Id,
|
|
|
|
+ KnowledgeTitle = o.Title,
|
|
|
|
+ OrderId = o.Id,
|
|
|
|
+ Title = o.Title,
|
|
|
|
+ No = o.No,
|
|
})
|
|
})
|
|
.ToListAsync(HttpContext.RequestAborted);
|
|
.ToListAsync(HttpContext.RequestAborted);
|
|
}
|
|
}
|