zhoufan 7 anos atrás
pai
commit
03594fb44d

+ 99 - 86
codegit/CallCenterApi/CallCenterApi.DAL/T_Call_ZBDH.cs

@@ -1,51 +1,58 @@
1
-using CallCenterApi.DB;
2
-using System;
3
-using System.Collections.Generic;
1
+using System;
4 2
 using System.Data;
5
-using System.Data.SqlClient;
6
-using System.Linq;
7 3
 using System.Text;
8
-using System.Threading.Tasks;
4
+using System.Data.SqlClient;
5
+using CallCenterApi.DB;
9 6
 
10 7
 namespace CallCenterApi.DAL
11 8
 {
12 9
     /// <summary>
13
-	/// 数据访问类:T_Call_ZBDH
14
-	/// </summary>
15
-	public partial class T_Call_ZBDH
10
+    /// 数据访问类:T_Call_ZBDH
11
+    /// </summary>
12
+    public partial class T_Call_ZBDH
16 13
     {
17 14
         public T_Call_ZBDH()
18 15
         { }
19 16
         #region  BasicMethod
17
+        /// <summary>
18
+        /// 是否存在该记录
19
+        /// </summary>
20
+        public bool Exists(int F_ID)
21
+        {
22
+            StringBuilder strSql = new StringBuilder();
23
+            strSql.Append("select count(1) from T_Call_ZBDH");
24
+            strSql.Append(" where F_ID=@F_ID");
25
+            SqlParameter[] parameters = {
26
+                    new SqlParameter("@F_ID", SqlDbType.Int,4)
27
+            };
28
+            parameters[0].Value = F_ID;
29
+
30
+            return DbHelperSQL.Exists(strSql.ToString(), parameters);
31
+        }
32
+
20 33
 
21 34
         /// <summary>
22
-		/// 增加一条数据
23
-		/// </summary>
24
-		public int Add(Model.T_Call_ZBDH model)
35
+        /// 增加一条数据
36
+        /// </summary>
37
+        public int Add(CallCenterApi.Model.T_Call_ZBDH model)
25 38
         {
26 39
             StringBuilder strSql = new StringBuilder();
27 40
             strSql.Append("insert into T_Call_ZBDH(");
28
-            strSql.Append("F_ZBDH,F_GroupName,F_Groupid,F_Remark,F_CallinTime,F_CreateBy,F_CreateTime,F_CreateID)");
41
+            strSql.Append("F_ZBDH,F_GroupCode,F_Remark,F_CreateUser,F_CreateTime)");
29 42
             strSql.Append(" values (");
30
-            strSql.Append("@F_ZBDH,@F_GroupName,@F_Groupid,@F_Remark,@F_CallinTime,@F_CreateBy,@F_CreateTime,@F_CreateID)");
43
+            strSql.Append("@F_ZBDH,@F_GroupCode,@F_Remark,@F_CreateUser,@F_CreateTime)");
31 44
             strSql.Append(";select @@IDENTITY");
32 45
             SqlParameter[] parameters = {
33 46
                     new SqlParameter("@F_ZBDH", SqlDbType.NVarChar,50),
34
-                    new SqlParameter("@F_GroupName", SqlDbType.NVarChar,50),
35
-                    new SqlParameter("@F_Groupid", SqlDbType.Int,4),
36
-                    new SqlParameter("@F_Remark", SqlDbType.NText),
37
-                    new SqlParameter("@F_CallinTime", SqlDbType.DateTime),
38
-                    new SqlParameter("@F_CreateBy", SqlDbType.NVarChar,50),
39
-                    new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
40
-                    new SqlParameter("@F_CreateID", SqlDbType.Int,4)};
47
+                    new SqlParameter("@F_GroupCode", SqlDbType.VarChar,50),
48
+                    new SqlParameter("@F_Remark", SqlDbType.NVarChar,500),
49
+                    new SqlParameter("@F_CreateUser", SqlDbType.VarChar,50),
50
+                    new SqlParameter("@F_CreateTime", SqlDbType.DateTime)};
41 51
             parameters[0].Value = model.F_ZBDH;
42
-            parameters[1].Value = model.F_GroupName;
43
-            parameters[2].Value = model.F_Groupid;
44
-            parameters[3].Value = model.F_Remark;
45
-            parameters[4].Value = model.F_CallinTime;
46
-            parameters[5].Value = model.F_CreateBy;
47
-            parameters[6].Value = model.F_CreateTime;
48
-            parameters[7].Value = model.F_CreateID;
52
+            parameters[1].Value = model.F_GroupCode;
53
+            parameters[2].Value = model.F_Remark;
54
+            parameters[3].Value = model.F_CreateUser;
55
+            parameters[4].Value = model.F_CreateTime;
49 56
 
50 57
             object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
51 58
             if (obj == null)
@@ -60,38 +67,29 @@ namespace CallCenterApi.DAL
60 67
         /// <summary>
61 68
         /// 更新一条数据
62 69
         /// </summary>
63
-        public bool Update(Model.T_Call_ZBDH model)
70
+        public bool Update(CallCenterApi.Model.T_Call_ZBDH model)
64 71
         {
65 72
             StringBuilder strSql = new StringBuilder();
66 73
             strSql.Append("update T_Call_ZBDH set ");
67 74
             strSql.Append("F_ZBDH=@F_ZBDH,");
68
-            strSql.Append("F_GroupName=@F_GroupName,");
69
-            strSql.Append("F_Groupid=@F_Groupid,");
75
+            strSql.Append("F_GroupCode=@F_GroupCode,");
70 76
             strSql.Append("F_Remark=@F_Remark,");
71
-            strSql.Append("F_CallinTime=@F_CallinTime,");
72
-            strSql.Append("F_CreateBy=@F_CreateBy,");
73
-            strSql.Append("F_CreateTime=@F_CreateTime,");
74
-            strSql.Append("F_CreateID=@F_CreateID");
75
-            strSql.Append(" where F_ZBID=@F_ZBID");
77
+            strSql.Append("F_CreateUser=@F_CreateUser,");
78
+            strSql.Append("F_CreateTime=@F_CreateTime");
79
+            strSql.Append(" where F_ID=@F_ID");
76 80
             SqlParameter[] parameters = {
77 81
                     new SqlParameter("@F_ZBDH", SqlDbType.NVarChar,50),
78
-                    new SqlParameter("@F_GroupName", SqlDbType.NVarChar,50),
79
-                    new SqlParameter("@F_Groupid", SqlDbType.Int,4),
80
-                    new SqlParameter("@F_Remark", SqlDbType.NText),
81
-                    new SqlParameter("@F_CallinTime", SqlDbType.DateTime),
82
-                    new SqlParameter("@F_CreateBy", SqlDbType.NVarChar,50),
82
+                    new SqlParameter("@F_GroupCode", SqlDbType.VarChar,50),
83
+                    new SqlParameter("@F_Remark", SqlDbType.NVarChar,500),
84
+                    new SqlParameter("@F_CreateUser", SqlDbType.VarChar,50),
83 85
                     new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
84
-                    new SqlParameter("@F_CreateID", SqlDbType.Int,4),
85
-                    new SqlParameter("@F_ZBID", SqlDbType.Int,4)};
86
+                    new SqlParameter("@F_ID", SqlDbType.Int,4)};
86 87
             parameters[0].Value = model.F_ZBDH;
87
-            parameters[1].Value = model.F_GroupName;
88
-            parameters[2].Value = model.F_Groupid;
89
-            parameters[3].Value = model.F_Remark;
90
-            parameters[4].Value = model.F_CallinTime;
91
-            parameters[5].Value = model.F_CreateBy;
92
-            parameters[6].Value = model.F_CreateTime;
93
-            parameters[7].Value = model.F_CreateID;
94
-            parameters[8].Value = model.F_ZBID;
88
+            parameters[1].Value = model.F_GroupCode;
89
+            parameters[2].Value = model.F_Remark;
90
+            parameters[3].Value = model.F_CreateUser;
91
+            parameters[4].Value = model.F_CreateTime;
92
+            parameters[5].Value = model.F_ID;
95 93
 
96 94
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
97 95
             if (rows > 0)
@@ -107,16 +105,16 @@ namespace CallCenterApi.DAL
107 105
         /// <summary>
108 106
         /// 删除一条数据
109 107
         /// </summary>
110
-        public bool Delete(int F_ZBID)
108
+        public bool Delete(int F_ID)
111 109
         {
112 110
 
113 111
             StringBuilder strSql = new StringBuilder();
114 112
             strSql.Append("delete from T_Call_ZBDH ");
115
-            strSql.Append(" where F_ZBID=@F_ZBID");
113
+            strSql.Append(" where F_ID=@F_ID");
116 114
             SqlParameter[] parameters = {
117
-                    new SqlParameter("@F_ZBID", SqlDbType.Int,4)
115
+                    new SqlParameter("@F_ID", SqlDbType.Int,4)
118 116
             };
119
-            parameters[0].Value = F_ZBID;
117
+            parameters[0].Value = F_ID;
120 118
 
121 119
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
122 120
             if (rows > 0)
@@ -131,11 +129,11 @@ namespace CallCenterApi.DAL
131 129
         /// <summary>
132 130
         /// 批量删除数据
133 131
         /// </summary>
134
-        public bool DeleteList(string F_ZBIDlist)
132
+        public bool DeleteList(string F_IDlist)
135 133
         {
136 134
             StringBuilder strSql = new StringBuilder();
137 135
             strSql.Append("delete from T_Call_ZBDH ");
138
-            strSql.Append(" where F_ZBID in (" + F_ZBIDlist + ")  ");
136
+            strSql.Append(" where F_ID in (" + F_IDlist + ")  ");
139 137
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
140 138
             if (rows > 0)
141 139
             {
@@ -151,18 +149,18 @@ namespace CallCenterApi.DAL
151 149
         /// <summary>
152 150
         /// 得到一个对象实体
153 151
         /// </summary>
154
-        public Model.T_Call_ZBDH GetModel(int F_ZBID)
152
+        public CallCenterApi.Model.T_Call_ZBDH GetModel(int F_ID)
155 153
         {
156 154
 
157 155
             StringBuilder strSql = new StringBuilder();
158
-            strSql.Append("select  top 1 F_ZBID,F_ZBDH,F_GroupName,F_Groupid,F_Remark,F_CallinTime,F_CreateBy,F_CreateTime,F_CreateID from T_Call_ZBDH ");
159
-            strSql.Append(" where F_ZBID=@F_ZBID");
156
+            strSql.Append("select  top 1 F_ID,F_ZBDH,F_GroupCode,F_Remark,F_CreateUser,F_CreateTime from T_Call_ZBDH ");
157
+            strSql.Append(" where F_ID=@F_ID");
160 158
             SqlParameter[] parameters = {
161
-                    new SqlParameter("@F_ZBID", SqlDbType.Int,4)
159
+                    new SqlParameter("@F_ID", SqlDbType.Int,4)
162 160
             };
163
-            parameters[0].Value = F_ZBID;
161
+            parameters[0].Value = F_ID;
164 162
 
165
-            Model.T_Call_ZBDH model = new Model.T_Call_ZBDH();
163
+            CallCenterApi.Model.T_Call_ZBDH model = new CallCenterApi.Model.T_Call_ZBDH();
166 164
             DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
167 165
             if (ds.Tables[0].Rows.Count > 0)
168 166
             {
@@ -178,47 +176,35 @@ namespace CallCenterApi.DAL
178 176
         /// <summary>
179 177
         /// 得到一个对象实体
180 178
         /// </summary>
181
-        public Model.T_Call_ZBDH DataRowToModel(DataRow row)
179
+        public CallCenterApi.Model.T_Call_ZBDH DataRowToModel(DataRow row)
182 180
         {
183
-            Model.T_Call_ZBDH model = new Model.T_Call_ZBDH();
181
+            CallCenterApi.Model.T_Call_ZBDH model = new CallCenterApi.Model.T_Call_ZBDH();
184 182
             if (row != null)
185 183
             {
186
-                if (row["F_ZBID"] != null && row["F_ZBID"].ToString() != "")
184
+                if (row["F_ID"] != null && row["F_ID"].ToString() != "")
187 185
                 {
188
-                    model.F_ZBID = int.Parse(row["F_ZBID"].ToString());
186
+                    model.F_ID = int.Parse(row["F_ID"].ToString());
189 187
                 }
190 188
                 if (row["F_ZBDH"] != null)
191 189
                 {
192 190
                     model.F_ZBDH = row["F_ZBDH"].ToString();
193 191
                 }
194
-                if (row["F_GroupName"] != null)
195
-                {
196
-                    model.F_GroupName = row["F_GroupName"].ToString();
197
-                }
198
-                if (row["F_Groupid"] != null && row["F_Groupid"].ToString() != "")
192
+                if (row["F_GroupCode"] != null)
199 193
                 {
200
-                    model.F_Groupid = int.Parse(row["F_Groupid"].ToString());
194
+                    model.F_GroupCode = row["F_GroupCode"].ToString();
201 195
                 }
202 196
                 if (row["F_Remark"] != null)
203 197
                 {
204 198
                     model.F_Remark = row["F_Remark"].ToString();
205 199
                 }
206
-                if (row["F_CallinTime"] != null && row["F_CallinTime"].ToString() != "")
207
-                {
208
-                    model.F_CallinTime = DateTime.Parse(row["F_CallinTime"].ToString());
209
-                }
210
-                if (row["F_CreateBy"] != null)
200
+                if (row["F_CreateUser"] != null)
211 201
                 {
212
-                    model.F_CreateBy = row["F_CreateBy"].ToString();
202
+                    model.F_CreateUser = row["F_CreateUser"].ToString();
213 203
                 }
214 204
                 if (row["F_CreateTime"] != null && row["F_CreateTime"].ToString() != "")
215 205
                 {
216 206
                     model.F_CreateTime = DateTime.Parse(row["F_CreateTime"].ToString());
217 207
                 }
218
-                if (row["F_CreateID"] != null && row["F_CreateID"].ToString() != "")
219
-                {
220
-                    model.F_CreateID = int.Parse(row["F_CreateID"].ToString());
221
-                }
222 208
             }
223 209
             return model;
224 210
         }
@@ -229,7 +215,7 @@ namespace CallCenterApi.DAL
229 215
         public DataSet GetList(string strWhere)
230 216
         {
231 217
             StringBuilder strSql = new StringBuilder();
232
-            strSql.Append("select F_ZBID,F_ZBDH,F_GroupName,F_Groupid,F_Remark,F_CallinTime,F_CreateBy,F_CreateTime,F_CreateID ");
218
+            strSql.Append("select F_ID,F_ZBDH,F_GroupCode,F_Remark,F_CreateUser,F_CreateTime ");
233 219
             strSql.Append(" FROM T_Call_ZBDH ");
234 220
             if (strWhere.Trim() != "")
235 221
             {
@@ -249,7 +235,7 @@ namespace CallCenterApi.DAL
249 235
             {
250 236
                 strSql.Append(" top " + Top.ToString());
251 237
             }
252
-            strSql.Append(" F_ZBID,F_ZBDH,F_GroupName,F_Groupid,F_Remark,F_CallinTime,F_CreateBy,F_CreateTime,F_CreateID ");
238
+            strSql.Append(" F_ID,F_ZBDH,F_GroupCode,F_Remark,F_CreateUser,F_CreateTime ");
253 239
             strSql.Append(" FROM T_Call_ZBDH ");
254 240
             if (strWhere.Trim() != "")
255 241
             {
@@ -258,6 +244,7 @@ namespace CallCenterApi.DAL
258 244
             strSql.Append(" order by " + filedOrder);
259 245
             return DbHelperSQL.Query(strSql.ToString());
260 246
         }
247
+
261 248
         /// <summary>
262 249
         /// 获取记录总数
263 250
         /// </summary>
@@ -293,7 +280,7 @@ namespace CallCenterApi.DAL
293 280
             }
294 281
             else
295 282
             {
296
-                strSql.Append("order by T.F_ZBID desc");
283
+                strSql.Append("order by T.F_ID desc");
297 284
             }
298 285
             strSql.Append(")AS Row, T.*  from T_Call_ZBDH T ");
299 286
             if (!string.IsNullOrEmpty(strWhere.Trim()))
@@ -305,9 +292,35 @@ namespace CallCenterApi.DAL
305 292
             return DbHelperSQL.Query(strSql.ToString());
306 293
         }
307 294
 
295
+        /*
296
+		/// <summary>
297
+		/// 分页获取数据列表
298
+		/// </summary>
299
+		public DataSet GetList(int PageSize,int PageIndex,string strWhere)
300
+		{
301
+			SqlParameter[] parameters = {
302
+					new SqlParameter("@tblName", SqlDbType.VarChar, 255),
303
+					new SqlParameter("@fldName", SqlDbType.VarChar, 255),
304
+					new SqlParameter("@PageSize", SqlDbType.Int),
305
+					new SqlParameter("@PageIndex", SqlDbType.Int),
306
+					new SqlParameter("@IsReCount", SqlDbType.Bit),
307
+					new SqlParameter("@OrderType", SqlDbType.Bit),
308
+					new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
309
+					};
310
+			parameters[0].Value = "T_Call_ZBDH";
311
+			parameters[1].Value = "F_ID";
312
+			parameters[2].Value = PageSize;
313
+			parameters[3].Value = PageIndex;
314
+			parameters[4].Value = 0;
315
+			parameters[5].Value = 0;
316
+			parameters[6].Value = strWhere;	
317
+			return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
318
+		}*/
319
+
308 320
         #endregion  BasicMethod
309 321
         #region  ExtensionMethod
310 322
 
311 323
         #endregion  ExtensionMethod
312 324
     }
313 325
 }
326
+

+ 50 - 50
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/UserAccountController.cs

@@ -23,12 +23,19 @@ namespace CallCenterApi.Interface.Controllers
23 23
         //用户列表
24 24
         public ActionResult GetList(FilterUserAccount filter)
25 25
         {
26
-            ActionResult res = NoToken("未知错误,请重新登录");
27 26
             if (Request.IsAuthenticated)
28 27
             {
28
+                int userId = CurrentUser.UserData.F_UserId;
29
+                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
30
+
29 31
                 DataTable dt = new DataTable();
30 32
                 string sql = " ";
31 33
 
34
+                if (userModel.F_SeartGroupID != 0)
35
+                {
36
+                    sql += " and F_SeartGroupID = '" + userModel.F_SeartGroupID + "' ";
37
+                }
38
+
32 39
                 if (filter.dptid > 0)
33 40
                 {
34 41
                     Model.T_Sys_Department deptModel = new BLL.T_Sys_Department().GetModel(filter.dptid);
@@ -96,20 +103,16 @@ namespace CallCenterApi.Interface.Controllers
96 103
                     total = recordCount
97 104
                 };
98 105
 
99
-                res = Content(obj.ToJson());
100
-
101
-
102 106
                 dt.Clear();
103 107
                 dt.Dispose();
104
-
108
+                return Content(obj.ToJson());
105 109
             }
106
-            return res;
110
+            return NoToken("未知错误,请重新登录");
107 111
         }
108 112
         //[Authority]
109 113
         //获取用户信息
110 114
         public ActionResult GetUser(int userId = 0, string userCode = "")
111 115
         {
112
-            ActionResult res = NoToken("未知错误,请重新登录");
113 116
             if (Request.IsAuthenticated)
114 117
             {
115 118
                 string sql = "";
@@ -128,7 +131,7 @@ namespace CallCenterApi.Interface.Controllers
128 131
                 if (userModel == null) return Error("获取失败");
129 132
                 var depModel = departmentBLL.GetModel(userModel.F_DeptId);
130 133
                 var zxzModel = dicValueBLL.GetModel(userModel.F_GroupId ?? 0);
131
-                res = Success("获取成功", new
134
+                return Success("获取成功", new
132 135
                 {
133 136
                     F_UserId = userModel.F_UserId,
134 137
                     F_UserCode = userModel.F_UserCode,
@@ -163,13 +166,12 @@ namespace CallCenterApi.Interface.Controllers
163 166
                     depname = depModel?.F_DeptName ?? ""
164 167
                 });
165 168
             }
166
-            return res;
169
+            return NoToken("未知错误,请重新登录");
167 170
         }
168 171
         //[Authority]
169 172
         //添加用户信息
170 173
         public ActionResult AddUsers(UserAccountInput input)
171 174
         {
172
-            ActionResult res = NoToken("未知错误,请重新登录");
173 175
             if (Request.IsAuthenticated)
174 176
             {
175 177
 
@@ -243,30 +245,29 @@ namespace CallCenterApi.Interface.Controllers
243 245
                         if (model != null)
244 246
                             return Error("当前员工工号存在,请更换!");
245 247
                         if (sysUserAccountBll.Add(userAccountModel) > 0)
246
-                            res = Success("新增成功!");
248
+                            return Success("新增成功!");
247 249
                         else
248
-                            res = Error("新增失败!");
250
+                            return Error("新增失败!");
249 251
                     }
250 252
                     else
251 253
                     {
252
-                        res = Error("话务人员数量已超!");
254
+                        return Error("话务人员数量已超!");
253 255
                     }
254 256
                 }
255 257
                 else
256 258
                 {
257 259
                     if (sysUserAccountBll.Add(userAccountModel) > 0)
258
-                        res = Success("新增成功!");
260
+                        return Success("新增成功!");
259 261
                     else
260
-                        res = Error("新增失败!");
262
+                        return Error("新增失败!");
261 263
                 }
262 264
             }
263
-            return res;
265
+            return NoToken("未知错误,请重新登录");
264 266
         }
265 267
         // [Authority]
266 268
         //修改用户信息
267 269
         public ActionResult EditUsers(UserAccountInput input)
268 270
         {
269
-            ActionResult res = NoToken("未知错误,请重新登录");
270 271
             if (Request.IsAuthenticated)
271 272
             {
272 273
                 BLL.T_Sys_UserAccount sysUserAccountBll = new BLL.T_Sys_UserAccount();
@@ -339,33 +340,30 @@ namespace CallCenterApi.Interface.Controllers
339 340
                     if (sys.IsValidSeatPermission())
340 341
                     {
341 342
                         if (sysUserAccountBll.Update(userAccountModel))
342
-                            res = Success("编辑成功!");
343
+                            return Success("编辑成功!");
343 344
                         else
344
-                            res = Error("编辑失败!");
345
+                            return Error("编辑失败!");
345 346
                     }
346 347
                     else
347 348
                     {
348
-                        res = Error("话务人员数量已超!");
349
+                        return Error("话务人员数量已超!");
349 350
                     }
350 351
                 }
351 352
                 else
352 353
                 {
353 354
                     if (sysUserAccountBll.Update(userAccountModel))
354
-                        res = Success("编辑成功!");
355
+                        return Success("编辑成功!");
355 356
                     else
356
-                        res = Error("编辑失败!");
357
+                        return Error("编辑失败!");
357 358
                 }
358 359
             }
359
-            return res;
360
+            return NoToken("未知错误,请重新登录");
360 361
         }
361 362
         //[Authority]
362 363
         //删除/禁用/启用 用户
363 364
         [Authority]
364 365
         public ActionResult DelUsers(string[] ids, int state = 0)
365 366
         {
366
-            //ActionResult res = NoToken("未知错误,请重新登录");
367
-            //if (Request.IsAuthenticated)
368
-            //{
369 367
             if (ids == null || ids.Length <= 0)
370 368
                 return Error("请选择用户");
371 369
             var idStr = string.Join(",", ids);
@@ -389,15 +387,12 @@ namespace CallCenterApi.Interface.Controllers
389 387
                 return Success("设置成功");
390 388
             else
391 389
                 return Error("设置失败");
392
-            //}
393
-            //return res;
394 390
         }
395 391
 
396 392
         //[Authority]
397 393
         //删除用户
398 394
         public ActionResult DeleteUsers(string[] ids)
399 395
         {
400
-            ActionResult res = NoToken("未知错误,请重新登录");
401 396
             if (Request.IsAuthenticated)
402 397
             {
403 398
                 if (ids == null || ids.Length <= 0)
@@ -406,19 +401,22 @@ namespace CallCenterApi.Interface.Controllers
406 401
                 if (string.IsNullOrEmpty(idStr))
407 402
                     return Error("请选择用户");
408 403
                 if (sysUserAccountBll.DeleteList(idStr))
409
-                    res = Success("删除成功");
404
+                    return Success("删除成功");
410 405
                 else
411
-                    res = Error("删除失败");
406
+                    return Error("删除失败");
412 407
             }
413
-            return res;
408
+            return NoToken("未知错误,请重新登录");
414 409
         }
415 410
 
416 411
         //获取坐席列表
417 412
         public ActionResult GetSeatList()
418 413
         {
419
-            ActionResult res = NoToken("未知错误,请重新登录");
420 414
             if (Request.IsAuthenticated)
421 415
             {
416
+
417
+                int userId = CurrentUser.UserData.F_UserId;
418
+                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
419
+
422 420
                 string sql = " f_seatflag=1 ";
423 421
                 int roleid = CurrentUser.UserData.F_RoleId;
424 422
                 int deptid = CurrentUser.UserData.F_DeptId;
@@ -430,30 +428,34 @@ namespace CallCenterApi.Interface.Controllers
430 428
                             sql += " and F_DeptId=" + deptid;
431 429
                     }
432 430
                 }
431
+
432
+                if (userModel.F_SeartGroupID != 0)
433
+                {
434
+                    sql += " and F_SeartGroupID = '" + userModel.F_SeartGroupID + "' ";
435
+                }
436
+
433 437
                 List<Model.T_Sys_UserAccount> userSeartList = sysUserAccountBll.GetModelList(sql + " order by f_userid desc ");
434 438
                 if (userSeartList.Count > 0)
435
-                    res = Success("列表加载成功", userSeartList);
439
+                    return Success("列表加载成功", userSeartList);
436 440
                 else
437
-                    res = Error("列表加载失败");
441
+                    return Error("列表加载失败");
438 442
             }
439
-            return res;
443
+            return NoToken("未知错误,请重新登录");
440 444
         }
441 445
 
442 446
         //根据部门获取用户
443 447
         public ActionResult GetDeptUserList(int deptid = 0)
444 448
         {
445
-            ActionResult res = NoToken("未知错误,请重新登录");
446 449
             if (Request.IsAuthenticated)
447 450
             {
448 451
                 List<Model.T_Sys_UserAccount> DeptUserList = sysUserAccountBll.GetModelList("F_DeptId='" + deptid + "' order by f_userid desc ");
449
-                res = Success("列表加载成功", DeptUserList);
452
+                return Success("列表加载成功", DeptUserList);
450 453
             }
451
-            return res;
454
+            return NoToken("未知错误,请重新登录");
452 455
         }
453 456
         //获取当前用户信息
454 457
         public ActionResult GetNowUser()
455 458
         {
456
-            ActionResult res = NoToken("未知错误,请重新登录");
457 459
             if (Request.IsAuthenticated)
458 460
             {
459 461
                 Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(CurrentUser.UserData.F_UserId);
@@ -465,9 +467,9 @@ namespace CallCenterApi.Interface.Controllers
465 467
                     user = userModel,
466 468
                     role = roleModel
467 469
                 };
468
-                res = Success("获取成功", obj);
470
+                return Success("获取成功", obj);
469 471
             }
470
-            return res;
472
+            return NoToken("未知错误,请重新登录");
471 473
         }
