|
@@ -14,6 +14,7 @@ using Hotline.Share.Dtos;
|
|
|
using Hotline.Share.Dtos.Bi;
|
|
|
using Hotline.Share.Dtos.Bigscreen;
|
|
|
using Hotline.Share.Dtos.CallCenter;
|
|
|
+using Hotline.Share.Dtos.DataSharing.PusherHotlineDto;
|
|
|
using Hotline.Share.Dtos.FlowEngine.Workflow;
|
|
|
using Hotline.Share.Dtos.Order;
|
|
|
using Hotline.Share.Enums.CallCenter;
|
|
@@ -22,6 +23,7 @@ using Hotline.Share.Enums.Order;
|
|
|
using Hotline.Share.Requests;
|
|
|
using Hotline.Tools;
|
|
|
using MapsterMapper;
|
|
|
+using Microsoft.AspNetCore.Authorization;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
using Org.BouncyCastle.Utilities;
|
|
@@ -31,6 +33,7 @@ using XF.Domain.Authentications;
|
|
|
using XF.Domain.Constants;
|
|
|
using XF.Domain.Exceptions;
|
|
|
using XF.Domain.Repository;
|
|
|
+using XF.Utility.EnumExtensions;
|
|
|
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
|
|
|
|
|
|
namespace Hotline.Api.Controllers.Bi
|
|
@@ -740,13 +743,13 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("visit-measure-statistics")]
|
|
|
- public async Task<VisitMeasureStatisticsDto> VisitMeasureStatistics(DateTime StartDate, DateTime EndDate, string? VisitName)
|
|
|
+ public async Task<VisitMeasureStatisticsDto> VisitMeasureStatistics(DateTime StartTime, DateTime EndTime, string? VisitName)
|
|
|
{
|
|
|
- EndDate = EndDate.AddDays(1).AddSeconds(-1);
|
|
|
+ EndTime = EndTime.AddDays(1).AddSeconds(-1);
|
|
|
|
|
|
var list = await _orderVisitRepository.Queryable()
|
|
|
.Includes(x => x.Employee)
|
|
|
- .Where(x => x.VisitTime >= StartDate && x.VisitTime <= EndDate && x.VisitState == EVisitState.Visited)
|
|
|
+ .Where(x => x.VisitTime >= StartTime && x.VisitTime <= EndTime && x.VisitState == EVisitState.Visited)
|
|
|
.WhereIF(!string.IsNullOrEmpty(VisitName), x => x.Employee.Name.Contains(VisitName))
|
|
|
.GroupBy(x => new { x.EmployeeId, x.Employee.Name })
|
|
|
.Select(x => new VisitMeasureStatisticsModelDto()
|
|
@@ -762,18 +765,18 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
|
|
|
//查询AIVisit
|
|
|
returnModel.AiVisitCount = await _aiOrderVisitDetailRepository.Queryable()
|
|
|
- .Where(x => x.AiVisitTime >= StartDate && x.AiVisitTime <= EndDate && x.IsSuccess != null).CountAsync();
|
|
|
+ .Where(x => x.AiVisitTime >= StartTime && x.AiVisitTime <= EndTime && x.IsSuccess != null).CountAsync();
|
|
|
|
|
|
returnModel.AiVisitSatisfiedCount = await _aiOrderVisitDetailRepository.Queryable()
|
|
|
.Includes(x => x.OrderVisit)
|
|
|
- .Where(x => x.AiVisitTime >= StartDate && x.AiVisitTime <= EndDate && x.IsSuccess == true && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") != "1" && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") != "2").CountAsync();
|
|
|
+ .Where(x => x.AiVisitTime >= StartTime && x.AiVisitTime <= EndTime && x.IsSuccess == true && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") != "1" && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") != "2").CountAsync();
|
|
|
|
|
|
returnModel.AiVisitNoSatisfiedCount = await _aiOrderVisitDetailRepository.Queryable()
|
|
|
.Includes(x => x.OrderVisit)
|
|
|
- .Where(x => x.AiVisitTime >= StartDate && x.AiVisitTime <= EndDate && x.IsSuccess == true && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") == "1" && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") == "2").CountAsync();
|
|
|
+ .Where(x => x.AiVisitTime >= StartTime && x.AiVisitTime <= EndTime && x.IsSuccess == true && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") == "1" && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") == "2").CountAsync();
|
|
|
|
|
|
returnModel.AIVisitFailCount = await _aiOrderVisitDetailRepository.Queryable()
|
|
|
- .Where(x => x.AiVisitTime >= StartDate && x.AiVisitTime <= EndDate && x.IsSuccess == false).CountAsync();
|
|
|
+ .Where(x => x.AiVisitTime >= StartTime && x.AiVisitTime <= EndTime && x.IsSuccess == false).CountAsync();
|
|
|
|
|
|
|
|
|
return returnModel;
|
|
@@ -782,14 +785,14 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
/// <summary>
|
|
|
/// 热点类型小类统计
|
|
|
/// </summary>
|
|
|
- /// <param name="StartDate"></param>
|
|
|
- /// <param name="EndDate"></param>
|
|
|
+ /// <param name="StartTime"></param>
|
|
|
+ /// <param name="EndTime"></param>
|
|
|
/// <param name="TypeId">0:全部 ,1:市民,2:企业</param>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("hotspot-statistics")]
|
|
|
- public async Task<object> HotspotStatistics(DateTime StartDate, DateTime EndDate, int TypeId, string? HotspotCode)
|
|
|
+ public async Task<object> HotspotStatistics(DateTime StartTime, DateTime EndTime, int TypeId, string? HotspotCode)
|
|
|
{
|
|
|
- EndDate = EndDate.AddDays(1).AddSeconds(-1);
|
|
|
+ EndTime = EndTime.AddDays(1).AddSeconds(-1);
|
|
|
|
|
|
var IsCenter = _sessionContext.OrgIsCenter;
|
|
|
|
|
@@ -797,7 +800,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
{
|
|
|
var list = await _hotspotTypeRepository.Queryable()
|
|
|
.LeftJoin<Order>((it, o) => it.Id == o.HotspotId)
|
|
|
- .Where((it, o) => o.CreationTime >= StartDate && o.CreationTime <= EndDate && o.Id != null)
|
|
|
+ .Where((it, o) => o.CreationTime >= StartTime && o.CreationTime <= EndTime && o.Id != null)
|
|
|
.WhereIF(TypeId == 1, (it, o) => o.IdentityType == EIdentityType.Citizen)
|
|
|
.WhereIF(TypeId == 2, (it, o) => o.IdentityType == EIdentityType.Enterprise)
|
|
|
.WhereIF(IsCenter == false, (it, o) => o.ActualHandleOrgCode.StartsWith(_sessionContext.RequiredOrgId))
|
|
@@ -826,7 +829,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
string countx = HotspotCode.Length.ToString();
|
|
|
var list = await _hotspotTypeRepository.Queryable()
|
|
|
.LeftJoin<Order>((it, o) => it.Id == o.HotspotId)
|
|
|
- .Where((it, o) => o.CreationTime >= StartDate && o.CreationTime <= EndDate && it.ParentId.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>(countx)) == HotspotCode)
|
|
|
+ .Where((it, o) => o.CreationTime >= StartTime && o.CreationTime <= EndTime && it.ParentId.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>(countx)) == HotspotCode)
|
|
|
.WhereIF(TypeId == 1, (it, o) => o.IdentityType == EIdentityType.Citizen)
|
|
|
.WhereIF(TypeId == 2, (it, o) => o.IdentityType == EIdentityType.Enterprise)
|
|
|
.WhereIF(IsCenter == false, (it, o) => o.ActualHandleOrgCode.StartsWith(_sessionContext.RequiredOrgId))
|
|
@@ -854,8 +857,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
/// <summary>
|
|
|
/// 部门满意度统计
|
|
|
/// </summary>
|
|
|
- /// <param name="StartDate"></param>
|
|
|
- /// <param name="EndDate"></param>
|
|
|
+ /// <param name="StartTime"></param>
|
|
|
+ /// <param name="EndTime"></param>
|
|
|
/// <param name="OrgName"></param>
|
|
|
/// <param name="TypeId">1:办件结果 2:办件态度</param>
|
|
|
/// <param name="LineNum"></param>
|
|
@@ -865,7 +868,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
{
|
|
|
var data = await _orderApplication.VisitAndOrgSatisfactionStatistics(dto);
|
|
|
|
|
|
- var countySumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
+ var countySumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
{
|
|
|
OrgName = "区县合计",
|
|
|
TotalSumCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.TotalSumCount),
|
|
@@ -915,46 +918,46 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
[HttpPost("visit-org-satisfaction-statistics/_export")]
|
|
|
public async Task<FileStreamResult> VisitAndOrgSatisfactionStatisticsExport([FromBody] ExportExcelDto<PagedKeywordSonRequest> dto)
|
|
|
{
|
|
|
- List<VisitAndOrgSatisfactionStatisticsDto> data = await _orderApplication.VisitAndOrgSatisfactionStatistics(dto.QueryDto);
|
|
|
- var countySumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
- {
|
|
|
- OrgName = "区县合计",
|
|
|
- TotalSumCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.TotalSumCount),
|
|
|
- VerySatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.VerySatisfiedCount),
|
|
|
- SatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.SatisfiedCount),
|
|
|
- RegardedAsSatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.RegardedAsSatisfiedCount),
|
|
|
- DefaultSatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.DefaultSatisfiedCount),
|
|
|
- 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),
|
|
|
- };
|
|
|
- var citySumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
- {
|
|
|
- OrgName = "市直合计",
|
|
|
- TotalSumCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.TotalSumCount),
|
|
|
- VerySatisfiedCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.VerySatisfiedCount),
|
|
|
- SatisfiedCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.SatisfiedCount),
|
|
|
- RegardedAsSatisfiedCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.RegardedAsSatisfiedCount),
|
|
|
- DefaultSatisfiedCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.DefaultSatisfiedCount),
|
|
|
- NoSatisfiedCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoSatisfiedCount),
|
|
|
- NoEvaluateCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoEvaluateCount),
|
|
|
- NoPutThroughCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoPutThroughCount),
|
|
|
- };
|
|
|
- var sumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
- {
|
|
|
- OrgName = "总计",
|
|
|
- TotalSumCount = data.Sum(x => x.TotalSumCount),
|
|
|
- VerySatisfiedCount = data.Sum(x => x.VerySatisfiedCount),
|
|
|
- SatisfiedCount = data.Sum(x => x.SatisfiedCount),
|
|
|
- RegardedAsSatisfiedCount = data.Sum(x => x.RegardedAsSatisfiedCount),
|
|
|
- DefaultSatisfiedCount = data.Sum(x => x.DefaultSatisfiedCount),
|
|
|
- NoSatisfiedCount = data.Sum(x => x.NoSatisfiedCount),
|
|
|
- NoEvaluateCount = data.Sum(x => x.NoEvaluateCount),
|
|
|
- NoPutThroughCount = data.Sum(x => x.NoPutThroughCount),
|
|
|
- };
|
|
|
- data.Add(countySumModel);
|
|
|
- data.Add(citySumModel);
|
|
|
- data.Add(sumModel);
|
|
|
+ List<VisitAndOrgSatisfactionStatisticsDto> data = await _orderApplication.VisitAndOrgSatisfactionStatistics(dto.QueryDto);
|
|
|
+ var countySumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
+ {
|
|
|
+ OrgName = "区县合计",
|
|
|
+ TotalSumCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.TotalSumCount),
|
|
|
+ VerySatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.VerySatisfiedCount),
|
|
|
+ SatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.SatisfiedCount),
|
|
|
+ RegardedAsSatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.RegardedAsSatisfiedCount),
|
|
|
+ DefaultSatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.DefaultSatisfiedCount),
|
|
|
+ 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),
|
|
|
+ };
|
|
|
+ var citySumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
+ {
|
|
|
+ OrgName = "市直合计",
|
|
|
+ TotalSumCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.TotalSumCount),
|
|
|
+ VerySatisfiedCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.VerySatisfiedCount),
|
|
|
+ SatisfiedCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.SatisfiedCount),
|
|
|
+ RegardedAsSatisfiedCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.RegardedAsSatisfiedCount),
|
|
|
+ DefaultSatisfiedCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.DefaultSatisfiedCount),
|
|
|
+ NoSatisfiedCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoSatisfiedCount),
|
|
|
+ NoEvaluateCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoEvaluateCount),
|
|
|
+ NoPutThroughCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoPutThroughCount),
|
|
|
+ };
|
|
|
+ var sumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
+ {
|
|
|
+ OrgName = "总计",
|
|
|
+ TotalSumCount = data.Sum(x => x.TotalSumCount),
|
|
|
+ VerySatisfiedCount = data.Sum(x => x.VerySatisfiedCount),
|
|
|
+ SatisfiedCount = data.Sum(x => x.SatisfiedCount),
|
|
|
+ RegardedAsSatisfiedCount = data.Sum(x => x.RegardedAsSatisfiedCount),
|
|
|
+ DefaultSatisfiedCount = data.Sum(x => x.DefaultSatisfiedCount),
|
|
|
+ NoSatisfiedCount = data.Sum(x => x.NoSatisfiedCount),
|
|
|
+ NoEvaluateCount = data.Sum(x => x.NoEvaluateCount),
|
|
|
+ NoPutThroughCount = data.Sum(x => x.NoPutThroughCount),
|
|
|
+ };
|
|
|
+ data.Add(countySumModel);
|
|
|
+ data.Add(citySumModel);
|
|
|
+ data.Add(sumModel);
|
|
|
dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(dto.ColumnInfos);
|
|
|
var dtos = data
|
|
|
.Select(stu => _mapper.Map(stu, typeof(VisitAndOrgSatisfactionStatisticsDto), dynamicClass))
|
|
@@ -970,8 +973,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
/// <summary>
|
|
|
/// 子部门满意度明细
|
|
|
/// </summary>
|
|
|
- /// <param name="StartDate"></param>
|
|
|
- /// <param name="EndDate"></param>
|
|
|
+ /// <param name="StartTime"></param>
|
|
|
+ /// <param name="EndTime"></param>
|
|
|
/// <param name="OrgCode"></param>
|
|
|
/// <param name="TypeId"></param>
|
|
|
/// <param name="LineNum"></param>
|
|
@@ -979,8 +982,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
[HttpGet("visit-org-statisfaction-org-detail")]
|
|
|
public async Task<VisitAndOrgSatisfactionStatisticsResultDto> VisitAndOrgStatisfactionOrgDetail([FromQuery] PagedKeywordSonRequest dto)
|
|
|
{
|
|
|
- var list = await _orderApplication.VisitAndOrgStatisfactionOrgDetail(dto);
|
|
|
- var countySumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
+ var list = await _orderApplication.VisitAndOrgStatisfactionOrgDetail(dto);
|
|
|
+ var countySumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
{
|
|
|
OrgName = "区县合计",
|
|
|
TotalSumCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.TotalSumCount),
|
|
@@ -1022,93 +1025,93 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
return new VisitAndOrgSatisfactionStatisticsResultDto { DataList = list, CountySumModel = countySumModel, CitySumModel = citySumModel, SumModel = sumModel };
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 部门满意度统计导出
|
|
|
- /// </summary>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpPost("visit-org-statisfaction-org-detail/_export")]
|
|
|
- public async Task<FileStreamResult> VisitAndOrgStatisfactionOrgDetailExport([FromBody] ExportExcelDto<PagedKeywordSonRequest> dto)
|
|
|
- {
|
|
|
- var list = await _orderApplication.VisitAndOrgStatisfactionOrgDetail(dto.QueryDto);
|
|
|
- var countySumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
- {
|
|
|
- OrgName = "区县合计",
|
|
|
- TotalSumCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.TotalSumCount),
|
|
|
- VerySatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.VerySatisfiedCount),
|
|
|
- SatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.SatisfiedCount),
|
|
|
- RegardedAsSatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.RegardedAsSatisfiedCount),
|
|
|
- DefaultSatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.DefaultSatisfiedCount),
|
|
|
- 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),
|
|
|
- };
|
|
|
- var citySumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
- {
|
|
|
- OrgName = "市直合计",
|
|
|
- TotalSumCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.TotalSumCount),
|
|
|
- VerySatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.VerySatisfiedCount),
|
|
|
- SatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.SatisfiedCount),
|
|
|
- RegardedAsSatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.RegardedAsSatisfiedCount),
|
|
|
- DefaultSatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.DefaultSatisfiedCount),
|
|
|
- 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),
|
|
|
- };
|
|
|
- var sumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
- {
|
|
|
- OrgName = "总计",
|
|
|
- TotalSumCount = list.Sum(x => x.TotalSumCount),
|
|
|
- VerySatisfiedCount = list.Sum(x => x.VerySatisfiedCount),
|
|
|
- SatisfiedCount = list.Sum(x => x.SatisfiedCount),
|
|
|
- RegardedAsSatisfiedCount = list.Sum(x => x.RegardedAsSatisfiedCount),
|
|
|
- DefaultSatisfiedCount = list.Sum(x => x.DefaultSatisfiedCount),
|
|
|
- NoSatisfiedCount = list.Sum(x => x.NoSatisfiedCount),
|
|
|
- NoEvaluateCount = list.Sum(x => x.NoEvaluateCount),
|
|
|
- NoPutThroughCount = list.Sum(x => x.NoPutThroughCount),
|
|
|
- };
|
|
|
- list.Add(countySumModel);
|
|
|
- list.Add(citySumModel);
|
|
|
- list.Add(sumModel);
|
|
|
- dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(dto.ColumnInfos);
|
|
|
- var dtos = list
|
|
|
- .Select(stu => _mapper.Map(stu, typeof(VisitAndOrgSatisfactionStatisticsDto), dynamicClass))
|
|
|
- .Cast<object>()
|
|
|
- .ToList();
|
|
|
-
|
|
|
- var stream = ExcelHelper.CreateStream(dtos);
|
|
|
-
|
|
|
- return ExcelStreamResult(stream, "部门满意度统计数据");
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 部门满意度明细
|
|
|
- /// </summary>
|
|
|
- /// <param name="StartDate"></param>
|
|
|
- /// <param name="EndDate"></param>
|
|
|
- /// <param name="OrgCode"></param>
|
|
|
- /// <param name="TypeId"></param>
|
|
|
- /// <param name="LineNum"></param>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpGet("visit-org-satisfaction-detail")]
|
|
|
+ /// <summary>
|
|
|
+ /// 部门满意度统计导出
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("visit-org-statisfaction-org-detail/_export")]
|
|
|
+ public async Task<FileStreamResult> VisitAndOrgStatisfactionOrgDetailExport([FromBody] ExportExcelDto<PagedKeywordSonRequest> dto)
|
|
|
+ {
|
|
|
+ var list = await _orderApplication.VisitAndOrgStatisfactionOrgDetail(dto.QueryDto);
|
|
|
+ var countySumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
+ {
|
|
|
+ OrgName = "区县合计",
|
|
|
+ TotalSumCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.TotalSumCount),
|
|
|
+ VerySatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.VerySatisfiedCount),
|
|
|
+ SatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.SatisfiedCount),
|
|
|
+ RegardedAsSatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.RegardedAsSatisfiedCount),
|
|
|
+ DefaultSatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.DefaultSatisfiedCount),
|
|
|
+ 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),
|
|
|
+ };
|
|
|
+ var citySumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
+ {
|
|
|
+ OrgName = "市直合计",
|
|
|
+ TotalSumCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.TotalSumCount),
|
|
|
+ VerySatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.VerySatisfiedCount),
|
|
|
+ SatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.SatisfiedCount),
|
|
|
+ RegardedAsSatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.RegardedAsSatisfiedCount),
|
|
|
+ DefaultSatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.DefaultSatisfiedCount),
|
|
|
+ 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),
|
|
|
+ };
|
|
|
+ var sumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
+ {
|
|
|
+ OrgName = "总计",
|
|
|
+ TotalSumCount = list.Sum(x => x.TotalSumCount),
|
|
|
+ VerySatisfiedCount = list.Sum(x => x.VerySatisfiedCount),
|
|
|
+ SatisfiedCount = list.Sum(x => x.SatisfiedCount),
|
|
|
+ RegardedAsSatisfiedCount = list.Sum(x => x.RegardedAsSatisfiedCount),
|
|
|
+ DefaultSatisfiedCount = list.Sum(x => x.DefaultSatisfiedCount),
|
|
|
+ NoSatisfiedCount = list.Sum(x => x.NoSatisfiedCount),
|
|
|
+ NoEvaluateCount = list.Sum(x => x.NoEvaluateCount),
|
|
|
+ NoPutThroughCount = list.Sum(x => x.NoPutThroughCount),
|
|
|
+ };
|
|
|
+ list.Add(countySumModel);
|
|
|
+ list.Add(citySumModel);
|
|
|
+ list.Add(sumModel);
|
|
|
+ dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(dto.ColumnInfos);
|
|
|
+ var dtos = list
|
|
|
+ .Select(stu => _mapper.Map(stu, typeof(VisitAndOrgSatisfactionStatisticsDto), dynamicClass))
|
|
|
+ .Cast<object>()
|
|
|
+ .ToList();
|
|
|
+
|
|
|
+ var stream = ExcelHelper.CreateStream(dtos);
|
|
|
+
|
|
|
+ return ExcelStreamResult(stream, "部门满意度统计数据");
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 部门满意度明细
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="StartDate"></param>
|
|
|
+ /// <param name="EndDate"></param>
|
|
|
+ /// <param name="OrgCode"></param>
|
|
|
+ /// <param name="TypeId"></param>
|
|
|
+ /// <param name="LineNum"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("visit-org-satisfaction-detail")]
|
|
|
public async Task<PagedDto<OrderVisitDetailDto>> VisitAndOrgSatisfactionDetail([FromQuery] VisitAndOrgSatisfactionDetailDto dto)
|
|
|
{
|
|
|
var (total, items) = await _orderApplication.VisitAndOrgSatisfactionDetail(dto)
|
|
|
- .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
+ .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
return new PagedDto<OrderVisitDetailDto>(total, _mapper.Map<IReadOnlyList<OrderVisitDetailDto>>(items));
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 部门满意度明细导出
|
|
|
- /// </summary>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpPost("visit-org-satisfaction-detail/_export")]
|
|
|
+ /// <summary>
|
|
|
+ /// 部门满意度明细导出
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("visit-org-satisfaction-detail/_export")]
|
|
|
public async Task<FileStreamResult> VisitAndOrgSatisfactionDetailExport([FromBody] ExportExcelDto<VisitAndOrgSatisfactionDetailDto> dto)
|
|
|
{
|
|
|
var query = _orderApplication.VisitAndOrgSatisfactionDetail(dto.QueryDto);
|
|
|
List<OrderVisitDetail> data;
|
|
|
if (dto.IsExportAll)
|
|
|
{
|
|
|
- data = await query.ToListAsync(HttpContext.RequestAborted);
|
|
|
+ data = await query.ToListAsync(HttpContext.RequestAborted);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -1121,7 +1124,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(dto.ColumnInfos);
|
|
|
|
|
|
var dtos = dataDtos
|
|
|
- .Select(stu => _mapper.Map(stu, typeof(OrderVisitDetailDto), dynamicClass))
|
|
|
+ .Select(stu => _mapper.Map(stu, typeof(OrderVisitDetailDto), dynamicClass))
|
|
|
.Cast<object>()
|
|
|
.ToList();
|
|
|
|
|
@@ -1138,19 +1141,19 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
/// <param name="EndDate"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("center_report_forms_statistics")]
|
|
|
- public async Task<CenterReportStatisticsDto> CenterReportFormsStatistics(DateTime StartDate, DateTime EndDate)
|
|
|
+ public async Task<CenterReportStatisticsDto> CenterReportFormsStatistics(DateTime StartTime, DateTime EndTime)
|
|
|
{
|
|
|
- EndDate = EndDate.AddDays(1).AddSeconds(-1);
|
|
|
+ EndTime = EndTime.AddDays(1).AddSeconds(-1);
|
|
|
|
|
|
CenterReportStatisticsDto centerReportStatisticsDto = new();
|
|
|
|
|
|
//信件总量
|
|
|
- int sourceChannelCount = await _orderRepository.Queryable().Where(p => p.CreationTime >= StartDate && p.CreationTime <= EndDate).CountAsync();
|
|
|
+ int sourceChannelCount = await _orderRepository.Queryable().Where(p => p.CreationTime >= StartTime && p.CreationTime <= EndTime).CountAsync();
|
|
|
|
|
|
#region 通话记录
|
|
|
//通话记录
|
|
|
var callData = await _trCallRecordRepository.Queryable()
|
|
|
- .Where(p => p.CreatedTime >= StartDate && p.CreatedTime <= EndDate && p.Gateway != "82826886" && SqlFunc.Length(p.Gateway) != 4)
|
|
|
+ .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)),//有效
|
|
@@ -1167,7 +1170,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
#region 工单
|
|
|
//工单
|
|
|
var orderData = await _orderRepository.Queryable()
|
|
|
- .Where(p => p.CreationTime >= StartDate && p.CreationTime <= EndDate)
|
|
|
+ .Where(p => p.CreationTime >= StartTime && p.CreationTime <= EndTime)
|
|
|
.Select(x => new CenterReportOrderDto
|
|
|
{
|
|
|
EffectiveCount = SqlFunc.AggregateSum(SqlFunc.IIF(true, 1, 0)),
|
|
@@ -1183,7 +1186,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
#region 信件来源
|
|
|
//信件来源
|
|
|
var sourceChannelData = await _orderRepository.Queryable()
|
|
|
- .Where(p => p.CreationTime >= StartDate && p.CreationTime <= EndDate)
|
|
|
+ .Where(p => p.CreationTime >= StartTime && p.CreationTime <= EndTime)
|
|
|
.Select(it => new
|
|
|
{
|
|
|
SourceChannelCode = SqlFunc.IIF(SqlFunc.IsNullOrEmpty(it.SourceChannelCode), "QT", it.SourceChannelCode)
|
|
@@ -1222,7 +1225,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
#region 信件分类
|
|
|
//信件来源
|
|
|
var acceptTypeData = await _orderRepository.Queryable(false, false, false)
|
|
|
- .Where(p => p.CreationTime >= StartDate && p.CreationTime <= EndDate)
|
|
|
+ .Where(p => p.CreationTime >= StartTime && p.CreationTime <= EndTime)
|
|
|
.Select(it => new
|
|
|
{
|
|
|
AcceptTypeCode = SqlFunc.IIF(SqlFunc.IsNullOrEmpty(it.AcceptTypeCode), "40", it.AcceptTypeCode)
|
|
@@ -1256,15 +1259,15 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
CenterReportVisitdDto centerReportVisitd = new()
|
|
|
{
|
|
|
Visitd = await _orderVisitRepository.Queryable()
|
|
|
- .Where(x => x.VisitTime >= StartDate && x.VisitTime <= EndDate && x.VisitState == EVisitState.Visited).CountAsync(),
|
|
|
+ .Where(x => x.VisitTime >= StartTime && x.VisitTime <= EndTime && x.VisitState == EVisitState.Visited).CountAsync(),
|
|
|
WaitVisitd = await _orderVisitRepository.Queryable()
|
|
|
- .Where(x => x.VisitTime >= StartDate && x.VisitTime <= EndDate && x.VisitState != EVisitState.None && x.VisitState != EVisitState.Visited).CountAsync()
|
|
|
+ .Where(x => x.VisitTime >= StartTime && x.VisitTime <= EndTime && x.VisitState != EVisitState.None && x.VisitState != EVisitState.Visited).CountAsync()
|
|
|
};
|
|
|
|
|
|
//部门
|
|
|
var listOrg = await _orderVisitDetailRepository.Queryable()
|
|
|
.LeftJoin<OrderVisit>((it, o) => it.VisitId == o.Id)
|
|
|
- .Where((it, o) => it.VisitTarget == EVisitTarget.Org && o.VisitTime >= StartDate && o.VisitTime <= EndDate && o.VisitState == EVisitState.Visited)
|
|
|
+ .Where((it, o) => it.VisitTarget == EVisitTarget.Org && o.VisitTime >= StartTime && o.VisitTime <= EndTime && o.VisitState == EVisitState.Visited)
|
|
|
.Select((it, o) => new Satisfaction
|
|
|
{
|
|
|
Dissatisfied = SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "1") || SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "2"), 1, 0)),
|
|
@@ -1285,7 +1288,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
//坐席
|
|
|
var listSet = await _orderVisitDetailRepository.Queryable()
|
|
|
.LeftJoin<OrderVisit>((it, o) => it.VisitId == o.Id)
|
|
|
- .Where((it, o) => it.VisitTarget == EVisitTarget.Seat && o.VisitTime >= StartDate && o.VisitTime <= EndDate && o.VisitState == EVisitState.Visited)
|
|
|
+ .Where((it, o) => it.VisitTarget == EVisitTarget.Seat && o.VisitTime >= StartTime && o.VisitTime <= EndTime && o.VisitState == EVisitState.Visited)
|
|
|
.Select((it, o) => new Satisfaction
|
|
|
{
|
|
|
Dissatisfied = SqlFunc.AggregateSum(SqlFunc.IIF(it.SeatEvaluate == ESeatEvaluate.NoSatisfied, 1, 0)),
|
|
@@ -1309,7 +1312,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
//市直部门
|
|
|
var listOrgStatisticsCityAll = await _orderRepository.Queryable()
|
|
|
.LeftJoin<SystemOrganize>((it, o) => it.OrgLevelOneCode == o.Id)
|
|
|
- .Where((it, o) => (o.OrgType == EOrgType.City || o.OrgType == EOrgType.Province) && it.CreationTime >= StartDate && it.CreationTime <= EndDate)
|
|
|
+ .Where((it, o) => (o.OrgType == EOrgType.City || o.OrgType == EOrgType.Province) && it.CreationTime >= StartTime && it.CreationTime <= EndTime)
|
|
|
.GroupBy((it, o) => new
|
|
|
{
|
|
|
it.OrgLevelOneCode,
|
|
@@ -1330,7 +1333,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
//区县部门
|
|
|
var listOrgStatisticsAreaAll = await _orderRepository.Queryable()
|
|
|
.LeftJoin<SystemOrganize>((it, o) => it.OrgLevelOneCode == o.Id)
|
|
|
- .Where((it, o) => o.OrgType == EOrgType.County && it.CreationTime >= StartDate && it.CreationTime <= EndDate)
|
|
|
+ .Where((it, o) => o.OrgType == EOrgType.County && it.CreationTime >= StartTime && it.CreationTime <= EndTime)
|
|
|
.GroupBy((it, o) => new
|
|
|
{
|
|
|
it.OrgLevelOneCode,
|
|
@@ -1354,30 +1357,33 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
/// <summary>
|
|
|
/// 部门受理类型统计周期
|
|
|
/// </summary>
|
|
|
- /// <param name="StartDate"></param>
|
|
|
- /// <param name="EndDate"></param>
|
|
|
+ /// <param name="StartTime"></param>
|
|
|
+ /// <param name="EndTime"></param>
|
|
|
/// <param name="TypeCode">0:全部,1:中心,2:部门</param>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("department_acceptance_type_statistics")]
|
|
|
- public async Task<List<DepartmentAcceptanceTypeStatisticsDto>> DepartmentAcceptanceTypeStatistics(DateTime StartDate, DateTime EndDate, int TypeCode)
|
|
|
+ public async Task<List<DepartmentAcceptanceTypeStatisticsDto>> DepartmentAcceptanceTypeStatistics(DateTime StartTime, DateTime EndTime, int TypeCode)
|
|
|
{
|
|
|
- EndDate = EndDate.AddDays(1).AddSeconds(-1);
|
|
|
+ EndTime = EndTime.AddDays(1).AddSeconds(-1);
|
|
|
|
|
|
var IsCenter = _sessionContext.OrgIsCenter;
|
|
|
|
|
|
var orderData = await _orderRepository.Queryable()
|
|
|
- .Where(it => it.CreationTime >= StartDate && it.CreationTime <= EndDate && it.Status > EOrderStatus.WaitForAccept)
|
|
|
+ .Where(it => it.CreationTime >= StartTime && it.CreationTime <= EndTime && it.Status >= EOrderStatus.Filed)
|
|
|
.Select(it => new
|
|
|
{
|
|
|
OrgCode = IsCenter == true ? it.ActualHandleOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")) : it.ActualHandleOrgCode.Substring(0, _sessionContext.RequiredOrgId.Length + 3),
|
|
|
- it.AcceptTypeCode,
|
|
|
- it.FileDurationWorkday,
|
|
|
- it.AllDuration
|
|
|
+ AcceptTypeCode = it.AcceptTypeCode,
|
|
|
+ ProcessType = it.ProcessType,
|
|
|
+ AllTime = it.ProcessType == EProcessType.Zhiban ? it.CreationTimeHandleDurationWorkday : it.CenterToOrgHandleDurationWorkday
|
|
|
+
|
|
|
})
|
|
|
.MergeTable()
|
|
|
.LeftJoin<SystemOrganize>((it, o) => it.OrgCode == o.Id)
|
|
|
- .WhereIF(TypeCode == 1, (it, o) => it.OrgCode == "001")
|
|
|
- .WhereIF(TypeCode == 2, (it, o) => it.OrgCode != "001")
|
|
|
+ //.WhereIF(TypeCode == 1, (it, o) => it.OrgCode == "001")
|
|
|
+ //.WhereIF(TypeCode == 2, (it, o) => it.OrgCode != "001")
|
|
|
+ .WhereIF(TypeCode == 1, (it, o) => it.ProcessType == EProcessType.Zhiban)
|
|
|
+ .WhereIF(TypeCode == 2, (it, o) => it.ProcessType == EProcessType.Jiaoban)
|
|
|
.WhereIF(IsCenter == false, (it, o) => it.OrgCode.StartsWith(_sessionContext.RequiredOrgId))
|
|
|
.GroupBy((it, o) => new
|
|
|
{
|
|
@@ -1389,156 +1395,44 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
{
|
|
|
OrgName = it.OrgCode == "001" ? "热线中心" : o.Name,
|
|
|
OrgCode = it.OrgCode,
|
|
|
- OrgType = (int)o.OrgType == 2 ? "区县部门" : "市直部门",
|
|
|
+ OrgType = o.OrgType == EOrgType.County ? "区县部门" : "市直部门",
|
|
|
ZxAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "10", 1, 0)),
|
|
|
- ZxAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "10" && it.AllDuration != null, it.AllDuration, 0)),
|
|
|
+ ZxAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "10" && it.AllTime != null, it.AllTime, 0)),
|
|
|
ZxAcceptanceTypeCode = "10",
|
|
|
|
|
|
JyAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "15", 1, 0)),
|
|
|
- JyAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "15" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
|
|
|
+ JyAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "15" && it.AllTime != null, it.AllTime, 0)),
|
|
|
JyAcceptanceTypeCode = "15",
|
|
|
|
|
|
QzAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "20", 1, 0)),
|
|
|
- QzAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "20" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
|
|
|
+ QzAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "20" && it.AllTime != null, it.AllTime, 0)),
|
|
|
QzAcceptanceTypeCode = "20",
|
|
|
|
|
|
ByAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "25", 1, 0)),
|
|
|
- ByAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "25" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
|
|
|
+ ByAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "25" && it.AllTime != null, it.AllTime, 0)),
|
|
|
ByAcceptanceTypeCode = "25",
|
|
|
|
|
|
JbAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "30", 1, 0)),
|
|
|
- JbAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "30" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
|
|
|
+ JbAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "30" && it.AllTime != null, it.AllTime, 0)),
|
|
|
JbAcceptanceTypeCode = "30",
|
|
|
|
|
|
TsAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "35", 1, 0)),
|
|
|
- TsAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "35" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
|
|
|
+ TsAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "35" && it.AllTime != null, it.AllTime, 0)),
|
|
|
TsAcceptanceTypeCode = "35",
|
|
|
|
|
|
QtAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "40", 1, 0)),
|
|
|
- QtAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "40" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
|
|
|
+ QtAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "40" && it.AllTime != null, it.AllTime, 0)),
|
|
|
QtAcceptanceTypeCode = "40",
|
|
|
|
|
|
YjAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "1", 1, 0)),
|
|
|
- YjAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "1" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
|
|
|
+ YjAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "1" && it.AllTime != null, it.AllTime, 0)),
|
|
|
YjAcceptanceTypeCode = "1"
|
|
|
})
|
|
|
.ToListAsync();
|
|
|
|
|
|
-
|
|
|
return orderData;
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 部门受理类型统计周期---子级
|
|
|
- /// </summary>
|
|
|
- /// <param name="StartDate"></param>
|
|
|
- /// <param name="EndDate"></param>
|
|
|
- /// <param name="TypeCode">0:全部,1:中心,2:部门</param>
|
|
|
- /// <param name="OrgCode"></param>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpGet("department_acceptance_type_child_statistics")]
|
|
|
- public async Task<object> DepartmentAcceptanceTypeChildStatistics(DateTime StartDate, DateTime EndDate, int TypeCode, string OrgCode)
|
|
|
- {
|
|
|
- EndDate = EndDate.AddDays(1).AddSeconds(-1);
|
|
|
-
|
|
|
- // var IsCenter = _sessionContext.OrgIsCenter;
|
|
|
-
|
|
|
- var orderData = await _orderRepository.Queryable()
|
|
|
- .Where(it => it.CreationTime >= StartDate && it.CreationTime <= EndDate && it.Status > EOrderStatus.WaitForAccept)// && it.Status >= EOrderStatus.Filed
|
|
|
- .WhereIF(OrgCode == "001", it => it.ActualHandleOrgCode == OrgCode)
|
|
|
- .WhereIF(OrgCode != "001", it => it.ActualHandleOrgCode.StartsWith(OrgCode))
|
|
|
-
|
|
|
- .Select(it => new
|
|
|
- {
|
|
|
- // OrgCode = OrgCode == "001" ? OrgCode : it.ActualHandleOrgCode.Substring(0, OrgCode.Length + 3),
|
|
|
- OrgCode = it.ActualHandleOrgCode == "001" ? it.ActualHandleOrgCode : it.ActualHandleOrgCode.Substring(0, OrgCode.Length + 3),
|
|
|
- it.AcceptTypeCode,
|
|
|
- it.FileDurationWorkday,
|
|
|
- it.AllDuration
|
|
|
- })
|
|
|
- .MergeTable()
|
|
|
- .LeftJoin<SystemOrganize>((it, o) => it.OrgCode == o.Id)
|
|
|
-
|
|
|
- .WhereIF(TypeCode == 1, (it, o) => it.OrgCode == "001")
|
|
|
- .WhereIF(TypeCode == 2, (it, o) => it.OrgCode != "001")
|
|
|
- //.WhereIF(IsCenter == false, (it, o) => it.OrgCode.StartsWith(_sessionContext.RequiredOrgId))
|
|
|
-
|
|
|
- .GroupBy((it, o) => new
|
|
|
- {
|
|
|
- it.OrgCode,
|
|
|
- o.Name,
|
|
|
- o.OrgType
|
|
|
- })
|
|
|
- .Select((it, o) => new DepartmentAcceptanceTypeStatisticsDto
|
|
|
- {
|
|
|
- OrgName = it.OrgCode == "001" ? "热线中心" : o.Name,
|
|
|
- OrgCode = it.OrgCode,
|
|
|
- OrgType = (int)o.OrgType == 2 ? "区县部门" : "市直部门",
|
|
|
- ZxAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "10", 1, 0)),
|
|
|
- ZxAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "10" && it.AllDuration != null, it.AllDuration, 0)),
|
|
|
- ZxAcceptanceTypeCode = "10",
|
|
|
-
|
|
|
- JyAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "15", 1, 0)),
|
|
|
- JyAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "15" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
|
|
|
- JyAcceptanceTypeCode = "15",
|
|
|
-
|
|
|
- QzAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "20", 1, 0)),
|
|
|
- QzAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "20" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
|
|
|
- QzAcceptanceTypeCode = "20",
|
|
|
-
|
|
|
- ByAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "25", 1, 0)),
|
|
|
- ByAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "25" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
|
|
|
- ByAcceptanceTypeCode = "25",
|
|
|
-
|
|
|
- JbAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "30", 1, 0)),
|
|
|
- JbAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "30" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
|
|
|
- JbAcceptanceTypeCode = "30",
|
|
|
-
|
|
|
- TsAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "35", 1, 0)),
|
|
|
- TsAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "35" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
|
|
|
- TsAcceptanceTypeCode = "35",
|
|
|
-
|
|
|
- QtAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "40", 1, 0)),
|
|
|
- QtAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "40" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
|
|
|
- QtAcceptanceTypeCode = "40"
|
|
|
- })
|
|
|
- .ToListAsync();
|
|
|
-
|
|
|
- var sumModel = new DepartmentAcceptanceTypeStatisticsDto
|
|
|
- {
|
|
|
- OrgName = "合计",
|
|
|
- ZxAllCount = orderData.Sum(x => x.ZxAllCount),
|
|
|
- ZxAllTimes = orderData.Sum(x => x.ZxAllTimes),
|
|
|
- ZxAcceptanceTypeCode = "10",
|
|
|
-
|
|
|
- JyAllCount = orderData.Sum(x => x.JyAllCount),
|
|
|
- JyAllTimes = orderData.Sum(x => x.JyAllTimes),
|
|
|
- JyAcceptanceTypeCode = "15",
|
|
|
-
|
|
|
- QzAllCount = orderData.Sum(x => x.QzAllCount),
|
|
|
- QzAllTimes = orderData.Sum(x => x.QzAllTimes),
|
|
|
- QzAcceptanceTypeCode = "20",
|
|
|
-
|
|
|
- ByAllCount = orderData.Sum(x => x.ByAllCount),
|
|
|
- ByAllTimes = orderData.Sum(x => x.ByAllTimes),
|
|
|
- ByAcceptanceTypeCode = "25",
|
|
|
-
|
|
|
- JbAllCount = orderData.Sum(x => x.JbAllCount),
|
|
|
- JbAllTimes = orderData.Sum(x => x.JbAllTimes),
|
|
|
- JbAcceptanceTypeCode = "30",
|
|
|
-
|
|
|
- TsAllCount = orderData.Sum(x => x.TsAllCount),
|
|
|
- TsAllTimes = orderData.Sum(x => x.TsAllTimes),
|
|
|
- TsAcceptanceTypeCode = "35",
|
|
|
-
|
|
|
- QtAllCount = orderData.Sum(x => x.QtAllCount),
|
|
|
- QtAllTimes = orderData.Sum(x => x.QtAllTimes),
|
|
|
- QtAcceptanceTypeCode = "40"
|
|
|
- };
|
|
|
- return new { DataList = orderData, SumModel = sumModel };
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// 部门受理类型统计周期--明细列表
|
|
|
/// </summary>
|
|
@@ -1547,15 +1441,16 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
[HttpGet("department_acceptance_type_order_list")]
|
|
|
public async Task<PagedDto<OrderDto>> DepartmentAcceptanceTypeOrderList([FromQuery] DepartmentKeyWordRequest dto)
|
|
|
{
|
|
|
- dto.EndDate = dto.EndDate.AddDays(1).AddSeconds(-1);
|
|
|
+ dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
|
|
|
var (total, items) = await _orderRepository.Queryable()
|
|
|
- .Where(p => p.CreationTime >= dto.StartDate && p.CreationTime <= dto.EndDate && p.Status > EOrderStatus.WaitForAccept)//&& p.Status >= EOrderStatus.Filed
|
|
|
+ .Where(p => p.CreationTime >= dto.StartTime && p.CreationTime <= dto.EndTime && p.Status >= EOrderStatus.Filed)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.OrgCode) && dto.OrgCode == "001", p => p.ActualHandleOrgCode == dto.OrgCode)
|
|
|
+
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.OrgCode) && dto.OrgCode != "001" && _sessionContext.RequiredOrgId != dto.OrgCode, p => p.ActualHandleOrgCode.StartsWith(dto.OrgCode))
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.OrgCode) && dto.OrgCode != "001" && _sessionContext.RequiredOrgId == dto.OrgCode, p => p.ActualHandleOrgCode == dto.OrgCode)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.AcceptTypeCode), p => p.AcceptTypeCode == dto.AcceptTypeCode)
|
|
|
- .WhereIF(dto.TypeCode == 1, p => p.ActualHandleOrgCode == "001")
|
|
|
- .WhereIF(dto.TypeCode == 2, p => p.ActualHandleOrgCode != "001")
|
|
|
+ .WhereIF(dto.TypeCode == 1, p => p.ProcessType == EProcessType.Zhiban)
|
|
|
+ .WhereIF(dto.TypeCode == 2, p => p.ProcessType == EProcessType.Jiaoban)
|
|
|
.OrderByDescending(d => d.CreationTime)
|
|
|
.ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
|
|
@@ -1856,10 +1751,10 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
[HttpGet("high_frequency_call_statistics")]
|
|
|
public async Task<PagedDto<HighFrequencyCallStatisticsDto>> HighFrequencyCallStatistics([FromQuery] HighFrequencyCallStatisticsRequest dto)
|
|
|
{
|
|
|
- if (!dto.StartDate.HasValue || !dto.EndDate.HasValue)
|
|
|
+ if (!dto.StartTime.HasValue || !dto.EndTime.HasValue)
|
|
|
throw UserFriendlyException.SameMessage("请选择时间!");
|
|
|
|
|
|
- dto.EndDate = dto.EndDate.Value.AddDays(1).AddSeconds(-1);
|
|
|
+ dto.EndTime = dto.EndTime.Value.AddDays(1).AddSeconds(-1);
|
|
|
int CallCount = 2;
|
|
|
var HighFrequencyCallStatistics = _systemSettingCacheManager.GetSetting(SettingConstants.HighFrequencyCallStatistics)?.SettingValue[0];
|
|
|
if (HighFrequencyCallStatistics != null)
|
|
@@ -1867,7 +1762,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
|
|
|
var (total, items) = await _trCallRecordRepository.Queryable()
|
|
|
.LeftJoin<Order>((p, o) => p.ExternalId == o.Id)
|
|
|
- .Where((p, o) => p.OverTime >= dto.StartDate && p.OverTime <= dto.EndDate)
|
|
|
+ .Where((p, o) => p.OverTime >= dto.StartTime && p.OverTime <= dto.EndTime)
|
|
|
.Where((p, o) => p.CallOrderType == ECallOrderType.Order)
|
|
|
.Where((p, o) => p.ExternalId != null && o.Id != null)
|
|
|
.Where((p, o) => p.CallDirection == ECallDirection.In)
|
|
@@ -1900,15 +1795,15 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
[HttpGet("high_frequency_call_statistics_order_list")]
|
|
|
public async Task<PagedDto<OrderDto>> HighFrequencyCallStatisticsOrderList([FromQuery] HighFrequencyCallStatisticsListRequest dto)
|
|
|
{
|
|
|
- if (!dto.StartDate.HasValue || !dto.EndDate.HasValue)
|
|
|
+ if (!dto.StartTime.HasValue || !dto.EndTime.HasValue)
|
|
|
throw UserFriendlyException.SameMessage("请选择时间!");
|
|
|
if (string.IsNullOrEmpty(dto.FromPhone))
|
|
|
throw UserFriendlyException.SameMessage("号码不能为空!");
|
|
|
|
|
|
- dto.EndDate = dto.EndDate.Value.AddDays(1).AddSeconds(-1);
|
|
|
+ dto.EndTime = dto.EndTime.Value.AddDays(1).AddSeconds(-1);
|
|
|
var data = await _trCallRecordRepository.Queryable()
|
|
|
.LeftJoin<Order>((p, o) => p.ExternalId == o.Id)
|
|
|
- .Where((p, o) => p.OverTime >= dto.StartDate && p.OverTime <= dto.EndDate)
|
|
|
+ .Where((p, o) => p.OverTime >= dto.StartTime && p.OverTime <= dto.EndTime)
|
|
|
.Where((p, o) => p.CallOrderType == ECallOrderType.Order)
|
|
|
.Where((p, o) => p.ExternalId != null && o.Id != null)
|
|
|
.Where((p, o) => p.CPN == dto.FromPhone)
|
|
@@ -1970,7 +1865,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
public async Task<PagedDto<HighMatterWarningDto>> HighMatterWarning([FromQuery] HighMatterWarningRequest dto)
|
|
|
{
|
|
|
|
|
|
- dto.EndDate = dto.EndDate.AddDays(1).AddSeconds(-1);
|
|
|
+ dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
|
|
|
|
|
|
List<string> filterTitle = new List<string>();
|
|
|
filterTitle.Add("无声");
|
|
@@ -1979,7 +1874,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
filterTitle.Add("测试");
|
|
|
|
|
|
var (total, items) = await _orderRepository.Queryable()
|
|
|
- .Where(x => x.CreationTime >= dto.StartDate && x.CreationTime <= dto.EndDate)
|
|
|
+ .Where(x => x.CreationTime >= dto.StartTime && x.CreationTime <= dto.EndTime)
|
|
|
.Where(x => filterTitle.Any(s => x.Title.Contains(s)) == false)
|
|
|
.LeftJoin<SystemArea>((it, o) => it.AreaCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")) == o.Id)
|
|
|
.WhereIF(dto.AreaCodes.Any(), (it, o) => dto.AreaCodes.Contains(it.AreaCode)) //区域
|
|
@@ -2034,7 +1929,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
[HttpGet("highmatter-warning-detail")]
|
|
|
public async Task<PagedDto<OrderDto>> HighMatterWarningDetail([FromQuery] HighMatterWarningDetailRequest dto)
|
|
|
{
|
|
|
- dto.EndDate = dto.EndDate.AddDays(1).AddSeconds(-1);
|
|
|
+ dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
|
|
|
List<string> filterTitle = new List<string>();
|
|
|
filterTitle.Add("无声");
|
|
|
filterTitle.Add("骚扰");
|
|
@@ -2045,8 +1940,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
.Includes(x => x.OrderScreens)
|
|
|
.Where(d => d.AcceptTypeCode == dto.AcceptTypeCode) //受理类型
|
|
|
.Where(d => d.HotspotId == dto.HotspotId) //热点类型
|
|
|
- .Where(d => d.CreationTime >= dto.StartDate) //受理时间开始
|
|
|
- .Where(d => d.CreationTime <= dto.EndDate) //受理时间结束
|
|
|
+ .Where(d => d.CreationTime >= dto.StartTime) //受理时间开始
|
|
|
+ .Where(d => d.CreationTime <= dto.EndTime) //受理时间结束
|
|
|
.Where(d => d.AreaCode == dto.AreaCode) //区域
|
|
|
.Where(x => filterTitle.Any(s => x.Title.Contains(s)) == false)
|
|
|
.OrderByDescending(d => d.CreationTime)
|