Procházet zdrojové kódy

来电弹屏显示系统字段,自定义字段

yuqian %!s(int64=8) %!d(string=před) roky
rodič
revize
0f941bc78e

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

@@ -89,6 +89,7 @@
89 89
     <Compile Include="T_SMS_SendSMSTask.cs" />
90 90
     <Compile Include="T_SMS_SentSMS.cs" />
91 91
     <Compile Include="T_SMS_Template.cs" />
92
+    <Compile Include="T_Sys_BanCallOutTime.cs" />
92 93
     <Compile Include="T_Sys_Department.cs" />
93 94
     <Compile Include="T_Sys_DictionaryBase.cs" />
94 95
     <Compile Include="T_Sys_DictionaryValue.cs" />

+ 8 - 1
CallCenterApi/CallCenterApi.BLL/T_Cus_CustomerBase.cs

@@ -70,11 +70,18 @@ namespace CallCenterApi.BLL
70 70
         /// </summary>
71 71
         public CallCenterApi.Model.T_Cus_CustomerBase GetModel(string id)
72 72
         {
73
-
74 73
             return dal.GetModel(id);
75 74
         }
76 75
 
77 76
         /// <summary>
77
+        /// 得到一个对象实体
78
+        /// </summary>
79
+        public CallCenterApi.Model.T_Cus_CustomerBase GetModelByTel(string tel)
80
+        {
81
+            return dal.GetModelByTel(tel);
82
+        }
83
+
84
+        /// <summary>
78 85
         /// 获得数据列表
79 86
         /// </summary>
80 87
         public DataSet GetList(string strWhere)

+ 53 - 0
CallCenterApi/CallCenterApi.BLL/T_Sys_BanCallOutTime.cs

@@ -0,0 +1,53 @@
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
+
8
+namespace CallCenterApi.BLL
9
+{
10
+    public class T_Sys_BanCallOutTime
11
+    {
12
+        private readonly DAL.T_Sys_BanCallOutTime dal = new DAL.T_Sys_BanCallOutTime();
13
+        /// <summary>
14
+        /// 获得数据列表
15
+        /// </summary>
16
+        public List<CallCenterApi.Model.T_Sys_BanCallOutTime> DataTableToList(DataTable dt)
17
+        {
18
+            List<CallCenterApi.Model.T_Sys_BanCallOutTime> modelList = new List<CallCenterApi.Model.T_Sys_BanCallOutTime>();
19
+            int rowsCount = dt.Rows.Count;
20
+            if (rowsCount > 0)
21
+            {
22
+                CallCenterApi.Model.T_Sys_BanCallOutTime model;
23
+                for (int n = 0; n < rowsCount; n++)
24
+                {
25
+                    model = new CallCenterApi.Model.T_Sys_BanCallOutTime();
26
+                    model.Id = Convert.ToInt32(dt.Rows[n]["F_Id"]);
27
+                    model.StartTime1 = dt.Rows[0]["StartTime1"] == DBNull.Value ? null : (DateTime?)Convert.ToDateTime(dt.Rows[0]["StartTime1"].ToString());
28
+                    model.StartTime2 = dt.Rows[0]["StartTime2"] == DBNull.Value ? null : (DateTime?)Convert.ToDateTime(dt.Rows[0]["StartTime2"].ToString());
29
+                    model.EndTime1 = dt.Rows[0]["EndTime1"] == DBNull.Value ? null : (DateTime?)Convert.ToDateTime(dt.Rows[0]["EndTime1"].ToString());
30
+                    model.EndTime2 = dt.Rows[0]["EndTime2"] == DBNull.Value ? null : (DateTime?)Convert.ToDateTime(dt.Rows[0]["EndTime2"].ToString());
31
+                    modelList.Add(model);
32
+                }
33
+            }
34
+            return modelList;
35
+        }
36
+
37
+        public Model.T_Sys_BanCallOutTime GetModel(string phone)
38
+        {
39
+            return dal.GetModel(phone);
40
+        }
41
+
42
+        public int Add(Model.T_Sys_BanCallOutTime model)
43
+        {
44
+            return dal.Add(model);
45
+        }
46
+
47
+        public int deleteBatch(string ids)
48
+        {
49
+            return dal.DeleteBatch(ids);
50
+        }
51
+
52
+    }
53
+}

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