472 474
         // [Authority]
473 475
         /// <summary>
@@ -478,7 +480,6 @@ namespace CallCenterApi.Interface.Controllers
478 480
         /// <returns></returns>
479 481
         public ActionResult ResetPwd(string usercode = "", string pwd = "")
480 482
         {
481
-            var res = NoToken("未知错误,请重新登录");
482 483
             if (Request.IsAuthenticated)
483 484
             {
484 485
                 if (string.IsNullOrWhiteSpace(pwd))
@@ -487,16 +488,15 @@ namespace CallCenterApi.Interface.Controllers
487 488
                 if (model == null) return Error("此用户不存在");
488 489
                 model.F_Password = pwd;
489 490
                 if (sysUserAccountBll.Update(model))
490
-                    res = Success("重置密码成功");
491
+                    return Success("重置密码成功");
491 492
                 else
492
-                    res = Error("重置密码失败");
493
+                    return Error("重置密码失败");
493 494
             }
494
-            return res;
495
+            return NoToken("未知错误,请重新登录");
495 496
         }
496 497
 
497 498
         public ActionResult UpdatePwd(string usercode = "", string pwd = "", string oldPwd = "", string mobile = "")
498 499
         {
499
-            var res = NoToken("未知错误,请重新登录");
500 500
             if (Request.IsAuthenticated)
501 501
             {
502 502
                 if (string.IsNullOrWhiteSpace(pwd))
@@ -510,11 +510,11 @@ namespace CallCenterApi.Interface.Controllers
510 510
                 if (!string.IsNullOrWhiteSpace(mobile))
511 511
                     model.F_Mobile = mobile;
512 512
                 if (sysUserAccountBll.Update(model))
513
-                    res = Success("重置密码成功");
513
+                    return Success("重置密码成功");
514 514
                 else
515
-                    res = Error("重置密码失败");
515
+                    return Error("重置密码失败");
516 516
             }
517
-            return res;
517
+            return NoToken("未知错误,请重新登录");
518 518
         }
