Pārlūkot izejas kodu

坐席批量修改坐席组,坐席组调整

zhengbingbing 8 gadi atpakaļ
vecāks
revīzija
9d49c9d11c

+ 11 - 1
codegit/CallCenterApi/CallCenterApi.BLL/T_Sys_UserAccount.cs

228
         }
228
         }
229
         #endregion  BasicMethod
229
         #endregion  BasicMethod
230
         #region  ExtensionMethod
230
         #region  ExtensionMethod
231
-
231
+        /// <summary>
232
+        /// 批量修改坐席的坐席组
233
+        /// </summary>
234
+        /// <param name="ids">坐席ID</param>
235
+        /// <param name="sgid">坐席组ID</param>
236
+        /// <param name="sgname">坐席组名称</param>
237
+        /// <returns></returns>
238
+        public bool UpdateSeatGroup(string ids, string sgid, string sgname)
239
+        {
240
+            return dal.UpdateSeatGroup(ids, sgid, sgname);
241
+        }
232
         #endregion  ExtensionMethod
242
         #endregion  ExtensionMethod
233
     }
243
     }
234
 }
244
 }

+ 26 - 3
codegit/CallCenterApi/CallCenterApi.DAL/T_Sys_UserAccount.cs

323
         /// <summary>
323
         /// <summary>
324
         /// 登录得到一个对象实体
324
         /// 登录得到一个对象实体
325
         /// </summary>
325
         /// </summary>
326
-        public Model.T_Sys_UserAccount LoginGetModel(string F_UserCode,string F_Password)
326
+        public Model.T_Sys_UserAccount LoginGetModel(string F_UserCode, string F_Password)
327
         {
327
         {
328
 
328
 
329
             StringBuilder strSql = new StringBuilder();
329
             StringBuilder strSql = new StringBuilder();
400
             }
400
             }
401
         }
401
         }
402
 
402
 
403
-       
404
-      
403
+
404
+
405
 
405
 
406
         /// <summary>
406
         /// <summary>
407
         /// 得到一个对象实体
407
         /// 得到一个对象实体
726
         #endregion  BasicMethod
726
         #endregion  BasicMethod
727
         #region  ExtensionMethod
727
         #region  ExtensionMethod
728
 
728
 
729
+        /// <summary>
730
+        /// 批量修改坐席的坐席组
731
+        /// </summary>
732
+        /// <param name="ids">坐席ID</param>
733
+        /// <param name="sgid">坐席组ID</param>
734
+        /// <param name="sgname">坐席组名称</param>
735
+        /// <returns></returns>
736
+        public bool UpdateSeatGroup(string ids,string sgid,string sgname)
737
+        {
738
+            StringBuilder strSql = new StringBuilder();
739
+            strSql.Append("update T_Sys_UserAccount set ");
740
+            strSql.Append(" F_SeartGroupID=" + sgid + ", F_SeartGroup='" + sgname + "' ");
741
+            strSql.Append(" where F_UserId in (" + ids + ")");
742
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
743
+            if (rows > 0)
744
+            {
745
+                return true;
746
+            }
747
+            else
748
+            {
749
+                return false;
750
+            }
751
+        }
729
         #endregion  ExtensionMethod
752
         #endregion  ExtensionMethod
730
     }
753
     }
731
 }
754
 }

+ 167 - 162
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/SeatGroupController.cs

20
         /// <returns></returns>
20
         /// <returns></returns>
21
         public ActionResult GetList()
21
         public ActionResult GetList()
