Dun.Jason 11 月之前
父节点
当前提交
a0bea57e0b

+ 1 - 1
src/Hotline.Api/Controllers/Bi/BiCallController.cs

@@ -194,7 +194,7 @@ public class BiCallController : BaseController
                  StaffNo  = x.StaffNo,
                  UserName = x.UserName,
                  RestCount = SqlFunc.AggregateCount(x.Id),
-                 RestDuration = SqlFunc.AggregateSum(x.RestDuration/60)
+                 RestDuration = SqlFunc.AggregateSum(x.RestDuration/60) / SqlFunc.AggregateCount(x.Id)
             })
             .OrderByIF(dto.SortRule ==0,a=> a.RestDuration,OrderByType.Asc)
             .OrderByIF(dto.SortRule ==1,a=> a.RestDuration,OrderByType.Desc)

+ 8 - 8
src/Hotline.Api/Controllers/Bi/BiOrderController.cs

@@ -227,21 +227,21 @@ namespace Hotline.Api.Controllers.Bi
                 .WhereIF(dto.StartTime.HasValue, it => it.CreationTime >= dto.StartTime)
                 .WhereIF(dto.EndTime.HasValue, it => it.CreationTime <= dto.EndTime)
                 .WhereIF(!string.IsNullOrEmpty(dto.Keyword), it => it.SignerName.Contains(dto.Keyword!))
-                .GroupBy(it => new { it.CreatorId, it.CreatorName })
+                .GroupBy(it => new { it.SignerId, it.SignerName })
                 .Select(it => new OrderBiCentreDataListVo
                 {
-                    UserName = it.CreatorName,
-                    UserId = it.CreatorId,
+                    UserName = it.SignerName,
+                    UserId = it.SignerId,
                     //Subtotal = SqlFunc.AggregateCount(x.AcceptorId),
-                    CentreArchive = SqlFunc.AggregateSum(SqlFunc.IIF(it.Status >= EOrderStatus.Filed && it.ProcessType == EProcessType.Zhiban, 1, 0)), //中心归档件
+                    CentreArchive = SqlFunc.AggregateSum(SqlFunc.IIF(it.Status >= EOrderStatus.Filed && it.ProcessType == EProcessType.Zhiban && it.AcceptType != "无效", 1, 0)), //中心归档件
                     //CentreCareOf = SqlFunc.AggregateSum(SqlFunc.IIF(it.Status >= EOrderStatus.Filed && (it.FileUserRole == EFileUserType.Org || it.FileUserRole == EFileUserType.Dispatch), 1, 0)), //转办信件
-                    CentreCareOf = SqlFunc.AggregateSum(SqlFunc.IIF(it.ProcessType == EProcessType.Jiaoban || it.FileUserRole == EFileUserType.Dispatch || it.ActualHandleStepName == "派单组", 1, 0)),
-                    NoCentreCareOf = SqlFunc.AggregateSum(SqlFunc.IIF(it.Status <= EOrderStatus.SpecialToUnAccept || it.ActualHandleStepName == "班长审批", 1, 0)), //坐席待办 //中心领导?市领导? 是否在统计条件中
+                    CentreCareOf = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptType != "无效" && (it.ProcessType == EProcessType.Jiaoban || (it.ActualHandleStepName == "派单组" && it.Status< EOrderStatus.Filed ) || (it.ActualHandleStepName == "班长审批" && it.Status < EOrderStatus.Filed)),1,0)),
+                    NoCentreCareOf = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptType != "无效" && (it.Status <= EOrderStatus.SpecialToUnAccept), 1, 0)), //坐席待办 //中心领导?市领导? 是否在统计条件中
                     //CentreCareOf = SqlFunc.AggregateSum(SqlFunc.IIF(it.Status >= EOrderStatus.Filed && it.ProcessType == EProcessType.Jiaoban, 1, 0)),
                     //NoCentreCareOf = SqlFunc.AggregateSum(SqlFunc.IIF((int)x.Status < 300 && x.ExpiredTime > x.FiledTime, 1, 0)),
                     Invalid = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptType == "无效", 1, 0)),
                     Repeat = SqlFunc.AggregateSum(SqlFunc.IIF(it.DuplicateIds != null && SqlFunc.JsonArrayLength(it.DuplicateIds) > 0, 1, 0)),
