Quellcode durchsuchen

1.禁止外呼号码列表
2.获取角色列表接口调整

yuqian vor 8 Jahren
Ursprung
Commit
42ce19d92d

+ 1 - 0
CallCenterApi/CallCenterApi.BLL/CallCenterApi.BLL.csproj

@@ -51,6 +51,7 @@
51 51
     <Compile Include="T_Ask_Question.cs" />
52 52
     <Compile Include="T_Ask_QuestionCategory.cs" />
53 53
     <Compile Include="T_Ask_QuestionItems.cs" />
54
+    <Compile Include="T_Call_BanCallOut.cs" />
54 55
     <Compile Include="T_Call_Blacklist.cs" />
55 56
     <Compile Include="T_Call_CallRecords.cs" />
56 57
     <Compile Include="T_Call_CallRecordsLD.cs" />

+ 51 - 0
CallCenterApi/CallCenterApi.BLL/T_Call_BanCallOut.cs

@@ -0,0 +1,51 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Data;
4
+using System.Linq;
5
+using System.Text;
6
+using System.Threading.Tasks;
7
+using CallCenterApi.Model;
8
+
9
+namespace CallCenterApi.BLL
10
+{
11
+    public class T_Call_BanCallOut
12
+    {
13
+        private readonly DAL.T_Call_BanCallOut dal = new DAL.T_Call_BanCallOut();
14
+        /// <summary>
15
+        /// 获得数据列表
16
+        /// </summary>
17
+        public List<CallCenterApi.Model.T_Call_BanCallOut> DataTableToList(DataTable dt)
18
+        {
19
+            List<CallCenterApi.Model.T_Call_BanCallOut> modelList = new List<CallCenterApi.Model.T_Call_BanCallOut>();
20
+            int rowsCount = dt.Rows.Count;
21
+            if (rowsCount > 0)
22
+            {
23
+                CallCenterApi.Model.T_Call_BanCallOut model;
24
+                for (int n = 0; n < rowsCount; n++)
25
+                {
26
+                    model = new CallCenterApi.Model.T_Call_BanCallOut();
27
+                    model.Id = Convert.ToInt32(dt.Rows[n]["F_Id"]);
28
+                    model.F_Phone = dt.Rows[n]["F_Phone"] == null ? "" : dt.Rows[n]["F_Phone"].ToString();
29
+                    model.F_SetTime = dt.Rows[n]["F_SetTime"] == null ? null : (DateTime?)Convert.ToDateTime(dt.Rows[n]["F_Phone"].ToString());
30
+                    modelList.Add(model);
31
+                }
32
+            }
33
+            return modelList;
34
+        }
35
+
36
+        public Model.T_Call_BanCallOut GetModel(string phone)
37
+        {
38
+            return dal.GetModel(phone);
39
+        }
40
+
41
+        public int Add(Model.T_Call_BanCallOut model)
42
+        {
43
+            return dal.Add(model);
44
+        }
45
+
46
+        public int deleteBatch(string ids)
47
+        {
48
+            return dal.DeleteBatch(ids);
49
+        }
50
+    }
51
+}

+ 1 - 0
CallCenterApi/CallCenterApi.DAL/CallCenterApi.DAL.csproj

@@ -51,6 +51,7 @@
51 51
     <Compile Include="T_Ask_Question.cs" />
52 52
     <Compile Include="T_Ask_QuestionCategory.cs" />
53 53
     <Compile Include="T_Ask_QuestionItems.cs" />
54
+    <Compile Include="T_Call_BanCallOut.cs" />
54 55
     <Compile Include="T_Call_Blacklist.cs" />
55 56
     <Compile Include="T_Call_CallRecords.cs" />
56 57
     <Compile Include="T_Call_CallRecordsLD.cs" />

+ 37 - 0
CallCenterApi/CallCenterApi.DAL/T_Call_BanCallOut.cs

