lihai лет назад: 6
Родитель
Сommit
803b277aa2

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

@@ -98,6 +98,7 @@
98 98
     <Compile Include="T_Sys_Department.cs" />
99 99
     <Compile Include="T_Sys_DictionaryBase.cs" />
100 100
     <Compile Include="T_Sys_DictionaryValue.cs" />
101
+    <Compile Include="T_Sys_IVRWords.cs" />
101 102
     <Compile Include="T_Sys_LoginLogs.cs" />
102 103
     <Compile Include="T_Sys_MobileData.cs" />
103 104
     <Compile Include="T_Sys_ModuleInfo.cs" />

+ 180 - 0
codegit/CallCenterApi/CallCenterApi.BLL/T_Sys_IVRWords.cs

@@ -0,0 +1,180 @@
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 class T_Sys_IVRWords
14
+    {
15
+        private readonly DAL.T_Sys_IVRWords dal = new DAL.T_Sys_IVRWords();
16
+        public T_Sys_IVRWords()
17
+        { }
18
+        #region  BasicMethod
19
+
20
+        /// <summary>
21
+        /// 得到最大ID
22
+        /// </summary>
23
+        public int GetMaxId()
24
+        {
25
+            return dal.GetMaxId();
26
+        }
27
+
28
+        /// <summary>
29
+        /// 是否存在该记录
30
+        /// </summary>
31
+        public bool Exists(int FID)
32
+        {
33
+            return dal.Exists(FID);
34
+        }
35
+
36
+        /// <summary>
37
+        /// 增加一条数据
38
+        /// </summary>
39
+        public int Add(Model.T_Sys_IVRWords model)
40
+        {
41
+            return dal.Add(model);
42
+        }
43
+
44
+        /// <summary>
45
+        /// 更新一条数据
46
+        /// </summary>
47
+        public bool Update(Model.T_Sys_IVRWords model)
48
+        {
49
+            return dal.Update(model);
50
+        }
51
+
52
+        /// <summary>
53
+        /// 删除一条数据
54
+        /// </summary>
55
+        public bool Delete(int FID)
56
+        {
57
+
58
+            return dal.Delete(FID);
59
+        }
60
+        /// <summary>
61
+        /// 删除一条数据
62
+        /// </summary>
63
+        public bool DeleteList(string FIDlist)
64
+        {
65
+            return dal.DeleteList(FIDlist);
66
+        }
67
+
68
+        /// <summary>
69
+        /// 得到一个对象实体
70
+        /// </summary>
71
+        public Model.T_Sys_IVRWords GetModel(int FID)
72
+        {
73
+
74
+            return dal.GetModel(FID);
75
+        }
76
+
77
+        ///// <summary>
78
+        ///// 得到一个对象实体,从缓存中
79
+        ///// </summary>
80
+        //public Model.T_Sys_IVRWords GetModelByCache(int FID)
81
+        //{
82
+
83
+        //    string CacheKey = "T_Sys_IVRWordsModel-" + FID;
84
+        //    object objModel = Common.DataCache.GetCache(CacheKey);
85
+        //    if (objModel == null)
86
+        //    {
87
+        //        try
88
+        //        {
89
+        //            objModel = dal.GetModel(FID);
90
+        //            if (objModel != null)
91
+        //            {
92
+        //                int ModelCache = Common.ConfigHelper.GetConfigInt("ModelCache");
93
+        //                Common.DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero);
94
+        //            }
95
+        //        }
96
+        //        catch { }
97
+        //    }
98
+        //    return (Model.T_Sys_IVRWords)objModel;
99
+        //}
100
+
101
+        /// <summary>
102
+        /// 获得数据列表
103
+        /// </summary>
104
+        public DataSet GetList(string strWhere)
105
+        {
106
+            return dal.GetList(strWhere);
107
+        }
108
+        /// <summary>
109
+        /// 获得前几行数据
110
+        /// </summary>
111
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
112
+        {
113
+            return dal.GetList(Top, strWhere, filedOrder);
114
+        }
115
+        /// <summary>
116
+        /// 获得数据列表
117
+        /// </summary>
118
+        public List<Model.T_Sys_IVRWords> GetModelList(string strWhere)
119
+        {
120
+            DataSet ds = dal.GetList(strWhere);
121
+            return DataTableToList(ds.Tables[0]);
122
+        }
123
+        /// <summary>
124
+        /// 获得数据列表
125
+        /// </summary>
126
+        public List<Model.T_Sys_IVRWords> DataTableToList(DataTable dt)
127
+        {
128
+            List<Model.T_Sys_IVRWords> modelList = new List<Model.T_Sys_IVRWords>();
129
+            int rowsCount = dt.Rows.Count;
130
+            if (rowsCount > 0)
131
+            {
132
+                Model.T_Sys_IVRWords model;
133
+                for (int n = 0; n < rowsCount; n++)
134
+                {
135
+                    model = dal.DataRowToModel(dt.Rows[n]);
136
+                    if (model != null)
137
+                    {
138
+                        modelList.Add(model);
139
+                    }
140
+                }
141
+            }
142
+            return modelList;
143
+        }
144
+
145
+        /// <summary>
146
+        /// 获得数据列表
147
+        /// </summary>
148
+        public DataSet GetAllList()
149
+        {
150
+            return GetList("");
151
+        }
152
+
153
+        /// <summary>
154
+        /// 分页获取数据列表
155
+        /// </summary>
156
+        public int GetRecordCount(string strWhere)
157
+        {
158
+            return dal.GetRecordCount(strWhere);
159
+        }
160
+        /// <summary>
161
+        /// 分页获取数据列表
162
+        /// </summary>
163
+        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
164
+        {
165
+            return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
166
+        }
167
+        /// <summary>
168
+        /// 分页获取数据列表
169
+        /// </summary>
170
+        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
171
+        //{
172
+        //return dal.GetList(PageSize,PageIndex,strWhere);
173
+        //}
174
+
175
+        #endregion  BasicMethod
176
+        #region  ExtensionMethod
177
+
178
+        #endregion  ExtensionMethod
179
+    }
180
+}

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

