Kaynağa Gözat

报表分析-员工考核分析-坐席工作报表-部门下拉框选择 全部

yuqian 8 yıl önce
ebeveyn
işleme
4a222c0774

+ 34 - 4
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/DepartmentController.cs

@@ -15,7 +15,7 @@ namespace CallCenterApi.Interface.Controllers
15 15
     public class DepartmentController : BaseController
16 16
     {
17 17
         private BLL.T_Sys_Department departmentBLL = new BLL.T_Sys_Department();
18
-    
18
+
19 19
         /// <summary>
20 20
         /// 获取部门列表
21 21
         /// </summary>
@@ -75,14 +75,14 @@ namespace CallCenterApi.Interface.Controllers
75 75
                     Model.T_Sys_Department pdModel = departmentBLL.GetModel(input.PId);
76 76
                     if (pdModel != null)
77 77
                     {
78
-                        pcode = dModel.F_ParentCode = pdModel.F_DeptCode;                        
78
+                        pcode = dModel.F_ParentCode = pdModel.F_DeptCode;
79 79
                     }
80 80
                 }
81 81
                 dModel.F_Sort = input.Sort;
82 82
                 dModel.F_DeptName = input.DeptName;
83 83
                 dModel.F_State = 1;
84 84
                 int id = departmentBLL.Add(dModel);
85
-                if (id> 0)
85
+                if (id > 0)
86 86
                 {
87 87
                     departmentBLL.UpdateDeptCode(pcode + id.ToString() + "|", id);
88 88
                     res = Success("添加成功");
@@ -163,9 +163,39 @@ namespace CallCenterApi.Interface.Controllers
163 163
                 dt = new BLL.T_Sys_Department().GetList(" F_State=1 and F_ParentId=" + pId).Tables[0];
164 164
                 List<Model.TreeModel> modelList = BindTree(dt, "0");
165 165
 
166
-                if (modelList != null) {
166
+                if (modelList != null)
167
+                {
168
+                    if (modelList.Count > 0)
169
+                        return Success("加载成功", modelList);
170
+                }
171
+                return Error("加载失败");
172
+            }
173
+            return NoToken("未知错误,请重新登录");
174
+        }
175
+
176
+        /// <summary>
177
+        /// 获取部门列表
178
+        /// </summary>
179
+        /// <returns></returns>
180
+        public ActionResult GetDeptListForReport(int pId = 0)
181
+        {
182
+            if (Request.IsAuthenticated)
183
+            {
184
+                DataTable dt = new DataTable();
185
+                dt = new BLL.T_Sys_Department().GetList(" F_State=1 and F_ParentId=" + pId).Tables[0];
186
+                List<Model.TreeModel> modelList = BindTree(dt, "0");
187
+
188
+                if (modelList != null)
189
+                {
167 190
                     if (modelList.Count > 0)
191
+                    {
192
+                        modelList.Insert(0, new Model.TreeModel
193
+                        {
194
+                            id = "-1",
195
+                            text = "全部"
196
+                        });
168 197
                         return Success("加载成功", modelList);
198
+                    }
169 199
                 }
170 200
                 return Error("加载失败");
171 201
             }

+ 1 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/ZuoXiWorkTotalController.cs

@@ -507,7 +507,7 @@ namespace CallCenterApi.Interface.Controllers.report
507 507
             double itrunkpjpd = 0.00;//平均排队
508 508
             #endregion
509 509
             DataTable dtdpt = null;
510
-            if (dpt != null && dpt.Trim() != "")
510
+            if (!string.IsNullOrWhiteSpace(dpt) && Convert.ToInt32(dpt) >= 0)
511 511
             {
512 512
                 dtdpt = DbHelperSQL.Query("select F_DeptId,F_DeptName,F_Remark from  T_Sys_Department where F_ParentId!=0 and F_DeptId=" + dpt).Tables[0];
513 513
             }