|
@@ -3267,11 +3267,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>((x, ov) => x.VisitId == ov.Id)
|
|
.LeftJoin<OrderVisit>((x, ov) => x.VisitId == ov.Id)
|
|
.LeftJoin<Order>((x, ov, o) => ov.OrderId == o.Id)
|
|
.LeftJoin<Order>((x, ov, o) => ov.OrderId == o.Id)
|
|
.WhereIF(IdentityType.HasValue, (x, ov, o) => o.IdentityType == IdentityType)
|
|
.WhereIF(IdentityType.HasValue, (x, ov, o) => o.IdentityType == IdentityType)
|