519 519
 
520 520
     }

+ 413 - 409
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/quality/QCManageController.cs

@@ -15,489 +15,493 @@ namespace CallCenterApi.Interface.Controllers.quality
15 15
         //获取未质检列表
16 16
         public ActionResult GetList()
17 17
         {
18
-            ActionResult res = NoToken("未知错误,请重新登录");
19
-            string sql = " 1=1 ";
20
-            DataTable dt = new DataTable();
21
-
22
-            string phone = HttpUtility.UrlDecode(RequestString.GetQueryString("phone"));
23
-            string usercode = HttpUtility.UrlDecode(RequestString.GetQueryString("usercode"));
24
-            string calltype = HttpUtility.UrlDecode(RequestString.GetQueryString("calltype"));
25
-            string starttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
26
-            string endtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
27
-            string startl = HttpUtility.UrlDecode(RequestString.GetQueryString("startl"));
28
-            string endl = HttpUtility.UrlDecode(RequestString.GetQueryString("endl"));
29
-            string optid = HttpUtility.UrlDecode(RequestString.GetQueryString("optid"));
30
-
31
-            string strpageindex = RequestString.GetQueryString("page");
32
-            int pageindex = 1;
33
-            string strpagesize = RequestString.GetQueryString("pagesize");
34
-            int pagesize = 10;
35
-
36
-            sql += " and CallState='1' and F_QCState<>1  ";
37
-
38
-            if (phone.Trim() != "")
18
+            if (Request.IsAuthenticated)
39 19
             {
40
-                sql += " and CallNumber='" + phone + "'";
41
-            }
42
-            if (usercode.Trim() != "")
43
-            {
44
-                sql += " and UserCode='" + usercode + "'";
45
-            }
46
-            if (calltype.Trim() != "")
47
-            {
48
-                sql += " and CallType='" + calltype + "'";
49
-            }
50
-            if (starttime.Trim() == "" && endtime.Trim() == "")
51
-            {
52
-                sql += " and DATEDIFF(week, BeginTime,getdate())=1 ";//默认显示上周记录
53
-            }
54
-            else
55
-            {
56
-                if (starttime.Trim() != "")
20
+                int userId = CurrentUser.UserData.F_UserId;
21
+                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
22
+
23
+                string sql = " 1=1 ";
24
+                DataTable dt = new DataTable();
25
+
26
+                if (!string.IsNullOrEmpty(userModel.groupcode))
57 27
                 {
58
-                    sql += " and BeginTime>='" + starttime + "'";
28
+                    sql += " and F_GroupCode = '" + userModel.groupcode + "' ";
59 29
                 }
60
-                if (endtime.Trim() != "")
30
+
31
+                string phone = HttpUtility.UrlDecode(RequestString.GetQueryString("phone"));
32
+                string usercode = HttpUtility.UrlDecode(RequestString.GetQueryString("usercode"));
33
+                string calltype = HttpUtility.UrlDecode(RequestString.GetQueryString("calltype"));
34
+                string starttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
35
+                string endtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
36
+                string startl = HttpUtility.UrlDecode(RequestString.GetQueryString("startl"));
37
+                string endl = HttpUtility.UrlDecode(RequestString.GetQueryString("endl"));
38
+                string optid = HttpUtility.UrlDecode(RequestString.GetQueryString("optid"));
39
+
40
+                string strpageindex = RequestString.GetQueryString("page");
41
+                int pageindex = 1;
42
+                string strpagesize = RequestString.GetQueryString("pagesize");
43
+                int pagesize = 10;
44
+
45
+                sql += " and CallState='1' and F_QCState<>1  ";
46
+
47
+                if (phone.Trim() != "")
61 48
                 {
62
-                    sql += " and BeginTime<='" + endtime + "'";
49
+                    sql += " and CallNumber='" + phone + "'";
50
+                }
51
+                if (usercode.Trim() != "")
52
+                {
53
+                    sql += " and UserCode='" + usercode + "'";
54
+                }
55
+                if (calltype.Trim() != "")
56
+                {
57
+                    sql += " and CallType='" + calltype + "'";
58
+                }
59
+                if (starttime.Trim() == "" && endtime.Trim() == "")
60
+                {
61
+                    sql += " and DATEDIFF(week, BeginTime,getdate())=1 ";//默认显示上周记录
62
+                }
63
+                else
64
+                {
65
+                    if (starttime.Trim() != "")
66
+                    {
67
+                        sql += " and BeginTime>='" + starttime + "'";
68
+                    }
69
+                    if (endtime.Trim() != "")
70
+                    {
71
+                        sql += " and BeginTime<='" + endtime + "'";
72
+                    }
73
+                }
74
+                if (startl.Trim() != "")
75
+                {
76
+                    sql += " and TalkLongTime>=" + startl + " ";
77
+                }
78
+                if (endl.Trim() != "")
79
+                {
80
+                    sql += " and TalkLongTime<=" + endl + " ";
63 81
                 }
64
-            }
65
-            if (startl.Trim() != "")
66
-            {
67
-                sql += " and TalkLongTime>=" + startl + " ";
68
-            }
69
-            if (endl.Trim() != "")
70
-            {
71
-                sql += " and TalkLongTime<=" + endl + " ";
72
-            }
73 82
 
74
-            if (strpageindex.Trim() != "")
75
-            {
76
-                pageindex = Convert.ToInt32(strpageindex);
77
-            }
83
+                if (strpageindex.Trim() != "")
84
+                {
85
+                    pageindex = Convert.ToInt32(strpageindex);
86
+                }
78 87
 
79
-            if (strpagesize.Trim() != "")
80
-            {
81
-                pagesize = Convert.ToInt32(strpagesize);
82
-            }
88
+                if (strpagesize.Trim() != "")
89
+                {
90
+                    pagesize = Convert.ToInt32(strpagesize);
91
+                }
83 92
 
84
-            List<Model.T_Call_CallRecords_QC> Plist = new BLL.T_Call_CallRecords_QC().GetModelList(sql);//.GetListV1(sql);
85
-            List<Model.T_Call_CallRecordsLD> ldList = new BLL.T_Call_CallRecordsLD().GetModelList("");
86
-            Model.PageData<object> pageData = new Model.PageData<object>();
87
-            var list = Plist.Select(d => {
88
-                int lc = ldList.Where(l => l.F_CallRecordsID == d.CallRecordsId && l.F_OptID == int.Parse(optid) && l.F_IsListen == true).Count();
89
-                int dc = ldList.Where(l => l.F_CallRecordsID == d.CallRecordsId && l.F_OptID == int.Parse(optid) && l.F_IsDownload == true).Count();
90
-                return new
93
+                List<Model.T_Call_CallRecords_QC> Plist = new BLL.T_Call_CallRecords_QC().GetModelList(sql);//.GetListV1(sql);
94
+                List<Model.T_Call_CallRecordsLD> ldList = new BLL.T_Call_CallRecordsLD().GetModelList("");
95
+                Model.PageData<object> pageData = new Model.PageData<object>();
96
+                var list = Plist.Select(d =>
97
+                {
98
+                    int lc = ldList.Where(l => l.F_CallRecordsID == d.CallRecordsId && l.F_OptID == int.Parse(optid) && l.F_IsListen == true).Count();
99
+                    int dc = ldList.Where(l => l.F_CallRecordsID == d.CallRecordsId && l.F_OptID == int.Parse(optid) && l.F_IsDownload == true).Count();
100
+                    return new
101
+                    {
102
+                        _callnumber = d.CallNumber,
103
+                        _filepath = d.FilePath,
104
+                        _f_qcstate = d.F_QCState,
105
+                        _f_qcscore = d.F_QCScore,
106
+                        _f_qcquestion = d.F_QCQuestion,
107
+                        _f_qcadvise = d.F_QCAdvise,
108
+                        _calltype = d.CallType,
109
+                        _callstate = d.CallState,
110
+                        _usercode = d.UserCode,
111
+                        _username = d.UserName,
112
+                        _talkstarttime = d.TalkStartTime,
113
+                        _talkendtime = d.TalkEndTime,
114
+                        _talklongtime = d.TalkLongTime,
115
+                        _businesstype = d.BusinessType,
116
+                        _f_qclc = lc,
117
+                        _f_qcdc = dc,
118
+                        _callrecordsid = d.CallRecordsId
119
+                    };
120
+                }).ToList<object>();
121
+                //pageData.Rows = list.Skip((pageindex - 1) * pagesize).Take(pagesize).ToList();
122
+                //pageData.Total = list.Count;
123
+
124
+                var obj = new
91 125
                 {
92
-                    _callnumber = d.CallNumber,
93
-                    _filepath = d.FilePath,
94
-                    _f_qcstate = d.F_QCState,
95
-                    _f_qcscore = d.F_QCScore,
96
-                    _f_qcquestion = d.F_QCQuestion,
97
-                    _f_qcadvise = d.F_QCAdvise,
98
-                    _calltype = d.CallType,
99
-                    _callstate = d.CallState,
100
-                    _usercode = d.UserCode,
101
-                    _username = d.UserName,
102
-                    _talkstarttime = d.TalkStartTime,
103
-                    _talkendtime = d.TalkEndTime,
104
-                    _talklongtime = d.TalkLongTime,
105
-                    _businesstype = d.BusinessType,
106
-                    _f_qclc = lc,
107
-                    _f_qcdc = dc,
108
-                    _callrecordsid = d.CallRecordsId
126
+                    rows = list.Skip((pageindex - 1) * pagesize).Take(pagesize).ToList(),
127
+                    total = list.Count
109 128
                 };
110
-            }).ToList<object>();
111
-            //pageData.Rows = list.Skip((pageindex - 1) * pagesize).Take(pagesize).ToList();
112
-            //pageData.Total = list.Count;
113 129
 
114
-            var obj = new
115
-            {
116
-                rows = list.Skip((pageindex - 1) * pagesize).Take(pagesize).ToList(),
117
-                total = list.Count
118
-            };
119
-
120
-            res = Content(obj.ToJson());
121
-
122
-            //if (pageData.Total > 0)
123
-            //{
124
-            //    res = Success("未质检列表加载成功", pageData);
125
-            //}
126
-            //else
127
-            //{
128
-            //    res = Error("未质检列表暂无数据");
129
-            //}
130
-
131
-            return res;
130
+                return Content(obj.ToJson());
131
+            }
132
+            return NoToken("未知错误,请重新登录");
132 133
         }