@@ -89,6 +89,7 @@
89 89
     <Compile Include="T_SMS_SendSMSTask.cs" />
90 90
     <Compile Include="T_SMS_SentSMS.cs" />
91 91
     <Compile Include="T_SMS_Template.cs" />
92
+    <Compile Include="T_Sys_BanCallOutTime.cs" />
92 93
     <Compile Include="T_Sys_Department.cs" />
93 94
     <Compile Include="T_Sys_DictionaryBase.cs" />
94 95
     <Compile Include="T_Sys_DictionaryValue.cs" />

+ 25 - 0
CallCenterApi/CallCenterApi.DAL/T_Cus_CustomerBase.cs

@@ -191,6 +191,31 @@ namespace CallCenterApi.DAL
191 191
             }
192 192
         }
193 193
 
194
+        /// <summary>
195
+        /// 得到一个对象实体
196
+        /// </summary>
197
+        public CallCenterApi.Model.T_Cus_CustomerBase GetModelByTel(string tel)
198
+        {
199
+
200
+            StringBuilder strSql = new StringBuilder();
201
+            strSql.Append("select  top 1 F_Id,F_Name,F_PhoneNum1,F_PhoneNum2,F_Address,F_CusType,F_AddAgentId,F_AddTime,F_Remark,F_YHFKId,F_YHFKName,F_DeptId,F_DeleteFlag  from T_Cus_CustomerBase ");
202
+            strSql.Append(" where F_PhoneNum1=@F_PhoneNum1");
203
+            SqlParameter[] parameters = {
204
+                    new SqlParameter("@F_PhoneNum1",tel)
205
+            };
206
+
207
+            CallCenterApi.Model.T_Cus_CustomerBase model = new CallCenterApi.Model.T_Cus_CustomerBase();
208
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
209
+            if (ds.Tables[0].Rows.Count > 0)
210
+            {
211
+                return DataRowToModel(ds.Tables[0].Rows[0]);
212
+            }
213
+            else
214
+            {
215
+                return null;
216
+            }
217
+        }
218
+
194 219
 
195 220
         /// <summary>
196 221
         /// 得到一个对象实体

+ 49 - 0
CallCenterApi/CallCenterApi.DAL/T_Sys_BanCallOutTime.cs

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

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

@@ -253,6 +253,7 @@
253 253
     <Compile Include="Controllers\SysConfigController.cs" />
254 254
     <Compile Include="Controllers\tel\CallblackController.cs" />
255 255
     <Compile Include="Controllers\tel\CallInScreenController.cs" />
256
+    <Compile Include="Controllers\tel\CallInTransferController.cs" />
256 257
     <Compile Include="Controllers\tel\CallleaveController.cs" />
257 258
     <Compile Include="Controllers\tel\CallOutScreenController.cs" />
258 259
     <Compile Include="Controllers\tel\CallrecordsController.cs" />
@@ -364,6 +365,7 @@
364 365
     <Folder Include="Views\Base\" />
365 366
     <Folder Include="Views\Business\" />
366 367
     <Folder Include="Views\Callblack\" />
368
+    <Folder Include="Views\CallInTransfer\" />
367 369
     <Folder Include="Views\CallIn\" />
368 370
     <Folder Include="Views\Callleave\" />
369 371
     <Folder Include="Views\CallOutLimit\" />

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

@@ -14,6 +14,8 @@ namespace CallCenterApi.Interface.Controllers.callout
14 14
     public class BanCallOutController : BaseController