@@ -0,0 +1,37 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+using CallCenterApi.Model;
7
+using CallCenterApi.DB;
8
+using System.Data.SqlClient;
9
+
10
+namespace CallCenterApi.DAL
11
+{
12
+    public class T_Call_BanCallOut
13
+    {
14
+        public int Add(Model.T_Call_BanCallOut model)
15
+        {
16
+            var sql = "insert into T_Call_BanCallOut (F_Phone) values (@F_Phone)";
17
+            return DbHelperSQL.ExecuteSql(sql, new SqlParameter("@F_Phone", model.F_Phone));
18
+        }
19
+
20
+        public int DeleteBatch(string ids)
21
+        {
22
+            var sql = $"delete form T_Call_BanCallOut where F_Id in ({ids}) ";
23
+            return DbHelperSQL.ExecuteSql(sql);
24
+        }
25
+
26
+        public Model.T_Call_BanCallOut GetModel(string phone)
27
+        {
28
+            Model.T_Call_BanCallOut model = new Model.T_Call_BanCallOut();
29
+            var sql = "select F_Id,F_Phone,F_SetTime from T_Call_BanCallOut WHERE F_Phone=@F_Phone";
30
+            var dt = DbHelperSQL.Query(sql, new SqlParameter("@F_Phone", phone)).Tables[0];
31
+            model.Id = Convert.ToInt32(dt.Rows[0]["F_Id"]);
32
+            model.F_Phone = dt.Rows[0]["F_Phone"] == null ? "" : dt.Rows[0]["F_Phone"].ToString();
33
+            model.F_SetTime = dt.Rows[0]["F_SetTime"] == null ? null : (DateTime?)Convert.ToDateTime(dt.Rows[0]["F_Phone"].ToString());
34
+            return model;
35
+        }
36
+    }
37
+}

+ 5 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj

@@ -209,6 +209,7 @@
209 209
     <Compile Include="App_Start\RouteConfig.cs" />
210 210
     <Compile Include="Controllers\Base\BaseController.cs" />
211 211
     <Compile Include="Controllers\CallOutOptController.cs" />
212
+    <Compile Include="Controllers\callout\BanCallOutController.cs" />
212 213
     <Compile Include="Controllers\callout\CallPlanController.cs" />
213 214
     <Compile Include="Controllers\callout\ExcelTmpController.cs" />
214 215
     <Compile Include="Controllers\customer\CustomerController.cs" />
@@ -286,11 +287,13 @@
286 287
     <Compile Include="Models\Dto\ModuleInfoDto.cs" />
287 288
     <Compile Include="Models\Dto\OrderDto.cs" />
288 289
     <Compile Include="Models\Dto\ProductDto.cs" />
290
+    <Compile Include="Models\Filter\FilterBanCallOut.cs" />
289 291
     <Compile Include="Models\Filter\FilterCallPhone.cs" />
290 292
     <Compile Include="Models\Filter\FilterCallPlan.cs" />
291 293
     <Compile Include="Models\Filter\FilterExcelTmp.cs" />
292 294
     <Compile Include="Models\Filter\FilterPagerInfo.cs" />
293 295
     <Compile Include="Models\Filter\FilterQuestion.cs" />
296
+    <Compile Include="Models\Filter\FilterRole.cs" />
294 297
     <Compile Include="Models\Filter\FilterTalkRecord.cs" />
295 298
     <Compile Include="Models\Filter\FilterCategory.cs" />
296 299
     <Compile Include="Models\Filter\FilterDictionary.cs" />
@@ -301,6 +304,7 @@
301 304
     <Compile Include="Models\Filter\FilterSysConfig.cs" />
302 305
     <Compile Include="Models\Filter\FilterUserAccount.cs" />
303 306
     <Compile Include="Models\Filter\FilterProduct.cs" />
307
+    <Compile Include="Models\Input\BanCallOutInput.cs" />
304 308
     <Compile Include="Models\Input\CallNumberInput.cs" />
305 309
     <Compile Include="Models\Input\CallPlanInput.cs" />
306 310
     <Compile Include="Models\Input\CategoryInput.cs" />
