Jelajahi Sumber

Merge branch 'dev_dss' of Fengwo/hotline into dev

dengshengshuang 1 tahun lalu
induk
melakukan
0c7f173a4e

+ 8 - 3
src/Hotline.Repository.SqlSugar/CallCenter/TrCallRecordRepository.cs

@@ -44,9 +44,12 @@ namespace Hotline.Repository.SqlSugar.CallCenter
                 {
                     Hour = it.ColumnName.Hour, //小时段
                     Total = SqlFunc.AggregateCount(o.Id),
-                    Answered = SqlFunc.AggregateSum(SqlFunc.IIF(o.AnsweredTime!=null,1,0)), //应答数
-                    Hanguped = SqlFunc.AggregateSum(SqlFunc.IIF(o.AnsweredTime==null && o.EndBy!=null && o.EndBy.Value == EEndBy.To,1,0)),//挂断数
-                }).ToListAsync();
+                    Answered = SqlFunc.AggregateSum(SqlFunc.IIF(o.AnsweredTime != null, 1, 0)), //应答数
+                    Hanguped = SqlFunc.AggregateSum(SqlFunc.IIF(o.AnsweredTime == null && o.EndBy != null && o.EndBy.Value == EEndBy.To, 1, 0)),//挂断数
+                })
+                .MergeTable()
+                .OrderBy(x => x.Hour)
+                .ToListAsync();
             var returnList = list.GroupBy(x => x.Hour)
                .Select(x => new BiCallDto()
                {
@@ -97,6 +100,8 @@ namespace Hotline.Repository.SqlSugar.CallCenter
                     QueueByeCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.QueueTims > 0 && o.RingTimes == 0, 1, 0)), //队列挂断
                     IvrByeCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.BeginIvrTime.HasValue && !o.BeginQueueTime.HasValue && !o.BeginRingTime.HasValue && o.OnState == EOnState.NoOn, 1, 0)), //IVR挂断
                 })
+                .MergeTable()
+                .OrderBy(x=>x.Hour)
                 .ToListAsync();
 
            var resultList = list.GroupBy(x => x.Hour)

+ 2 - 2
src/Hotline.Repository.SqlSugar/Extensions/SqlSugarStartupExtensions.cs

@@ -207,8 +207,8 @@ namespace Hotline.Repository.SqlSugar.Extensions
             /***写AOP等方法***/
             db.Aop.OnLogExecuting = (sql, pars) =>
             {
-                //Log.Information("Sql: {0}", sql);
-                //Log.Information("SqlParameters: {0}", string.Join(',', pars.Select(d => d.Value)));
+                Log.Information("Sql: {0}", sql);
+                Log.Information("SqlParameters: {0}", string.Join(',', pars.Select(d => d.Value)));
             };
             db.Aop.OnError = (exp) =>//SQL报错
             {