15 15
     {
16 16
         private readonly BLL.T_Call_BanCallOut banCallOutBLL = new BLL.T_Call_BanCallOut();
17
+        private readonly BLL.T_Sys_BanCallOutTime banCallOutTimeBLL = new BLL.T_Sys_BanCallOutTime();
18
+
17 19
 
18 20
         #region 禁止外呼号码管理
19 21
         public ActionResult GetList(FilterBanCallOut filter)
@@ -74,7 +76,61 @@ namespace CallCenterApi.Interface.Controllers.callout
74 76
         #endregion
75 77
 
76 78
         #region 限制外呼时间管理
79
+        public ActionResult GetBanCallOutTimeList(FilterBanCallOut filter)
80
+        {
81
+            StringBuilder sb = new StringBuilder();
82
+            if (!string.IsNullOrWhiteSpace(filter.Phone))
83
+            {
84
+                sb.Append($"  and  F_Phone='{filter.Phone}'");
85
+            }
86
+            //if (filter.Start != null && filter.End != null)
87
+            //{
88
+            //    sb.Append($"  and  F_Phone='{filter.Phone}'");
89
+            //}
90
+            var recordCount = 0;
91
+            var dt = BLL.PagerBLL.GetListPager(
92
+                             "T_Sys_BanCallOut",
93
+                             "F_Id",
94
+                             "*",
95
+                             sb.ToString(),
96
+                             "ORDER BY F_ID desc",
97
+                             filter.PageSize,
98
+                             filter.PageIndex,
99
+                             true,
100
+                             out recordCount);
101
+            List<Model.T_Sys_BanCallOutTime> modelList = new BLL.T_Sys_BanCallOutTime().DataTableToList(dt);
102
+            var obj = new
103
+            {
104
+                rows = modelList,
105
+                total = recordCount
106
+            };
107
+            return Content(obj.ToJson());
108
+        }
77 109
 
110
+        public ActionResult AddBanCallOutTime(BanCallOutInput input)
111
+        {
112
+            if (string.IsNullOrWhiteSpace(input.Phone))
113
+                return Error("号码不可为空");
114
+            var model = banCallOutBLL.GetModel(input.Phone);
115
+            if (model != null)
116
+                return Error("该号码已被限制外呼");
117
+            if (banCallOutBLL.Add(new Model.T_Call_BanCallOut()
118
+            {
119
+                F_Phone = input.Phone,
120
+                F_Remark = input.Remark
121
+            }) > 0)
122
+                return Success("添加成功");
123
+            return Error("添加失败");
124
+        }
125
+
126
+        public ActionResult DeleteBanCallOutTime(int[] ids)
127
+        {
128
+            if (ids == null || ids.Length <= 0)
129
+                return Error("请选择需要删除的项");
130
+            var idsStr = string.Join(",", ids);
131
+            banCallOutBLL.deleteBatch(idsStr);
132
+            return Success("删除成功");
133
+        }
78 134
         #endregion
79 135
 
80 136
     }

+ 1 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerController.cs

@@ -201,6 +201,7 @@ namespace CallCenterApi.Interface.Controllers.customer
201 201
                 model.F_DeptId = CurrentUser.UserData.F_DeptId;
202 202
 
203 203
 
204
+
204 205
                 if (bll.Add(model) > 0)
205 206
                     return Success("新增成功!");
206 207
                 return Error("新增失败!");

+ 52 - 11
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallInScreenController.cs

@@ -1,9 +1,11 @@
1 1
 using CallCenter.Utility;
2 2
 using CallCenterApi.Common;
3
+using CallCenterApi.DB;
3 4
 using CallCenterApi.Interface.Controllers.Base;
4 5
 using System;
5 6
 using System.Collections.Generic;
6 7
 using System.Data;
8
+using System.Data.SqlClient;
7 9
 using System.Linq;
8 10
 using System.Web;
9 11
 using System.Web.Mvc;
