|
|
@@ -150,8 +150,7 @@ namespace CallCenterApi.Interface.Controllers
|
|
150
|
150
|
|
|
151
|
151
|
if (userModel != null)
|
|
152
|
152
|
{
|
|
153
|
|
- if (userModel.F_RoleId == 51 || userModel.F_RoleId == 52)
|
|
154
|
|
- filter.dptid = userModel.F_DeptId;
|
|
|
153
|
+ filter.dptid = userModel.F_DeptId;
|
|
155
|
154
|
}
|
|
156
|
155
|
if (filter.dptid > 0)
|
|
157
|
156
|
{
|
|
|
@@ -257,8 +256,17 @@ namespace CallCenterApi.Interface.Controllers
|
|
257
|
256
|
//}
|
|
258
|
257
|
if (userModel != null)
|
|
259
|
258
|
{
|
|
260
|
|
- if (userModel.F_RoleId == 51|| userModel.F_RoleId == 52)
|
|
261
|
|
- filter.dptid= userModel.F_DeptId;
|
|
|
259
|
+ Model.T_Sys_Department deptModel = new BLL.T_Sys_Department().GetModel(filter.dptid);
|
|
|
260
|
+ if (deptModel != null)
|
|
|
261
|
+ {
|
|
|
262
|
+ if (userModel.F_RoleId != 1 || userModel.F_RoleId != 4 || userModel.F_RoleId != 17
|
|
|
263
|
+ || userModel.F_RoleId != 50 || userModel.F_RoleId != 67)
|
|
|
264
|
+ sql += " and F_DeptId in ( select F_DeptId from T_Sys_Department where F_DeptCode like '%" + deptModel.F_DeptCode + "%') ";
|
|
|
265
|
+ }
|
|
|
266
|
+ else
|
|
|
267
|
+ {
|
|
|
268
|
+ filter.dptid = userModel.F_DeptId;
|
|
|
269
|
+ }
|
|
262
|
270
|
}
|
|
263
|
271
|
if (filter.dptid > 0)
|
|
264
|
272
|
{
|
|
|
@@ -428,11 +436,20 @@ namespace CallCenterApi.Interface.Controllers
|
|
428
|
436
|
{
|
|
429
|
437
|
if (Request.IsAuthenticated)
|
|
430
|
438
|
{
|
|
|
439
|
+ int userId = CurrentUser.UserData.F_UserId;
|
|
|
440
|
+ Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
|
|
|
441
|
+ if (userModel.F_RoleId ==53)
|
|
|
442
|
+ {
|
|
|
443
|
+ return Error("无操作权限");
|
|
|
444
|
+ }
|
|
431
|
445
|
|
|
432
|
446
|
Model.T_Sys_UserAccount userAccountModel = new Model.T_Sys_UserAccount();
|
|
433
|
447
|
//员工工号不能重复
|
|
434
|
|
-
|
|
435
|
|
-
|
|
|
448
|
+ var user = new BLL.T_Sys_UserAccount().GetModelList("F_UserName='" + input.Username + "' and F_Mobile='" + input.Mobile + "'");
|
|
|
449
|
+ if (user.Count >0)
|
|
|
450
|
+ {
|
|
|
451
|
+ return Error("已存在该账号!");
|
|
|
452
|
+ }
|
|
436
|
453
|
if (!string.IsNullOrEmpty(input.Usercode))
|
|
437
|
454
|
{
|
|
438
|
455
|
string ucode = input.Usercode.Trim();
|
|
|
@@ -465,7 +482,7 @@ namespace CallCenterApi.Interface.Controllers
|
|
465
|
482
|
if (input.RoleId != 0)
|
|
466
|
483
|
{
|
|
467
|
484
|
userAccountModel.F_RoleId = input.RoleId;
|
|
468
|
|
- if (input.RoleId==17|| input.RoleId == 50|| input.RoleId == 49 || input.RoleId == 65)
|
|
|
485
|
+ if (input.RoleId==17|| input.RoleId == 50|| input.RoleId == 49 || input.RoleId == 65 || input.RoleId == 66 || input.RoleId == 67)
|
|
469
|
486
|
{
|
|
470
|
487
|
userAccountModel.F_See = "0";
|
|
471
|
488
|
}
|
|
|
@@ -481,10 +498,7 @@ namespace CallCenterApi.Interface.Controllers
|
|
481
|
498
|
{
|
|
482
|
499
|
userAccountModel.F_See = "3";
|
|
483
|
500
|
}
|
|
484
|
|
- else if (input.RoleId==66)
|
|
485
|
|
- {
|
|
486
|
|
- userAccountModel.F_See = "4";
|
|
487
|
|
- }
|
|
|
501
|
+
|
|
488
|
502
|
}
|
|
489
|
503
|
|
|
490
|
504
|
|
|
|
@@ -558,6 +572,12 @@ namespace CallCenterApi.Interface.Controllers
|
|
558
|
572
|
{
|
|
559
|
573
|
if (Request.IsAuthenticated)
|
|
560
|
574
|
{
|
|
|
575
|
+ int userId = CurrentUser.UserData.F_UserId;
|
|
|
576
|
+ Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
|
|
|
577
|
+ if (userModel.F_RoleId == 53)
|
|
|
578
|
+ {
|
|
|
579
|
+ return Error("无操作权限");
|
|
|
580
|
+ }
|
|
561
|
581
|
BLL.T_Sys_UserAccount sysUserAccountBll = new BLL.T_Sys_UserAccount();
|
|
562
|
582
|
Model.T_Sys_UserAccount userAccountModel = sysUserAccountBll.GetModelList(" F_UserId = " + input.UserId).FirstOrDefault();
|
|
563
|
583
|
if (userAccountModel == null)
|
|
|
@@ -590,7 +610,7 @@ namespace CallCenterApi.Interface.Controllers
|
|
590
|
610
|
if (input.RoleId != 0)
|
|
591
|
611
|
{
|
|
592
|
612
|
userAccountModel.F_RoleId = input.RoleId;
|
|
593
|
|
- if (input.RoleId == 17 || input.RoleId == 50 || input.RoleId == 49 || input.RoleId == 65)
|
|
|
613
|
+ if (input.RoleId == 17 || input.RoleId == 50 || input.RoleId == 49 || input.RoleId == 65|| input.RoleId == 66 || input.RoleId == 67)
|
|
594
|
614
|
{
|
|
595
|
615
|
userAccountModel.F_See = "0";
|
|
596
|
616
|
}
|
|
|
@@ -606,10 +626,7 @@ namespace CallCenterApi.Interface.Controllers
|
|
606
|
626
|
{
|
|
607
|
627
|
userAccountModel.F_See = "3";
|
|
608
|
628
|
}
|
|
609
|
|
- else if (input.RoleId == 66)
|
|
610
|
|
- {
|
|
611
|
|
- userAccountModel.F_See = "4";
|
|
612
|
|
- }
|
|
|
629
|
+
|
|
613
|
630
|
}
|
|
614
|
631
|
if (input.Pid!=0)
|
|
615
|
632
|
userAccountModel.F_PId = input.Pid;
|