@@ -98,6 +98,7 @@
98 98
     <Compile Include="T_Sys_Department.cs" />
99 99
     <Compile Include="T_Sys_DictionaryBase.cs" />
100 100
     <Compile Include="T_Sys_DictionaryValue.cs" />
101
+    <Compile Include="T_Sys_IVRWords.cs" />
101 102
     <Compile Include="T_Sys_LoginLogs.cs" />
102 103
     <Compile Include="T_Sys_MobileData.cs" />
103 104
     <Compile Include="T_Sys_ModuleInfo.cs" />

+ 400 - 0
codegit/CallCenterApi/CallCenterApi.DAL/T_Sys_IVRWords.cs

@@ -0,0 +1,400 @@
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
+    /// IVR语音文件表
14
+    /// </summary>
15
+    public class T_Sys_IVRWords
16
+    {
17
+        public T_Sys_IVRWords()
18
+        { }
19
+        #region  BasicMethod
20
+
21
+        /// <summary>
22
+        /// 得到最大ID
23
+        /// </summary>
24
+        public int GetMaxId()
25
+        {
26
+            return DbHelperSQL.GetMaxID("FID", "T_Sys_IVRWords");
27
+        }
28
+
29
+        /// <summary>
30
+        /// 是否存在该记录
31
+        /// </summary>
32
+        public bool Exists(int FID)
33
+        {
34
+            StringBuilder strSql = new StringBuilder();
35
+            strSql.Append("select count(1) from T_Sys_IVRWords");
36
+            strSql.Append(" where FID=@FID");
37
+            SqlParameter[] parameters = {
38
+                    new SqlParameter("@FID", SqlDbType.Int,4)
39
+            };
40
+            parameters[0].Value = FID;
41
+
42
+            return DbHelperSQL.Exists(strSql.ToString(), parameters);
43
+        }
44
+
45
+
46
+        /// <summary>
47
+        /// 增加一条数据
48
+        /// </summary>
49
+        public int Add(Model.T_Sys_IVRWords model)
50
+        {
51
+            StringBuilder strSql = new StringBuilder();
52
+            strSql.Append("insert into T_Sys_IVRWords(");
53
+            strSql.Append("Title,GroupCode,Content,Type,WavFile,StartDate,EndDate,Remark,IsState,CreateBy,CreateTime,IsDelete)");
54
+            strSql.Append(" values (");
55
+            strSql.Append("@Title,@GroupCode,@Content,@Type,@WavFile,@StartDate,@EndDate,@Remark,@IsState,@CreateBy,@CreateTime,@IsDelete)");
56
+            strSql.Append(";select @@IDENTITY");
57
+            SqlParameter[] parameters = {
58
+                    new SqlParameter("@Title", SqlDbType.VarChar,50),
59
+                    new SqlParameter("@GroupCode", SqlDbType.VarChar,20),
60
+                    new SqlParameter("@Content", SqlDbType.NVarChar,200),
61
+                    new SqlParameter("@Type", SqlDbType.Int,4),
62
+                    new SqlParameter("@WavFile", SqlDbType.VarChar,200),
63
+                    new SqlParameter("@StartDate", SqlDbType.DateTime),
64
+                    new SqlParameter("@EndDate", SqlDbType.DateTime),
65
+                    new SqlParameter("@Remark", SqlDbType.NVarChar,200),
66
+                    new SqlParameter("@IsState", SqlDbType.Int,4),
67
+                    new SqlParameter("@CreateBy", SqlDbType.VarChar,50),
68
+                    new SqlParameter("@CreateTime", SqlDbType.DateTime),
69
+                    new SqlParameter("@IsDelete", SqlDbType.Int,4)};
70
+            parameters[0].Value = model.Title;
71
+            parameters[1].Value = model.GroupCode;
72
+            parameters[2].Value = model.Content;
73
+            parameters[3].Value = model.Type;
74
+            parameters[4].Value = model.WavFile;
75
+            parameters[5].Value = model.StartDate;
76
+            parameters[6].Value = model.EndDate;
77
+            parameters[7].Value = model.Remark;
78
+            parameters[8].Value = model.IsState;
79
+            parameters[9].Value = model.CreateBy;
80
+            parameters[10].Value = model.CreateTime;
81
+            parameters[11].Value = model.IsDelete;
82
+
83
+            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
84
+            if (obj == null)
85
+            {
86
+                return 0;
87
+            }
88
+            else
89
+            {
90
+                return Convert.ToInt32(obj);
91
+            }
92
+        }
93
+        /// <summary>
94
+        /// 更新一条数据
95
+        /// </summary>
96
+        public bool Update(Model.T_Sys_IVRWords model)
97
+        {
98
+            StringBuilder strSql = new StringBuilder();
99
+            strSql.Append("update T_Sys_IVRWords set ");
100
+            strSql.Append("Title=@Title,");
101
+            strSql.Append("GroupCode=@GroupCode,");
102
+            strSql.Append("Content=@Content,");
103
+            strSql.Append("Type=@Type,");
104
+            strSql.Append("WavFile=@WavFile,");
105
+            strSql.Append("StartDate=@StartDate,");
106
+            strSql.Append("EndDate=@EndDate,");
107
+            strSql.Append("Remark=@Remark,");
108
+            strSql.Append("IsState=@IsState,");
109
+            strSql.Append("CreateBy=@CreateBy,");
110
+            strSql.Append("CreateTime=@CreateTime,");
111
+            strSql.Append("IsDelete=@IsDelete");
112
+            strSql.Append(" where FID=@FID");
113
+            SqlParameter[] parameters = {
114
+                    new SqlParameter("@Title", SqlDbType.VarChar,50),
115
+                    new SqlParameter("@GroupCode", SqlDbType.VarChar,20),
116
+                    new SqlParameter("@Content", SqlDbType.NVarChar,200),
117
+                    new SqlParameter("@Type", SqlDbType.Int,4),
118
+                    new SqlParameter("@WavFile", SqlDbType.VarChar,200),
119
+                    new SqlParameter("@StartDate", SqlDbType.DateTime),
120
+                    new SqlParameter("@EndDate", SqlDbType.DateTime),
121
+                    new SqlParameter("@Remark", SqlDbType.NVarChar,200),
122
+                    new SqlParameter("@IsState", SqlDbType.Int,4),
123
+                    new SqlParameter("@CreateBy", SqlDbType.VarChar,50),
124
+                    new SqlParameter("@CreateTime", SqlDbType.DateTime),
125
+                    new SqlParameter("@IsDelete", SqlDbType.Int,4),
126
+                    new SqlParameter("@FID", SqlDbType.Int,4)};
127
+            parameters[0].Value = model.Title;
128
+            parameters[1].Value = model.GroupCode;
129
+            parameters[2].Value = model.Content;
130
+            parameters[3].Value = model.Type;
131
+            parameters[4].Value = model.WavFile;
132
+            parameters[5].Value = model.StartDate;
133
+            parameters[6].Value = model.EndDate;
134
+            parameters[7].Value = model.Remark;
135
+            parameters[8].Value = model.IsState;
136
+            parameters[9].Value = model.CreateBy;
137
+            parameters[10].Value = model.CreateTime;
138
+            parameters[11].Value = model.IsDelete;
139
+            parameters[12].Value = model.FID;
140
+
141
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
142
+            if (rows > 0)
143
+            {
144
+                return true;
145
+            }
146
+            else
147
+            {
148
+                return false;
149
+            }
150
+        }
151
+
152
+        /// <summary>
153
+        /// 删除一条数据
154
+        /// </summary>
155
+        public bool Delete(int FID)
156
+        {
157
+
158
+            StringBuilder strSql = new StringBuilder();
159
+            strSql.Append("delete from T_Sys_IVRWords ");
160
+            strSql.Append(" where FID=@FID");
161
+            SqlParameter[] parameters = {
162
+                    new SqlParameter("@FID", SqlDbType.Int,4)
163
+            };
164
+            parameters[0].Value = FID;
165
+
166
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
167
+            if (rows > 0)
168
+            {
169
+                return true;
170
+            }
171
+            else
172
+            {
173
+                return false;
174
+            }
175
+        }
176
+        /// <summary>
177
+        /// 批量删除数据
178
+        /// </summary>
179
+        public bool DeleteList(string FIDlist)
180
+        {
181
+            StringBuilder strSql = new StringBuilder();
182
+            strSql.Append("delete from T_Sys_IVRWords ");
183
+            strSql.Append(" where FID in (" + FIDlist + ")  ");
184
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
185
+            if (rows > 0)
186
+            {
187
+                return true;
188
+            }
189
+            else
190
+            {
191
+                return false;
192
+            }
193
+        }
194
+
195
+
196
+        /// <summary>
197
+        /// 得到一个对象实体
198
+        /// </summary>
199
+        public Model.T_Sys_IVRWords GetModel(int FID)
200
+        {
201
+
202
+            StringBuilder strSql = new StringBuilder();
203
+            strSql.Append("select  top 1 FID,Title,GroupCode,Content,Type,WavFile,StartDate,EndDate,Remark,IsState,CreateBy,CreateTime,IsDelete from T_Sys_IVRWords ");
204
+            strSql.Append(" where FID=@FID");
205
+            SqlParameter[] parameters = {
206
+                    new SqlParameter("@FID", SqlDbType.Int,4)
207
+            };
208
+            parameters[0].Value = FID;
209
+
210
+            Model.T_Sys_IVRWords model = new Model.T_Sys_IVRWords();
211
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
212
+            if (ds.Tables[0].Rows.Count > 0)
213
+            {
214
+                return DataRowToModel(ds.Tables[0].Rows[0]);
215
+            }
216
+            else
217
+            {
218
+                return null;
219
+            }
220
+        }
221
+
222
+
223
+        /// <summary>
224
+        /// 得到一个对象实体
225
+        /// </summary>
226
+        public Model.T_Sys_IVRWords DataRowToModel(DataRow row)
227
+        {
228
+            Model.T_Sys_IVRWords model = new Model.T_Sys_IVRWords();
229
+            if (row != null)
230
+            {
231
+                if (row["FID"] != null && row["FID"].ToString() != "")
232
+                {
233
+                    model.FID = int.Parse(row["FID"].ToString());
234
+                }
235
+                if (row["Title"] != null)
236
+                {
237
+                    model.Title = row["Title"].ToString();
238
+                }
239
+                if (row["GroupCode"] != null)
240
+                {
241
+                    model.GroupCode = row["GroupCode"].ToString();
242
+                }
243
+                if (row["Content"] != null)
244
+                {
245
+                    model.Content = row["Content"].ToString();
246
+                }
247
+                if (row["Type"] != null && row["Type"].ToString() != "")
248
+                {
249
+                    model.Type = int.Parse(row["Type"].ToString());
250
+                }
251
+                if (row["WavFile"] != null)
252
+                {
253
+                    model.WavFile = row["WavFile"].ToString();
254
+                }
255
+                if (row["StartDate"] != null && row["StartDate"].ToString() != "")
256
+                {
257
+                    model.StartDate = DateTime.Parse(row["StartDate"].ToString());
258
+                }
259
+                if (row["EndDate"] != null && row["EndDate"].ToString() != "")
260
+                {
261
+                    model.EndDate = DateTime.Parse(row["EndDate"].ToString());
262
+                }
263
+                if (row["Remark"] != null)
264
+                {
265
+                    model.Remark = row["Remark"].ToString();
266
+                }
267
+                if (row["IsState"] != null && row["IsState"].ToString() != "")
268
+                {
269
+                    model.IsState = int.Parse(row["IsState"].ToString());
270
+                }
271
+                if (row["CreateBy"] != null)
272
+                {
273
+                    model.CreateBy = row["CreateBy"].ToString();
274
+                }
275
+                if (row["CreateTime"] != null && row["CreateTime"].ToString() != "")
276
+                {
277
+                    model.CreateTime = DateTime.Parse(row["CreateTime"].ToString());
278
+                }
279
+                if (row["IsDelete"] != null && row["IsDelete"].ToString() != "")
280
+                {
281
+                    model.IsDelete = int.Parse(row["IsDelete"].ToString());
282
+                }
283
+            }
284
+            return model;
285
+        }
286
+
287
+        /// <summary>
288
+        /// 获得数据列表
289
+        /// </summary>
290
+        public DataSet GetList(string strWhere)
291
+        {
292
+            StringBuilder strSql = new StringBuilder();
293
+            strSql.Append("select FID,Title,GroupCode,Content,Type,WavFile,StartDate,EndDate,Remark,IsState,CreateBy,CreateTime,IsDelete ");
294
+            strSql.Append(" FROM T_Sys_IVRWords ");
295
+            if (strWhere.Trim() != "")
296
+            {
297
+                strSql.Append(" where " + strWhere);
298
+            }
299
+            return DbHelperSQL.Query(strSql.ToString());
300
+        }
301
+
302
+        /// <summary>
303
+        /// 获得前几行数据
304
+        /// </summary>
305
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
306
+        {
307
+            StringBuilder strSql = new StringBuilder();
308
+            strSql.Append("select ");
309
+            if (Top > 0)
310
+            {
311
+                strSql.Append(" top " + Top.ToString());
312
+            }
313
+            strSql.Append(" FID,Title,GroupCode,Content,Type,WavFile,StartDate,EndDate,Remark,IsState,CreateBy,CreateTime,IsDelete ");
314
+            strSql.Append(" FROM T_Sys_IVRWords ");
315
+            if (strWhere.Trim() != "")
316
+            {
317
+                strSql.Append(" where " + strWhere);
318
+            }
319
+            strSql.Append(" order by " + filedOrder);
320
+            return DbHelperSQL.Query(strSql.ToString());
321
+        }
322
+
323
+        /// <summary>
324
+        /// 获取记录总数
325
+        /// </summary>
326
+        public int GetRecordCount(string strWhere)
327
+        {
328
+            StringBuilder strSql = new StringBuilder();
329
+            strSql.Append("select count(1) FROM T_Sys_IVRWords ");
330
+            if (strWhere.Trim() != "")
331
+            {
332
+                strSql.Append(" where " + strWhere);
333
+            }
334
+            object obj = DbHelperSQL.GetSingle(strSql.ToString());
335
+            if (obj == null)
336
+            {
337
+                return 0;
338
+            }
339
+            else
340
+            {
341
+                return Convert.ToInt32(obj);
342
+            }
343
+        }
344
+        /// <summary>
345
+        /// 分页获取数据列表
346
+        /// </summary>
347
+        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
348
+        {
349
+            StringBuilder strSql = new StringBuilder();
350
+            strSql.Append("SELECT * FROM ( ");
351
+            strSql.Append(" SELECT ROW_NUMBER() OVER (");
352
+            if (!string.IsNullOrEmpty(orderby.Trim()))
353
+            {
354
+                strSql.Append("order by T." + orderby);
355
+            }
356
+            else
357
+            {
358
+                strSql.Append("order by T.FID desc");
359
+            }
360
+            strSql.Append(")AS Row, T.*  from T_Sys_IVRWords T ");
361
+            if (!string.IsNullOrEmpty(strWhere.Trim()))
362
+            {
363
+                strSql.Append(" WHERE " + strWhere);
364
+            }
365
+            strSql.Append(" ) TT");
366
+            strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
367
+            return DbHelperSQL.Query(strSql.ToString());
368
+        }
369
+
370
+        /*
371
+		/// <summary>
372
+		/// 分页获取数据列表
373
+		/// </summary>
374
+		public DataSet GetList(int PageSize,int PageIndex,string strWhere)
375
+		{
376
+			SqlParameter[] parameters = {
377
+					new SqlParameter("@tblName", SqlDbType.VarChar, 255),
378
+					new SqlParameter("@fldName", SqlDbType.VarChar, 255),
379
+					new SqlParameter("@PageSize", SqlDbType.Int),
380
+					new SqlParameter("@PageIndex", SqlDbType.Int),
381
+					new SqlParameter("@IsReCount", SqlDbType.Bit),
382
+					new SqlParameter("@OrderType", SqlDbType.Bit),
383
+					new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
384
+					};
385
+			parameters[0].Value = "T_Sys_IVRWords";
386
+			parameters[1].Value = "FID";
387
+			parameters[2].Value = PageSize;
388
+			parameters[3].Value = PageIndex;
389
+			parameters[4].Value = 0;
390
+			parameters[5].Value = 0;
391
+			parameters[6].Value = strWhere;	
392
+			return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
393
+		}*/
394
+
395
+        #endregion  BasicMethod
396
+        #region  ExtensionMethod
397
+
398
+        #endregion  ExtensionMethod
399
+    }
400
+}