133 134
 
134 135
         //获取已质检列表
135 136
         public ActionResult GetYZJList()
136 137
         {
137
-            ActionResult res = NoToken("未知错误,请重新登录");
138
-            string sql = " 1=1 ";
139
-            DataTable dt = new DataTable();
140
-
141
-            string phone = HttpUtility.UrlDecode(RequestString.GetQueryString("phone"));
142
-            string usercode = HttpUtility.UrlDecode(RequestString.GetQueryString("usercode"));
143
-            string calltype = HttpUtility.UrlDecode(RequestString.GetQueryString("calltype"));
144
-            string starttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
145
-            string endtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
146
-            string startl = HttpUtility.UrlDecode(RequestString.GetQueryString("startl"));
147
-            string endl = HttpUtility.UrlDecode(RequestString.GetQueryString("endl"));
148
-            string optid = HttpUtility.UrlDecode(RequestString.GetQueryString("optid"));
149
-
150
-            string strpageindex = RequestString.GetQueryString("page");
151
-            int pageindex = 1;
152
-            string strpagesize = RequestString.GetQueryString("pagesize");
153
-            int pagesize = 10;
154
-
155
-            //已接通,已质检
156
-            sql += "  and CallState='1' and F_QCState=1 ";
157
-
158
-            if (phone.Trim() != "")
159
-            {
160
-                sql += " and CallNumber='" + phone + "'";
161
-            }
162
-            if (usercode.Trim() != "")
163
-            {
164
-                sql += " and UserCode='" + usercode + "'";
165
-            }
166
-            if (calltype.Trim() != "")
167
-            {
168
-                sql += " and CallType='" + calltype + "'";
169
-            }
170
-            if (starttime.Trim() != "")
138
+            if (Request.IsAuthenticated)
171 139
             {
172
-                sql += " and BeginTime>='" + starttime + "'";
173
-            }
174
-            if (endtime.Trim() != "")
175
-            {
176
-                sql += " and BeginTime<='" + endtime + "'";
177
-            }
178
-            if (startl.Trim() != "")
179
-            {
180
-                sql += " and TalkLongTime>=" + startl + " ";
181
-            }
182
-            if (endl.Trim() != "")
183
-            {
184
-                sql += " and TalkLongTime<=" + endl + " ";
185
-            }
186 140
 
187
-            if (strpageindex.Trim() != "")
188
-            {
189
-                pageindex = Convert.ToInt32(strpageindex);
190
-            }
141
+                int userId = CurrentUser.UserData.F_UserId;
142
+                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
191 143
 
192
-            if (strpagesize.Trim() != "")
193
-            {
194
-                pagesize = Convert.ToInt32(strpagesize);
195
-            }
144
+                string sql = " 1=1 ";
145
+                DataTable dt = new DataTable();
196 146
 
197
-            List<Model.T_Call_CallRecords_QC> Plist = new BLL.T_Call_CallRecords_QC().GetModelList(sql);//.GetListV1(sql);
198
-            List<Model.T_Call_CallRecordsLD> ldList = new BLL.T_Call_CallRecordsLD().GetModelList("");
199
-            Model.PageData<object> pageData = new Model.PageData<object>();
200
-            var list = Plist.Select(d => {
201
-                int lc = ldList.Where(l => l.F_CallRecordsID == d.CallRecordsId && l.F_OptID == int.Parse(optid) && l.F_IsListen == true).Count();
202
-                int dc = ldList.Where(l => l.F_CallRecordsID == d.CallRecordsId && l.F_OptID == int.Parse(optid) && l.F_IsDownload == true).Count();
203
-                return new
147
+
148
+                if (!string.IsNullOrEmpty(userModel.groupcode))
204 149
                 {
205
-                    _callnumber = d.CallNumber,
206
-                    _filepath = d.FilePath,
207
-                    _f_qcstate = d.F_QCState,
208
-                    _f_qcscore = d.F_QCScore,
209
-                    _f_qcquestion = d.F_QCQuestion,
210
-                    _f_qcadvise = d.F_QCAdvise,
211
-                    _calltype = d.CallType,
212
-                    _callstate = d.CallState,
213
-                    _usercode = d.UserCode,
214
-                    _username = d.UserName,
215
-                    _talkstarttime = d.TalkStartTime,
216
-                    _talkendtime = d.TalkEndTime,
217
-                    _talklongtime = d.TalkLongTime,
218
-                    _businesstype = d.BusinessType,
219
-                    _f_qclc = lc,
220
-                    _f_qcdc = dc,
221
-                    _callrecordsid = d.CallRecordsId
222
-                };
223
-            }).ToList<object>();
150
+                    sql += " and F_GroupCode = '" + userModel.groupcode + "' ";
151
+                }
224 152
 