22
         {
22
         {
23
-            ActionResult res = NoToken("未知错误,请重新登录");
24
-            
25
-                DataTable dt = new DataTable();
26
-                string strpageindex = RequestString.GetQueryString("page");
27
-                int pageindex = 1;
28
-                string strpagesize = RequestString.GetQueryString("pagesize");
29
-                int pagesize = 10;
23
+            DataTable dt = new DataTable();
24
+            string strpageindex = RequestString.GetQueryString("page");
25
+            int pageindex = 1;
26
+            string strpagesize = RequestString.GetQueryString("pagesize");
27
+            int pagesize = 10;
30
             string strcontent = RequestString.GetQueryString("content");
28
             string strcontent = RequestString.GetQueryString("content");
31
-            
29
+
32
             string sql = "";
30
             string sql = "";
33
-            if (strcontent!=null&&strcontent != "")
31
+            if (strcontent != null && strcontent != "")
34
             {
32
             {
35
                 sql = " and( F_ZXZCode like '" + strcontent + "' or F_ZXZName  like '" + strcontent + "'  or F_WHBDKey like '" + strcontent + "%'  or F_WHWDKey  like '" + strcontent + "%'  or F_ZXAtt like '" + strcontent + "'  or F_Des like '" + strcontent + "')";
33
                 sql = " and( F_ZXZCode like '" + strcontent + "' or F_ZXZName  like '" + strcontent + "'  or F_WHBDKey like '" + strcontent + "%'  or F_WHWDKey  like '" + strcontent + "%'  or F_ZXAtt like '" + strcontent + "'  or F_Des like '" + strcontent + "')";
36
             }
34
             }
37
-                if (strpageindex.Trim() != "")
38
-                {
39
-                    pageindex = Convert.ToInt32(strpageindex);
40
-                }
35
+            if (strpageindex.Trim() != "")
36
+            {
37
+                pageindex = Convert.ToInt32(strpageindex);
38
+            }
41
 
39
 
42
-                if (strpagesize.Trim() != "")
43
-                {
44
-                    pagesize = Convert.ToInt32(strpagesize);
45
-                }
46
-                int recordCount = 0;
47
-                dt = BLL.PagerBLL.GetListPager(
48
-                    "T_Sys_SeatGroup",
49
-                    "F_ZXZID",
50
-                    "*",
51
-                    sql,
52
-                    "ORDER BY F_ZXZID desc",
53
-                    pagesize,
54
-                    pageindex,
55
-                    true,
56
-                    out recordCount);
40
+            if (strpagesize.Trim() != "")
41
+            {
42
+                pagesize = Convert.ToInt32(strpagesize);
43
+            }
44
+            int recordCount = 0;
45
+            dt = BLL.PagerBLL.GetListPager(
46
+                "T_Sys_SeatGroup",
47
+                "F_ZXZID",
48
+                "*",
49
+                sql,
50
+                "ORDER BY F_ZXZID desc",
51
+                pagesize,
52
+                pageindex,
53
+                true,
54
+                out recordCount);
57
 
55
 
58
-                var obj = new
59
-                {
60
-                    rows = dt,
61
-                    total = recordCount
62
-                };
56
+            var obj = new
57
+            {
58
+                rows = dt,
59
+                total = recordCount
60
+            };
63
 
61
 
64
-                res = Content(obj.ToJson());
65
-         
66
-            return res;
62
+            return Content(obj.ToJson());
67
         }
63
         }
68
 
64
 
69
-        //获取坐席组列表
65
+        ///获取坐席组列表
70
         public ActionResult GetSeatList()
66
         public ActionResult GetSeatList()
71
         {
67
         {
72
-            ActionResult res = NoToken("未知错误,请重新登录");
73
-            if (Request.IsAuthenticated)
74
-            {
75
-                List<Model.T_Sys_SeatGroup> seatList = seatBLL.GetModelList(" 1=1 order by F_ZXZID desc ");
76
-                if (seatList.Count > 0)
77
-                    res = Success("坐席组列表加载成功", seatList);
78
-                else
79
-                    res = Error("坐席组列表加载失败");
80
-            }
81
-            return res;
68
+            List<Model.T_Sys_SeatGroup> seatList = seatBLL.GetModelList(" 1=1 order by F_ZXZID desc ");
69
+            if (seatList.Count > 0)
70
+                return Success("坐席组列表加载成功", seatList);
71
+            else
72
+                return Error("坐席组列表加载失败");
82
         }
73
         }
83
 
74
 
84
         /// <summary>
75
         /// <summary>
88
         /// <returns></returns>
79
         /// <returns></returns>
89
         public ActionResult GetSeatGroup(int ZXZID = 0)
80
         public ActionResult GetSeatGroup(int ZXZID = 0)