+ 4 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj

@@ -184,6 +184,7 @@
184 184
     <Compile Include="Controllers\IndexController.cs" />
185 185
     <Compile Include="Controllers\InfoController.cs" />
186 186
     <Compile Include="Controllers\information\NoticeController.cs" />
187
+    <Compile Include="Controllers\IVRWordsController.cs" />
187 188
     <Compile Include="Controllers\knowledge\KnowledgeClassController.cs" />
188 189
     <Compile Include="Controllers\knowledge\KnowledgeController.cs" />
189 190
     <Compile Include="Controllers\LogController.cs" />
@@ -292,6 +293,7 @@
292 293
     <Compile Include="Models\Input\DepartmentInput.cs" />
293 294
     <Compile Include="Models\Input\DictionaryInput.cs" />
294 295
     <Compile Include="Models\Input\ImportDataInput.cs" />
296
+    <Compile Include="Models\Input\IVRWordsInput.cs" />
295 297
     <Compile Include="Models\Input\LoginModel.cs" />
296 298
     <Compile Include="Models\Input\ModuleFunctionInput.cs" />
297 299
     <Compile Include="Models\Input\OrderInput.cs" />
@@ -327,6 +329,7 @@
327 329
     <None Include="Properties\PublishProfiles\1q.pubxml" />
