Dun.Jason 1 year ago
parent
commit
fd77824dda

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

@@ -22,6 +22,9 @@ namespace Hotline.Repository.SqlSugar.CallCenter
 
 
         public async Task<List<TrCallHourDto>?> GetCallHourList(DateTime beginDate,DateTime? endDate,int noConnectByeTimes,int effectiveTimes)
         public async Task<List<TrCallHourDto>?> GetCallHourList(DateTime beginDate,DateTime? endDate,int noConnectByeTimes,int effectiveTimes)
         {
         {
+
+
+
             //List<DateTime> dts = new List<DateTime>() { beginDate.Date.AddDays(1) };
             //List<DateTime> dts = new List<DateTime>() { beginDate.Date.AddDays(1) };
             //for (int i = 0; i < 24; i++)
             //for (int i = 0; i < 24; i++)
             //{
             //{
@@ -85,6 +88,11 @@ namespace Hotline.Repository.SqlSugar.CallCenter
                 dts.Add(dts.Last().AddHours(-1));
                 dts.Add(dts.Last().AddHours(-1));
             }
             }
 
 
+            var templist = await Db.Reportable(dts).ToQueryable<DateTime>()
+                .LeftJoin<TrCallRecord>((it, o) => o.CreatedTime >= it.ColumnName && o.CreatedTime <= it.ColumnName.AddHours(1))
+                .ToListAsync();
+
+
             var list = Db.Reportable(dts).ToQueryable<DateTime>()
             var list = Db.Reportable(dts).ToQueryable<DateTime>()
                 .LeftJoin<TrCallRecord>((it, o) => o.CreatedTime >= it.ColumnName && o.CreatedTime <= it.ColumnName.AddHours(1))
                 .LeftJoin<TrCallRecord>((it, o) => o.CreatedTime >= it.ColumnName && o.CreatedTime <= it.ColumnName.AddHours(1))
                 .GroupBy(it => it.ColumnName)
                 .GroupBy(it => it.ColumnName)

+ 7 - 1
src/Hotline.Repository.SqlSugar/Orders/OrderRepository.cs

@@ -14,6 +14,7 @@ using Hotline.Share.Enums.Order;
 using Hotline.Tools;
 using Hotline.Tools;
 using MapsterMapper;
 using MapsterMapper;
 using SqlSugar;
 using SqlSugar;
+using System.Reflection;
 using XF.Domain.Constants;
 using XF.Domain.Constants;
 using XF.Domain.Dependency;
 using XF.Domain.Dependency;
 using XF.Domain.Repository;
 using XF.Domain.Repository;
@@ -86,6 +87,11 @@ namespace Hotline.Repository.SqlSugar.Orders
 			await Db.Updateable<Order>().SetColumns(x=>x.FileJson == order.FileJson).Where(x=>x.Id == order.Id).ExecuteCommandAsync(cancellationToken);
 			await Db.Updateable<Order>().SetColumns(x=>x.FileJson == order.FileJson).Where(x=>x.Id == order.Id).ExecuteCommandAsync(cancellationToken);
 		}
 		}
 
 
+        private static object GetPropertyValue(object obj, string property)
+        {
+            PropertyInfo propertyInfo = obj.GetType().GetProperty(property);
+            return propertyInfo.GetValue(obj, null);
+        }
 
 
         public async Task<object> HotPortJoinOrgStatistics(DateTime StartTime, DateTime EndTime)
         public async Task<object> HotPortJoinOrgStatistics(DateTime StartTime, DateTime EndTime)
         {
         {
@@ -111,7 +117,7 @@ namespace Hotline.Repository.SqlSugar.Orders
                     }).ToPivotListAsync(x=>x.Key,x=>new { x.OrgCode,x.OrgName,x.HotSorpName },x=> x.Sum(x=>x.Count));
                     }).ToPivotListAsync(x=>x.Key,x=>new { x.OrgCode,x.OrgName,x.HotSorpName },x=> x.Sum(x=>x.Count));
                 listReturn.AddRange(table);
                 listReturn.AddRange(table);
             }
             }
-
+            
             return new { HotSpot = hotSpotList, Data = listReturn };
             return new { HotSpot = hotSpotList, Data = listReturn };
 
 
 
 

+ 4 - 4
src/Hotline.Share/Dtos/Order/OrderDto.cs

@@ -24,12 +24,12 @@ namespace Hotline.Share.Dtos.Order
         /// <summary>
         /// <summary>
         /// 过期状态
         /// 过期状态
         /// </summary>
         /// </summary>
-        public EExpiredStatus ExpiredStatus => CalculateExpiredState();
+        public EExpiredStatus? ExpiredStatus => CalculateExpiredState();
 
 
         /// <summary>
         /// <summary>
         /// 过期状态
         /// 过期状态
         /// </summary>
         /// </summary>
-        public string ExpiredStatusText => ExpiredStatus.GetDescription();
+        public string ExpiredStatusText => ExpiredStatus?.GetDescription() ?? string.Empty;
 
 
         /// <summary>
         /// <summary>
         /// 处理方式(直办、交办)
         /// 处理方式(直办、交办)
@@ -426,7 +426,7 @@ namespace Hotline.Share.Dtos.Order
 
 
         }
         }
 
 
-        public EExpiredStatus CalculateExpiredState()
+        public EExpiredStatus? CalculateExpiredState()
         {
         {
             //ExpiredStatus
             //ExpiredStatus
             if (ExpiredTime.HasValue)
             if (ExpiredTime.HasValue)
@@ -444,7 +444,7 @@ namespace Hotline.Share.Dtos.Order
                     return EExpiredStatus.Expired;
                     return EExpiredStatus.Expired;
                 }
                 }
             }
             }
-            return EExpiredStatus.Expired;
+            return null;
         }
         }