@@ -12,6 +14,10 @@ namespace CallCenterApi.Interface.Controllers.tel
12 14
 {
13 15
     public class CallInScreenController : BaseController
14 16
     {
17
+        private readonly BLL.T_Cus_CustomerBase customerBaseBLL = new BLL.T_Cus_CustomerBase();
18
+        private readonly BLL.T_Cus_CustomerField customerFieldBLL = new BLL.T_Cus_CustomerField();
19
+        private readonly BLL.T_Cus_CustomerExpand customerExpandBLL = new BLL.T_Cus_CustomerExpand();
20
+
15 21
         /// <summary>
16 22
         /// 添加黑名单
17 23
         /// </summary>
@@ -112,21 +118,56 @@ namespace CallCenterApi.Interface.Controllers.tel
112 118
         /// 根据来电号码获取客户信息
113 119
         /// </summary>
114 120
         /// <returns></returns>
115
-        public ActionResult GetCustomerByTel()
121
+        public ActionResult GetCustomerByTel(string tel)
116 122
         {
117
-            ActionResult res = NoToken("未知错误,请重新登录");
118
-            if (Request.IsAuthenticated)
123
+            //ActionResult res = NoToken("未知错误,请重新登录");
124
+            //if (Request.IsAuthenticated)
125
+            //{
126
+            //    DataTable dt = new DataTable();
127
+
128
+            //    string tel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));
129
+            //    BLL.T_Cus_CustomerBase bll = new BLL.T_Cus_CustomerBase();
130
+            //    dt = bll.GetList(" F_Telephone like '%" + tel + "%' or F_Mobile like '%" + tel + "%' ").Tables[0];
131
+
132
+            //    res = Success("客户信息加载成功", dt);
133
+
134
+            //}
135
+            //return res;
136
+
137
+
138
+            if (string.IsNullOrWhiteSpace(tel))
139
+                return Error("来电号码为空");
140
+            var userModel = customerBaseBLL.GetModelByTel(tel);
141
+            if (userModel == null)
142
+                return Error("获取失败,该客户信息不存在");
143
+            //系统列+自定义列 实体
144
+            var columnList = customerFieldBLL.GetList().Where(x => x.F_IsShowOnList > 0).OrderBy(x => x.F_Sort).ToList();
145
+            //系统列+自定义列 字符串
146
+            var headList = columnList.Select(x => x.F_Name).ToList();
147
+            //系统列+自定义列 字段名
148
+            var nameList = columnList.Select(x => x.F_DBFieldName).ToList();
149
+            //自定义列字段名
150
+            var customerColumnArr = columnList.Where(x => x.F_FieldType == 1).Select(x => x.F_DBFieldName).ToList();
151
+            //自定义列值
152
+            var expand = DbHelperSQL.Query("select  top 1 * from T_Cus_CustomerExpand where F_CustomerId=@F_CustomerId", new SqlParameter("@F_CustomerId", userModel.F_Id)).Tables[0].Rows[0];
153
+            List<string> strList1 = new List<string>()
119 154
             {
120
-                DataTable dt = new DataTable();
121
-
122
-                string tel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));
123
-                BLL.T_Cus_CustomerBase bll = new BLL.T_Cus_CustomerBase();
124
-                dt = bll.GetList(" F_Telephone like '%" + tel + "%' or F_Mobile like '%" + tel + "%' ").Tables[0];
155
+                 userModel.F_Name, userModel.F_PhoneNum1, userModel.F_PhoneNum2, userModel.F_Address, userModel.F_CusType.ToString(), userModel.F_AddAgentId.ToString(), userModel.F_AddTime.ToString("yyyy-MM-dd HH:mm:ss"), userModel.F_Remark
156
+            };
157
+            List<string> strList2 = new List<string>();
158
+            foreach (var item in customerColumnArr)
159
+            {
160
+                strList2.Add(expand[item].ToString());
161
+            }
162
+            strList1.AddRange(strList2);
125 163
 
126
-                res = Success("客户信息加载成功", dt);
164
+            return Success("获取成功", new
165
+            {
166
+                namelist = nameList,
167
+                headlist = headList,
168
+                datalist = strList1
169
+            });
127 170
 
128
-            }
129
-            return res;
130 171
         }
131 172
 
132 173
         /// <summary>

+ 14 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallInTransferController.cs