328 330
     <None Include="Properties\PublishProfiles\Autobio_API.pubxml" />
329 331
     <None Include="Properties\PublishProfiles\ddr.pubxml" />
332
+    <None Include="Properties\PublishProfiles\KFLTSWCallCenter_API.pubxml" />
330 333
     <None Include="Properties\PublishProfiles\LvDi_API.pubxml" />
331 334
     <None Include="Properties\PublishProfiles\my.pubxml" />
332 335
     <None Include="Properties\PublishProfiles\sycw.pubxml" />
@@ -371,6 +374,7 @@
371 374
     <Folder Include="Views\Index\" />
372 375
     <Folder Include="Views\Info\" />
373 376
     <Folder Include="Views\InputDXTel\" />
377
+    <Folder Include="Views\IVRWords\" />
374 378
     <Folder Include="Views\KnowledgeClass\" />
375 379
     <Folder Include="Views\Knowledge\" />
376 380
     <Folder Include="Views\Login\" />

+ 1 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj.user

@@ -8,7 +8,7 @@
8 8
     <WebStackScaffolding_IsReferencingScriptLibrariesSelected>True</WebStackScaffolding_IsReferencingScriptLibrariesSelected>
9 9
     <WebStackScaffolding_LayoutPageFile />
10 10
     <WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
