Преглед на файлове

Merge branch 'master' of http://192.168.1.222:3000/zhoufan/12345_Base_Api

zhoufan преди 8 години
родител
ревизия
9bbb90e981

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

@@ -101,6 +101,7 @@
101 101
     <Compile Include="T_Sys_Function.cs" />
102 102
     <Compile Include="T_Sys_Group.cs" />
103 103
     <Compile Include="T_Sys_GroupClass.cs" />
104
+    <Compile Include="T_Sys_IVRWords.cs" />
104 105
     <Compile Include="T_Sys_LoginLogs.cs" />
105 106
     <Compile Include="T_Sys_MobileData.cs" />
106 107
     <Compile Include="T_Sys_RoleFunction.cs" />

+ 132 - 0
CallCenterApi/CallCenterApi.BLL/T_Sys_IVRWords.cs

@@ -0,0 +1,132 @@
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
+    /// <summary>
11
+	/// IVR语音文件表
12
+	/// </summary>
13
+	public partial class T_Sys_IVRWords
14
+    {
15
+        private readonly CallCenterApi.DAL.T_Sys_IVRWords dal = new CallCenterApi.DAL.T_Sys_IVRWords();
16
+        public T_Sys_IVRWords()
17
+        { }
18
+        #region  BasicMethod
19
+        /// <summary>
20
+        /// 增加一条数据
21
+        /// </summary>
22
+        public int Add(CallCenterApi.Model.T_Sys_IVRWords model)
23
+        {
24
+            return dal.Add(model);
25
+        }
26
+
27
+        /// <summary>
28
+        /// 更新一条数据
29
+        /// </summary>
30
+        public bool Update(CallCenterApi.Model.T_Sys_IVRWords model)
31
+        {
32
+            return dal.Update(model);
33
+        }
34
+
35
+        /// <summary>
36
+        /// 删除一条数据
37
+        /// </summary>
38
+        public bool Delete(int F_ID)
39
+        {
40
+
41
+            return dal.Delete(F_ID);
42
+        }
43
+        /// <summary>
44
+        /// 删除一条数据
45
+        /// </summary>
46
+        public bool DeleteList(string F_IDlist)
47
+        {
48
+            return dal.DeleteList(F_IDlist);
49
+        }
50
+
51
+        /// <summary>
52
+        /// 得到一个对象实体
53
+        /// </summary>
54
+        public CallCenterApi.Model.T_Sys_IVRWords GetModel(int F_ID)
55
+        {
56
+
57
+            return dal.GetModel(F_ID);
58
+        }
59
+
60
+        /// <summary>
61
+        /// 获得数据列表
62
+        /// </summary>
63
+        public DataSet GetList(string strWhere)
64
+        {
65
+            return dal.GetList(strWhere);
66
+        }
67
+        /// <summary>
68
+        /// 获得前几行数据
69
+        /// </summary>
70
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
71
+        {
72
+            return dal.GetList(Top, strWhere, filedOrder);
73
+        }
74
+        /// <summary>
75
+        /// 获得数据列表
76
+        /// </summary>
77
+        public List<CallCenterApi.Model.T_Sys_IVRWords> GetModelList(string strWhere)
78
+        {
79
+            DataSet ds = dal.GetList(strWhere);
80
+            return DataTableToList(ds.Tables[0]);
81
+        }
82
+        /// <summary>
83
+        /// 获得数据列表
84
+        /// </summary>
85
+        public List<CallCenterApi.Model.T_Sys_IVRWords> DataTableToList(DataTable dt)
86
+        {
87
+            List<CallCenterApi.Model.T_Sys_IVRWords> modelList = new List<CallCenterApi.Model.T_Sys_IVRWords>();
88
+            int rowsCount = dt.Rows.Count;
89
+            if (rowsCount > 0)
90
+            {
91
+                CallCenterApi.Model.T_Sys_IVRWords model;
92
+                for (int n = 0; n < rowsCount; n++)
93
+                {
94
+                    model = dal.DataRowToModel(dt.Rows[n]);
95
+                    if (model != null)
96
+                    {
97
+                        modelList.Add(model);
98
+                    }
99
+                }
100
+            }
101
+            return modelList;
102
+        }
103
+
104
+        /// <summary>
105
+        /// 获得数据列表
106
+        /// </summary>
107
+        public DataSet GetAllList()
108
+        {
109
+            return GetList("");
110
+        }
111
+
112
+        /// <summary>
113
+        /// 分页获取数据列表
114
+        /// </summary>
115
+        public int GetRecordCount(string strWhere)
116
+        {
117
+            return dal.GetRecordCount(strWhere);
118
+        }
119
+        /// <summary>
120
+        /// 分页获取数据列表
121
+        /// </summary>
122
+        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
123
+        {
124
+            return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
125
+        }
126
+
127
+        #endregion  BasicMethod
128
+        #region  ExtensionMethod
129
+
130
+        #endregion  ExtensionMethod
131
+    }
132
+}

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