225
-            var obj = new
226
-            {
227
-                rows = list.Skip((pageindex - 1) * pagesize).Take(pagesize).ToList(),
228
-                total = list.Count
229
-            };
153
+                string phone = HttpUtility.UrlDecode(RequestString.GetQueryString("phone"));
154
+                string usercode = HttpUtility.UrlDecode(RequestString.GetQueryString("usercode"));
155
+                string calltype = HttpUtility.UrlDecode(RequestString.GetQueryString("calltype"));
156
+                string starttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
157
+                string endtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
158
+                string startl = HttpUtility.UrlDecode(RequestString.GetQueryString("startl"));
159
+                string endl = HttpUtility.UrlDecode(RequestString.GetQueryString("endl"));
160
+                string optid = HttpUtility.UrlDecode(RequestString.GetQueryString("optid"));
161
+
162
+                string strpageindex = RequestString.GetQueryString("page");
163
+                int pageindex = 1;
164
+                string strpagesize = RequestString.GetQueryString("pagesize");
165
+                int pagesize = 10;
166
+
167
+                //已接通,已质检
168
+                sql += "  and CallState='1' and F_QCState=1 ";
169
+
170
+                if (phone.Trim() != "")
171
+                {
172
+                    sql += " and CallNumber='" + phone + "'";
173
+                }
174
+                if (usercode.Trim() != "")
175
+                {
176
+                    sql += " and UserCode='" + usercode + "'";
177
+                }
178
+                if (calltype.Trim() != "")
179
+                {
180
+                    sql += " and CallType='" + calltype + "'";
181
+                }
182
+                if (starttime.Trim() != "")
183
+                {
184
+                    sql += " and BeginTime>='" + starttime + "'";
185
+                }
186
+                if (endtime.Trim() != "")
187
+                {
188
+                    sql += " and BeginTime<='" + endtime + "'";
189
+                }
190
+                if (startl.Trim() != "")
191
+                {
192
+                    sql += " and TalkLongTime>=" + startl + " ";
193
+                }
194
+                if (endl.Trim() != "")
195
+                {
196
+                    sql += " and TalkLongTime<=" + endl + " ";
197
+                }
230 198
 
231
-            res = Content(obj.ToJson());
199
+                if (strpageindex.Trim() != "")
200
+                {
201
+                    pageindex = Convert.ToInt32(strpageindex);
202
+                }
203
+
204
+                if (strpagesize.Trim() != "")
205
+                {
206
+                    pagesize = Convert.ToInt32(strpagesize);
207
+                }
232 208
 
233
-            //pageData.Rows = list.Skip((pageindex - 1) * pagesize).Take(pagesize).ToList();
234
-            //pageData.Total = list.Count;
209
+                List<Model.T_Call_CallRecords_QC> Plist = new BLL.T_Call_CallRecords_QC().GetModelList(sql);//.GetListV1(sql);
210
+                List<Model.T_Call_CallRecordsLD> ldList = new BLL.T_Call_CallRecordsLD().GetModelList("");
211
+                Model.PageData<object> pageData = new Model.PageData<object>();
212
+                var list = Plist.Select(d =>
213
+                {
214
+                    int lc = ldList.Where(l => l.F_CallRecordsID == d.CallRecordsId && l.F_OptID == int.Parse(optid) && l.F_IsListen == true).Count();
215
+                    int dc = ldList.Where(l => l.F_CallRecordsID == d.CallRecordsId && l.F_OptID == int.Parse(optid) && l.F_IsDownload == true).Count();
216
+                    return new
217
+                    {
218
+                        _callnumber = d.CallNumber,
219
+                        _filepath = d.FilePath,
220
+                        _f_qcstate = d.F_QCState,
221
+                        _f_qcscore = d.F_QCScore,
222
+                        _f_qcquestion = d.F_QCQuestion,
223
+                        _f_qcadvise = d.F_QCAdvise,
224
+                        _calltype = d.CallType,
225
+                        _callstate = d.CallState,
226
+                        _usercode = d.UserCode,
227
+                        _username = d.UserName,
228
+                        _talkstarttime = d.TalkStartTime,
229
+                        _talkendtime = d.TalkEndTime,
230
+                        _talklongtime = d.TalkLongTime,
231
+                        _businesstype = d.BusinessType,
232
+                        _f_qclc = lc,
233
+                        _f_qcdc = dc,
234
+                        _callrecordsid = d.CallRecordsId
235
+                    };
236
+                }).ToList<object>();
237
+
238
+                var obj = new
239
+                {
240
+                    rows = list.Skip((pageindex - 1) * pagesize).Take(pagesize).ToList(),
241
+                    total = list.Count
242
+                };
235 243
 
236
-            //if (pageData.Total > 0)
237
-            //{
238
-            //    res = Success("已质检列表加载成功", pageData);
239
-            //}
240
-            //else
241
-            //{
242
-            //    res = Error("已质检列表暂无数据");
243
-            //}
244
+                return Content(obj.ToJson());
244 245
 
245
-            return res;
246
+            }
247
+            return NoToken("未知错误,请重新登录");
246 248
         }
247 249
 
248 250
         //获取质检详情
249 251
         public ActionResult GetIndexList(string id)
