liyuanyuan %!s(int64=3) %!d(string=hace) años
padre
commit
fc452b7233

+ 4 - 4
RMYY_CallCenter_Api.Model/T_Sys_Department.cs

@@ -25,12 +25,12 @@ namespace RMYY_CallCenter_Api.Model
25 25
         private string _f_floordistribution;
26 26
         private string _f_officetelephone;
27 27
 
28
-        private int _f_transfertype = 0;
29
-        
28
+        private int? _f_transfertype = 0;
29
+
30 30
         /// <summary>
31
-        /// 0是转值班 1 是转组长
31
+        /// 0 是转值班 1 是转组长  默认0
32 32
         /// </summary>
33
-        public int F_TransferType
33
+        public int? F_TransferType
34 34
         {
35 35
             set { _f_transfertype = value; }
36 36
             get { return _f_transfertype; }

+ 22 - 6
RMYY_CallCenter_Api/Common/WorkOrderBase.cs

@@ -264,7 +264,7 @@ namespace RMYY_CallCenter_Api
264 264
         /// </summary>
265 265
         /// <param name="dt"></param>
266 266
         /// <returns></returns>
267
-        public static DataTable SetOtherField(DataTable dt, MENUENUM menuName,string usercode, int roleId = 0, int type = 0,int mysubmit=0,int workuser=0)//报修列表是值班人员workuser传1,
267
+        public static DataTable SetOtherField(DataTable dt, MENUENUM menuName,string usercode, int roleId = 0, int type = 0,int mysubmit=0,int workuser=0,int transfertype=0)//报修列表是值班人员workuser传1,  // transfertype 0 是转值班 1 是转组长 默认0
268 268
         {
269 269
             if (dt.Columns.Contains("Buttons") && dt.Columns.Contains("GapTime") && dt.Columns.Contains("StateName"))
270 270
             {
@@ -495,20 +495,36 @@ namespace RMYY_CallCenter_Api
495 495
 
496 496
                 #endregion
497 497
 
498
-                //仅仅值班人员可以有这三个按钮
499
-                if (menuName == MENUENUM.报修列表 && workuser==0)
498
+                //仅仅值班人员或者组长可以有这三个按钮 workuser=0 不是值班人也不是组长
499
+                if (menuName == MENUENUM.报修列表 && workuser == 0)
500 500
                 {
501
+
501 502
                     var hasButton = allButtons.Where(p => p.value == "内协作").FirstOrDefault();
502 503
                     var hasButton1 = allButtons.Where(p => p.value == "外协作").FirstOrDefault();
503 504
                     var hasButton2 = allButtons.Where(p => p.value == "转部门").FirstOrDefault();
504 505
                     allButtons.Remove(hasButton);
505 506
                     allButtons.Remove(hasButton1);
506
-                    allButtons.Remove(hasButton2);
507
+                    allButtons.Remove(hasButton2);               
508
+
507 509
                 }
508 510
 
511
+                //转组长和转值班是互斥的按钮,根据部门类型设置的选项决定
512
+                if (menuName == MENUENUM.报修列表 )
513
+                {
514
+                    if (transfertype == 0)
515
+                    {
516
+                        var existButton = allButtons.Where(p => p.value == "转组长").FirstOrDefault();
517
+                        allButtons.Remove(existButton);
518
+                    }
519
+                    else
520
+                    {
521
+                        var existButton = allButtons.Where(p => p.value == "转值班").FirstOrDefault();
522
+                        allButtons.Remove(existButton);
523
+                    }
524
+                }
509 525
 
510
-                    // 工单管理  我的提交页面,数据有我的提交和我处理的, 只有自己申请的工单 能催单
511
-                    if (menuName== MENUENUM.我的提交 && mysubmit == 0)
526
+                // 工单管理  我的提交页面,数据有我的提交和我处理的, 只有自己申请的工单 能催单
527
+                if (menuName== MENUENUM.我的提交 && mysubmit == 0)
512 528
                 {
513 529
                     if (dr["F_Proposer"].ToString() != usercode)
514 530
                     {

+ 40 - 14
RMYY_CallCenter_Api/Controllers/FaultRepairController.cs

@@ -1502,7 +1502,7 @@ namespace RMYY_CallCenter_Api.Controllers
1502 1502
 
1503 1503
                     if (userzz != null && userzz.Count > 0)
1504 1504
                     {
1505
-                        //转同事
1505
+                       
1506 1506
                         model.F_Maintenancer = userzz.First().F_UserCode;
1507 1507
                         model.F_UpdateTime = DateTime.Now;
1508 1508
                         model.F_WorkOrderState = (int)EnumFaultRepairWorkOrderState.receive;
@@ -1660,30 +1660,56 @@ namespace RMYY_CallCenter_Api.Controllers
1660 1660
             string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
1661 1661
             string strworkcode = HttpUtility.UrlDecode(RequestString.GetQueryString("workordercode"));
1662 1662
 
1663
-            #region    今天值班人员可看到全部工单,其他人员看到个人工单
1663
+            //获取部门表中设置的,当前部门是转组长还是转值班
1664
+            //  0 是转值班 1 是转组长 默认0
1665
+            Model.T_Sys_Department depmodel = departmentBLL.GetModel(User.F_DeptId);
1666
+            int transfertype = 0;
1667
+            if (depmodel != null && depmodel.F_TransferType != null)
1668
+            {
1669
+                transfertype = depmodel.F_TransferType.Value;
1670
+            }
1671
+            #region  部门表中设置的转值班,值班人员 可看到部门工单; 设置转组长 ,组长可以看见部门工单;其他人员看到个人工单
1672
+
1664 1673
 
1665
-           List<T_Sys_GroupClass>  GroupClass= GetWorkUser(User.F_DeptId);
1666 1674
             int workuser = 0;
1675
+            if (transfertype == 0)
1676
+            {
1677
+                List<T_Sys_GroupClass> GroupClass = GetWorkUser(User.F_DeptId);
1678
+                if (GroupClass != null && GroupClass.Count > 0)
1679
+                {
1680
+                    var iszhibanrenyuan = GroupClass.Where(x => x.F_UserCode.Contains(User.F_UserCode)).ToList();
1667 1681
 
1668
-            if (GroupClass != null && GroupClass.Count > 0)
1669
-            {            
1670
-                var iszhibanrenyuan = GroupClass.Where(x => x.F_UserCode.Contains(User.F_UserCode)).ToList();
1682
+                    if (iszhibanrenyuan != null && iszhibanrenyuan.Count > 0)
1683
+                    {
1684
+                        workuser = 1;//当前登录人是值班人员
1685
+                        sql += " and F_MaintenanceDept='" + User.F_DeptId + "'";
1686
+                    }
1687
+                    else
1688
+                    {
1689
+                        sql += " and F_Maintenancer='" + User.F_UserCode + "'";
1671 1690
 
1672
-                if (iszhibanrenyuan!=null&& iszhibanrenyuan.Count>0)
1673
-                {
1674
-                    workuser = 1;//当前登录人是值班人员
1675
-                    sql += " and F_MaintenanceDept='" + User.F_DeptId + "'";
1691
+                    }
1676 1692
                 }
1677 1693
                 else
1678 1694
                 {
1679 1695
                     sql += " and F_Maintenancer='" + User.F_UserCode + "'";
1680
-                    
1696
+
1681 1697
                 }
1682 1698
             }
1699
+
1683 1700
             else
1684 1701
             {
1685
-                sql += " and F_Maintenancer='" + User.F_UserCode + "'";
1686
-
1702
+                //  判断当前登录人是不是组长角色               
1703
+                var user = new Bll.T_Sys_UserAccount().GetModelList(" F_UserCode='"+User.F_UserCode+ "' and F_RoleId in ( select F_RoleId from T_Sys_Role where F_RoleCode='WXBZZ' and F_State =1)");
1704
+                if (user!=null && user.Count>0)
1705
+                {
1706
+                    sql += " and F_MaintenanceDept='" + User.F_DeptId + "'";
1707
+                    workuser = 1;
1708
+                }
1709
+                else
1710
+                {
1711
+                    sql += " and F_Maintenancer='" + User.F_UserCode + "'";
1712
+                }
1687 1713
             }
1688 1714
             #endregion
1689 1715
 
@@ -1763,7 +1789,7 @@ namespace RMYY_CallCenter_Api.Controllers
1763 1789
                                             );
1764 1790
 
1765 1791
 
1766
-            datatable = WorkOrderBase.SetOtherField(datatable, MENUENUM.报修列表, User.F_UserCode, User.F_RoleId, 3000,0,workuser);
1792
+            datatable = WorkOrderBase.SetOtherField(datatable, MENUENUM.报修列表, User.F_UserCode, User.F_RoleId, 3000,0,workuser, transfertype);
1767 1793
 
1768 1794
             var obj = new
1769 1795
             {

+ 16 - 15
RMYY_CallCenter_Api/Controllers/System/DepartmentController.cs

@@ -18,17 +18,17 @@ namespace RMYY_CallCenter_Api.Controllers.System
18 18
         /// 获取列表
19 19
         /// </summary>
20 20
         /// <returns></returns>
21
-        public ActionResult GetList(string keyword,int hosid=0,int pid=0, int pageindex = 1, int pagesize = 10)
21
+        public ActionResult GetList(string keyword, int hosid = 0, int pid = 0, int pageindex = 1, int pagesize = 10)
22 22
         {
23 23
             DataTable date = new DataTable();
24 24
             string sql = "";
25 25
             string where = " and F_State=1";
26 26
             if (!string.IsNullOrEmpty(keyword))
27
-            sql += $" and F_DeptName like '%" + keyword + "%'";
28
-            if(pid!=0)
29
-            sql += $" and F_ParentId= "+pid;
27
+                sql += $" and F_DeptName like '%" + keyword + "%'";
28
+            if (pid != 0)
29
+                sql += $" and F_ParentId= " + pid;
30 30
             if (hosid != 0)
31
-            sql += $" and T_Woid="+hosid;
31
+                sql += $" and T_Woid=" + hosid;
32 32
             int recordCount = 0;
33 33
             if (!string.IsNullOrEmpty(sql))
34 34
             {
@@ -47,20 +47,21 @@ namespace RMYY_CallCenter_Api.Controllers.System
47 47
 
48 48
                                 );
49 49
             //  List<Model.T_Sys_Department> carlist = new Bll.T_Sys_Department().DataTableToList(date);
50
-                var obj = new
51
-                {
52
-                    state = "success",
53
-                    message = "成功",
54
-                    rows = date,
55
-                    total = recordCount
56
-                };
57
-                return Content(obj.ToJson());
50
+            var obj = new
51
+            {
52
+                state = "success",
53
+                message = "成功",
54
+                rows = date,
55
+                total = recordCount
56
+            };
57
+            return Content(obj.ToJson());
58 58
         }
59 59
 
60 60
         /// <summary>
61 61
         /// 返回树形下拉框 菜单数据
62 62
         /// </summary>
63 63
         /// <returns></returns>
64
+   
64 65
         [HttpGet]
65 66
         public ActionResult GetTreeList(int hosid=0,int pid=0)
66 67
         {
@@ -164,7 +165,7 @@ namespace RMYY_CallCenter_Api.Controllers.System
164 165
         /// <param name="sort"></param>
165 166
         /// <returns></returns>
166 167
         [HttpPost]
167
-        public ActionResult Insert(int pid, string code, string name,int hosid, string location, string floorDistribution, string officeTelephone, int sort=0,int transfertype=0)
168
+        public ActionResult Add(int pid, string code, string name,int hosid, string location, string floorDistribution, string officeTelephone, int sort=0,int transfertype=0)
168 169
         {
169 170
             if (departmentBLL.Exists(code))
170 171
             {
@@ -208,7 +209,7 @@ namespace RMYY_CallCenter_Api.Controllers.System
208 209
         /// <param name="sort"></param>
209 210
         /// <returns></returns>
210 211
         [HttpPost]
211
-        public ActionResult Update(int id, int pid, string code, string name, int sort,int hosid,string location,string floorDistribution,string officeTelephone,int transfertype=0)
212
+        public ActionResult Edit(int id, int pid, string code, string name, int sort,int hosid,string location,string floorDistribution,string officeTelephone,int transfertype=0)
212 213
         {
213 214
             Model.T_Sys_Department dModel = departmentBLL.GetModel(id);
214 215
             if (dModel != null)

+ 2 - 2
RMYY_CallCenter_Api/Controllers/System/MenuController.cs

@@ -168,7 +168,7 @@ namespace RMYY_CallCenter_Api.Controllers.System
168 168
         /// <param name="sort"></param>
169 169
         /// <returns></returns>
170 170
         [HttpPost]
171
-        public ActionResult Insert(int pid, string code, string name, int sort, int type, string url, string function,string icon,string remark,int menutype=0, int state = 1, string workState = "")
171
+        public ActionResult Add(int pid, string code, string name, int sort, int type, string url, string function,string icon,string remark,int menutype=0, int state = 1, string workState = "")
172 172
         {
173 173
             if (menuBLL.Exists(code))
174 174
             {
@@ -213,7 +213,7 @@ namespace RMYY_CallCenter_Api.Controllers.System
213 213
         /// <param name="sort"></param>
214 214
         /// <returns></returns>
215 215
         [HttpPost]
216
-        public ActionResult Update(int id, int pid, string code, string name, int sort, int type, string url, string function, string icon,string remark, int menutype=0, int state=1, string workState = "")
216
+        public ActionResult Edit(int id, int pid, string code, string name, int sort, int type, string url, string function, string icon,string remark, int menutype=0, int state=1, string workState = "")
217 217
         {
218 218
             Model.T_Sys_Menu dModel = menuBLL.GetModel(id);
219 219
             if (dModel != null)

+ 2 - 2
RMYY_CallCenter_Api/Controllers/System/RoleController.cs

@@ -84,7 +84,7 @@ namespace RMYY_CallCenter_Api.Controllers.System
84 84
         /// <param name="sort"></param>
85 85
         /// <returns></returns>
86 86
         [HttpPost]
87
-        public ActionResult Insert(string code, string name, int? sort=0)
87
+        public ActionResult Add(string code, string name, int? sort=0)
88 88
         {
89 89
             if (roleBLL.Exists(code))
90 90
             {
@@ -121,7 +121,7 @@ namespace RMYY_CallCenter_Api.Controllers.System
121 121
         /// <param name="sort"></param>
122 122
         /// <returns></returns>
123 123
         [HttpPost]
124
-        public ActionResult Update(int id, string code, string name, int sort)
124
+        public ActionResult  Edit(int id, string code, string name, int sort)
125 125
         {
126 126
             Model.T_Sys_Role dModel = roleBLL.GetModel(id);
127 127
             if (dModel != null)