11
-    <NameOfLastUsedPublishProfile>sycw</NameOfLastUsedPublishProfile>
11
+    <NameOfLastUsedPublishProfile>KFLTSWCallCenter_API</NameOfLastUsedPublishProfile>
12 12
     <ProjectView>ShowAllFiles</ProjectView>
13 13
     <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
14 14
   </PropertyGroup>

+ 225 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/IVRWordsController.cs

@@ -0,0 +1,225 @@
1
+using CallCenter.Utility;
2
+using CallCenterApi.Interface.Controllers.Base;
3
+using CallCenterApi.Interface.Models.Input;
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
+    /// <summary>
14
+    /// IVR语音文件表
15
+    /// </summary>
16
+    public class IVRWordsController : BaseController
17
+    {
18
+        BLL.T_Sys_IVRWords bll = new BLL.T_Sys_IVRWords();
19
+
20
+        /// <summary>
21
+        /// 获取IVR语音文件列表
22
+        /// </summary>
23
+        /// <returns></returns>
24
+        [Authority]
25
+        public ActionResult GetList()
26
+        {
27
+            DataTable dt = new DataTable();
28
+            string sql = " and IsDelete = 0 ";
29
+            //string id = RequestString.GetQueryString("id");
30
+            // 状态
31
+            int isstate = RequestString.GetInt("isstate", 0);
32
+            string strstarttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
33
+            string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
34
+            string strpageindex = RequestString.GetQueryString("page");
35
+            int pageindex = 1;
36
+            string strpagesize = RequestString.GetQueryString("pagesize");
37
+            int pagesize = 10;
38
+
39
+            if (isstate > 0)
40
+                sql += $" AND IsState = {isstate}";
41
+            if (strstarttime.Trim() != "" && strstarttime != "undefined")
42
+            {
43
+                sql += " and datediff(day,CreateTime,'" + strstarttime + "')<=0 ";
44
+            }
45
+            if (strendtime.Trim() != "" && strendtime != "undefined")
46
+            {
47
+                sql += " and datediff(day,CreateTime,'" + strendtime + "')>=0   ";
48
+            }
49
+            if (strpageindex.Trim() != "")
50
+            {
51
+                pageindex = Convert.ToInt32(strpageindex);
52
+            }
53
+
54
+            if (strpagesize.Trim() != "")
55
+            {
56
+                pagesize = Convert.ToInt32(strpagesize);
57
+            }
58
+            int recordCount = 0;
59
+            dt = BLL.PagerBLL.GetListPager(
60
+                "T_Sys_IVRWords WITH(NOLOCK) ",
61
+                "FID",
62
+                "*",
63
+                sql,
64
+                "ORDER BY FID desc",
65
+                pagesize,
66
+                pageindex,
67
+                true,
68
+                out recordCount);
69
+
70
+            var obj = new
71
+            {
72
+                rows = dt,
73
+                total = recordCount
74
+            };
75
+
76
+            return Content(obj.ToJson());
77
+        }
78
+
79
+        /// <summary>
80
+        /// 获取地市
81
+        /// </summary>
82
+        /// <param name="deptId"></param>
83
+        /// <returns></returns>
84
+        [Authority]
85
+        public ActionResult GetInfo(int id = 0)
86
+        {
87
+            #region 添加验证判断
88
+            if (id <= 0)
89
+                return Error("参数不能为空!");
90
+            #endregion
91
+            var model = bll.GetModel(id);
92
+            if (model != null)
93
+                return Success("获取成功", model);
94
+            return Error("获取失败");
95
+        }
96
+
97
+
98
+        /// <summary>
99
+        /// 添加地市
100
+        /// </summary>
101
+        /// <param name="input"></param>
102
+        /// <returns></returns>
103
+        [Authority]
104
+        [HttpPost]
105
+        public ActionResult Add(IVRWordsInput input)
106
+        {
107
+            int userId = CurrentUser.UserData.F_UserId;
108
+            string usercode = CurrentUser.UserData.F_UserCode;
109
+            #region 添加验证判断
110
+            if (string.IsNullOrEmpty(input.Title))
111
+                return Error("标题不能为空!");
112
+            if (string.IsNullOrEmpty(input.StartDate.ToString()))
113
+                return Error("生效时间不能为空!");
114
+            if (string.IsNullOrEmpty(input.EndDate.ToString()))
115
+                return Error("失效时间不能为空!");
116
+            #endregion
117
+            var model = new Model.T_Sys_IVRWords();
118
+            //获取房东信息            
119
+            model.Title = input.Title;    // 标题
120
+            model.GroupCode = input.GroupCode;                  // 坐席组编号
121
+            model.Content = input.Content;    // 内容 
122
+            model.Type = input.Type;    // 类型:1文本,2语音文件
123
+            model.WavFile = input.WavFile;  // 语音文件路径
124
+            model.StartDate = input.StartDate;    // 生效时间
125
+            model.EndDate = input.EndDate;                // 失效时间
126
+            model.Remark = input.Remark;                // 备注
127
+            model.IsState = input.IsState;    // 状态:1启动,0不启动
128
+            model.CreateBy = usercode;              // 备注
129
+            model.CreateTime = DateTime.Now;
130
+            int n = bll.Add(model);
131
+            if (n > 0)
132
+                return Success("添加成功!", model);
133
+            else
134
+                return Error("添加失败!");
135
+        }
136
+
137
+        /// <summary>
138
+        /// 编辑地市
139
+        /// </summary>
140
+        /// <param name="input"></param>
141
+        /// <returns></returns>
142
+        [Authority]
143
+        [HttpPost]
144
+        public ActionResult Update(IVRWordsInput input)
145
+        {
146
+            int userId = CurrentUser.UserData.F_UserId;
147
+            string usercode = CurrentUser.UserData.F_UserCode;
148
+            #region 添加验证判断
149
+            if (string.IsNullOrEmpty(input.Title))
150
+                return Error("标题不能为空!");
151
+            if (string.IsNullOrEmpty(input.StartDate.ToString()))
152
+                return Error("生效时间不能为空!");
153
+            if (string.IsNullOrEmpty(input.EndDate.ToString()))
154
+                return Error("失效时间不能为空!");
155
+            #endregion
156
+            var model = bll.GetModel(input.ID);
157
+            if (model == null)
158
+                return Error("参数错误");
159
+
160
+            //获取房东信息            
161
+            model.Title = input.Title;    // 标题
162
+            model.GroupCode = input.GroupCode;                  // 坐席组编号
163
+            model.Content = input.Content;    // 内容 
164
+            model.Type = input.Type;    // 类型:1文本,2语音文件
165
+            model.WavFile = input.WavFile;  // 语音文件路径
166
+            model.StartDate = input.StartDate;    // 生效时间
167
+            model.EndDate = input.EndDate;                // 失效时间
168
+            model.Remark = input.Remark;                // 备注
169
+            model.IsState = input.IsState;    // 状态:1启动,0不启动
170
+            bool b = bll.Update(model);
171
+            if (b)
172
+                return Success("修改成功!", model);
173
+            else
174
+                return Error("修改失败!");
175
+        }
176
+
177
+        /// <summary>
178
+        /// 删除地市
179
+        /// </summary>
180
+        /// <param name="ids"></param>
181
+        /// <returns></returns>
182
+        [Authority]
183
+        public ActionResult Delele(string[] ids)
184
+        {
185
+            if (ids == null || ids.Length <= 0)
186
+                return Error("请选择要删除的项");
187
+            var idStr = string.Join(",", ids);
188
+            if (string.IsNullOrEmpty(idStr.Trim()))
189
+                return Error("请选择要删除的项");
190
+            if (bll.DeleteList(idStr))
191
+                return Success("删除成功");
192
+            return Error("删除失败");
193
+        }
194
+
195
+        /// <summary>
196
+        /// 获取地市
197
+        /// </summary>
198
+        /// <param name="deptId"></param>
199
+        /// <returns></returns>
200
+        public ActionResult GetIvrWords()
201
+        {
202
+            var text = ""; var type = 0;
203
+            var model = new Model.T_Sys_IVRWords();
204
+            var list = bll.GetModelList(" IsDelete = 0 AND IsState = 1 AND StartDate <= GETDATE() AND EndDate >= GETDATE() ORDER BY CreateTime DESC ");
205
+            if (list.Count() > 0)
206
+            {
207
+                model = list.Last();
208
+                type = model.Type;
209
+                if (type == 1)
210
+                    text = model.Content;
211
+                else if (type == 2)
212
+                    text = model.WavFile;
213
+            }
214
+            var obj = new
215
+            {
216
+                ttstext = text,
217
+                type = type
218
+                //ttstext="欢迎致电科技有限公司"
219
+            };
220
+
221
+            return Success("获取欢迎词", obj);
222
+        }
223
+
224
+    }
225
+}