250 252
         {
251
-            ActionResult res = NoToken("未知错误,请重新登录");
252
-            DataTable dt = new DataTable();
253
-            DataTable dtindex = new DataTable();
254
-            DataTable dtres = new DataTable();
255
-
256
-            dt = new BLL.T_QC_IndexCategory().GetList(" F_DeleteFlag=0 order by F_Sort ,F_CategoryId").Tables[0];
257
-            dtindex = new BLL.T_QC_IndexBase().GetList(" F_DeleteFlag=0 order by F_Sort ,F_CategoryId").Tables[0];
258
-            dtres = new BLL.T_QC_IndexRes().GetList(" CallRecordsId=" + id + " ").Tables[0];
259
-            int i = 0;
260
-            int m = 0;
261
-            int indexcount = 0;
262
-            int allscore = 0;
263
-            int childscore = 0;
264
-            int childpf = 0;
265
-            int allpf = 0;
266
-            List<Model.QCModel> qclist = new List<Model.QCModel>();
267
-            object obj = null;
268
-
269
-            foreach (DataRow dr in dt.Select("F_ParentId=0"))
253
+            if (Request.IsAuthenticated)
270 254
             {
271
-                Model.QCModel qcml = new Model.QCModel();
272
-                List<Model.QCModel> qcclist = new List<Model.QCModel>();
255
+                DataTable dt = new DataTable();
256
+                DataTable dtindex = new DataTable();
257
+                DataTable dtres = new DataTable();
258
+
259
+                dt = new BLL.T_QC_IndexCategory().GetList(" F_DeleteFlag=0 order by F_Sort ,F_CategoryId").Tables[0];
260
+                dtindex = new BLL.T_QC_IndexBase().GetList(" F_DeleteFlag=0 order by F_Sort ,F_CategoryId").Tables[0];
261
+                dtres = new BLL.T_QC_IndexRes().GetList(" CallRecordsId=" + id + " ").Tables[0];
262
+                int i = 0;
263
+                int m = 0;
264
+                int indexcount = 0;
265
+                int allscore = 0;
266
+                int childscore = 0;
267
+                int childpf = 0;
268
+                int allpf = 0;
269
+                List<Model.QCModel> qclist = new List<Model.QCModel>();
270
+                object obj = null;
271
+
272
+                foreach (DataRow dr in dt.Select("F_ParentId=0"))
273
+                {
274
+                    Model.QCModel qcml = new Model.QCModel();
275
+                    List<Model.QCModel> qcclist = new List<Model.QCModel>();
273 276
 
274
-                i = 0;
275
-                indexcount = 0;
276
-                childscore = 0;
277
-                childpf = 0;
277
+                    i = 0;
278
+                    indexcount = 0;
279
+                    childscore = 0;
280
+                    childpf = 0;
278 281
 
279
-                string categoryid = dr["F_CategoryId"].ToString().Trim();
282
+                    string categoryid = dr["F_CategoryId"].ToString().Trim();
280 283
 
281
-                qcml.Qcid = categoryid;
282
-                qcml.Qcname = dr["F_CategoryName"].ToString().Trim();
284
+                    qcml.Qcid = categoryid;
285
+                    qcml.Qcname = dr["F_CategoryName"].ToString().Trim();
283 286
 
284
-                obj = DbHelperSQL.GetSingle("select count(*) from T_QC_IndexBase where F_CategoryId in(select F_CategoryId from T_QC_IndexCategory where F_ParentId=" + dr["F_CategoryId"] + ")");
285
-                qcml.Rowspan = obj.ToString();
286
-                foreach (DataRow childdr in dt.Select("F_ParentId=" + categoryid + ""))
287
-                {
288
-                    Model.QCModel qcmlc = new Model.QCModel();
289
-                    List<Model.QCModel> qccrlist = new List<Model.QCModel>();
290
-                    m = 0;
291
-                    #region 子分类
292
-                    string childcategoryid = childdr["F_CategoryId"].ToString().Trim();
293
-                    DataRow[] arrchild = dtindex.Select("F_CategoryId=" + childcategoryid + "");
294
-                    indexcount += arrchild.Length;
295
-
296
-                    //加载项
297
-                    qcmlc.Qcid = categoryid + "-" + childcategoryid;
298
-                    qcmlc.Qcname = childdr["F_CategoryName"].ToString().Trim();
299
-                    obj = DbHelperSQL.GetSingle("select count(*) from T_QC_IndexBase where F_CategoryId=" + childdr["F_CategoryId"]);
300
-                    qcmlc.Rowspan = obj.ToString();
301
-                    #endregion
302
-                    foreach (DataRow indexdr in arrchild)
287
+                    obj = DbHelperSQL.GetSingle("select count(*) from T_QC_IndexBase where F_CategoryId in(select F_CategoryId from T_QC_IndexCategory where F_ParentId=" + dr["F_CategoryId"] + ")");
288
+                    qcml.Rowspan = obj.ToString();
289
+                    foreach (DataRow childdr in dt.Select("F_ParentId=" + categoryid + ""))
303 290
                     {
304
-                        Model.QCModel qcmlcr = new Model.QCModel();
305
-                        string indexid = indexdr["F_IndexId"].ToString().Trim();
306
-                        string pf = "0";
307
-                        try
308
-                        {
309
-                            //分类分数合计
310
-                            childscore += Convert.ToInt32(indexdr["F_Score"].ToString().Trim());
311
-                            //总计合计
312
-                            allscore += Convert.ToInt32(indexdr["F_Score"].ToString().Trim());
313
-                        }
314
-                        catch
315
-                        { }
316
-                        try
317
-                        {
318
-                            pf = dtres.Select("F_IndexId=" + indexid + "")[0]["F_QCScore"].ToString().Trim();
319
-                            childpf += Convert.ToInt32(pf);//分类评分合计
320
-                            allpf += Convert.ToInt32(pf);//评分总计
321
-                        }
322
-                        catch
323
-                        {
324
-                        }
325
-
326
-                        #region 指标
327
-                        //加载指标
328
-                        qcmlcr.Qcid = categoryid + "-" + childcategoryid + "-" + indexid;
329
-                        qcmlcr.Qcname = indexdr["F_Title"].ToString().Trim();
330
-                        qcmlcr.Qcscore = indexdr["F_Score"].ToString().Trim();
331
-                        qcmlcr.Qcpf = pf;
332
-                        qcmlcr.Rowspan = "0";
333
-                        qcmlcr.Colspan = "0";
291
+                        Model.QCModel qcmlc = new Model.QCModel();
292
+                        List<Model.QCModel> qccrlist = new List<Model.QCModel>();
293
+                        m = 0;
294
+                        #region 子分类
295
+                        string childcategoryid = childdr["F_CategoryId"].ToString().Trim();
296
+                        DataRow[] arrchild = dtindex.Select("F_CategoryId=" + childcategoryid + "");
297
+                        indexcount += arrchild.Length;
298
+
299
+                        //加载项
300
+                        qcmlc.Qcid = categoryid + "-" + childcategoryid;
301
+                        qcmlc.Qcname = childdr["F_CategoryName"].ToString().Trim();
302
+                        obj = DbHelperSQL.GetSingle("select count(*) from T_QC_IndexBase where F_CategoryId=" + childdr["F_CategoryId"]);
303
+                        qcmlc.Rowspan = obj.ToString();
334 304
                         #endregion
335
-                        m++;
336
-
337
-                        qccrlist.Add(qcmlcr);
305
+                        foreach (DataRow indexdr in arrchild)
306
+                        {
307
+                            Model.QCModel qcmlcr = new Model.QCModel();
308
+                            string indexid = indexdr["F_IndexId"].ToString().Trim();
309
+                            string pf = "0";
310
+                            try
311
+                            {
312
+                                //分类分数合计
313
+                                childscore += Convert.ToInt32(indexdr["F_Score"].ToString().Trim());
314
+                                //总计合计
315
+                                allscore += Convert.ToInt32(indexdr["F_Score"].ToString().Trim());
316
+                            }
317
+                            catch
318
+                            { }
319
+                            try
320
+                            {
321
+                                pf = dtres.Select("F_IndexId=" + indexid + "")[0]["F_QCScore"].ToString().Trim();
322
+                                childpf += Convert.ToInt32(pf);//分类评分合计
323
+                                allpf += Convert.ToInt32(pf);//评分总计
324
+                            }
325
+                            catch
326
+                            {
327
+                            }
328
+
329
+                            #region 指标
330
+                            //加载指标
331
+                            qcmlcr.Qcid = categoryid + "-" + childcategoryid + "-" + indexid;
332
+                            qcmlcr.Qcname = indexdr["F_Title"].ToString().Trim();
333
+                            qcmlcr.Qcscore = indexdr["F_Score"].ToString().Trim();
334
+                            qcmlcr.Qcpf = pf;
335
+                            qcmlcr.Rowspan = "0";
336
+                            qcmlcr.Colspan = "0";
337
+                            #endregion
338
+                            m++;
339
+
340
+                            qccrlist.Add(qcmlcr);
338 341
 
342
+                        }
343
+                        i++;
344
+                        qcmlc.Qclist = qccrlist;
345
+                        qcclist.Add(qcmlc);
339 346
                     }
340
-                    i++;
341
-                    qcmlc.Qclist = qccrlist;
342
-                    qcclist.Add(qcmlc);
347
+                    //合计
348
+                    qcml.Qcscore = childscore.ToString().Trim();
349
+                    qcml.Qcpf = childpf.ToString().Trim();
350
+                    qcml.Qclist = qcclist;
351
+                    qcml.Colspan = "2";
352
+                    qclist.Add(qcml);
343 353
                 }
344
-                //合计
345
-                qcml.Qcscore = childscore.ToString().Trim();
346
-                qcml.Qcpf = childpf.ToString().Trim();
347
-                qcml.Qclist = qcclist;
348
-                qcml.Colspan = "2";
349
-                qclist.Add(qcml);
350
-            }
351
-            Model.QCModel qcmlhj = new Model.QCModel();
352
-            qcmlhj.Qcid = "0";
353
-            qcmlhj.Qcname = "总计";
354
-            qcmlhj.Qcscore = allscore.ToString().Trim();
355
-            qcmlhj.Qcpf = allpf.ToString().Trim();
356
-            qcmlhj.Qclist = qclist;
357
-            qcmlhj.Colspan = "3";
354
+                Model.QCModel qcmlhj = new Model.QCModel();
355
+                qcmlhj.Qcid = "0";
356
+                qcmlhj.Qcname = "总计";
357
+                qcmlhj.Qcscore = allscore.ToString().Trim();
358
+                qcmlhj.Qcpf = allpf.ToString().Trim();
359
+                qcmlhj.Qclist = qclist;
360
+                qcmlhj.Colspan = "3";
361
+
362
+
363
+                dtres.Clear();
364
+                dtres.Dispose();
365
+                dtindex.Clear();
366
+                dtindex.Dispose();
367
+                dt.Clear();
368
+                dt.Dispose();
358 369
 
359
-            res = Success("质检部分加载成功", qcmlhj);
370
+                return Success("质检部分加载成功", qcmlhj);
360 371
 
361 372
 
362
-            dtres.Clear();
363
-            dtres.Dispose();
364
-            dtindex.Clear();
365
-            dtindex.Dispose();
366
-            dt.Clear();
367
-            dt.Dispose();
368 373
 
369
-            return res;
374
+            }
375
+            return NoToken("未知错误,请重新登录");
370 376
         }
371 377
 
372 378
 
373 379
         //保存质检得分
374 380
         public ActionResult SaveData(string id, string xmlinfo)