@@ -0,0 +1,14 @@
1
+using CallCenterApi.Interface.Controllers.Base;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Linq;
5
+using System.Web;
6
+using System.Web.Mvc;
7
+
8
+namespace CallCenterApi.Interface.Controllers.tel
9
+{
10
+    public class CallInTransferController : BaseController
11
+    {
12
+
13
+    }
14
+}

+ 41 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/CustomerInput.cs

@@ -16,5 +16,46 @@ namespace CallCenterApi.Interface.Models.Input
16 16
         public string Remark { get; set; }
17 17
         public int? YHFKId { get; set; }
18 18
         public string YHFKName { get; set; }
19
+
20
+        public string F_StrExpand1 { get; set; }
21
+        public string F_StrExpand2 { get; set; }
22
+        public string F_StrExpand3 { get; set; }
23
+        public string F_StrExpand4 { get; set; }
24
+        public string F_StrExpand5 { get; set; }
25
+        public string F_StrExpand6 { get; set; }
26
+        public string F_StrExpand7 { get; set; }
27
+        public string F_StrExpand8 { get; set; }
28
+        public string F_StrExpand9 { get; set; }
29
+        public string F_StrExpand10 { get; set; }
30
+        public string F_StrExpand11 { get; set; }
31
+        public string F_StrExpand12 { get; set; }
32
+        public string F_StrExpand13 { get; set; }
33
+        public string F_StrExpand14 { get; set; }
34
+        public string F_StrExpand15 { get; set; }
35
+        public string F_StrExpand16 { get; set; }
36
+        public string F_StrExpand17 { get; set; }
37
+        public string F_StrExpand18 { get; set; }
38
+        public string F_StrExpand19 { get; set; }
39
+        public string F_StrExpand20 { get; set; }
40
+        public string F_StrExpand21 { get; set; }
41
+        public string F_StrExpand22 { get; set; }
42
+        public string F_StrExpand23 { get; set; }
43
+        public string F_StrExpand24 { get; set; }
44
+        public string F_StrExpand25 { get; set; }
45
+        public string F_StrExpand26 { get; set; }
46
+        public string F_StrExpand27 { get; set; }
47
+        public string F_StrExpand28 { get; set; }
48
+        public string F_StrExpand29 { get; set; }
49
+        public string F_StrExpand30 { get; set; }
50
+        public string F_StrExpand31 { get; set; }
51
+        public string F_StrExpand32 { get; set; }
52
+        public string F_StrExpand33 { get; set; }
53
+        public string F_StrExpand34 { get; set; }
54
+        public string F_StrExpand35 { get; set; }
55
+        public string F_StrExpand36 { get; set; }
56
+        public string F_StrExpand37 { get; set; }
57
+        public string F_StrExpand38 { get; set; }
58
+        public string F_StrExpand39 { get; set; }
59
+        public string F_StrExpand40 { get; set; }
19 60
     }
20 61
 }

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

@@ -95,6 +95,7 @@
95 95
     <Compile Include="T_SMS_SendSMSTask.cs" />
96 96
     <Compile Include="T_SMS_SentSMS.cs" />
97 97
     <Compile Include="T_SMS_Template.cs" />
98
+    <Compile Include="T_Sys_BanCallOutTime.cs" />
98 99
     <Compile Include="T_Sys_Department.cs" />
99 100
     <Compile Include="T_Sys_DictionaryBase.cs" />
100 101
     <Compile Include="T_Sys_DictionaryValue.cs" />

+ 19 - 0
CallCenterApi/CallCenterApi.Model/T_Sys_BanCallOutTime.cs

@@ -0,0 +1,19 @@
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_Sys_BanCallOutTime
10
+    {
11
+        public int Id { get; set; }
12
+        public DateTime? StartTime1 { get; set; }
13
+        public DateTime? StartTime2 { get; set; }
14
+        public DateTime? EndTime1 { get; set; }
15
+        public DateTime? EndTime2 { get; set; }
16
+
17
+
18
+    }
19
+}