|
@@ -228,7 +228,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
|
|
|
dto.EndTime = dto.EndTime.Value.AddDays(1).AddSeconds(-1);
|
|
dto.EndTime = dto.EndTime.Value.AddDays(1).AddSeconds(-1);
|
|
|
|
|
|
- if (dto.Type==0)
|
|
|
|
|
|
+ if (dto.Type == 0)
|
|
{
|
|
{
|
|
dto.ChainEndTime = dto.ChainEndTime.Value.AddDays(1).AddSeconds(-1);
|
|
dto.ChainEndTime = dto.ChainEndTime.Value.AddDays(1).AddSeconds(-1);
|
|
}
|
|
}
|
|
@@ -570,17 +570,18 @@ namespace Hotline.Api.Controllers.Bi
|
|
public async Task<VisitMeasureStatisticsDto> VisitMeasureStatistics(DateTime StartDate, DateTime EndDate, string? VisitName)
|
|
public async Task<VisitMeasureStatisticsDto> VisitMeasureStatistics(DateTime StartDate, DateTime EndDate, string? VisitName)
|
|
{
|
|
{
|
|
EndDate = EndDate.AddDays(1).AddSeconds(-1);
|
|
EndDate = EndDate.AddDays(1).AddSeconds(-1);
|
|
-
|
|
|
|
|
|
+
|
|
var list = await _orderVisitRepository.Queryable()
|
|
var list = await _orderVisitRepository.Queryable()
|
|
.Includes(x => x.Employee)
|
|
.Includes(x => x.Employee)
|
|
.Where(x => x.VisitTime >= StartDate && x.VisitTime <= EndDate && x.VisitState == EVisitState.Visited)
|
|
.Where(x => x.VisitTime >= StartDate && x.VisitTime <= EndDate && x.VisitState == EVisitState.Visited)
|
|
.WhereIF(!string.IsNullOrEmpty(VisitName), x => x.Employee.Name.Contains(VisitName))
|
|
.WhereIF(!string.IsNullOrEmpty(VisitName), x => x.Employee.Name.Contains(VisitName))
|
|
.GroupBy(x => new { x.EmployeeId, x.Employee.Name })
|
|
.GroupBy(x => new { x.EmployeeId, x.Employee.Name })
|
|
- .Select(x=> new VisitMeasureStatisticsModelDto() {
|
|
|
|
- VisitName = x.Employee.Name,
|
|
|
|
- CallVisitCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.VisitType == EVisitType.CallVisit,1,0)),
|
|
|
|
- ArtificialVisitCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.VisitType!= EVisitType.CallVisit,1,0)),
|
|
|
|
- SumCount = SqlFunc.AggregateCount(x.EmployeeId)
|
|
|
|
|
|
+ .Select(x => new VisitMeasureStatisticsModelDto()
|
|
|
|
+ {
|
|
|
|
+ VisitName = x.Employee.Name,
|
|
|
|
+ CallVisitCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.VisitType == EVisitType.CallVisit, 1, 0)),
|
|
|
|
+ ArtificialVisitCount = SqlFunc.AggregateSum(SqlFunc.IIF(x.VisitType != EVisitType.CallVisit, 1, 0)),
|
|
|
|
+ SumCount = SqlFunc.AggregateCount(x.EmployeeId)
|
|
})
|
|
})
|
|
.ToListAsync();
|
|
.ToListAsync();
|
|
var returnModel = new VisitMeasureStatisticsDto();
|
|
var returnModel = new VisitMeasureStatisticsDto();
|
|
@@ -592,11 +593,11 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
|
|
|
returnModel.AiVisitSatisfiedCount = await _aiOrderVisitDetailRepository.Queryable()
|
|
returnModel.AiVisitSatisfiedCount = await _aiOrderVisitDetailRepository.Queryable()
|
|
.Includes(x => x.OrderVisit)
|
|
.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 >= StartDate && x.AiVisitTime <= EndDate && x.IsSuccess == true && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") != "1" && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") != "2").CountAsync();
|
|
|
|
|
|
returnModel.AiVisitNoSatisfiedCount = await _aiOrderVisitDetailRepository.Queryable()
|
|
returnModel.AiVisitNoSatisfiedCount = await _aiOrderVisitDetailRepository.Queryable()
|
|
.Includes(x => x.OrderVisit)
|
|
.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 >= StartDate && x.AiVisitTime <= EndDate && x.IsSuccess == true && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") == "1" && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") == "2").CountAsync();
|
|
|
|
|
|
returnModel.AIVisitFailCount = await _aiOrderVisitDetailRepository.Queryable()
|
|
returnModel.AIVisitFailCount = await _aiOrderVisitDetailRepository.Queryable()
|
|
.Where(x => x.AiVisitTime >= StartDate && x.AiVisitTime <= EndDate && x.IsSuccess == false).CountAsync();
|
|
.Where(x => x.AiVisitTime >= StartDate && x.AiVisitTime <= EndDate && x.IsSuccess == false).CountAsync();
|
|
@@ -691,21 +692,22 @@ namespace Hotline.Api.Controllers.Bi
|
|
//.Includes(x => x.OrderVisit,o=>o.Order,d=>d.CallRecord)
|
|
//.Includes(x => x.OrderVisit,o=>o.Order,d=>d.CallRecord)
|
|
.Where(x => x.OrderVisit.VisitTime >= StartDate && x.OrderVisit.VisitTime <= EndDate && x.VisitTarget == EVisitTarget.Org && x.OrderVisit.VisitState == EVisitState.Visited && !string.IsNullOrEmpty(x.VisitOrgCode))
|
|
.Where(x => x.OrderVisit.VisitTime >= StartDate && x.OrderVisit.VisitTime <= EndDate && x.VisitTarget == EVisitTarget.Org && x.OrderVisit.VisitState == EVisitState.Visited && !string.IsNullOrEmpty(x.VisitOrgCode))
|
|
.WhereIF(!string.IsNullOrEmpty(OrgName), x => x.VisitOrgName.Contains(OrgName))
|
|
.WhereIF(!string.IsNullOrEmpty(OrgName), x => x.VisitOrgName.Contains(OrgName))
|
|
- .WhereIF(!string.IsNullOrEmpty(LineNum),x=>x.OrderVisit.Order.CallRecord.Gateway.Contains(LineNum))
|
|
|
|
- .GroupBy(x => new {
|
|
|
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(LineNum), x => x.OrderVisit.Order.CallRecord.Gateway.Contains(LineNum))
|
|
|
|
+ .GroupBy(x => new
|
|
|
|
+ {
|
|
VisitOrgCode = x.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6"))
|
|
VisitOrgCode = x.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6"))
|
|
})
|
|
})
|
|
.Select(x => new VisitAndOrgSatisfactionStatisticsDto()
|
|
.Select(x => new VisitAndOrgSatisfactionStatisticsDto()
|
|
{
|
|
{
|
|
OrgCode = x.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")),
|
|
OrgCode = x.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")),
|
|
TotalSumCount = SqlFunc.AggregateCount(x.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6"))),
|
|
TotalSumCount = SqlFunc.AggregateCount(x.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6"))),
|
|
- VerySatisfiedCount =SqlFunc.IIF(TypeId==1,SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgProcessingResults, "Key")== "5",1,0)),SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgHandledAttitude,"Key")=="5",1,0))),//非常满意数
|
|
|
|
- SatisfiedCount = SqlFunc.IIF(TypeId==1,SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgProcessingResults, "Key" )=="4",1,0)),SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgHandledAttitude,"Key")=="4",1,0))), //满意数
|
|
|
|
- RegardedAsSatisfiedCount = SqlFunc.IIF(TypeId==1,SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgProcessingResults, "Key")== "-1",1,0)),SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgHandledAttitude,"Key")=="-1",1,0))),//视为满意
|
|
|
|
|
|
+ VerySatisfiedCount = SqlFunc.IIF(TypeId == 1, SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "5", 1, 0)), SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "5", 1, 0))),//非常满意数
|
|
|
|
+ SatisfiedCount = SqlFunc.IIF(TypeId == 1, SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "4", 1, 0)), SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "4", 1, 0))), //满意数
|
|
|
|
+ RegardedAsSatisfiedCount = SqlFunc.IIF(TypeId == 1, SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "-1", 1, 0)), SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "-1", 1, 0))),//视为满意
|
|
DefaultSatisfiedCount = SqlFunc.IIF(TypeId == 1, SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "0", 1, 0)), SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "0", 1, 0))),//默认满意
|
|
DefaultSatisfiedCount = SqlFunc.IIF(TypeId == 1, SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "0", 1, 0)), SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "0", 1, 0))),//默认满意
|
|
- NoSatisfiedCount =SqlFunc.IIF(TypeId==1,SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "2",1,0)),SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "2", 1, 0))),//不满意
|
|
|
|
- NoEvaluateCount = SqlFunc.IIF(TypeId==1,SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgProcessingResults, "Key")== "7",1,0)),SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgHandledAttitude,"Key")=="7",1,0))),//未做评价
|
|
|
|
- NoPutThroughCount = SqlFunc.IIF(TypeId==1, SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgProcessingResults, "Key")=="6",1,0)),SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgHandledAttitude,"Key")=="6",1,0))),//未接通
|
|
|
|
|
|
+ NoSatisfiedCount = SqlFunc.IIF(TypeId == 1, SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "2", 1, 0)), SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "2", 1, 0))),//不满意
|
|
|
|
+ NoEvaluateCount = SqlFunc.IIF(TypeId == 1, SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "7", 1, 0)), SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "7", 1, 0))),//未做评价
|
|
|
|
+ NoPutThroughCount = SqlFunc.IIF(TypeId == 1, SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "6", 1, 0)), SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "6", 1, 0))),//未接通
|
|
})
|
|
})
|
|
.MergeTable()
|
|
.MergeTable()
|
|
.LeftJoin<SystemOrganize>((it, o) => it.OrgCode == o.Id)
|
|
.LeftJoin<SystemOrganize>((it, o) => it.OrgCode == o.Id)
|
|
@@ -728,8 +730,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
var countySumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
var countySumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
{
|
|
{
|
|
OrgName = "区县合计",
|
|
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),
|
|
|
|
|
|
+ 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),
|
|
SatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.SatisfiedCount),
|
|
RegardedAsSatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.RegardedAsSatisfiedCount),
|
|
RegardedAsSatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.RegardedAsSatisfiedCount),
|
|
DefaultSatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.DefaultSatisfiedCount),
|
|
DefaultSatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.DefaultSatisfiedCount),
|
|
@@ -740,7 +742,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
|
|
|
var citySumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
var citySumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
{
|
|
{
|
|
- OrgName ="市直合计",
|
|
|
|
|
|
+ OrgName = "市直合计",
|
|
TotalSumCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.TotalSumCount),
|
|
TotalSumCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.TotalSumCount),
|
|
VerySatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.VerySatisfiedCount),
|
|
VerySatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.VerySatisfiedCount),
|
|
SatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.SatisfiedCount),
|
|
SatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.SatisfiedCount),
|
|
@@ -753,7 +755,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
|
|
|
var sumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
var sumModel = new VisitAndOrgSatisfactionStatisticsDto()
|
|
{
|
|
{
|
|
- OrgName ="总计",
|
|
|
|
|
|
+ OrgName = "总计",
|
|
TotalSumCount = list.Sum(x => x.TotalSumCount),
|
|
TotalSumCount = list.Sum(x => x.TotalSumCount),
|
|
VerySatisfiedCount = list.Sum(x => x.VerySatisfiedCount),
|
|
VerySatisfiedCount = list.Sum(x => x.VerySatisfiedCount),
|
|
SatisfiedCount = list.Sum(x => x.SatisfiedCount),
|
|
SatisfiedCount = list.Sum(x => x.SatisfiedCount),
|
|
@@ -765,7 +767,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
- return new VisitAndOrgSatisfactionStatisticsResultDto{ DataList = list, CountySumModel = countySumModel,CitySumModel = citySumModel, SumModel = sumModel };
|
|
|
|
|
|
+ return new VisitAndOrgSatisfactionStatisticsResultDto { DataList = list, CountySumModel = countySumModel, CitySumModel = citySumModel, SumModel = sumModel };
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -786,11 +788,12 @@ namespace Hotline.Api.Controllers.Bi
|
|
var list = await _systemOrganizeRepository.Queryable().Where(x => x.Id.StartsWith(OrgCode))
|
|
var list = await _systemOrganizeRepository.Queryable().Where(x => x.Id.StartsWith(OrgCode))
|
|
.LeftJoin<OrderVisitDetail>((x, it) => x.Id == it.VisitOrgCode)
|
|
.LeftJoin<OrderVisitDetail>((x, it) => x.Id == it.VisitOrgCode)
|
|
.Where((x, it) => it.OrderVisit.VisitTime >= StartDate && it.OrderVisit.VisitTime <= EndDate && it.VisitTarget == EVisitTarget.Org && it.OrderVisit.VisitState == EVisitState.Visited)
|
|
.Where((x, it) => it.OrderVisit.VisitTime >= StartDate && it.OrderVisit.VisitTime <= EndDate && it.VisitTarget == EVisitTarget.Org && it.OrderVisit.VisitState == EVisitState.Visited)
|
|
- .WhereIF(!string.IsNullOrEmpty(LineNum),(x,it)=>it.OrderVisit.Order.CallRecord.Gateway.Contains(LineNum))
|
|
|
|
- .GroupBy((x,it) => new {
|
|
|
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(LineNum), (x, it) => it.OrderVisit.Order.CallRecord.Gateway.Contains(LineNum))
|
|
|
|
+ .GroupBy((x, it) => new
|
|
|
|
+ {
|
|
VisitOrgCode = it.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("9"))
|
|
VisitOrgCode = it.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("9"))
|
|
})
|
|
})
|
|
- .Select((x,it) => new VisitAndOrgSatisfactionStatisticsDto()
|
|
|
|
|
|
+ .Select((x, it) => new VisitAndOrgSatisfactionStatisticsDto()
|
|
{
|
|
{
|
|
OrgCode = it.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("9")),
|
|
OrgCode = it.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("9")),
|
|
TotalSumCount = SqlFunc.AggregateCount(it.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("9"))),
|
|
TotalSumCount = SqlFunc.AggregateCount(it.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("9"))),
|
|
@@ -873,22 +876,22 @@ namespace Hotline.Api.Controllers.Bi
|
|
/// <param name="LineNum"></param>
|
|
/// <param name="LineNum"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
[HttpGet("visit-org-satisfaction-detail")]
|
|
[HttpGet("visit-org-satisfaction-detail")]
|
|
- public async Task<PagedDto<OrderVisitDetailDto>> VisitAndOrgSatisfactionDetail([FromQuery]VisitAndOrgSatisfactionDetailDto dto)
|
|
|
|
|
|
+ public async Task<PagedDto<OrderVisitDetailDto>> VisitAndOrgSatisfactionDetail([FromQuery] VisitAndOrgSatisfactionDetailDto dto)
|
|
{
|
|
{
|
|
dto.EndDate = dto.EndDate.AddDays(1).AddSeconds(-1);
|
|
dto.EndDate = dto.EndDate.AddDays(1).AddSeconds(-1);
|
|
- var (total,items) = await _orderVisitDetailRepository.Queryable()
|
|
|
|
|
|
+ var (total, items) = await _orderVisitDetailRepository.Queryable()
|
|
.Includes(x => x.OrderVisit, o => o.Order, d => d.CallRecord)
|
|
.Includes(x => x.OrderVisit, o => o.Order, d => d.CallRecord)
|
|
.Where(x => x.OrderVisit.VisitTime >= dto.StartDate && x.OrderVisit.VisitTime <= dto.EndDate && x.VisitTarget == EVisitTarget.Org && x.OrderVisit.VisitState == EVisitState.Visited)
|
|
.Where(x => x.OrderVisit.VisitTime >= dto.StartDate && x.OrderVisit.VisitTime <= dto.EndDate && x.VisitTarget == EVisitTarget.Org && x.OrderVisit.VisitState == EVisitState.Visited)
|
|
- .WhereIF(dto.OrgCode=="001",x => x.VisitOrgCode==dto.OrgCode)
|
|
|
|
- .WhereIF(dto.OrgCode!="001",x => x.VisitOrgCode.StartsWith(dto.OrgCode))
|
|
|
|
|
|
+ .WhereIF(dto.OrgCode == "001", x => x.VisitOrgCode == dto.OrgCode)
|
|
|
|
+ .WhereIF(dto.OrgCode != "001", x => x.VisitOrgCode.StartsWith(dto.OrgCode))
|
|
.WhereIF(dto.TypeId == 1, x => SqlFunc.JsonField(x.OrgProcessingResults, "Key") == dto.DateValue)
|
|
.WhereIF(dto.TypeId == 1, x => SqlFunc.JsonField(x.OrgProcessingResults, "Key") == dto.DateValue)
|
|
.WhereIF(dto.TypeId == 2, x => SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == dto.DateValue)
|
|
.WhereIF(dto.TypeId == 2, x => SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == dto.DateValue)
|
|
.WhereIF(!string.IsNullOrEmpty(dto.LineNum), x => x.OrderVisit.Order.CallRecord.Gateway == dto.LineNum)
|
|
.WhereIF(!string.IsNullOrEmpty(dto.LineNum), x => x.OrderVisit.Order.CallRecord.Gateway == dto.LineNum)
|
|
- .ToPagedListAsync(dto.PageIndex,dto.PageSize,HttpContext.RequestAborted);
|
|
|
|
|
|
+ .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
return new PagedDto<OrderVisitDetailDto>(total, _mapper.Map<IReadOnlyList<OrderVisitDetailDto>>(items));
|
|
return new PagedDto<OrderVisitDetailDto>(total, _mapper.Map<IReadOnlyList<OrderVisitDetailDto>>(items));
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -1031,8 +1034,15 @@ namespace Hotline.Api.Controllers.Bi
|
|
})
|
|
})
|
|
.ToListAsync();
|
|
.ToListAsync();
|
|
|
|
|
|
- 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);
|
|
|
|
|
|
+ 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()
|
|
var listSet = await _orderVisitDetailRepository.Queryable()
|
|
@@ -1044,8 +1054,15 @@ namespace Hotline.Api.Controllers.Bi
|
|
Satisfied = SqlFunc.AggregateSum(SqlFunc.IIF(it.SeatEvaluate != ESeatEvaluate.VeryNoSatisfied && it.SeatEvaluate != ESeatEvaluate.NoSatisfied, 1, 0)),
|
|
Satisfied = SqlFunc.AggregateSum(SqlFunc.IIF(it.SeatEvaluate != ESeatEvaluate.VeryNoSatisfied && it.SeatEvaluate != ESeatEvaluate.NoSatisfied, 1, 0)),
|
|
}).ToListAsync();
|
|
}).ToListAsync();
|
|
|
|
|
|
- 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 (listSet != null && listSet.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ var SatisfiedCount = listSet[0].Satisfied + listSet[0].Satisfied;
|
|
|
|
+ if (SatisfiedCount > 0 && listSet[0].Satisfied > 0)
|
|
|
|
+ centerReportVisitd.OrgRate = Math.Round((listSet[0].Satisfied / (double)SatisfiedCount) * 100, 2);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //if (centerReportVisitd.Visitd > 0 && listSet != null && listSet.Count > 0 && listSet[0].Satisfied > 0)
|
|
|
|
+ // centerReportVisitd.SeatsRate = Math.Round((listSet[0].Satisfied / (double)centerReportVisitd.Visitd) * 100, 2);
|
|
|
|
|
|
centerReportStatisticsDto.CenterReportVisitd = centerReportVisitd;
|
|
centerReportStatisticsDto.CenterReportVisitd = centerReportVisitd;
|
|
#endregion
|
|
#endregion
|
|
@@ -1242,13 +1259,23 @@ namespace Hotline.Api.Controllers.Bi
|
|
.LeftJoin<WorkflowCountersignMember>((x, o) => x.Id == o.WorkflowCountersignId)
|
|
.LeftJoin<WorkflowCountersignMember>((x, o) => x.Id == o.WorkflowCountersignId)
|
|
.Where(x => x.CreationTime >= StartDate && x.CreationTime <= EndDate)
|
|
.Where(x => x.CreationTime >= StartDate && x.CreationTime <= EndDate)
|
|
.GroupBy((x, o) => o.Key)
|
|
.GroupBy((x, o) => o.Key)
|
|
- .Select((x, o) => new OrderBiOrgDataListVo
|
|
|
|
|
|
+ .Select((x, o) => new DepartmentalProcessingStatisticsDataDto
|
|
{
|
|
{
|
|
- OrgId = o.Key,
|
|
|
|
- CounterHandlerExtendedNum = SqlFunc.AggregateSum(SqlFunc.IIF(o.IsHandled, 1, 0)),
|
|
|
|
- CounterNoHandlerExtendedNum = SqlFunc.AggregateSum(SqlFunc.IIF(!o.IsHandled, 1, 0)),
|
|
|
|
|
|
+ OrgCode = o.Key,
|
|
|
|
+ HQYBOverdue = SqlFunc.AggregateSum(SqlFunc.IIF(o.IsHandled, 1, 0)),
|
|
|
|
+ HQZBOverdue = SqlFunc.AggregateSum(SqlFunc.IIF(!o.IsHandled, 1, 0)),
|
|
|
|
+ DelayEnd = SqlFunc.AggregateSum(SqlFunc.IIF(!o.IsHandled, 1, 0)),
|
|
|
|
+ DelayWait = SqlFunc.AggregateSum(SqlFunc.IIF(!o.IsHandled, 1, 0)),
|
|
}).MergeTable();
|
|
}).MergeTable();
|
|
var queryPush = query.LeftJoin(queryPublish, (it, o) => it.Id == o.Id).Where(it => it.OrgCode != null);
|
|
var queryPush = query.LeftJoin(queryPublish, (it, o) => it.Id == o.Id).Where(it => it.OrgCode != null);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
return await queryPush.GroupBy((it, o) => new
|
|
return await queryPush.GroupBy((it, o) => new
|
|
{
|
|
{
|
|
it.OrgCode
|
|
it.OrgCode
|
|
@@ -1262,8 +1289,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
ZBOrderCountNum = SqlFunc.AggregateSum(SqlFunc.IIF((int)it.Status < 300, 1, 0)),//在办
|
|
ZBOrderCountNum = SqlFunc.AggregateSum(SqlFunc.IIF((int)it.Status < 300, 1, 0)),//在办
|
|
|
|
|
|
|
|
|
|
- YBOverdue = SqlFunc.AggregateSum(SqlFunc.IIF((int)it.Status >= 300 && it.ActualHandleTime > it.ExpiredTime, 1, 0)),//已办超期
|
|
|
|
- ZBOverdue = SqlFunc.AggregateSum(SqlFunc.IIF((int)it.Status < 300 && it.ExpiredTime < SqlFunc.GetDate(), 1, 0)),//待办超期
|
|
|
|
|
|
+ YBOverdue = SqlFunc.AggregateSum(SqlFunc.IIF((int)it.Status >= 300 && it.ActualHandleTime > it.ExpiredTime, 1, 0)),//已办超期
|
|
|
|
+ ZBOverdue = SqlFunc.AggregateSum(SqlFunc.IIF((int)it.Status < 300 && it.ExpiredTime < SqlFunc.GetDate(), 1, 0)),//待办超期
|
|
|
|
|
|
HQYBOverdue = SqlFunc.AggregateSum(SqlFunc.IIF((int)it.Status >= 300 && it.CounterSignType != null && it.ActualHandleTime > it.ExpiredTime, 1, 0)),//会签已办超期
|
|
HQYBOverdue = SqlFunc.AggregateSum(SqlFunc.IIF((int)it.Status >= 300 && it.CounterSignType != null && it.ActualHandleTime > it.ExpiredTime, 1, 0)),//会签已办超期
|
|
HQZBOverdue = SqlFunc.AggregateSum(SqlFunc.IIF((int)it.Status < 300 && it.CounterSignType != null && it.ExpiredTime < SqlFunc.GetDate(), 1, 0)),//会签待办超期
|
|
HQZBOverdue = SqlFunc.AggregateSum(SqlFunc.IIF((int)it.Status < 300 && it.CounterSignType != null && it.ExpiredTime < SqlFunc.GetDate(), 1, 0)),//会签待办超期
|