375 381
         {
376
-            ActionResult res = NoToken("未知错误,请重新登录");
377
-            DataTable dt = new DataTable();
378
-
379
-            //string id = HttpUtility.UrlDecode(RequestString.GetQueryString("id"));
380
-            //string userid = HttpUtility.UrlDecode(RequestString.GetQueryString("userid"));
381
-            //string username = HttpUtility.UrlDecode(RequestString.GetQueryString("username"));
382
-            //string xmlinfo = HttpUtility.UrlDecode(RequestString.GetQueryString("xmlinfo"));
383
-            //string question = HttpUtility.UrlDecode(RequestString.GetQueryString("question"));
384
-            //string advise = HttpUtility.UrlDecode(RequestString.GetQueryString("advise"));
385
-            dt = new BLL.T_QC_IndexRes().GetList(" CallRecordsId=" + id + " ").Tables[0];
386
-            int allscore = 0;
387
-            foreach (string scoreinfo in xmlinfo.Trim(';').Split(';'))
382
+            if (Request.IsAuthenticated)
388 383
             {
389
-                //判断存在该指标评估则修改,无则添加
390
-                string idsss = scoreinfo.Split(':')[0];
391
-                string indexid = idsss.Split('-')[2];
392
-                if (dt.Select(" F_IndexId=" + indexid + " ").Length > 0)
384
+                DataTable dt = new DataTable();
385
+
386
+                //string id = HttpUtility.UrlDecode(RequestString.GetQueryString("id"));
387
+                //string userid = HttpUtility.UrlDecode(RequestString.GetQueryString("userid"));
388
+                //string username = HttpUtility.UrlDecode(RequestString.GetQueryString("username"));
389
+                //string xmlinfo = HttpUtility.UrlDecode(RequestString.GetQueryString("xmlinfo"));
390
+                //string question = HttpUtility.UrlDecode(RequestString.GetQueryString("question"));
391
+                //string advise = HttpUtility.UrlDecode(RequestString.GetQueryString("advise"));
392
+                dt = new BLL.T_QC_IndexRes().GetList(" CallRecordsId=" + id + " ").Tables[0];
393
+                int allscore = 0;
394
+                foreach (string scoreinfo in xmlinfo.Trim(';').Split(';'))
393 395
                 {
394
-                    Model.T_QC_IndexRes model = new Model.T_QC_IndexRes();
395
-                    model.F_Id = Convert.ToInt32(dt.Select(" F_IndexId=" + indexid + " ")[0]["F_Id"].ToString());
396
-                    model.CallRecordsId = Convert.ToInt32(id);
397
-                    try
396
+                    //判断存在该指标评估则修改,无则添加
397
+                    string idsss = scoreinfo.Split(':')[0];
398
+                    string indexid = idsss.Split('-')[2];
399
+                    if (dt.Select(" F_IndexId=" + indexid + " ").Length > 0)
398 400
                     {
399
-                        model.F_IndexId = Convert.ToInt32(indexid);
401
+                        Model.T_QC_IndexRes model = new Model.T_QC_IndexRes();
402
+                        model.F_Id = Convert.ToInt32(dt.Select(" F_IndexId=" + indexid + " ")[0]["F_Id"].ToString());
403
+                        model.CallRecordsId = Convert.ToInt32(id);
404
+                        try
405
+                        {
406
+                            model.F_IndexId = Convert.ToInt32(indexid);
407
+                        }
408
+                        catch
409
+                        { }
410
+                        try
411
+                        {
412
+                            model.F_QCScore = Convert.ToInt32(scoreinfo.Split(':')[1]);
413
+                            allscore += Convert.ToInt32(scoreinfo.Split(':')[1]);
414
+                        }
415
+                        catch
416
+                        { }
417
+                        new BLL.T_QC_IndexRes().Update(model);
400 418
                     }
401
-                    catch
402
-                    { }
403
-                    try
419
+                    else
404 420
                     {
405
-                        model.F_QCScore = Convert.ToInt32(scoreinfo.Split(':')[1]);
406
-                        allscore += Convert.ToInt32(scoreinfo.Split(':')[1]);
421
+                        Model.T_QC_IndexRes model = new Model.T_QC_IndexRes();
422
+                        model.CallRecordsId = Convert.ToInt32(id);
423
+                        try
424
+                        {
425
+                            model.F_IndexId = Convert.ToInt32(indexid);
426
+                        }
427
+                        catch
428
+                        { }
429
+                        try
430
+                        {
431
+                            model.F_QCScore = Convert.ToInt32(scoreinfo.Split(':')[1]);
432
+                            allscore += Convert.ToInt32(scoreinfo.Split(':')[1]);
433
+                        }
434
+                        catch
435
+                        { }
436
+                        new BLL.T_QC_IndexRes().Add(model);
407 437
                     }
408
-                    catch
409
-                    { }
410
-                    new BLL.T_QC_IndexRes().Update(model);
438
+                }
439
+
440
+                Model.T_Call_CallRecords_QC callmodel = new Model.T_Call_CallRecords_QC();
441
+                callmodel.CallRecordsId = Convert.ToInt32(id);
442
+                callmodel.F_QCState = 1;
443
+                callmodel.F_QCScore = allscore;
444
+                callmodel.F_QCUserId = CurrentUser.UserData.F_UserId;
445
+                callmodel.F_QCUserName = CurrentUser.UserData.F_UserName;
446
+                callmodel.F_QCTime = DateTime.Now;
447
+                callmodel.F_QCIsSelect = 0;
448
+                callmodel.F_QCRemark = "";
449
+                //callmodel.F_QCQuestion = question;
450
+                //callmodel.F_QCAdvise = advise;
451
+
452
+
453
+                dt.Clear();
454
+                dt.Dispose();
455
+
456
+                if (new BLL.T_Call_CallRecords_QC().UpdateQC(callmodel))
457
+                {
458
+                    return Success("保存成功");
411 459
                 }
412 460
                 else
413 461
                 {
414
-                    Model.T_QC_IndexRes model = new Model.T_QC_IndexRes();
415
-                    model.CallRecordsId = Convert.ToInt32(id);
416
-                    try
417
-                    {
418
-                        model.F_IndexId = Convert.ToInt32(indexid);
419
-                    }
420
-                    catch
421
-                    { }
422
-                    try
423
-                    {
424
-                        model.F_QCScore = Convert.ToInt32(scoreinfo.Split(':')[1]);
425
-                        allscore += Convert.ToInt32(scoreinfo.Split(':')[1]);
426
-                    }
427
-                    catch
428
-                    { }
429
-                    new BLL.T_QC_IndexRes().Add(model);
462
+                    return Error("保存质检评分信息失败");
430 463
                 }
431
-            }
432 464
 
433
-            Model.T_Call_CallRecords_QC callmodel = new Model.T_Call_CallRecords_QC();
434
-            callmodel.CallRecordsId = Convert.ToInt32(id);
435
-            callmodel.F_QCState = 1;
436
-            callmodel.F_QCScore = allscore;
437
-            callmodel.F_QCUserId = CurrentUser.UserData.F_UserId;
438
-            callmodel.F_QCUserName = CurrentUser.UserData.F_UserName;
439
-            callmodel.F_QCTime = DateTime.Now;
440
-            callmodel.F_QCIsSelect = 0;
441
-            callmodel.F_QCRemark = "";
442
-            //callmodel.F_QCQuestion = question;
443
-            //callmodel.F_QCAdvise = advise;
444
-            if (new BLL.T_Call_CallRecords_QC().UpdateQC(callmodel))
445
-            {
446
-                res = Success("保存成功");
447
-            }
448
-            else
449
-            {
450
-                res = Error("保存质检评分信息失败");
451
-            }
452 465
 
453
-            dt.Clear();
454
-            dt.Dispose();
455
-
456
-            return res;
466
+            }
467
+            return NoToken("未知错误,请重新登录");
457 468
         }
458 469
 
459 470
         //添加日志
460 471
         public ActionResult AddLogs()
461 472
         {
462
-            ActionResult res = NoToken("未知错误,请重新登录");
473
+            if (Request.IsAuthenticated)
474
+            {
463 475
 
464
-            string id = HttpUtility.UrlDecode(RequestString.GetQueryString("id"));
465
-            //string optid = HttpUtility.UrlDecode(RequestString.GetQueryString("optid"));
466
-            //string optby = HttpUtility.UrlDecode(RequestString.GetQueryString("optby"));
467
-            string type = HttpUtility.UrlDecode(RequestString.GetQueryString("type"));
476
+                string id = HttpUtility.UrlDecode(RequestString.GetQueryString("id"));
477
+                //string optid = HttpUtility.UrlDecode(RequestString.GetQueryString("optid"));
478
+                //string optby = HttpUtility.UrlDecode(RequestString.GetQueryString("optby"));
479
+                string type = HttpUtility.UrlDecode(RequestString.GetQueryString("type"));
468 480
 
469
-            bool r = addldlog(int.Parse(id), CurrentUser.UserData.F_UserId, CurrentUser.UserData.F_UserName, int.Parse(type));
470
-            if (r)
471
-            {
472
-                res = Success("添加日志成功");
473
-            }
474
-            else
475
-            {
476
-                res = Error("添加日志失败");
481
+                bool r = addldlog(int.Parse(id), CurrentUser.UserData.F_UserId, CurrentUser.UserData.F_UserName, int.Parse(type));
482
+                if (r)
483
+                {
484
+                    return Success("添加日志成功");
485
+                }
486
+                else
487
+                {
488
+                    return Error("添加日志失败");
489
+                }
477 490
             }
478
-
479
-            return res;
491
+            return NoToken("未知错误,请重新登录");
480 492
         }
481 493
         private bool addldlog(int id, int optid, string optby, int type)
482 494
         {
483
-            bool res = false;
484
-            try
485
-            {
486
-                Model.T_Call_CallRecordsLD ldmodel = new Model.T_Call_CallRecordsLD();
487
-                ldmodel.F_CallRecordsID = id;
488
-                if (type == 0)
489
-                    ldmodel.F_IsListen = true;
490
-                else if (type == 1)
491
-                    ldmodel.F_IsDownload = true;
492
-                ldmodel.F_OptID = optid;
493
-                ldmodel.F_OptBy = optby;
494
-                ldmodel.F_OptDate = DateTime.Now;
495
-                res = new BLL.T_Call_CallRecordsLD().Add(ldmodel) > 1;
496
-            }
497
-            catch (Exception ex)
498
-            {
499
-            }
500
-            return res;
495
+            Model.T_Call_CallRecordsLD ldmodel = new Model.T_Call_CallRecordsLD();
496
+            ldmodel.F_CallRecordsID = id;
497
+            if (type == 0)
498
+                ldmodel.F_IsListen = true;
499
+            else if (type == 1)
500
+                ldmodel.F_IsDownload = true;
501
+            ldmodel.F_OptID = optid;
502
+            ldmodel.F_OptBy = optby;
503
+            ldmodel.F_OptDate = DateTime.Now;
504
+            return new BLL.T_Call_CallRecordsLD().Add(ldmodel) > 1;
501 505
         }
502 506
 
503 507
     }

+ 4 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/BusinessController.cs

@@ -19,6 +19,9 @@ namespace CallCenterApi.Interface.Controllers.report
19 19
         /// <returns></returns>
20 20
         public ActionResult GetSeatSourceReport(string sdate, string edate, int isdc = 0)