@@ -101,6 +101,7 @@
101 101
     <Compile Include="T_Sys_Function.cs" />
102 102
     <Compile Include="T_Sys_Group.cs" />
103 103
     <Compile Include="T_Sys_GroupClass.cs" />
104
+    <Compile Include="T_Sys_IVRWords.cs" />
104 105
     <Compile Include="T_Sys_LoginLogs.cs" />
105 106
     <Compile Include="T_Sys_MobileData.cs" />
106 107
     <Compile Include="T_Sys_RoleFunction.cs" />

+ 325 - 0
CallCenterApi/CallCenterApi.DAL/T_Sys_IVRWords.cs

@@ -0,0 +1,325 @@
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
+    /// <summary>
13
+	/// 数据访问类:T_Sys_IVRWords
14
+	/// </summary>
15
+	public partial class T_Sys_IVRWords
16
+    {
17
+        public T_Sys_IVRWords()
18
+        { }
19
+        #region  BasicMethod
20
+
21
+        /// <summary>
22
+        /// 增加一条数据
23
+        /// </summary>
24
+        public int Add(CallCenterApi.Model.T_Sys_IVRWords model)
25
+        {
26
+            StringBuilder strSql = new StringBuilder();
27
+            strSql.Append("insert into T_Sys_IVRWords(");
28
+            strSql.Append("F_Title,F_Content,F_StartDate,F_EndDate,F_Remark,F_IsState,F_CreateTime,F_CreateUser,F_IsDel)");
29
+            strSql.Append(" values (");
30
+            strSql.Append("@F_Title,@F_Content,@F_StartDate,@F_EndDate,@F_Remark,@F_IsState,@F_CreateTime,@F_CreateUser,@F_IsDel)");
31
+            strSql.Append(";select @@IDENTITY");
32
+            SqlParameter[] parameters = {
33
+                    new SqlParameter("@F_Title", SqlDbType.NVarChar,500),
34
+                    new SqlParameter("@F_Content", SqlDbType.NText),
35
+                    new SqlParameter("@F_StartDate", SqlDbType.DateTime),
36
+                    new SqlParameter("@F_EndDate", SqlDbType.DateTime),
37
+                    new SqlParameter("@F_Remark", SqlDbType.NText),
38
+                    new SqlParameter("@F_IsState", SqlDbType.Int,4),
39
+                    new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
40
+                    new SqlParameter("@F_CreateUser", SqlDbType.NVarChar,50),
41
+                    new SqlParameter("@F_IsDel", SqlDbType.Int,4)};
42
+            parameters[0].Value = model.F_Title;
43
+            parameters[1].Value = model.F_Content;
44
+            parameters[2].Value = model.F_StartDate;
45
+            parameters[3].Value = model.F_EndDate;
46
+            parameters[4].Value = model.F_Remark;
47
+            parameters[5].Value = model.F_IsState;
48
+            parameters[6].Value = model.F_CreateTime;
49
+            parameters[7].Value = model.F_CreateUser;
50
+            parameters[8].Value = model.F_IsDel;
51
+
52
+            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
53
+            if (obj == null)
54
+            {
55
+                return 0;
56
+            }
57
+            else
58
+            {
59
+                return Convert.ToInt32(obj);
60
+            }
61
+        }
62
+        /// <summary>
63
+        /// 更新一条数据
64
+        /// </summary>
65
+        public bool Update(CallCenterApi.Model.T_Sys_IVRWords model)
66
+        {
67
+            StringBuilder strSql = new StringBuilder();
68
+            strSql.Append("update T_Sys_IVRWords set ");
69
+            strSql.Append("F_Title=@F_Title,");
70
+            strSql.Append("F_Content=@F_Content,");
71
+            strSql.Append("F_StartDate=@F_StartDate,");
72
+            strSql.Append("F_EndDate=@F_EndDate,");
73
+            strSql.Append("F_Remark=@F_Remark,");
74
+            strSql.Append("F_IsState=@F_IsState,");
75
+            strSql.Append("F_CreateTime=@F_CreateTime,");
76
+            strSql.Append("F_CreateUser=@F_CreateUser,");
77
+            strSql.Append("F_IsDel=@F_IsDel");
78
+            strSql.Append(" where F_ID=@F_ID");
79
+            SqlParameter[] parameters = {
80
+                    new SqlParameter("@F_Title", SqlDbType.NVarChar,500),
81
+                    new SqlParameter("@F_Content", SqlDbType.NText),
82
+                    new SqlParameter("@F_StartDate", SqlDbType.DateTime),
83
+                    new SqlParameter("@F_EndDate", SqlDbType.DateTime),
84
+                    new SqlParameter("@F_Remark", SqlDbType.NText),
85
+                    new SqlParameter("@F_IsState", SqlDbType.Int,4),
86
+                    new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
87
+                    new SqlParameter("@F_CreateUser", SqlDbType.NVarChar,50),
88
+                    new SqlParameter("@F_IsDel", SqlDbType.Int,4),
89
+                    new SqlParameter("@F_ID", SqlDbType.Int,4)};
90
+            parameters[0].Value = model.F_Title;
91
+            parameters[1].Value = model.F_Content;
92
+            parameters[2].Value = model.F_StartDate;
93
+            parameters[3].Value = model.F_EndDate;
94
+            parameters[4].Value = model.F_Remark;
95
+            parameters[5].Value = model.F_IsState;
96
+            parameters[6].Value = model.F_CreateTime;
97
+            parameters[7].Value = model.F_CreateUser;
98
+            parameters[8].Value = model.F_IsDel;
99
+            parameters[9].Value = model.F_ID;
100
+
101
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
102
+            if (rows > 0)
103
+            {
104
+                return true;
105
+            }
106
+            else
107
+            {
108
+                return false;
109
+            }
110
+        }
111
+
112
+        /// <summary>
113
+        /// 删除一条数据
114
+        /// </summary>
115
+        public bool Delete(int F_ID)
116
+        {
117
+
118
+            StringBuilder strSql = new StringBuilder();
119
+            //strSql.Append("delete from T_Sys_IVRWords ");
120
+            strSql.Append("update T_Sys_IVRWords set F_IsDel=1 ");
121
+            strSql.Append(" where F_ID=@F_ID");
122
+            SqlParameter[] parameters = {
123
+                    new SqlParameter("@F_ID", SqlDbType.Int,4)
124
+            };
125
+            parameters[0].Value = F_ID;
126
+
127
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
128
+            if (rows > 0)
129
+            {
130
+                return true;
131
+            }
132
+            else
133
+            {
134
+                return false;
135
+            }
136
+        }
137
+        /// <summary>
138
+        /// 批量删除数据
139
+        /// </summary>
140
+        public bool DeleteList(string F_IDlist)
141
+        {
142
+            StringBuilder strSql = new StringBuilder();
143
+            //strSql.Append("delete from T_Sys_IVRWords ");
144
+            strSql.Append("update T_Sys_IVRWords set F_IsDel=1 ");
145
+            strSql.Append(" where F_ID in (" + F_IDlist + ")  ");
146
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
147
+            if (rows > 0)
148
+            {
149
+                return true;
150
+            }
151
+            else
152
+            {
153
+                return false;
154
+            }
155
+        }
156
+
157
+
158
+        /// <summary>
159
+        /// 得到一个对象实体
160
+        /// </summary>
161
+        public CallCenterApi.Model.T_Sys_IVRWords GetModel(int F_ID)
162
+        {
163
+
164
+            StringBuilder strSql = new StringBuilder();
165
+            strSql.Append("select  top 1 F_ID,F_Title,F_Content,F_StartDate,F_EndDate,F_Remark,F_IsState,F_CreateTime,F_CreateUser,F_IsDel from T_Sys_IVRWords ");
166
+            strSql.Append(" where F_ID=@F_ID");
167
+            SqlParameter[] parameters = {
168
+                    new SqlParameter("@F_ID", SqlDbType.Int,4)
169
+            };
170
+            parameters[0].Value = F_ID;
171
+
172
+            CallCenterApi.Model.T_Sys_IVRWords model = new CallCenterApi.Model.T_Sys_IVRWords();
173
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
174
+            if (ds.Tables[0].Rows.Count > 0)
175
+            {
176
+                return DataRowToModel(ds.Tables[0].Rows[0]);
177
+            }
178
+            else
179
+            {
180
+                return null;
181
+            }
182
+        }
183
+
184
+
185
+        /// <summary>
186
+        /// 得到一个对象实体
187
+        /// </summary>
188
+        public CallCenterApi.Model.T_Sys_IVRWords DataRowToModel(DataRow row)
189
+        {
190
+            CallCenterApi.Model.T_Sys_IVRWords model = new CallCenterApi.Model.T_Sys_IVRWords();
191
+            if (row != null)
192
+            {
193
+                if (row["F_ID"] != null && row["F_ID"].ToString() != "")
194
+                {
195
+                    model.F_ID = int.Parse(row["F_ID"].ToString());
196
+                }
197
+                if (row["F_Title"] != null)
198
+                {
199
+                    model.F_Title = row["F_Title"].ToString();
200
+                }
201
+                if (row["F_Content"] != null)
202
+                {
203
+                    model.F_Content = row["F_Content"].ToString();
204
+                }
205
+                if (row["F_StartDate"] != null && row["F_StartDate"].ToString() != "")
206
+                {
207
+                    model.F_StartDate = DateTime.Parse(row["F_StartDate"].ToString());
208
+                }
209
+                if (row["F_EndDate"] != null && row["F_EndDate"].ToString() != "")
210
+                {
211
+                    model.F_EndDate = DateTime.Parse(row["F_EndDate"].ToString());
212
+                }
213
+                if (row["F_Remark"] != null)
214
+                {
215
+                    model.F_Remark = row["F_Remark"].ToString();
216
+                }
217
+                if (row["F_IsState"] != null && row["F_IsState"].ToString() != "")
218
+                {
219
+                    model.F_IsState = int.Parse(row["F_IsState"].ToString());
220
+                }
221
+                if (row["F_CreateTime"] != null && row["F_CreateTime"].ToString() != "")
222
+                {
223
+                    model.F_CreateTime = DateTime.Parse(row["F_CreateTime"].ToString());
224
+                }
225
+                if (row["F_CreateUser"] != null)
226
+                {
227
+                    model.F_CreateUser = row["F_CreateUser"].ToString();
228
+                }
229
+                if (row["F_IsDel"] != null && row["F_IsDel"].ToString() != "")
230
+                {
231
+                    model.F_IsDel = int.Parse(row["F_IsDel"].ToString());
232
+                }
233
+            }
234
+            return model;
235
+        }
236
+
237
+        /// <summary>
238
+        /// 获得数据列表
239
+        /// </summary>
240
+        public DataSet GetList(string strWhere)
241
+        {
242
+            StringBuilder strSql = new StringBuilder();
243
+            strSql.Append("select F_ID,F_Title,F_Content,F_StartDate,F_EndDate,F_Remark,F_IsState,F_CreateTime,F_CreateUser,F_IsDel ");
244
+            strSql.Append(" FROM T_Sys_IVRWords ");
245
+            if (strWhere.Trim() != "")
246
+            {
247
+                strSql.Append(" where " + strWhere);
248
+            }
249
+            return DbHelperSQL.Query(strSql.ToString());
250
+        }
251
+
252
+        /// <summary>
253
+        /// 获得前几行数据
254
+        /// </summary>
255
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
256
+        {
257
+            StringBuilder strSql = new StringBuilder();
258
+            strSql.Append("select ");
259
+            if (Top > 0)
260
+            {
261
+                strSql.Append(" top " + Top.ToString());
262
+            }
263
+            strSql.Append(" F_ID,F_Title,F_Content,F_StartDate,F_EndDate,F_Remark,F_IsState,F_CreateTime,F_CreateUser,F_IsDel ");
264
+            strSql.Append(" FROM T_Sys_IVRWords ");
265
+            if (strWhere.Trim() != "")
266
+            {
267
+                strSql.Append(" where " + strWhere);
268
+            }
269
+            strSql.Append(" order by " + filedOrder);
270
+            return DbHelperSQL.Query(strSql.ToString());
271
+        }
272
+
273
+        /// <summary>
274
+        /// 获取记录总数
275
+        /// </summary>
276
+        public int GetRecordCount(string strWhere)
277
+        {
278
+            StringBuilder strSql = new StringBuilder();
279
+            strSql.Append("select count(1) FROM T_Sys_IVRWords ");
280
+            if (strWhere.Trim() != "")
281
+            {
282
+                strSql.Append(" where " + strWhere);
283
+            }
284
+            object obj = DbHelperSQL.GetSingle(strSql.ToString());
285
+            if (obj == null)
286
+            {
287
+                return 0;
288
+            }
289
+            else
290
+            {
291
+                return Convert.ToInt32(obj);
292
+            }
293
+        }
294
+        /// <summary>
295
+        /// 分页获取数据列表
296
+        /// </summary>
297
+        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
298
+        {
299
+            StringBuilder strSql = new StringBuilder();
300
+            strSql.Append("SELECT * FROM ( ");
301
+            strSql.Append(" SELECT ROW_NUMBER() OVER (");
302
+            if (!string.IsNullOrEmpty(orderby.Trim()))
303
+            {
304
+                strSql.Append("order by T." + orderby);
305
+            }
306
+            else
307
+            {
308
+                strSql.Append("order by T.F_ID desc");
309
+            }
310
+            strSql.Append(")AS Row, T.*  from T_Sys_IVRWords T ");
311
+            if (!string.IsNullOrEmpty(strWhere.Trim()))
312
+            {
313
+                strSql.Append(" WHERE " + strWhere);
314
+            }
315
+            strSql.Append(" ) TT");
316
+            strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
317
+            return DbHelperSQL.Query(strSql.ToString());
318
+        }
319
+
320
+        #endregion  BasicMethod
321
+        #region  ExtensionMethod
322
+
323
+        #endregion  ExtensionMethod
324
+    }
325
+}

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

