ソースを参照

通话记录部门限制调整

yuqian 8 年 前
コミット
d34d159928

+ 21 - 1
CallCenterApi/CallCenterApi.BLL/T_Sys_Department.cs

@@ -116,7 +116,27 @@ namespace CallCenterApi.BLL
116 116
             }
117 117
             return modelList;
118 118
         }
119
-
119
+        /// <summary>
120
+        /// 递归查询
121
+        /// </summary>
122
+        public List<Model.T_Sys_DepartmentLevel> DataTableToListForLevel(DataTable dt)
123
+        {
124
+            List<Model.T_Sys_DepartmentLevel> modelList = new List<Model.T_Sys_DepartmentLevel>();
125
+            int rowsCount = dt.Rows.Count;
126
+            if (rowsCount > 0)
127
+            {
128
+                Model.T_Sys_DepartmentLevel model;
129
+                foreach (DataRow row in dt.Rows)
130
+                {
131
+                    model = new Model.T_Sys_DepartmentLevel();
132
+                    model.DeptId = row["F_DeptId"] == DBNull.Value ? 0 : Convert.ToInt32(row["F_DeptId"]);
133
+                    model.Layer = row["F_Layer"] == DBNull.Value ? 0 : Convert.ToInt32(row["F_Layer"]);
134
+                    model.Level = row["lvl"] == DBNull.Value ? 0 : Convert.ToInt32(row["lvl"]);
135
+                    modelList.Add(model);
136
+                }
137
+            }
138
+            return modelList;
139
+        }
120 140
         /// <summary>
121 141
         /// 获得数据列表
122 142
         /// </summary>

+ 2 - 7
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/callout/CallPlanController.cs

@@ -90,12 +90,6 @@ namespace CallCenterApi.Interface.Controllers.callout
90 90
             var deptList = departmentBLL.DataTableToList(departmentBLL.GetList(" F_State=1 ").Tables[0]);
91 91
             foreach (var model in modelList)
92 92
             {
93
-                if (model.TaskID == 154)
94
-                {
95
-
96
-                    var a = 0;
97
-                }
98
-
99 93
                 //计算数据
100 94
                 string calledRate = "0";
101 95
                 var allcount = model.y_HMCount ?? 0;
@@ -989,6 +983,7 @@ namespace CallCenterApi.Interface.Controllers.callout
989 983
                 {
990 984
                     if (deptCode.Replace("|0|1|", "").Length > 0)
991 985
                     {
986
+
992 987
                         var deptDt = DbHelperSQL.Query($"with cte(F_DeptId,F_ParentId) as(select F_DeptId,F_ParentId from T_Sys_Department where F_DeptId={deptid} union all select dept.F_DeptId,dept.F_ParentId from T_Sys_Department dept inner join cte on dept.F_DeptId = cte.F_ParentId)select F_DeptId from  cte").Tables[0];
993 988
                         List<int> deptList = new List<int>();
994 989
                         if (deptDt.Rows.Count > 0)
@@ -1778,4 +1773,4 @@ namespace CallCenterApi.Interface.Controllers.callout
1778 1773
         #endregion
1779 1774
 
1780 1775
     }
1781
-}
1776
+}

+ 4 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallrecordsController.cs

@@ -1,5 +1,6 @@
1 1
 using CallCenter.Utility;
2 2
 using CallCenterApi.Common;
3
+using CallCenterApi.DB;
3 4
 using CallCenterApi.Interface.Controllers.Base;
4 5
 using System;
5 6
 using System.Collections.Generic;
@@ -42,6 +43,9 @@ namespace CallCenterApi.Interface.Controllers.tel
42 43
                 //17=系统管理员,36=客服,37=组长,38=组员,39=业主,40=话务员,41=客服主管,43=分公司市场部主任,45=业务稽核,46=集团客户部,
43 44
                 //47 =网络部,48=市场部经理,50=业务支撑中心,51=市场部,52=客户服务中心,53=总经理,54=副总经理,55=业务负责人,56=投诉处理员,57=基础业务主管,
44 45
 
46
+                //var deptCodeObj = DbHelperSQL.GetSingle($"with cte(F_DeptId,F_ParentId,F_DeptCode,F_Layer,lvl) as( select F_DeptId,F_ParentId,F_DeptCode,F_Layer,0 lvl from T_Sys_Department where F_DeptId={deptid} union all select dept.F_DeptId,dept.F_ParentId,dept.F_DeptCode,dept.F_Layer,lvl+1 from T_Sys_Department dept inner join cte on dept.F_DeptId = cte.F_ParentId) select top 1 F_DeptId,F_DeptCode from  cte where F_Layer=1 order by lvl");
47
+                //var deptCurrentCompany = deptList.Where(x => x.Layer == 1).OrderByDescending(x => x.Level).FirstOrDefault();
48
+                //var deptModelCode = deptCodeObj?.ToString() ?? "";
45 49
                 if (roleid != 0)
46 50
                 {
47 51
                     if (roleid != 17)

+ 1 - 0
CallCenterApi/CallCenterApi.Model/CallCenterApi.Model.csproj

@@ -100,6 +100,7 @@
100 100
     <Compile Include="T_Sys_BanCallOutTime.cs" />
101 101
     <Compile Include="T_Sys_CallForwarding.cs" />
102 102
     <Compile Include="T_Sys_Department.cs" />
103
+    <Compile Include="T_Sys_DepartmentLevel.cs" />
103 104
     <Compile Include="T_Sys_DictionaryBase.cs" />
104 105
     <Compile Include="T_Sys_DictionaryValue.cs" />
105 106
     <Compile Include="T_Sys_LoginLogs.cs" />

+ 25 - 0
CallCenterApi/CallCenterApi.Model/T_Sys_DepartmentLevel.cs

@@ -0,0 +1,25 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace CallCenterApi.Model
8
+{
9
+    public class T_Sys_DepartmentLevel
10
+    {
11
+        /// <summary>
12
+        /// 部门ID
13
+        /// </summary>
14
+        public int DeptId { get; set; }
15
+        /// <summary>
16
+        /// 级别
17
+        /// </summary>
18
+        public int Layer { get; set; }
19
+        /// <summary>
20
+        /// 递归序数
21
+        /// </summary>
22
+        public int Level { get; set; }
23
+
24
+    }
25
+}