21 21
         {
22
+            int userId = CurrentUser.UserData.F_UserId;
23
+            Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
24
+
22 25
             DateTime stime = DateTime.Now;
23 26
             DateTime etime = DateTime.Now;
24 27
 
@@ -37,6 +40,7 @@ namespace CallCenterApi.Interface.Controllers.report
37 40
             Dictionary<string, string> paras = new Dictionary<string, string>();
38 41
             paras.Add("@sdate", stime.ToString("yyyy-MM-dd"));
39 42
             paras.Add("@edate", etime.ToString("yyyy-MM-dd"));
43
+            paras.Add("@groupcode", userModel.groupcode);
40 44
             var obj = DbHelperSQL.RunProcedure("P_SeatSourceReport", paras, "SeatSourceReport");
41 45
             if (isdc > 0)
42 46
             {

+ 26 - 33
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/DutyPhoneController.cs

@@ -18,13 +18,20 @@ namespace CallCenterApi.Interface.Controllers.tel
18 18
             ActionResult res = NoToken("未知错误,请重新登录");
19 19
             if (Request.IsAuthenticated)
20 20
             {
21
+                int userId = CurrentUser.UserData.F_UserId;
22
+                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
23
+
21 24
                 string sql = "";
22 25
                 DataTable dt = new DataTable();
23 26
 
27
+                if (!string.IsNullOrEmpty(userModel.groupcode))
28
+                {
29
+                    sql += " and F_GroupCode = '" + userModel.groupcode + "' ";
30
+                }
31
+
24 32
                 string strtelnum = HttpUtility.UrlDecode(RequestString.GetQueryString("telnum"));
25 33
                 string strbtime = HttpUtility.UrlDecode(RequestString.GetQueryString("btime"));
26 34
                 string stretime = HttpUtility.UrlDecode(RequestString.GetQueryString("etime"));
27
-                int zxzid = RequestString.GetQueryInt("zxzid", 0);
28 35
 
29 36
                 string strpageindex = RequestString.GetQueryString("page");
30 37
                 int pageindex = 1;
@@ -43,10 +50,6 @@ namespace CallCenterApi.Interface.Controllers.tel
43 50
                 {
44 51
                     sql += " and T_Call_ZBDH.F_CreateTime <= '" + Convert.ToDateTime(stretime.Trim() + " 23:59:59") + "' ";
45 52
                 }
46
-                if (zxzid != 0)
47
-                {
48
-                    sql += " and F_Groupid=" + zxzid;
49
-                }
50 53
 
51 54
                 if (strpageindex.Trim() != "")
52 55
                 {
@@ -59,11 +62,11 @@ namespace CallCenterApi.Interface.Controllers.tel
59 62
                 }
60 63
                 int recordCount = 0;
61 64
                 dt = BLL.PagerBLL.GetListPager(
62
-               "T_Call_ZBDH left join T_Sys_SeatGroup on T_Call_ZBDH.F_Groupid=T_Sys_SeatGroup.F_ZXZID",
63
-               "F_ZBID",
64
-               "T_Call_ZBDH.*,T_Sys_SeatGroup.F_ZXZName",
65
+               "T_Call_ZBDH",
66
+               "F_ID",
67
+               "*",
65 68
                sql,
66
-               "ORDER BY F_ZBID desc",
69
+               "ORDER BY F_ID desc",
67 70
                pagesize,
68 71
                pageindex,
69 72
                true,
@@ -86,40 +89,38 @@ namespace CallCenterApi.Interface.Controllers.tel
86 89
         //获取值班电话
87 90
         public ActionResult GetDutyPhone(string zbid)
88 91
         {
89
-            ActionResult res = NoToken("未知错误,请重新登录");
90 92
             if (Request.IsAuthenticated)
91 93
             {
92
-
93 94
                 if (zbid != null && zbid.Trim() != "")
94 95
                 {
95 96
                     BLL.T_Call_ZBDH dBLL = new BLL.T_Call_ZBDH();
96 97
                     Model.T_Call_ZBDH dModel = dBLL.GetModel(int.Parse(zbid.Trim()));
97 98
                     if (dModel != null)
98 99
                     {
99
-                        res = Success("获取值班电话成功", dModel);
100
+                        return Success("获取值班电话成功", dModel);
100 101
                     }
101 102
                     else
102 103
                     {
103
-                        res = Error("获取值班电话失败");
104
+                        return Error("获取值班电话失败");
104 105
                     }
105 106
                 }
106 107
                 else
107 108
                 {
108
-                    res = Error("获取参数失败");
109
+                    return Error("获取参数失败");
109 110
                 }
110 111
 
111 112
             }
112
-            return res;
113
+            return NoToken("未知错误,请重新登录");
113 114
         }
114 115
 
115 116
         //添加值班电话
116
-        public ActionResult AddDutyPhone(string zbid, string telphone, string des, string groupid)
117
+        public ActionResult AddDutyPhone(string zbid, string telphone, string des)
117 118
         {
118
-            ActionResult res = NoToken("未知错误,请重新登录");
119 119
             if (Request.IsAuthenticated)
120 120
             {
121
+                int userId = CurrentUser.UserData.F_UserId;
122
+                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
121 123
 
122
-                res = Error("操作失败");
123 124
                 if (zbid != null && zbid.Trim() != "")
124 125
                 {
125 126
                     BLL.T_Call_ZBDH dBLL = new BLL.T_Call_ZBDH();
@@ -128,19 +129,15 @@ namespace CallCenterApi.Interface.Controllers.tel
128 129
                     {
129 130
                         dModel.F_ZBDH = telphone.Trim();
130 131
                         dModel.F_Remark = des.Trim();
131
-                        var gid = int.Parse(groupid.Trim());
132
-                        dModel.F_Groupid = gid;
133
-                        var gname = new BLL.T_Sys_SeatGroup().GetModel(gid) == null ? "" : new BLL.T_Sys_SeatGroup().GetModel(gid).F_ZXZName;
134
-                        dModel.F_GroupName = gname;
135 132
 
136 133
                         bool b = dBLL.Update(dModel);
137 134
                         if (b)
138 135
                         {
139
-                            res = Success("编辑成功");
136
+                            return Success("编辑成功");
140 137
                         }
141 138
                         else
142 139
                         {
143
-                            res = Error("编辑失败");
140
+                            return Error("编辑失败");
144 141
                         }
145 142
                     }
146 143
                 }
@@ -150,27 +147,23 @@ namespace CallCenterApi.Interface.Controllers.tel
150 147
 
151 148
                     dModel.F_ZBDH = telphone.Trim();
152 149
                     dModel.F_Remark = des.Trim();
153
-                    dModel.F_CreateBy = CurrentUser.UserData.F_UserName;
154
-                    dModel.F_CreateID = CurrentUser.UserData.F_UserId;
150
+                    dModel.F_CreateUser = userModel.F_UserCode;
155 151
                     dModel.F_CreateTime = DateTime.Now;
156
-                    var gid = int.Parse(groupid.Trim());
157
-                    dModel.F_Groupid = gid;
158
-                    var gname = new BLL.T_Sys_SeatGroup().GetModel(gid).F_ZXZName;
159
-                    dModel.F_GroupName = gname;
152
+                    dModel.F_GroupCode = userModel.groupcode;
160 153
 
161 154
                     int b = new BLL.T_Call_ZBDH().Add(dModel);
162 155
                     if (b > 0)
163 156
                     {
164
-                        res = Success("添加成功");
157
+                        return Success("添加成功");
165 158
                     }
166 159
                     else
167 160
                     {
168
-                        res = Error("添加失败");
161
+                        return Error("添加失败");
169 162
                     }
170 163
                 }
171 164
 
172 165
             }
173
-            return res;
166
+            return NoToken("未知错误,请重新登录");
174 167
         }
175 168
 
176 169
         //删除值班电话

+ 9 - 10
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/SeatMonitoringController.cs

@@ -17,9 +17,11 @@ namespace CallCenterApi.Interface.Controllers.tel
17 17
         /// <returns></returns>
18 18
         public ActionResult GetList()
19 19
         {
20
-            ActionResult res = NoToken("未知错误,请重新登录");
21 20
             if (Request.IsAuthenticated)
22 21
             {
22
+                int userId = CurrentUser.UserData.F_UserId;
23
+                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
24
+
23 25
                 DataTable dt = new DataTable();
24 26
                 int deptid = CurrentUser.UserData.F_DeptId;
25 27
                 int roleid = CurrentUser.UserData.F_RoleId;
@@ -30,19 +32,16 @@ namespace CallCenterApi.Interface.Controllers.tel
30 32
                 {
31 33
                     sql = " and F_DeptId=" + deptid;
32 34
                 }
35
+                if (userModel.F_SeartGroupID!=0)
36
+                {
37
+                    sql += " and F_SeartGroupID = '" + userModel.F_SeartGroupID + "' ";
38
+                }
33 39
 
34 40
                 dt = bll.GetList(" f_seatflag=1 and F_DeleteFlag=0 " + sql + " order by f_userid desc ").Tables[0];
35 41
 
36
-                if (dt.Rows.Count > 0)
37
-                {
38
-                    res = Success("坐席列表加载成功", dt);
39
-                }
40
-                else
41
-                {
42
-                    res = Error("坐席列表加载失败");
43
-                }
42
+                return Success("坐席列表加载成功", dt);
44 43
             }
45
-            return res;
44
+            return NoToken("未知错误,请重新登录");
46 45
         }
47 46
     }
48 47
 }

+ 17 - 48
codegit/CallCenterApi/CallCenterApi.Model/T_Call_ZBDH.cs

@@ -1,36 +1,28 @@
1 1
 using System;
2
-using System.Collections.Generic;
3
-using System.Linq;
4
-using System.Text;
5
-using System.Threading.Tasks;
6
-
7 2
 namespace CallCenterApi.Model
8 3
 {
9 4
     /// <summary>
10
-	/// T_Call_ZBDH:实体类(属性说明自动提取数据库字段的描述信息)
11
-	/// </summary>
12
-	[Serializable]
5
+    /// T_Call_ZBDH:实体类(属性说明自动提取数据库字段的描述信息)
6
+    /// </summary>
7
+    [Serializable]
13 8
     public partial class T_Call_ZBDH
14 9
     {
15 10
         public T_Call_ZBDH()
16 11
         { }
17 12
         #region Model
18
-        private int _f_zbid;
13
+        private int _f_id;
19 14
         private string _f_zbdh;
20
-        private string _f_groupname;
21
-        private int? _f_groupid;
15
+        private string _f_groupcode;
22 16
         private string _f_remark;
23
-        private DateTime? _f_callintime;
24
-        private string _f_createby;
17
+        private string _f_createuser;
25 18
         private DateTime? _f_createtime;
26
-        private int? _f_createid;
27 19
         /// <summary>
28 20
         /// 
29 21
         /// </summary>
30
-        public int F_ZBID
22
+        public int F_ID
31 23
         {
32
-            set { _f_zbid = value; }
33
-            get { return _f_zbid; }
24
+            set { _f_id = value; }
25
+            get { return _f_id; }
34 26
         }
35 27
         /// <summary>
36 28
         /// 值班电话
@@ -43,18 +35,10 @@ namespace CallCenterApi.Model
43 35
         /// <summary>
44 36
         /// 组别
45 37
         /// </summary>
46
-        public string F_GroupName
47
-        {
48
-            set { _f_groupname = value; }
49
-            get { return _f_groupname; }
50
-        }
51
-        /// <summary>
52
-        /// 组别
53
-        /// </summary>
54
-        public int? F_Groupid
38
+        public string F_GroupCode
55 39
         {
56
-            set { _f_groupid = value; }
57
-            get { return _f_groupid; }
40
+            set { _f_groupcode = value; }
41
+            get { return _f_groupcode; }
58 42
         }
59 43
         /// <summary>
60 44
         /// 备注
@@ -65,20 +49,12 @@ namespace CallCenterApi.Model
65 49
             get { return _f_remark; }
66 50
         }
67 51
         /// <summary>
68
-        /// 最后呼入时间
69
-        /// </summary>
70
-        public DateTime? F_CallinTime
71
-        {
72
-            set { _f_callintime = value; }
73
-            get { return _f_callintime; }
74
-        }
75
-        /// <summary>
76 52
         /// 
77 53
         /// </summary>
78
-        public string F_CreateBy
54
+        public string F_CreateUser
79 55
         {
80
-            set { _f_createby = value; }
81
-            get { return _f_createby; }
56
+            set { _f_createuser = value; }
57
+            get { return _f_createuser; }
82 58
         }
83 59
         /// <summary>
84 60
         /// 
@@ -88,15 +64,8 @@ namespace CallCenterApi.Model
88 64
             set { _f_createtime = value; }
89 65
             get { return _f_createtime; }
90 66
         }
91
-        /// <summary>
92
-        /// 
93
-        /// </summary>
94
-        public int? F_CreateID
95
-        {
96
-            set { _f_createid = value; }
97
-            get { return _f_createid; }
98
-        }
99 67
         #endregion Model
100 68
 
101 69
     }
102
-}
70
+}
71
+