+ 55 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/IVRWordsInput.cs

@@ -0,0 +1,55 @@
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 IVRWordsInput
9
+    {
10
+        /// <summary>
11
+        /// Id
12
+        /// </summary>
13
+        public int ID { get; set; }
14
+        /// <summary>
15
+        /// 标题
16
+        /// </summary>
17
+        public string Title { get; set; }
18
+        /// <summary>
19
+        /// 坐席组编号
20
+        /// </summary>
21
+        public string GroupCode { get; set; }
22
+        /// <summary>
23
+        /// 内容
24
+        /// </summary>
25
+        public string Content { get; set; }
26
+        /// <summary>
27
+        /// 类型:1文本,2语音文件
28
+        /// </summary>
29
+        public int Type { get; set; }
30
+        /// <summary>
31
+        /// 语音文件路径
32
+        /// </summary>
33
+        public string WavFile { get; set; }
34
+        /// <summary>
35
+        /// 生效时间
36
+        /// </summary>
37
+        public DateTime? StartDate { get; set; }
38
+        /// <summary>
39
+        /// 失效时间
40
+        /// </summary>
41
+        public DateTime? EndDate { get; set; }
42
+        /// <summary>
43
+        /// 备注
44
+        /// </summary>
45
+        public string Remark { get; set; }
46
+        /// <summary>
47
+        /// 状态:1启动,0不启动
48
+        /// </summary>
49
+        public int IsState { get; set; }
50
+        /// <summary>
51
+        /// 添加人
52
+        /// </summary>
53
+        public string CreateBy { get; set; }
54
+    }
55
+}

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