-                    Subtotal = SqlFunc.AggregateSum(SqlFunc.IIF((it.Status >= EOrderStatus.Filed && it.ProcessType == EProcessType.Zhiban) || (it.ProcessType == EProcessType.Jiaoban || it.FileUserRole == EFileUserType.Dispatch || it.ActualHandleStepName == "派单组") || (it.Status <= EOrderStatus.SpecialToUnAccept || it.ActualHandleStepName == "班长审批") || it.AcceptType == "无效" || (it.DuplicateIds != null && SqlFunc.JsonArrayLength(it.DuplicateIds) > 0), 1, 0))
+                    Subtotal = SqlFunc.AggregateSum(SqlFunc.IIF((it.Status >= EOrderStatus.Filed && it.ProcessType == EProcessType.Zhiban && it.AcceptType != "无效") || (it.AcceptType != "无效" && (it.ProcessType == EProcessType.Jiaoban || (it.ActualHandleStepName == "派单组" && it.Status < EOrderStatus.Filed) || (it.ActualHandleStepName == "班长审批" && it.Status < EOrderStatus.Filed))) || (it.Status <= EOrderStatus.SpecialToUnAccept) || it.AcceptType == "无效" || (it.DuplicateIds != null && SqlFunc.JsonArrayLength(it.DuplicateIds) > 0), 1, 0))
                 }).MergeTable();
             switch (dto.SortField)
             {
@@ -270,7 +270,7 @@ namespace Hotline.Api.Controllers.Bi
                 query = query.OrderByDescending(x => x.Subtotal);
             }
 
-            var list = await query.Where(x => (x.CentreArchive + x.CentreCareOf + x.Invalid + x.Repeat) != 0).ToListAsync(HttpContext.RequestAborted);
+            var list = await query.Where(x => (x.CentreArchive + x.CentreCareOf + x.NoCentreCareOf + x.Invalid + x.Repeat) != 0).ToListAsync(HttpContext.RequestAborted);
             return list;
         }
 

+ 6 - 0
src/Hotline.Api/Controllers/IPPbxController.cs

@@ -399,6 +399,12 @@ namespace Hotline.Api.Controllers
             {
                 model.TelNo = model.CPN;
             }
+            //判断是否是内部通话(目前分机都为4位)
+            if (model.CPN.Length==4 && model.CDPN.Length ==4) //是内部通话
+            {
+                model.TelNo = model.CDPN;//如果是内部通话  响应分机为被叫号码
+            }
+
 
             //获取关联 工单或是回访
             var order = await _orderRepository.GetAsync(x => x.CallId == model.CallAccept, HttpContext.RequestAborted);

+ 1 - 1
src/Hotline.Api/config/appsettings.Development.json