@@ -185,6 +185,7 @@
185 185
     <Compile Include="Controllers\InfoController.cs" />
186 186
     <Compile Include="Controllers\information\InternalMessagesController.cs" />
187 187
     <Compile Include="Controllers\information\NoticeController.cs" />
188
+    <Compile Include="Controllers\IVRWordsController.cs" />
188 189
     <Compile Include="Controllers\knowledge\KnowledgeClassController.cs" />
189 190
     <Compile Include="Controllers\knowledge\KnowledgeController.cs" />
190 191
     <Compile Include="Controllers\LogController.cs" />
@@ -316,6 +317,7 @@
316 317
     <Folder Include="Views\Index\" />
317 318
     <Folder Include="Views\Info\" />
318 319
     <Folder Include="Views\InternalMessages\" />
320
+    <Folder Include="Views\IVRWords\" />
319 321
     <Folder Include="Views\KnowledgeClass\" />
320 322
     <Folder Include="Views\Knowledge\" />
321 323
     <Folder Include="Views\Login\" />

+ 196 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/IVRWordsController.cs

@@ -0,0 +1,196 @@
1
+using CallCenter.Utility;
2
+using CallCenterApi.Common;
3
+using CallCenterApi.Interface.Controllers.Base;
4
+using System;
5
+using System.Collections.Generic;
6
+using System.Data;
7
+using System.Linq;
8
+using System.Web;
9
+using System.Web.Mvc;
10
+
11
+namespace CallCenterApi.Interface.Controllers
12
+{
13
+    public class IVRWordsController : BaseController
14
+    {
15
+        //获取IVR欢迎词列表
16
+        public ActionResult GetList()
17
+        {
18
+            string sql = " and F_IsDel = 0 ";
19
+            DataTable dt = new DataTable();
20
+
21
+            string key = HttpUtility.UrlDecode(RequestString.GetQueryString("key"));
22
+            string strbtime = HttpUtility.UrlDecode(RequestString.GetQueryString("btime"));
23
+            string stretime = HttpUtility.UrlDecode(RequestString.GetQueryString("etime"));
24
+
25
+            string strpageindex = RequestString.GetQueryString("page");
26
+            int pageindex = 1;
27
+            string strpagesize = RequestString.GetQueryString("pagesize");
28
+            int pagesize = 10;
29
+
30
+            if (key.Trim() != "" && key != "undefined")
31
+            {
32
+                sql += " and (F_Title like '%" + key.Trim() + "%' or F_Content like '%" + key.Trim() + "%' )";
33
+            }
34
+            if (strbtime.Trim() != "" && strbtime != "undefined")
35
+            {
36
+                sql += " and F_CreateTime >= '" + Convert.ToDateTime(strbtime.Trim()) + "' ";
37
+            }
38
+            if (stretime.Trim() != "" && stretime != "undefined")
39
+            {
40
+                sql += " and F_CreateTime <= '" + Convert.ToDateTime(stretime.Trim()) + "' ";
41
+            }
42
+
43
+            if (strpageindex.Trim() != "")
44
+            {
45
+                pageindex = Convert.ToInt32(strpageindex);
46
+            }
47
+
48
+            if (strpagesize.Trim() != "")
49
+            {
50
+                pagesize = Convert.ToInt32(strpagesize);
51
+            }
52
+            int recordCount = 0;
53
+            dt = BLL.PagerBLL.GetListPager(
54
+           "T_Sys_IVRWords",
55
+           "F_ID",
56
+           "*",
57
+           sql,
58
+           "ORDER BY F_ID desc",
59
+           pagesize,
60
+           pageindex,
61
+           true,
62
+           out recordCount);
63
+            dt.Columns.Add("isButton", typeof(string));
64
+            foreach (DataRow dr in dt.Rows)
65
+            {
66
+                string isstart = dr["F_IsState"] != null ? dr["F_IsState"].ToString() : "";
67
+                string sdate = dr["F_StartDate"] != null ? dr["F_StartDate"].ToString() : "";
68
+                string edate = dr["F_EndDate"] != null ? dr["F_EndDate"].ToString() : "";
69
+
70
+                dr["isButton"] = "0";
71
+                if (isstart == "1")
72
+                {//启动状态
73
+                    if (sdate != "" && edate != "")
74
+                    {
75
+                        DateTime sd = DateTime.Parse(sdate);
76
+                        DateTime ed = DateTime.Parse(edate);
77
+                        DateTime nd = DateTime.Now;
78
+                        if (nd <= sd || (nd >= sd && nd <= ed))
79
+                        {
80
+                            //生效时间大于当前时间,或(生效时间小于当前时间,当前时间小于失效时间)
81
+                            //即:启动状态下,未到生效时间,或在有效时间内,均可以修改,按钮可用
82
+                            dr["isButton"] = "1";
83
+                        }
84
+                    }
85
+                }
86
+                
87
+            }
88
+
89
+            var obj = new
90
+            {
91
+                state = "success",
92
+                message = "成功",
93
+                rows = dt,
94
+                total = recordCount
95
+            };
96
+
97
+            return Content(obj.ToJson());
98
+
99
+        }
100
+
101
+        //获取IVR欢迎词
102
+        public ActionResult GetIVRWords(string id)
103
+        {
104
+            if (id != null && id.Trim() != "")
105
+            {
106
+                BLL.T_Sys_IVRWords dBLL = new BLL.T_Sys_IVRWords();
107
+                Model.T_Sys_IVRWords dModel = dBLL.GetModel(int.Parse(id.Trim()));
108
+                if (dModel != null)
109
+                {
110
+                    return Success("获取IVR欢迎词成功", dModel);
111
+                }
112
+                else
113
+                {
114
+                    return Error("获取IVR欢迎词失败");
115
+                }
116
+            }
117
+            else
118
+            {
119
+                return Error("获取参数失败");
120
+            }
121
+
122
+        }
123
+
124
+        //添加IVR欢迎词
125
+        public ActionResult AddIVRWords(string id,string title,string content,string isstate,string sdate,string edate,string remark)
126
+        {
127
+            bool res = false;
128
+            if (id != null && id.Trim() != "")
129
+            {
130
+                BLL.T_Sys_IVRWords dBLL = new BLL.T_Sys_IVRWords();
131
+                Model.T_Sys_IVRWords dModel = dBLL.GetModel(int.Parse(id.Trim()));
132
+                if (dModel != null)
133
+                {
134
+                    dModel.F_Title = title.Trim();
135
+                    dModel.F_Content = content.Trim();
136
+                    dModel.F_IsState = Utils.StrToInt(isstate,0);
137
+                    dModel.F_StartDate = Utils.StrToDateTime(sdate, DateTime.Now);
138
+                    dModel.F_EndDate = Utils.StrToDateTime(edate, DateTime.Now);
139
+                    dModel.F_Remark = remark.Trim();
140
+
141
+                    res = dBLL.Update(dModel);
142
+                }
143
+            }
144
+            else
145
+            {
146
+                Model.T_Sys_IVRWords dModel = new Model.T_Sys_IVRWords();
147
+
148
+                dModel.F_Title = title.Trim();
149
+                dModel.F_Content = content.Trim();
150
+                dModel.F_IsState = 0;
151
+                dModel.F_StartDate = DateTime.Now;
152
+                dModel.F_EndDate = DateTime.Now;
153
+                dModel.F_Remark = remark.Trim();
154
+                dModel.F_IsDel = 0;
155
+                dModel.F_CreateUser = User.UserData["F_UserCode"];
156
+                dModel.F_CreateTime = DateTime.Now;
157
+
158
+                int b = new BLL.T_Sys_IVRWords().Add(dModel);
159
+                res = b > 0;
160
+            }
161
+            if(res)
162
+            {
163
+                return Success("保存IVR欢迎词成功");
164
+            }
165
+            else
166
+            {
167
+                return Error("保存IVR欢迎词失败");
168
+            }
169
+            return Error("操作失败");
170
+        }
171
+
172
+        //删除IVR欢迎词
173
+        public ActionResult DelIVRWords(string[] ids)
174
+        {
175
+            if (ids != null && ids.Length > 0)
176
+            {
177
+                string idd = " ";
178
+                foreach (string str in ids)
179
+                {
180
+                    idd += str + ",";
181
+                }
182
+                if (new BLL.T_Sys_IVRWords().DeleteList(idd.TrimEnd(',')))
183
+                {
184
+                    return Success("删除成功");
185
+                }
186
+                else
187
+                    return Error("删除失败");
188
+            }
189
+            else
190
+            {
191
+                return Error("请选择要删除的记录");
192
+            }
193
+
194
+        }
195
+    }
196
+}

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