@@ -104,6 +104,7 @@
104 104
     <Compile Include="T_Sys_Department.cs" />
105 105
     <Compile Include="T_Sys_DictionaryBase.cs" />
106 106
     <Compile Include="T_Sys_DictionaryValue.cs" />
107
+    <Compile Include="T_Sys_IVRWords.cs" />
107 108
     <Compile Include="T_Sys_LoginLogs.cs" />
108 109
     <Compile Include="T_Sys_MobileData.cs" />
109 110
     <Compile Include="T_Sys_ModuleFunctions.cs" />

+ 136 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_Sys_IVRWords.cs

@@ -0,0 +1,136 @@
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
+    public class T_Sys_IVRWords
13
+    {
14
+        public T_Sys_IVRWords()
15
+        { }
16
+        #region Model
17
+        private int _fid;
18
+        private string _title;
19
+        private string _groupcode;
20
+        private string _content;
21
+        private int _type;
22
+        private string _wavfile;
23
+        private DateTime? _startdate;
24
+        private DateTime? _enddate;
25
+        private string _remark;
26
+        private int _isstate;
27
+        private string _createby;
28
+        private DateTime? _createtime;
29
+        private int _isdelete;
30
+        /// <summary>
31
+        /// id
32
+        /// </summary>
33
+        public int FID
34
+        {
35
+            set { _fid = value; }
36
+            get { return _fid; }
37
+        }
38
+        /// <summary>
39
+        /// 标题
40
+        /// </summary>
41
+        public string Title
42
+        {
43
+            set { _title = value; }
44
+            get { return _title; }
45
+        }
46
+        /// <summary>
47
+        /// 坐席组编号
48
+        /// </summary>
49
+        public string GroupCode
50
+        {
51
+            set { _groupcode = value; }
52
+            get { return _groupcode; }
53
+        }
54
+        /// <summary>
55
+        /// 内容
56
+        /// </summary>
57
+        public string Content
58
+        {
59
+            set { _content = value; }
60
+            get { return _content; }
61
+        }
62
+        /// <summary>
63
+        /// 类型:1文本,2语音文件
64
+        /// </summary>
65
+        public int Type
66
+        {
67
+            set { _type = value; }
68
+            get { return _type; }
69
+        }
70
+        /// <summary>
71
+        /// 语音文件路径
72
+        /// </summary>
73
+        public string WavFile
74
+        {
75
+            set { _wavfile = value; }
76
+            get { return _wavfile; }
77
+        }
78
+        /// <summary>
79
+        /// 生效时间
80
+        /// </summary>
81
+        public DateTime? StartDate
82
+        {
83
+            set { _startdate = value; }
84
+            get { return _startdate; }
85
+        }
86
+        /// <summary>
87
+        /// 失效时间
88
+        /// </summary>
89
+        public DateTime? EndDate
90
+        {
91
+            set { _enddate = value; }
92
+            get { return _enddate; }
93
+        }
94
+        /// <summary>
95
+        /// 备注
96
+        /// </summary>
97
+        public string Remark
98
+        {
99
+            set { _remark = value; }
100
+            get { return _remark; }
101
+        }
102
+        /// <summary>
103
+        /// 状态:1启动,0不启动
104
+        /// </summary>
105
+        public int IsState
106
+        {
107
+            set { _isstate = value; }
108
+            get { return _isstate; }
109
+        }
110
+        /// <summary>
111
+        /// 添加人
112
+        /// </summary>
113
+        public string CreateBy
114
+        {
115
+            set { _createby = value; }
116
+            get { return _createby; }
117
+        }
118
+        /// <summary>
119
+        /// 添加时间
120
+        /// </summary>
121
+        public DateTime? CreateTime
122
+        {
123
+            set { _createtime = value; }
124
+            get { return _createtime; }
125
+        }
126
+        /// <summary>
127
+        /// 是否删除:0未删除,1已删除
128
+        /// </summary>
129
+        public int IsDelete
130
+        {
131
+            set { _isdelete = value; }
132
+            get { return _isdelete; }
133
+        }
134
+        #endregion Model
135
+    }
136
+}

