Преглед на файлове

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

yuqian преди 8 години
родител
ревизия
4a222c0774

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

15
     public class DepartmentController : BaseController
15
     public class DepartmentController : BaseController
16
     {
16
     {
17
         private BLL.T_Sys_Department departmentBLL = new BLL.T_Sys_Department();
17
         private BLL.T_Sys_Department departmentBLL = new BLL.T_Sys_Department();
18
-    
18
+
19
         /// <summary>
19
         /// <summary>
20
         /// 获取部门列表
20
         /// 获取部门列表
21
         /// </summary>
21
         /// </summary>
75
                     Model.T_Sys_Department pdModel = departmentBLL.GetModel(input.PId);
75
                     Model.T_Sys_Department pdModel = departmentBLL.GetModel(input.PId);
76
                     if (pdModel != null)
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
                 dModel.F_Sort = input.Sort;
81
                 dModel.F_Sort = input.Sort;
82
                 dModel.F_DeptName = input.DeptName;
82
                 dModel.F_DeptName = input.DeptName;
83
                 dModel.F_State = 1;
83
                 dModel.F_State = 1;
84
                 int id = departmentBLL.Add(dModel);
84
                 int id = departmentBLL.Add(dModel);
85
-                if (id> 0)
85
+                if (id > 0)
86
                 {
86
                 {
87
                     departmentBLL.UpdateDeptCode(pcode + id.ToString() + "|", id);
87
                     departmentBLL.UpdateDeptCode(pcode + id.ToString() + "|", id);
88
                     res = Success("添加成功");
88
                     res = Success("添加成功");
163
                 dt = new BLL.T_Sys_Department().GetList(" F_State=1 and F_ParentId=" + pId).Tables[0];
163
                 dt = new BLL.T_Sys_Department().GetList(" F_State=1 and F_ParentId=" + pId).Tables[0];
164
                 List<Model.TreeModel> modelList = BindTree(dt, "0");
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
                     if (modelList.Count > 0)
190
                     if (modelList.Count > 0)
191
+                    {
192
+                        modelList.Insert(0, new Model.TreeModel
193
+                        {
194
+                            id = "-1",
195
+                            text = "全部"
196
+                        });
168
                         return Success("加载成功", modelList);
197
                         return Success("加载成功", modelList);
198
+                    }
169
                 }
199
                 }
170
                 return Error("加载失败");
200
                 return Error("加载失败");
171
             }
201
             }

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

507
             double itrunkpjpd = 0.00;//平均排队
507
             double itrunkpjpd = 0.00;//平均排队
508
             #endregion
508
             #endregion
509
             DataTable dtdpt = null;
509
             DataTable dtdpt = null;
510
-            if (dpt != null && dpt.Trim() != "")
510
+            if (!string.IsNullOrWhiteSpace(dpt) && Convert.ToInt32(dpt) >= 0)
511
             {
511
             {
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];
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
             }