@@ -60,6 +60,7 @@
60 60
     <Compile Include="T_Msg_Chat_Map.cs" />
61 61
     <Compile Include="T_Sys_Group.cs" />
62 62
     <Compile Include="T_Sys_GroupClass.cs" />
63
+    <Compile Include="T_Sys_IVRWords.cs" />
63 64
     <Compile Include="T_Sys_SeatPermissionConfig.cs" />
64 65
     <Compile Include="T_Sys_UserClass.cs" />
65 66
     <Compile Include="T_Sys_Users.cs" />

+ 111 - 0
CallCenterApi/CallCenterApi.Model/T_Sys_IVRWords.cs

@@ -0,0 +1,111 @@
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
+    /// <summary>
10
+	/// IVR语音文件表
11
+	/// </summary>
12
+	[Serializable]
13
+    public partial class T_Sys_IVRWords
14
+    {
15
+        public T_Sys_IVRWords()
16
+        { }
17
+        #region Model
18
+        private int _f_id;
19
+        private string _f_title;
20
+        private string _f_content;
21
+        private DateTime? _f_startdate = DateTime.Now;
22
+        private DateTime? _f_enddate = DateTime.Now;
23
+        private string _f_remark;
24
+        private int? _f_isstate = 0;
25
+        private DateTime? _f_createtime = DateTime.Now;
26
+        private string _f_createuser;
27
+        private int? _f_isdel = 0;
28
+        /// <summary>
29
+        /// 自增ID
30
+        /// </summary>
31
+        public int F_ID
32
+        {
33
+            set { _f_id = value; }
34
+            get { return _f_id; }
35
+        }
36
+        /// <summary>
37
+        /// 标题
38
+        /// </summary>
39
+        public string F_Title
40
+        {
41
+            set { _f_title = value; }
42
+            get { return _f_title; }
43
+        }
44
+        /// <summary>
45
+        /// 内容
46
+        /// </summary>
47
+        public string F_Content
48
+        {
49
+            set { _f_content = value; }
50
+            get { return _f_content; }
51
+        }
52
+        /// <summary>
53
+        /// 生效时间
54
+        /// </summary>
55
+        public DateTime? F_StartDate
56
+        {
57
+            set { _f_startdate = value; }
58
+            get { return _f_startdate; }
59
+        }
60
+        /// <summary>
61
+        /// 失效时间
62
+        /// </summary>
63
+        public DateTime? F_EndDate
64
+        {
65
+            set { _f_enddate = value; }
66
+            get { return _f_enddate; }
67
+        }
68
+        /// <summary>
69
+        /// 备注
70
+        /// </summary>
71
+        public string F_Remark
72
+        {
73
+            set { _f_remark = value; }
74
+            get { return _f_remark; }
75
+        }
76
+        /// <summary>
77
+        /// 状态:1启动,0不启动
78
+        /// </summary>
79
+        public int? F_IsState
80
+        {
81
+            set { _f_isstate = value; }
82
+            get { return _f_isstate; }
83
+        }
84
+        /// <summary>
85
+        /// 添加时间
86
+        /// </summary>
87
+        public DateTime? F_CreateTime
88
+        {
89
+            set { _f_createtime = value; }
90
+            get { return _f_createtime; }
91
+        }
92
+        /// <summary>
93
+        /// 添加人
94
+        /// </summary>
95
+        public string F_CreateUser
96
+        {
97
+            set { _f_createuser = value; }
98
+            get { return _f_createuser; }
99
+        }
100
+        /// <summary>
101
+        /// 是否删除:0未删除,1已删除
102
+        /// </summary>
103
+        public int? F_IsDel
104
+        {
105
+            set { _f_isdel = value; }
106
+            get { return _f_isdel; }
107
+        }
108
+        #endregion Model
109
+
110
+    }
111
+}