|
@@ -3031,11 +3031,19 @@ namespace Hotline.Api.Controllers.Bi
|
|
CallVisitd = SqlFunc.AggregateSum(SqlFunc.IIF(x.VisitState == EVisitState.Visited && x.VisitType == EVisitType.CallVisit, 1, 0)),// 已回访--电话
|
|
CallVisitd = SqlFunc.AggregateSum(SqlFunc.IIF(x.VisitState == EVisitState.Visited && x.VisitType == EVisitType.CallVisit, 1, 0)),// 已回访--电话
|
|
SmsVisitd = SqlFunc.AggregateSum(SqlFunc.IIF(x.VisitState == EVisitState.Visited && x.VisitType == EVisitType.SmsVisit, 1, 0)),//已回访--短信
|
|
SmsVisitd = SqlFunc.AggregateSum(SqlFunc.IIF(x.VisitState == EVisitState.Visited && x.VisitType == EVisitType.SmsVisit, 1, 0)),//已回访--短信
|
|
OtherVisitd = SqlFunc.AggregateSum(SqlFunc.IIF(x.VisitState == EVisitState.Visited && x.VisitType != EVisitType.CallVisit && x.VisitType != EVisitType.SmsVisit, 1, 0)),//其他回访
|
|
OtherVisitd = SqlFunc.AggregateSum(SqlFunc.IIF(x.VisitState == EVisitState.Visited && x.VisitType != EVisitType.CallVisit && x.VisitType != EVisitType.SmsVisit, 1, 0)),//其他回访
|
|
- WaitVisitd = SqlFunc.AggregateSum(SqlFunc.IIF(x.VisitState != EVisitState.None && x.VisitState != EVisitState.Visited, 1, 0)),//待回访
|
|
|
|
|
|
+ //WaitVisitd = SqlFunc.AggregateSum(SqlFunc.IIF(x.VisitState != EVisitState.None && x.VisitState != EVisitState.Visited, 1, 0)),//待回访
|
|
}).FirstAsync();
|
|
}).FirstAsync();
|
|
|
|
|
|
- //部门
|
|
|
|
- var listOrg = await _orderVisitDetailRepository.Queryable()
|
|
|
|
|
|
+ var waitVisitd = await _orderVisitRepository.Queryable()
|
|
|
|
+ .LeftJoin<Order>((x, o) => x.OrderId == o.Id)
|
|
|
|
+ .WhereIF(IdentityType.HasValue, (x, o) => o.IdentityType == IdentityType)
|
|
|
|
+ .Where((x, o) => x.CreationTime >= StartTime && x.CreationTime <= EndTime).Select((x, o) =>
|
|
|
|
+ SqlFunc.AggregateSum(SqlFunc.IIF(x.VisitState != EVisitState.None && x.VisitState != EVisitState.Visited, 1, 0)) //待回访
|
|
|
|
+ ).FirstAsync();
|
|
|
|
+ centerReportVisitd.WaitVisitd = waitVisitd;
|
|
|
|
+
|
|
|
|
+ //部门
|
|
|
|
+ var listOrg = await _orderVisitDetailRepository.Queryable()
|
|
.LeftJoin<OrderVisit>((it, o) => it.VisitId == o.Id)
|
|
.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)
|
|
.Where((it, o) => it.VisitTarget == EVisitTarget.Org && o.VisitTime >= StartTime && o.VisitTime <= EndTime && o.VisitState == EVisitState.Visited)
|
|
.Select((it, o) => new Satisfaction
|
|
.Select((it, o) => new Satisfaction
|
|
@@ -3270,13 +3278,13 @@ namespace Hotline.Api.Controllers.Bi
|
|
//WaitVisitd = SqlFunc.AggregateSum(SqlFunc.IIF(x.VisitState != EVisitState.None && x.VisitState != EVisitState.Visited, 1, 0)),//待回访
|
|
//WaitVisitd = SqlFunc.AggregateSum(SqlFunc.IIF(x.VisitState != EVisitState.None && x.VisitState != EVisitState.Visited, 1, 0)),//待回访
|
|
}).FirstAsync();
|
|
}).FirstAsync();
|
|
|
|
|
|
- var WaitVisitd = await _orderVisitRepository.Queryable()
|
|
|
|
|
|
+ var waitVisitd = await _orderVisitRepository.Queryable()
|
|
.LeftJoin<Order>((x, o) => x.OrderId == o.Id)
|
|
.LeftJoin<Order>((x, o) => x.OrderId == o.Id)
|
|
.WhereIF(IdentityType.HasValue, (x, o) => o.IdentityType == IdentityType)
|
|
.WhereIF(IdentityType.HasValue, (x, o) => o.IdentityType == IdentityType)
|
|
.Where((x, o) => x.CreationTime >= StartTime && x.CreationTime <= EndTime).Select((x, o) =>
|
|
.Where((x, o) => x.CreationTime >= StartTime && x.CreationTime <= EndTime).Select((x, o) =>
|
|
SqlFunc.AggregateSum(SqlFunc.IIF(x.VisitState != EVisitState.None && x.VisitState != EVisitState.Visited, 1, 0)) //待回访
|
|
SqlFunc.AggregateSum(SqlFunc.IIF(x.VisitState != EVisitState.None && x.VisitState != EVisitState.Visited, 1, 0)) //待回访
|
|
).FirstAsync();
|
|
).FirstAsync();
|
|
- centerReportVisitd.WaitVisitd = WaitVisitd;
|
|
|
|
|
|
+ centerReportVisitd.WaitVisitd = waitVisitd;
|
|
|
|
|
|
//部门
|
|
//部门
|
|
var listOrg = await _orderVisitDetailRepository.Queryable()
|
|
var listOrg = await _orderVisitDetailRepository.Queryable()
|