90
         {
81
         {
91
-            if (Request.IsAuthenticated)
92
-            {
93
                 Model.T_Sys_SeatGroup sModel = seatBLL.GetModel(ZXZID);
82
                 Model.T_Sys_SeatGroup sModel = seatBLL.GetModel(ZXZID);
94
                 if (sModel != null)
83
                 if (sModel != null)
95
                     return Success("获取坐席组信息成功", sModel);
84
                     return Success("获取坐席组信息成功", sModel);
96
                 return Error("获取坐席组信息失败");
85
                 return Error("获取坐席组信息失败");
97
-            }
98
-            return NoToken("未知错误,请重新登录");
99
         }
86
         }
100
 
87
 
101
         /// <summary>
88
         /// <summary>
106
         [HttpPost]
93
         [HttpPost]
107
         public ActionResult AddSeatGroup(SeatGroupInput input)
94
         public ActionResult AddSeatGroup(SeatGroupInput input)
108
         {
95
         {
109
-            ActionResult res = NoToken("未知错误,请重新登录");
110
-            if (Request.IsAuthenticated)
111
-            {
112
-                Model.T_Sys_SeatGroup sModel = new Model.T_Sys_SeatGroup();
113
-                if (input.ZXZCode != null)
114
-                    sModel.F_ZXZCode = input.ZXZCode.Trim();
115
-                else
116
-                {
117
-                    res = Error("编号不能为空");
118
-                    return res;
119
-                }
120
-                if (input.ZXZName != null)
121
-                    sModel.F_ZXZName = input.ZXZName.Trim();
122
-                else
123
-                {
124
-                    res = Error("名称不能为空");
125
-                    return res;
126
-                }
127
-                if (input.ZXAtt != null)
128
-                    sModel.F_ZXAtt = input.ZXAtt.Trim();
129
-                else
130
-                {
131
-                    res = Error("坐席地区号不能为空");
132
-                    return res;
133
-                }
134
-                if (input.WHWDKey != null)
135
-                    sModel.F_WHWDKey = input.WHWDKey.Trim();
136
-                else
137
-                {
138
-                    res = Error("外呼外地前缀不能为空");
139
-                    return res;
140
-                }
141
-                if (input.WHBDKey != null)
142
-                    sModel.F_WHBDKey = input.WHBDKey.Trim();
143
-                else
144
-                {
145
-                    res = Error("外呼本地前缀不能为空");
146
-                    return res;
147
-                }
148
-                if (input.IVRKey != null)
149
-                    sModel.F_IVRKey = input.IVRKey;
150
-                if (input.Des != null)
151
-                    sModel.F_Des = input.Des.Trim();
152
-                if (!Validate.IsNumber(input.WHWDKey.ToString()))
153
-                {
154
-                    res = Error("外呼外地前缀必须为数字");
155
-                    return res;
156
-                }
157
-                if (!Validate.IsNumber(input.WHBDKey.ToString()))
158
-                {
159
-                    res = Error("外呼本地前缀必须为数字");
160
-                    return res;
161
-                }
162
-               
96
+            ActionResult res = Error("参数获取失败");
163
 
97
 
164
-                sModel.F_CreateTime = DateTime.Now;
165
-                sModel.F_CreateByName = CurrentUser.UserData.F_UserName;
166
-                sModel.F_CreateBy = CurrentUser.UserData.F_UserId;
98
+            if(GetExistByCode(input.ZXZCode,0))
99
+            {
100
+                return Error("坐席组编号必须唯一,请重新输入!");
101
+            }
167
 
102
 
168
-                if (seatBLL.Add(sModel) > 0)
169
-                    res = Success("添加成功");
170
-                else
171
-                    res = Error("添加失败");//res = Success("添加失败");//2017-11-15
103
+            Model.T_Sys_SeatGroup sModel = new Model.T_Sys_SeatGroup();
104
+            if (input.ZXZCode != null)
105
+                sModel.F_ZXZCode = input.ZXZCode.Trim();
106
+            else
107
+            {
108
+                return Error("编号不能为空");
109
+            }
110
+            if (input.ZXZName != null)
111
+                sModel.F_ZXZName = input.ZXZName.Trim();
112
+            else
113
+            {
114
+                return Error("名称不能为空");
115
+            }
116
+            if (input.ZXAtt != null)
117
+                sModel.F_ZXAtt = input.ZXAtt.Trim();
118
+            else
119
+            {
120
+                return Error("坐席地区号不能为空");
121
+            }
122
+            if (input.WHWDKey != null)
123
+                sModel.F_WHWDKey = input.WHWDKey.Trim();
124
+            else
125
+            {
126
+                return Error("外呼外地前缀不能为空");
127
+            }
128
+            if (input.WHBDKey != null)
129
+                sModel.F_WHBDKey = input.WHBDKey.Trim();
130
+            else
131
+            {
132
+                return Error("外呼本地前缀不能为空");
133
+            }
134
+            if (input.IVRKey != null)
135
+                sModel.F_IVRKey = input.IVRKey;
136
+            if (input.Des != null)
137
+                sModel.F_Des = input.Des.Trim();
138
+            if (!Validate.IsNumber(input.WHWDKey.ToString()))
139
+            {
140
+                return Error("外呼外地前缀必须为数字");
172
             }
141
             }
173
-            return res;
142
+            if (!Validate.IsNumber(input.WHBDKey.ToString()))
143
+            {
144
+                return Error("外呼本地前缀必须为数字"); 
145
+            }
146
+
147
+
148
+            sModel.F_CreateTime = DateTime.Now;
149
+            sModel.F_CreateByName = CurrentUser.UserData.F_UserName;
150
+            sModel.F_CreateBy = CurrentUser.UserData.F_UserId;
151
+
152
+            if (seatBLL.Add(sModel) > 0)
153
+                return Success("添加成功");
154
+            else
155
+                return Error("添加失败");//res = Success("添加失败");//2017-11-15
156
+
174
         }
157
         }