@@ -16,7 +16,7 @@
     }
   },
   "ConnectionStrings": {
-    "Hotline": "PORT=5432;DATABASE=hotline_dev;HOST=110.188.24.182;PASSWORD=fengwo11!!;USER ID=dev;",
+    "Hotline": "PORT=5432;DATABASE=hotline;HOST=110.188.24.182;PASSWORD=fengwo11!!;USER ID=dev;",
     "Redis": "110.188.24.182:50179",
     "MongoDB": "mongodb://192.168.100.121:27017",
     "Wex": "server=222.212.82.225;Port=4509;Database=fs_kft;Uid=root;Pwd=Wex@12345;"

+ 1 - 1
src/Hotline.Api/config/appsettings.json

@@ -16,7 +16,7 @@
     }
   },
   "ConnectionStrings": {
-    "Hotline": "PORT=5432;DATABASE=hotline_dev;HOST=110.188.24.182;PASSWORD=fengwo11!!;USER ID=dev;",
+    "Hotline": "PORT=5432;DATABASE=hotline;HOST=110.188.24.182;PASSWORD=fengwo11!!;USER ID=dev;",
     "Redis": "110.188.24.182:50179,password=fengwo22@@",
     "MongoDB": "mongodb://192.168.100.121:27017",
     "Wex": "server=222.212.82.225;Port=4509;Database=fs_kft;Uid=root;Pwd=Wex@12345;"

+ 5 - 3
src/Hotline.Application/CallCenter/Calls/TrApplication.cs

@@ -98,17 +98,19 @@ namespace Hotline.Application.CallCenter.Calls
                 
                 bool isRest = await _telRestRepository.AnyAsync(x => x.TelNo == work.TelNo && x.UserId == userId && !x.EndTime.HasValue,cancellationToken);
 
-                bool isCallHold = await _telActionRecordRepository.AnyAsync(x => x.TelNo == work.TelNo && x.UserId == userId && !x.EndTime.HasValue, cancellationToken);
+                bool isCallHold = await _telActionRecordRepository.AnyAsync(x => x.TelNo == work.TelNo && x.UserId == userId && x.ActionType == EActionType.CallHold && !x.EndTime.HasValue, cancellationToken);
+
+                bool isCallEndArrange = await _telActionRecordRepository.AnyAsync(x => x.TelNo == work.TelNo && x.UserId == userId && x.ActionType == EActionType.CallEndArrange && !x.EndTime.HasValue, cancellationToken);
 
                 bool IsTelNeedVerify = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.IsTelNeedVerify).SettingValue[0]);
                 string callOutQueueId = _systemSettingCacheManager.GetSetting(SettingConstants.CallOutQueueId).SettingValue[0];
                 if (IsTelNeedVerify)
                 {
-                    return new TrOnDutyResponseDto() { QueueCallOut= callOutQueueId, TelNo = work.TelNo, TelPwd = "", Description = work.Description, QueueId = work.QueueId, StartTime = work.StartTime, IsRest = isRest, TelModel = work.TelModel, IsCallHold = isCallHold };
+                    return new TrOnDutyResponseDto() { QueueCallOut= callOutQueueId, TelNo = work.TelNo, TelPwd = "", Description = work.Description, QueueId = work.QueueId, StartTime = work.StartTime, IsRest = isRest, TelModel = work.TelModel, IsCallHold = isCallHold, IsCallEndArrange = isCallEndArrange };
                 }
                 else
                 {
-                    return new TrOnDutyResponseDto() { QueueCallOut = callOutQueueId, TelNo = work.TelNo, TelPwd = work.TelPwd, Description = work.Description, QueueId = work.QueueId, StartTime = work.StartTime, IsRest = isRest, TelModel = work.TelModel, IsCallHold = isCallHold };
+                    return new TrOnDutyResponseDto() { QueueCallOut = callOutQueueId, TelNo = work.TelNo, TelPwd = work.TelPwd, Description = work.Description, QueueId = work.QueueId, StartTime = work.StartTime, IsRest = isRest, TelModel = work.TelModel, IsCallHold = isCallHold, IsCallEndArrange = isCallEndArrange };
                 }
                
             }

+ 2 - 0
src/Hotline.Share/Dtos/TrCallCenter/TrTelDao.cs

@@ -190,6 +190,8 @@ namespace Hotline.Share.Dtos.TrCallCenter
 
         public bool? IsCallHold { get; set; }
 
+        public bool? IsCallEndArrange { get; set; }
+
         public int Second => CalcSecond();
 
         public ETelModel? TelModel { get; set; }

+ 11 - 0
src/Hotline/Permissions/EPermission.cs

@@ -2134,6 +2134,17 @@ namespace Hotline.Permissions
         /// </summary>
         [Display(GroupName ="数据统计",Name = "部门满意度统计",Description = "部门满意度统计")]
         VisitAndOrgSatisfactionStatistics = 110604,
+
+        /// <summary>
+        /// 二次办理统计
+        /// </summary>
+        [Display(GroupName = "数据统计", Name = "二次办理统计", Description = "二次办理统计")]
+        SecondHandleStatistics = 110605,
+        /// <summary>
+        /// 二次办理满意度
+        /// </summary>
+        [Display(GroupName = "数据统计", Name = "二次办理满意度", Description = "二次办理满意度")]
+        SecondHandleSatisfied = 110606,
         #endregion