+ 81 - 0
文档/Sql/T_Sys_IVRWords创建.sql

@@ -0,0 +1,81 @@
1
+USE [CallCenter_KFLTSW]
2
+GO
3
+
4
+/****** Object:  Table [dbo].[T_Sys_IVRWords]    Script Date: 09/05/2019 11:14:05 ******/
5
+SET ANSI_NULLS ON
6
+GO
7
+
8
+SET QUOTED_IDENTIFIER ON
9
+GO
10
+
11
+SET ANSI_PADDING ON
12
+GO
13
+
14
+CREATE TABLE [dbo].[T_Sys_IVRWords](
15
+	[FID] [int] IDENTITY(1,1) NOT NULL,
16
+	[Title] [varchar](50) NULL,
17
+	[GroupCode] [varchar](20) NULL,
18
+	[Content] [nvarchar](200) NULL,
19
+	[Type] [int] NOT NULL,
20
+	[WavFile] [varchar](200) NULL,
21
+	[StartDate] [datetime] NULL,
22
+	[EndDate] [datetime] NULL,
23
+	[Remark] [nvarchar](200) NULL,
24
+	[IsState] [int] NOT NULL,
25
+	[CreateBy] [varchar](50) NULL,
26
+	[CreateTime] [datetime] NULL,
27
+	[IsDelete] [int] NOT NULL,
28
+ CONSTRAINT [PK_T_Sys_IVRWords] PRIMARY KEY CLUSTERED 
29
+(
30
+	[FID] ASC
31
+)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
32
+) ON [PRIMARY]
33
+
34
+GO
35
+
36
+SET ANSI_PADDING OFF
37
+GO
38
+
39
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_IVRWords', @level2type=N'COLUMN',@level2name=N'FID'
40
+GO
41
+
42
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_IVRWords', @level2type=N'COLUMN',@level2name=N'Title'
43
+GO
44
+
45
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'坐席组编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_IVRWords', @level2type=N'COLUMN',@level2name=N'GroupCode'
46
+GO
47
+
48
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_IVRWords', @level2type=N'COLUMN',@level2name=N'Content'
49
+GO
50
+
51
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型:1文本,2语音文件' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_IVRWords', @level2type=N'COLUMN',@level2name=N'Type'
52
+GO
53
+
54
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'语音文件路径' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_IVRWords', @level2type=N'COLUMN',@level2name=N'WavFile'
55
+GO
56
+
57
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'生效时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_IVRWords', @level2type=N'COLUMN',@level2name=N'StartDate'
58
+GO
59
+
60
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'失效时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_IVRWords', @level2type=N'COLUMN',@level2name=N'EndDate'
61
+GO
62
+
63
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_IVRWords', @level2type=N'COLUMN',@level2name=N'Remark'
64
+GO
65
+
66
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态:1启动,0不启动' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_IVRWords', @level2type=N'COLUMN',@level2name=N'IsState'
67
+GO
68
+
69
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'添加人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_IVRWords', @level2type=N'COLUMN',@level2name=N'CreateBy'
70
+GO
71
+
72
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'添加时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_IVRWords', @level2type=N'COLUMN',@level2name=N'CreateTime'
73
+GO
74
+
75
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否删除:0未删除,1已删除' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_IVRWords', @level2type=N'COLUMN',@level2name=N'IsDelete'
76
+GO
77
+
78
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'IVR语音文件表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_IVRWords'
79
+GO
80
+
81
+