175
 
158
 
176
         /// <summary>
159
         /// <summary>
181
         [HttpPost]
164
         [HttpPost]
182
         public ActionResult EditSeatGroup(SeatGroupInput input)
165
         public ActionResult EditSeatGroup(SeatGroupInput input)
183
         {
166
         {
184
-            if (Request.IsAuthenticated)
167
+            if (GetExistByCode(input.ZXZCode, input.ZXZID))
185
             {
168
             {
186
-                if (input.ZXZID <= 0)
187
-                    return Error("请选择要编辑的坐席组");
169
+                return Error("坐席组编号必须唯一,请重新输入!");
170
+            }
188
 
171
 
189
-                Model.T_Sys_SeatGroup sModel = seatBLL.GetModel(input.ZXZID);
190
-                if (sModel == null)
191
-                    return Error("获取信息失败");
172
+            if (input.ZXZID <= 0)
173
+                return Error("请选择要编辑的坐席组");
192
 
174
 
193
-                if (input.ZXZCode != null)
194
-                    sModel.F_ZXZCode = input.ZXZCode.Trim();
195
-                if (input.ZXZName != null)
196
-                    sModel.F_ZXZName = input.ZXZName.Trim();
197
-                if (input.ZXAtt != null)
198
-                    sModel.F_ZXAtt = input.ZXAtt.Trim();
199
-                if (input.WHWDKey != null)
200
-                    sModel.F_WHWDKey = input.WHWDKey.Trim();
201
-                if (input.WHBDKey != null)
202
-                    sModel.F_WHBDKey = input.WHBDKey.Trim();
203
-                if (input.IVRKey != null)
204
-                    sModel.F_IVRKey = input.IVRKey;
205
-                if (input.Des != null)
206
-                    sModel.F_Des = input.Des.Trim();
175
+            Model.T_Sys_SeatGroup sModel = seatBLL.GetModel(input.ZXZID);
176
+            if (sModel == null)
177
+                return Error("获取信息失败");
207
 
178
 
208
-                if (seatBLL.Update(sModel))
209
-                    return Success("编辑成功");
210
-                return Error("编辑失败");
211
-            }
212
-            return NoToken("未知错误,请重新登录");
179
+            if (input.ZXZCode != null)
180
+                sModel.F_ZXZCode = input.ZXZCode.Trim();
181
+            if (input.ZXZName != null)
182
+                sModel.F_ZXZName = input.ZXZName.Trim();
183
+            if (input.ZXAtt != null)
184
+                sModel.F_ZXAtt = input.ZXAtt.Trim();
185
+            if (input.WHWDKey != null)
186
+                sModel.F_WHWDKey = input.WHWDKey.Trim();
187
+            if (input.WHBDKey != null)
188
+                sModel.F_WHBDKey = input.WHBDKey.Trim();
189
+            if (input.IVRKey != null)
190
+                sModel.F_IVRKey = input.IVRKey;
191
+            if (input.Des != null)
192
+                sModel.F_Des = input.Des.Trim();
193
+
194
+            if (seatBLL.Update(sModel))
195
+                return Success("编辑成功");
196
+            return Error("编辑失败");
213
         }
197
         }