@@ -348,6 +352,7 @@
348 352
   </ItemGroup>
349 353
   <ItemGroup>
350 354
     <Folder Include="App_Data\" />
355
+    <Folder Include="Views\BanCallOut\" />
351 356
     <Folder Include="Views\Base\" />
352 357
     <Folder Include="Views\Business\" />
353 358
     <Folder Include="Views\Callblack\" />

+ 7 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/CallOutOptController.cs

@@ -10,6 +10,7 @@ namespace CallCenterApi.Interface.Controllers
10 10
 {
11 11
     public class CallOutOptController : BaseController
12 12
     {
13
+        private readonly BLL.T_Call_BanCallOut banCallOutBLL = new BLL.T_Call_BanCallOut();
13 14
         //外呼判断本地外地以及加前缀返回
14 15
         public ActionResult GetCallOutprefix(string phone)
15 16
         {
@@ -17,6 +18,12 @@ namespace CallCenterApi.Interface.Controllers
17 18
             if (Request.IsAuthenticated)
18 19
             {
19 20
                 string phone1 = RequestString.ToDBC(RequestString.RemoveNotNumber(WebHelper.NoHtml(phone)));
21
+
22
+                #region  //判断外呼号码是否存在于【禁止外呼表】,如果存在,不可进行外呼
23
+                if (banCallOutBLL.GetModel(phone1) != null)
24
+                    return Error("该号码已被列为禁止外呼号码");
25
+                #endregion
26
+
20 27
                 string zipcode = ""; string bfix = ""; string wfix = ""; string fix = "";
21 28
                 string userseatgroupid = CurrentUser.UserData.F_SeartGroupID.ToString();
22 29
                 if (userseatgroupid != "" && userseatgroupid != "0")

+ 20 - 19
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/RoleInfoController.cs

@@ -2,6 +2,7 @@
2 2
 using CallCenter.Utility.Linq;
3 3
 using CallCenterApi.DB;
4 4
 using CallCenterApi.Interface.Controllers.Base;
5
+using CallCenterApi.Interface.Models.Filter;
5 6
 using CallCenterApi.Interface.Models.Input;
6 7
 using System;
7 8
 using System.Collections.Generic;
@@ -17,33 +18,33 @@ namespace CallCenterApi.Interface.Controllers
17 18
     {
18 19
         private BLL.T_Sys_RoleInfo roleInfoBLL = new BLL.T_Sys_RoleInfo();
19 20
         // 获取角色列表
20
-        public ActionResult GetRoleList(int pageIndex = 1, int pageSize = 10, string code = "", string name = "")
21
+        public ActionResult GetRoleList(FilterRole filter)
21 22
         {
22 23
             ActionResult res = NoToken("未知错误,请重新登录");
23 24
             //if (Request.IsAuthenticated)
24 25
             //{
25
-                DataTable dt = new DataTable();
26
-                int recordCount = 0;
27
-                dt = BLL.PagerBLL.GetListPager(
28
-                    "T_Sys_RoleInfo",
29
-                    "F_RoleId",
30
-                    "*",
31
-                    " and  F_RoleName like '%" + name + "%' and F_RoleCode like '%" + code + "%'  ",
32
-                    "",
33
-                    pageSize,
34
-                    pageIndex,
35
-                    true,
36
-                    out recordCount);
26
+            DataTable dt = new DataTable();
27
+            int recordCount = 0;
28
+            dt = BLL.PagerBLL.GetListPager(
29
+                "T_Sys_RoleInfo",
30
+                "F_RoleId",
31
+                "*",
32
+                " and  F_RoleName like '%" + filter.Name + "%' and F_RoleCode like '%" + filter.Code + "%'  ",
33
+                "",
34
+                filter.PageSize,
35
+                filter.PageIndex,
36
+                true,
37
+                out recordCount);
37 38
 
38 39
 
39 40
 
40
-                var obj = new
41
-                {
42
-                    rows = dt,
43
-                    total = recordCount
44
-                };
41
+            var obj = new
42
+            {
43
+                rows = dt,
44
+                total = recordCount
45
+            };
45 46
 
46
-                res = Content(obj.ToJson());
47
+            res = Content(obj.ToJson());
47 48
             //}
48 49
             return res;
49 50
         }

+ 71 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/callout/BanCallOutController.cs

@@ -0,0 +1,71 @@
1
+using CallCenter.Utility;
2
+using CallCenterApi.Interface.Controllers.Base;
3
+using CallCenterApi.Interface.Models.Filter;
4
+using CallCenterApi.Interface.Models.Input;
5
+using System;
6
+using System.Collections.Generic;
7
+using System.Linq;
8
+using System.Text;
9
+using System.Web;
10
+using System.Web.Mvc;
11
+
12
+namespace CallCenterApi.Interface.Controllers.callout
13
+{
14
+    public class BanCallOutController : BaseController
15
+    {
16
+        private readonly BLL.T_Call_BanCallOut banCallOutBLL = new BLL.T_Call_BanCallOut();
17
+        public ActionResult GetList(FilterBanCallOut filter)
18
+        {
19
+            StringBuilder sb = new StringBuilder();
20
+            if (!string.IsNullOrWhiteSpace(filter.Phone))
21
+            {
22
+                sb.Append($"  and  F_Phone='{filter.Phone}'");
23
+            }
24
+            //if (filter.Start != null && filter.End != null)
25
+            //{
26
+            //    sb.Append($"  and  F_Phone='{filter.Phone}'");
27
+            //}
28
+            var recordCount = 0;
29
+            var dt = BLL.PagerBLL.GetListPager(
30
+                             "T_Call_BanCallOut",
31
+                             "F_Id",
32
+                             "*",
33
+                             sb.ToString(),
34
+                             "ORDER BY SetTime desc",
35
+                             filter.PageSize,
36
+                             filter.PageIndex,
37
+                             true,
38
+                             out recordCount);
39
+            List<Model.T_Call_BanCallOut> modelList = new BLL.T_Call_BanCallOut().DataTableToList(dt);
40
+            var obj = new
41
+            {
42
+                rows = modelList,
43
+                total = recordCount
44
+            };
45
+            return Content(obj.ToJson());
46
+        }
47
+
48
+        public ActionResult Add(BanCallOutInput input)
49
+        {
50
+            if (!string.IsNullOrWhiteSpace(input.Phone))
51
+                return Error("号码不可为空");
52
+            if (banCallOutBLL.Add(new Model.T_Call_BanCallOut()
53
+            {
54
+                F_Phone = input.Phone
55
+            }) > 0)
56
+                return Success("添加成功");
57
+            return Error("添加失败");
58
+        }
59
+
60
+        public ActionResult Delete(int[] ids)
61
+        {
62
+            if (ids == null || ids.Length <= 0)
63
+                return Error("请选择需要删除的项");
64
+            var idsStr = string.Join(",", ids);
65
+            banCallOutBLL.deleteBatch(idsStr);
66
+            return Success("删除成功");
67
+        }
68
+
69
+
70
+    }
71
+}

+ 18 - 19
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/callout/CallPlanController.cs

@@ -47,27 +47,26 @@ namespace CallCenterApi.Interface.Controllers.callout
47 47
                 sql += "  and (TaskName like '%" + filter.Name.Trim() + "%' ) ";
48 48
             }
49 49
 
50
-            var roleid = CurrentUser.UserData.F_RoleId;
51
-            var deptid = CurrentUser.UserData.F_DeptId;
52
-            var deptcode = CurrentUser.UserData.F_DeptCode;
53
-            var usercode = CurrentUser.UserData.F_UserCode;
54
-            if (roleid != 0)
55
-            {
56
-                if (roleid != 17)
57
-                {
58
-                    if (deptcode.IndexOf("|531|") > 0)
59
-                    {
60
-                        sql += " and UserCode in (select F_UserCode from T_Sys_UserAccount where F_DeptID in (select F_DeptId from T_Sys_Department where F_DeptCode like '" + deptcode + "%')) ";
61
-                    }
62
-                    else
63
-                    {
64
-                        sql += " and UserCode in (select F_UserCode from T_Sys_UserAccount where F_DeptId=" + deptid + ")";
65
-                    }
66
-                }
67
-            }
50
+            //var roleid = CurrentUser.UserData.F_RoleId;
51
+            //var deptid = CurrentUser.UserData.F_DeptId;
52
+            //var deptcode = CurrentUser.UserData.F_DeptCode;
53
+            //var usercode = CurrentUser.UserData.F_UserCode;
54
+            //if (roleid != 0)
55
+            //{
56
+            //    if (roleid != 17)
57
+            //    {
58
+            //        if (deptcode.IndexOf("|531|") > 0)
59
+            //        {
60
+            //            sql += " and UserCode in (select F_UserCode from T_Sys_UserAccount where F_DeptID in (select F_DeptId from T_Sys_Department where F_DeptCode like '" + deptcode + "%')) ";
61
+            //        }
62
+            //        else
63
+            //        {
64
+            //            sql += " and UserCode in (select F_UserCode from T_Sys_UserAccount where F_DeptId=" + deptid + ")";
65
+            //        }
66
+            //    }
67
+            //}
68 68
 
69 69
 
70
-            Model.PageData<Model.T_CTI_Task> pageModel = new Model.PageData<Model.T_CTI_Task>();
71 70
             var recordCount = 0;
72 71
             var dt = BLL.PagerBLL.GetListPager(
73 72
                              "T_CTI_Task",

+ 16 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Filter/FilterBanCallOut.cs

@@ -0,0 +1,16 @@
1
+using CallCenterApi.Interface.Models.Common;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Linq;
5
+using System.Web;
6
+
7
+namespace CallCenterApi.Interface.Models.Filter
8
+{
9
+    public class FilterBanCallOut : ListBase
10
+    {
11
+        public string Phone { get; set; }
12
+        public DateTime? Start { get; set; }
13
+        public DateTime? End { get; set; }
14
+
15
+    }
16
+}

+ 15 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Filter/FilterRole.cs

@@ -0,0 +1,15 @@
1
+using CallCenterApi.Interface.Models.Common;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Linq;
5
+using System.Web;
6
+
7
+namespace CallCenterApi.Interface.Models.Filter
8
+{
9
+    public class FilterRole : ListBase
10
+    {
11
+        public string Name { get; set; }
12
+        public string Code { get; set; }
13
+
14
+    }
15
+}

+ 13 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/BanCallOutInput.cs

@@ -0,0 +1,13 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Web;
5
+
6
+namespace CallCenterApi.Interface.Models.Input
7
+{
8
+    public class BanCallOutInput
9
+    {
10
+        public string Phone { get; set; }
11
+
12
+    }
13
+}

+ 1 - 0
CallCenterApi/CallCenterApi.Model/CallCenterApi.Model.csproj

@@ -56,6 +56,7 @@
56 56
     <Compile Include="T_Ask_Question.cs" />
57 57
     <Compile Include="T_Ask_QuestionCategory.cs" />
58 58
     <Compile Include="T_Ask_QuestionItems.cs" />
59
+    <Compile Include="T_Call_BanCallOut.cs" />
59 60
     <Compile Include="T_Call_Blacklist.cs" />
60 61
     <Compile Include="T_Call_CallRecords.cs" />
61 62
     <Compile Include="T_Call_CallRecordsLD.cs" />

+ 15 - 0
CallCenterApi/CallCenterApi.Model/T_Call_BanCallOut.cs

@@ -0,0 +1,15 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace CallCenterApi.Model
8
+{
9
+    public class T_Call_BanCallOut
10
+    {
11
+        public int Id { get; set; }
12
+        public string F_Phone { get; set; }
13
+        public DateTime? F_SetTime { get; set; }
14
+    }
15
+}