214
 
198
 
215
         /// <summary>
199
         /// <summary>
219
         /// <returns></returns>
203
         /// <returns></returns>
220
         public ActionResult DelSeatGroup(string[] ids)
204
         public ActionResult DelSeatGroup(string[] ids)
221
         {
205
         {
222
-            if (Request.IsAuthenticated)
223
-            {
224
-                if (ids == null || ids.Length <= 0)
225
-                    return Error("请选择要删除的坐席组");
206
+            if (ids == null || ids.Length <= 0)
207
+                return Error("请选择要删除的坐席组");
226
 
208
 
227
-                var idStr = string.Join(",", ids);
228
-                if (string.IsNullOrEmpty(idStr.Trim()))
229
-                    return Error("请选择要删除的坐席组");
209
+            var idStr = string.Join(",", ids);
210
+            if (string.IsNullOrEmpty(idStr.Trim()))
211
+                return Error("请选择要删除的坐席组");
230
 
212
 
231
-                if (seatBLL.DeleteList(idStr))
232
-                    return Success("删除成功");
233
-                return Error("删除失败");
234
-            }
235
-            return NoToken("未知错误,请重新登录");
213
+            int cc=new BLL.T_Sys_UserAccount().GetRecordCount(" F_SeartGroupID in (" + idStr + ")");
214
+            if (cc > 0)
215
+                return Error("请转移坐席组下的所有人员后再进行删除!当前坐席组下还有"+cc+"人。");
216
+
217
+            if (seatBLL.DeleteList(idStr))
218
+                return Success("删除成功");
219
+            return Error("删除失败");
236
         }
220
         }
237
 
221
 
238
         #region 按内容搜索
222
         #region 按内容搜索
243
         /// <returns></returns>
227
         /// <returns></returns>
244
         public ActionResult GetSearch()
228
         public ActionResult GetSearch()
245
         {
229
         {
246
-            if (Request.IsAuthenticated)
230
+            string strcontent = RequestString.GetQueryString("content");
231
+            string strwhere = "";
232
+            if (strcontent != "")
233
+            {
234
+                strwhere = " F_ZXZCode='" + strcontent + "' or F_ZXZName='" + strcontent + "'";
235
+            }
236
+            DataSet ds = seatBLL.GetList(strwhere);
237
+            if (ds != null)
238
+                return Success("查询坐席组信息成功", ds);
239
+            return Error("查询坐席组信息失败");
240
+        }
241
+        #endregion
242
+
243
+        #region
244
+        /// <summary>
245
+        /// 根据坐席组编号查询是否存在此坐席组编号
246
+        /// </summary>
247
+        /// <param name="code"></param>
248
+        /// <returns></returns>
249
+        private bool GetExistByCode(string code,int? id)
250
+        {
251
+            string sql = " 1=1 ";
252
+            if (code != null)
253
+            {
254
+                sql += " and F_ZXZCode='" + code.Trim() + "' ";
255
+            }
256
+            if (id != null)
247
             {
257
             {
248
-                string strcontent= RequestString.GetQueryString("content");
249
-                string strwhere = "";
250
-                if (strcontent != "")
251
-                {
252
-                    strwhere = " F_ZXZCode='" + strcontent + "' or F_ZXZName='" + strcontent + "'";
253
-                }
254
-                DataSet ds = seatBLL.GetList(strwhere);
255
-                if (ds != null)
256
-                    return Success("查询坐席组信息成功", ds);
257
-                return Error("查询坐席组信息失败");
258
+                sql += " and F_ZXZID <>" + id;
258
             }
259
             }
259
-            return NoToken("未知错误,请重新登录");
260
+            var ss = seatBLL.GetRecordCount(sql);
261
+            if (ss > 0)
262
+                return true;
263
+            else
264
+                return false;
260
         }
265
         }
261
         #endregion
266
         #endregion
262
     }
267
     }

+ 112 - 81
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/UserAccountController.cs

28
             {
28
             {
29
                 DataTable dt = new DataTable();
29
                 DataTable dt = new DataTable();
30
                 string sql = " ";
30
                 string sql = " ";
31
-               
32
-                    if (filter.dptid > 0)
31
+
32
+                if (filter.dptid > 0)
33
+                {
34
+                    Model.T_Sys_Department deptModel = departmentBLL.GetModel(filter.dptid);
35
+                    if (deptModel != null)
33
                     {
36
                     {
34
-                    Model.T_Sys_Department deptModel = new BLL.T_Sys_Department().GetModel(filter.dptid);
35
-                    if (deptModel != null) {
36
                         sql += " and F_DeptId in ( select F_DeptId from T_Sys_Department where F_DeptCode like '" + deptModel.F_DeptCode + "%') ";
37
                         sql += " and F_DeptId in ( select F_DeptId from T_Sys_Department where F_DeptCode like '" + deptModel.F_DeptCode + "%') ";
37
-                            }
38
-                    }
39
-                    if (!string.IsNullOrWhiteSpace(filter.Key))
40
-                    {
41
-                        sql = "";
42
-                        string str = string.Format(" and (F_UserCode like '%{0}%' or F_UserName like '%{1}%')", filter.Key, filter.Key);
43
-                        sql += str;
44
                     }
38
                     }
45
-                    int recordCount = 0;
46
-                    dt = BLL.PagerBLL.GetListPager(
47
-                                            "T_Sys_UserAccount",
48
-                                            "F_UserId",
49
-                                            "*",
50
-                                            sql,
51
-                                            "ORDER BY F_UserId desc",
52
-                                            filter.PageSize,
53
-                                            filter.PageIndex,
54
-                                            true,
55
-                                            out recordCount);
39
+                }
40
+                if (!string.IsNullOrWhiteSpace(filter.Key))
41
+                {
42
+                    sql = "";
43
+                    string str = string.Format(" and (F_UserCode like '%{0}%' or F_UserName like '%{1}%')", filter.Key, filter.Key);
44
+                    sql += str;
45
+                }
46
+                if (!string.IsNullOrWhiteSpace(filter.sgid))
47
+                {
48
+                    sql += " and F_SeartGroupID in (" + filter.sgid + ")";
49
+                }
50
+                int recordCount = 0;
51
+                dt = BLL.PagerBLL.GetListPager(
52
+                                        "T_Sys_UserAccount",
53
+                                        "F_UserId",
54
+                                        "*",
55
+                                        sql,
56
+                                        "ORDER BY F_UserId desc",
57
+                                        filter.PageSize,
58
+                                        filter.PageIndex,
59
+                                        true,
60
+                                        out recordCount);
56
 
61
 
57
-                    List<Model.UserAccount> modelList = new BLL.UserAccount().DataTableToList(dt);
58
-                    var obj = new
62
+                List<Model.UserAccount> modelList = new BLL.UserAccount().DataTableToList(dt);
63
+                var obj = new
64
+                {
65
+                    rows = modelList.Select(x => new
59
                     {
66
                     {
60
-                        rows = modelList.Select(x => new
61
-                        {
62
-                            F_UserId = x.F_UserId,
63
-                            F_UserCode = x.F_UserCode,
64
-                            F_ExtensionNumber = x.F_ExtensionNumber,
65
-                            F_UserName = x.F_UserName,
66
-                            F_GroupName = x.F_GroupName,
67
-                            F_DeptId = x.F_DeptId,
68
-                            F_RoleId = x.F_RoleId,
69
-                            F_GroupId = x.F_GroupId,
70
-                            F_SeatFlag = x.F_SeatFlag,
71
-                            F_SeatRight = x.F_SeatRight,
72
-                            F_SeatLevel = x.F_SeatLevel,
73
-                            F_SexFlag = x.F_SexFlag,
74
-                            F_RemindFlag = x.F_RemindFlag,
75
-                            F_Remark = x.F_Remark,
76
-                            F_Telephone = x.F_Telephone,
77
-                            F_Mobile = x.F_Mobile,
78
-                            F_HomePhone = x.F_HomePhone,
79
-                            F_Birthday = x.F_Birthday,
80
-                            F_CreateOn = x.F_CreateOn,
81
-                            F_CancelOn = x.F_CancelOn,
82
-                            F_DeleteFlag = x.F_DeleteFlag,
83
-                            F_APPOnFlag = x.F_APPOnFlag,
84
-                            F_LastActiveTime = x.F_LastActiveTime,
85
-                            F_See = x.F_See,
86
-                            F_HJType = x.F_HJType,
87
-                            F_PId = x.F_PId,
88
-                            F_TmId = x.F_TmId,
89
-                            F_RoleName = x.F_RoleName,
90
-                            F_DeptName = x.F_DeptName,
91
-                            F_WorkNumber = x.F_WorkNumber,
92
-                            //F_WXNo=x.F_WXNo,
93
-                            F_SeatGroup = x.F_SeartGroup
94
-                        }),
95
-                        total = recordCount
96
-                    };
67
+                        F_UserId = x.F_UserId,
68
+                        F_UserCode = x.F_UserCode,
69
+                        F_ExtensionNumber = x.F_ExtensionNumber,
70
+                        F_UserName = x.F_UserName,
71
+                        F_GroupName = x.F_GroupName,
72
+                        F_DeptId = x.F_DeptId,
73
+                        F_RoleId = x.F_RoleId,
74
+                        F_GroupId = x.F_GroupId,
75
+                        F_SeatFlag = x.F_SeatFlag,
76
+                        F_SeatRight = x.F_SeatRight,
77
+                        F_SeatLevel = x.F_SeatLevel,
78
+                        F_SexFlag = x.F_SexFlag,
79
+                        F_RemindFlag = x.F_RemindFlag,
80
+                        F_Remark = x.F_Remark,
81
+                        F_Telephone = x.F_Telephone,
82
+                        F_Mobile = x.F_Mobile,
83
+                        F_HomePhone = x.F_HomePhone,
84
+                        F_Birthday = x.F_Birthday,
85
+                        F_CreateOn = x.F_CreateOn,
86
+                        F_CancelOn = x.F_CancelOn,
87
+                        F_DeleteFlag = x.F_DeleteFlag,
88
+                        F_APPOnFlag = x.F_APPOnFlag,
89
+                        F_LastActiveTime = x.F_LastActiveTime,
90
+                        F_See = x.F_See,
91
+                        F_HJType = x.F_HJType,
92
+                        F_PId = x.F_PId,
93
+                        F_TmId = x.F_TmId,
94
+                        F_RoleName = x.F_RoleName,
95
+                        F_DeptName = x.F_DeptName,
96
+                        F_WorkNumber = x.F_WorkNumber,
97
+                        //F_WXNo=x.F_WXNo,
98
+                        F_SeatGroup = x.F_SeartGroup
99
+                    }),
100
+                    total = recordCount
101
+                };
102
+
103
+                res = Content(obj.ToJson());
104
+
105
+
106
+                dt.Clear();
107
+                dt.Dispose();
97
 
108
 
98
-                    res = Content(obj.ToJson());
99
-                
100
-           
101
-                    dt.Clear();
102
-                    dt.Dispose();
103
-                
104
             }
109
             }
105
             return res;
110
             return res;
106
         }
111
         }
257
             ActionResult res = NoToken("未知错误,请重新登录");
262
             ActionResult res = NoToken("未知错误,请重新登录");
258
             if (Request.IsAuthenticated)
263
             if (Request.IsAuthenticated)
259
             {
264
             {
260
-                BLL.T_Sys_UserAccount sysUserAccountBll = new BLL.T_Sys_UserAccount();
261
                 Model.T_Sys_UserAccount userAccountModel = sysUserAccountBll.GetModelList("  F_UserId = " + input.UserId).FirstOrDefault();
265
                 Model.T_Sys_UserAccount userAccountModel = sysUserAccountBll.GetModelList("  F_UserId = " + input.UserId).FirstOrDefault();
262
                 if (userAccountModel == null)
266
                 if (userAccountModel == null)
263
                     return Error("获取用户失败");
267
                     return Error("获取用户失败");
434
             ActionResult res = NoToken("未知错误,请重新登录");
438
             ActionResult res = NoToken("未知错误,请重新登录");
435
             if (Request.IsAuthenticated)
439
             if (Request.IsAuthenticated)
436
             {
440
             {
437
-                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(CurrentUser.UserData.F_UserId);
441
+                Model.T_Sys_UserAccount userModel = sysUserAccountBll.GetModel(CurrentUser.UserData.F_UserId);
438
                 if (userModel == null)
442
                 if (userModel == null)
439
                     return Error("获取失败");
443
                     return Error("获取失败");
440
                 Model.T_Sys_RoleInfo roleModel = new BLL.T_Sys_RoleInfo().GetModel(userModel.F_RoleId);
444
                 Model.T_Sys_RoleInfo roleModel = new BLL.T_Sys_RoleInfo().GetModel(userModel.F_RoleId);
495
             return res;
499
             return res;
496
         }
500
         }
497
 
501
 
498
-        //根据工号获取坐席组号
499
-        public ActionResult GetSeatGroup(string worknum)
502
+        /// <summary>
503
+        /// 批量修改坐席的坐席组ID
504
+        /// </summary>
505
+        /// <param name="userids"></param>
506
+        /// <param name="sgid"></param>
507
+        /// <returns></returns>
508
+        public ActionResult UpdateSeatGroup(string[] userids, string sgid)
500
         {
509
         {
501
-            ActionResult res = NoToken("未知错误,请重新登录");
502
-            if (Request.IsAuthenticated)
510
+            if (userids == null || userids.Length <= 0)
511
+                return Error("请选择要修改的坐席");
512
+
513
+            var idStr = string.Join(",", userids);
514
+            if (string.IsNullOrEmpty(idStr.Trim()))
515
+                return Error("请选择要修改的坐席");
516
+
517
+            Model.T_Sys_SeatGroup sgModel = new BLL.T_Sys_SeatGroup().GetModel(int.Parse(sgid));
518
+            string sgname = sgModel != null ? sgModel.F_ZXZName : "";
519
+
520
+            var res=sysUserAccountBll.UpdateSeatGroup(idStr, sgid, sgname);
521
+            if(res)
503
             {
522
             {
504
-                string strwhere = "";
505
-                if (worknum != "")
506
-                {
507
-                    strwhere = " F_WorkNumber='" + worknum + "'";
508
-                }
509
-                string setgroup = sysUserAccountBll.GetGroup(strwhere);
510
-                res = Success("坐席组号获取成功", setgroup);
523
+                return Success("修改坐席组成功");
511
             }
524
             }
512
-            return res;
525
+
526
+            return Error("修改坐席组失败!");
513
         }
527
         }
528
+
529
+        //根据工号获取坐席组号
530
+        //public ActionResult GetSeatGroup(string worknum)
531
+        //{
532
+        //    ActionResult res = NoToken("未知错误,请重新登录");
533
+        //    if (Request.IsAuthenticated)
534
+        //    {
535
+        //        string strwhere = "";
536
+        //        if (worknum != "")
537
+        //        {
538
+        //            strwhere = " F_WorkNumber='" + worknum + "'";
539
+        //        }
540
+        //        string setgroup = sysUserAccountBll.GetGroup(strwhere);
541
+        //        res = Success("坐席组号获取成功", setgroup);
542
+        //    }
543
+        //    return res;
544
+        //}
514
     }
545
     }
515
 }
546
 }

+ 1 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Filter/FilterUserAccount.cs

14
         }
14
         }
15
         public int dptid { get; set; } = 0;
15
         public int dptid { get; set; } = 0;
16
         public string Key { get; set; } = "";
16
         public string Key { get; set; } = "";
17
+        public string sgid { get; set; } = "";
17
     }
18
     }
18
 }
19
 }