Procházet zdrojové kódy

新增转派县级的表和其他bug

zhoufan %!s(int64=7) %!d(string=před) roky
rodič
revize
ac92d70df8

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

@@ -47,6 +47,7 @@
47 47
     <Compile Include="T_Bus_AssignedInfo.cs" />
48 48
     <Compile Include="T_Bus_AssignedInfo_Next.cs" />
49 49
     <Compile Include="T_Bus_AssignedItemInfo.cs" />
50
+    <Compile Include="T_Bus_CityTurn.cs" />
50 51
     <Compile Include="T_Bus_DelayTime.cs" />
51 52
     <Compile Include="T_Bus_Feedback.cs" />
52 53
     <Compile Include="T_Bus_Feedback_Next.cs" />

+ 145 - 0
CallCenterApi/CallCenterApi.BLL/T_Bus_CityTurn.cs

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

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

@@ -48,6 +48,7 @@
48 48
     <Compile Include="T_Bus_AssignedInfo.cs" />
49 49
     <Compile Include="T_Bus_AssignedInfo_Next.cs" />
50 50
     <Compile Include="T_Bus_AssignedItemInfo.cs" />
51
+    <Compile Include="T_Bus_CityTurn.cs" />
51 52
     <Compile Include="T_Bus_DelayTime.cs" />
52 53
     <Compile Include="T_Bus_Feedback.cs" />
53 54
     <Compile Include="T_Bus_Feedback_Next.cs" />

+ 416 - 0
CallCenterApi/CallCenterApi.DAL/T_Bus_CityTurn.cs

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

+ 26 - 2
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/App_Start/OutActionFilter.cs

@@ -1,4 +1,5 @@
1 1
 using CallCenter.Utility;
2
+using CallCenterApi.Common;
2 3
 using System;
3 4
 using System.Collections.Generic;
4 5
 using System.Linq;
@@ -12,11 +13,12 @@ namespace CallCenterApi.Interface.App_Start
12 13
         public override void OnActionExecuting(ActionExecutingContext filterContext)
13 14
         {
14 15
             var sign = filterContext.HttpContext.Request["signcode"];
16
+            var model = GetCityInfo();
15 17
             bool bl = true;
16
-            if (sign != null)
18
+            if (sign != null && model!=null)
17 19
             {
18 20
                 string insigncode = sign.ToString();
19
-                string outsigncode = Configs.GetValue("OutSignCode");
21
+                string outsigncode = model["F_Sign"].ToString();
20 22
                 string controllercode = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName.ToLower();
21 23
                 string actioncode = filterContext.ActionDescriptor.ActionName.ToLower();
22 24
                 string signcode = EncryptHelper.MD5Encrypt(controllercode + "/" + actioncode + "+" + EncryptHelper.SHA1Encrypt(outsigncode + "+" + DateTime.Now.ToString("yyyyMMdd")));
@@ -33,5 +35,27 @@ namespace CallCenterApi.Interface.App_Start
33 35
 
34 36
             base.OnActionExecuting(filterContext);
35 37
         }
38
+
39
+        /// <summary>
40
+        /// 获取当前网点信息
41
+        /// </summary>
42
+        /// <returns></returns>
43
+        public Newtonsoft.Json.Linq.JObject GetCityInfo()
44
+        {
45
+            string code = Configs.GetValue("CityCode");
46
+            string signcode = Configs.GetValue("CityOutSignCode");
47
+            string url = Configs.GetValue("CityOutUrl");
48
+            string outsigncode = CommonHelper.getsigncode("CountyBranch", "GetCityDetail", signcode);
49
+            string strparams = "?code=" + code + "&signcode=" + outsigncode;
50
+            var result = HttpMethods.HttpGet(url + "/CountyBranch/GetCityDetail" + strparams).ToJObject();
51
+            if (result["state"].ToString() == "success")
52
+            {
53
+                return result["data"].ToString().ToJObject();
54
+            }
55
+            else
56
+            {
57
+                return null;
58
+            }
59
+        }
36 60
     }
37 61
 }

+ 6 - 2
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Configs/system.config

@@ -60,8 +60,12 @@
60 60
   <!--归属地-->
61 61
   <add key="CallOutZipCode" value="0370" />
62 62
   <!-- ================== 9:对接外网接口 ================== -->
63
-  <!--验证码code-->
64
-  <add key="OutSignCode" value="#SQS@County*12345$hykj#" />
63
+  <!--城市Code-->
64
+  <add key="CityCode" value="sqs12345" />
65
+  <!--监管平台url-->
66
+  <add key="CityOutUrl" value="http://192.168.4.18:4032" />
67
+  <!--监管平台验证码code-->
68
+  <add key="CityOutSignCode" value="#SQS@Platform*12345$hykj#" />
65 69
   <!-- ================== 10:app政务网 ================== -->
66 70
   <!--验证码code-->
67 71
   <add key="APPSignCode" value="#SQS@12345$zwfww%" />

+ 460 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/County/CountyBusinessController.cs

@@ -3,6 +3,7 @@ using System;
3 3
 using System.Collections.Generic;
4 4
 using System.Data;
5 5
 using System.Linq;
6
+using System.Transactions;
6 7
 using System.Web;
7 8
 using System.Web.Mvc;
8 9
 using CallCenter.Utility;
@@ -17,6 +18,465 @@ namespace CallCenterApi.Interface.Controllers.County
17 18
     {
18 19
         // GET: CountyBusiness
19 20
 
21
+        /// <summary>
22
+        /// 退回市工单
23
+        /// </summary>
24
+        /// <returns></returns>
25
+        public ActionResult RefuseCityWorkOrder()
26
+        {
27
+            string workorderid = RequestString.GetFormString("workorderid");
28
+            string reson = RequestString.GetFormString("reson");
29
+            Model.T_Bus_WorkOrder modelT_Bus_WorkOrder = new BLL.T_Bus_WorkOrder().GetModel(workorderid);
30
+            Model.T_Bus_CityTurn modelT_Bus_CityTurn = new BLL.T_Bus_CityTurn().GetModelList(" F_WorkOrderId='" + workorderid + "' and F_IsDelete=0 ").FirstOrDefault();
31
+            if (modelT_Bus_WorkOrder != null && modelT_Bus_CityTurn != null)
32
+            {
33
+                using (TransactionScope trans = new TransactionScope())
34
+                {
35
+                    #region 保存工单信息
36
+                    modelT_Bus_WorkOrder.F_WorkState = 1;
37
+                    modelT_Bus_WorkOrder.F_IsClosed = 0;
38
+                    modelT_Bus_WorkOrder.F_Result = "";
39
+                    modelT_Bus_WorkOrder.F_DealUser = "";
40
+                    modelT_Bus_WorkOrder.F_DealTime = null;
41
+                    modelT_Bus_WorkOrder.F_CloseUser = "";
42
+                    modelT_Bus_WorkOrder.F_CloseTime = null;
43
+                    new BLL.T_Bus_WorkOrder().Update(modelT_Bus_WorkOrder);
44
+                    #endregion
45
+
46
+                    #region 保存转单信息
47
+                    modelT_Bus_CityTurn.F_IsSure = 2;
48
+                    modelT_Bus_CityTurn.F_SureTime = DateTime.Now;
49
+                    modelT_Bus_CityTurn.F_Reson = reson;
50
+                    new BLL.T_Bus_CityTurn().Update(modelT_Bus_CityTurn); 
51
+                    #endregion
52
+
53
+                    #region 插入操作记录
54
+                    Model.T_Bus_Operation oper = new Model.T_Bus_Operation();
55
+                    oper.F_WorkOrderId = modelT_Bus_WorkOrder.F_WorkOrderId;
56
+                    oper.F_Message = modelT_Bus_CityTurn.F_CityName + " 退回了工单";
57
+                    oper.F_CreateTime = DateTime.Now;
58
+                    oper.F_IsDelete = 0;
59
+
60
+                    new BLL.T_Bus_Operation().Add(oper);
61
+                    #endregion
62
+
63
+                    trans.Complete();
64
+                }
65
+
66
+                return Success("操作成功");
67
+            }
68
+            else
69
+            {
70
+                return Error("操作失败");
71
+            }
72
+        }
73
+
74
+        /// <summary>
75
+        /// 获取工单列表
76
+        /// </summary>
77
+        /// <returns></returns>
78
+        public ActionResult GetAreaOrderList()
79
+        {
80
+            DataTable dt = new DataTable();
81
+            string sql = " and F_IsDelete=0 ";
82
+            string strstate = HttpUtility.UrlDecode(RequestString.GetQueryString("state"));
83
+            string strname = HttpUtility.UrlDecode(RequestString.GetQueryString("name"));
84
+            string strtel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));
85
+            string strkey = HttpUtility.UrlDecode(RequestString.GetQueryString("key"));
86
+            string strstarttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
87
+            string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
88
+            string strworkid = HttpUtility.UrlDecode(RequestString.GetQueryString("workid"));
89
+            int dealtype = RequestString.GetInt("dealtype", -1);
90
+
91
+            string strpageindex = RequestString.GetQueryString("page");
92
+            int pageindex = 1;
93
+            string strpagesize = RequestString.GetQueryString("pagesize");
94
+            int pagesize = 10;
95
+
96
+            #region sql 语句相关处理
97
+            if (strstate.Trim() != "" && strstate != "undefined")
98
+            {
99
+                sql += " and F_WorkState = '" + strstate.Trim() + "' ";
100
+            }
101
+            if (strworkid.Trim() != "" && strworkid != "undefined")
102
+            {
103
+                sql += " and F_WorkOrderId like '%" + strworkid + "%' ";
104
+            }
105
+            if (strname.Trim() != "" && strname != "undefined")
106
+            {
107
+                sql += " and F_CusName like '%" + strname + "%' ";
108
+            }
109
+            if (strtel.Trim() != "" && strtel != "undefined")
110
+            {
111
+                sql += " and (F_CusPhone like '%" + strtel + "%' or F_ConPhone like '%" + strtel + "%') ";
112
+            }
113
+            if (strkey.Trim() != "" && strkey != "undefined")
114
+            {
115
+                sql += " and (F_ComTitle like '%" + strkey + "%' or F_ComContent like '%" + strkey + "%') ";
116
+            }
117
+            if (dealtype != -1)
118
+            {
119
+                sql += " and isnull(F_IsResult,0) = '" + dealtype + "' ";
120
+            }
121
+           
122
+            if (strstarttime.Trim() != "" && strstarttime != "undefined")
123
+            {
124
+                sql += " and datediff(day,F_CreateTime,'" + strstarttime + "')<=0 ";
125
+            }
126
+            if (strendtime.Trim() != "" && strendtime != "undefined")
127
+            {
128
+                sql += " and datediff(day,F_CreateTime,'" + strendtime + "')>=0   ";
129
+            }
130
+            #endregion
131
+
132
+            if (strpageindex.Trim() != "")
133
+            {
134
+                pageindex = Convert.ToInt32(strpageindex);
135
+            }
136
+
137
+            if (strpagesize.Trim() != "")
138
+            {
139
+                pagesize = Convert.ToInt32(strpagesize);
140
+            }
141
+
142
+            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName";
143
+
144
+            int recordCount = 0;
145
+            dt = BLL.PagerBLL.GetListPager(
146
+                "T_Bus_WorkOrder",
147
+                "F_WorkOrderId",
148
+                cols,
149
+                sql,
150
+                "ORDER BY F_CreateTime DESC",
151
+                pagesize,
152
+                pageindex,
153
+                true,
154
+                out recordCount);
155
+
156
+            #region 声音文件和交办超时
157
+            dt.Columns.Add("DeptName", typeof(string));//交办单位
158
+            dt.Columns.Add("AssignTime", typeof(string));//交办时间
159
+            dt.Columns.Add("OtherDeptName", typeof(string));//协办单位
160
+            foreach (DataRow dr in dt.Rows)
161
+            {
162
+                int state = Int32.Parse(dr["F_WorkState"].ToString());
163
+                if (state > 1)
164
+                {
165
+                    //获取最新交办信息
166
+                    string sqljb = "SELECT TOP 1 * FROM T_Bus_AssignedInfo WHERE F_WorkOrderId='" + dr["F_WorkOrderId"].ToString() + "' and F_State=1 and F_IsDelete=0 and F_IsSure<>3   ORDER BY F_Id DESC";
167
+                    var dtjb = DbHelperSQL.Query(sqljb).Tables[0];
168
+                    if (dtjb.Rows.Count > 0)
169
+                    {
170
+                        dr["DeptName"] = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + dtjb.Rows[0]["F_MainDeptId"].ToString() + "')");
171
+                        if (dtjb.Rows[0]["F_OtherDeptIds"] != null && dtjb.Rows[0]["F_OtherDeptIds"].ToString() != "")
172
+                        {
173
+                            dr["OtherDeptName"] = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + dtjb.Rows[0]["F_OtherDeptIds"].ToString() + "')");
174
+                        }
175
+                        dr["AssignTime"] = dtjb.Rows[0]["F_CreateTime"].ToString();
176
+                    }
177
+                }
178
+            }
179
+            #endregion
180
+
181
+            var obj = new
182
+            {
183
+                state = "success",
184
+                message = "成功",
185
+                rows = dt,
186
+                total = recordCount
187
+            };
188
+            return Content(obj.ToJson());
189
+
190
+        }
191
+
192
+        /// <summary>
193
+        /// 获取工单信息
194
+        /// </summary>
195
+        /// <returns></returns>
196
+        public ActionResult GetAreaWorkOrder()
197
+        {
198
+            string strworkorderid = HttpUtility.UrlDecode(RequestString.GetQueryString("workorderid"));
199
+
200
+            if (!string.IsNullOrEmpty(strworkorderid))
201
+            {
202
+                string sql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName1,"
203
+                    + "dbo.GetAreaName(F_SourceArea) as AreaName,dbo.GetDictionaryName(F_InfoSource) as SourceName "
204
+                    + " from T_Bus_WorkOrder where F_WorkOrderId ='" + strworkorderid + "'";
205
+                var dt = DbHelperSQL.Query(sql).Tables[0];
206
+                if (dt.Rows.Count > 0)
207
+                {
208
+                    var configly = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayLeaveVoice' ").FirstOrDefault();
209
+                    var config = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayPath' ").FirstOrDefault();
210
+                    var configfj = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='FileUrlPath' ").FirstOrDefault();
211
+
212
+                    string jcsql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDeptName(F_DeptId) as DeptName "
213
+                                    + "from T_Bus_RemindRecord where F_Type=2 and F_State=1 and F_IsDelete=0 and F_WorkOrderId ='" + strworkorderid + "'";
214
+                    string dbsql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDeptName(F_DeptId) as DeptName "
215
+                                    + "from T_Bus_RemindRecord where F_Type=1 and F_State=1 and F_IsDelete=0 and F_WorkOrderId ='" + strworkorderid + "'";
216
+                    string pssql = "select *,dbo.GetUserName(F_CreateUser) as UserName "
217
+                                    + "from T_Bus_SubmitSuper where F_State=1 and F_IsDelete=0 and F_Type=1 and F_WorkOrderId ='" + strworkorderid + "'";
218
+                    string zssql = "select *,dbo.GetUserName(F_CreateUser) as UserName "
219
+                                    + "from T_Bus_SubmitSuper where F_State=1 and F_IsDelete=0 and F_Type=2 and F_WorkOrderId ='" + strworkorderid + "'";
220
+                    string htsql = "select *,dbo.GetUserName(F_CreateUser) as UserName "
221
+                                    + "from T_Bus_SubmitSuper where F_State=1 and F_IsDelete=0 and F_Type=3 and F_WorkOrderId ='" + strworkorderid + "'";
222
+                    string jbsql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDeptName(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName "
223
+                                    + "from T_Bus_AssignedInfo where F_State=1 and F_IsDelete=0 and F_WorkOrderId ='" + strworkorderid + "'";
224
+                    string thsql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDeptName(F_CreateDeptId) as DeptName "
225
+                                    + "from T_Bus_Feedback where F_State=1 and F_Type=3 and F_IsDelete=0 and  F_WorkOrderId ='" + strworkorderid + "'";
226
+                    string yssql = "select *,dbo.GetUserName(F_CreateUser) as UserName "
227
+                                    + "from T_Bus_DelayTime where F_State=1 and F_IsDelete=0 and F_WorkOrderId ='" + strworkorderid + "'";
228
+                    string blsql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDeptName(F_CreateDeptId) as DeptName "
229
+                                    + "from T_Bus_Feedback where F_State=1 and F_Type!=3 and F_IsDelete=0 and  F_WorkOrderId ='" + strworkorderid + "'";
230
+                    string hfsql = "select *,dbo.GetUserName(F_CreateUser) as UserName "
231
+                                    + "from T_Bus_VisitResult where F_State=1 and F_IsDelete=0 and F_WorkOrderId ='" + strworkorderid + "'";
232
+                    string gcsql = "select *,dbo.GetUserName(F_CreateUser) as UserName "
233
+                                    + "from T_Bus_Operation where F_IsDelete=0 and F_WorkOrderId ='" + strworkorderid + "'";
234
+                    string cbsql = "select *,dbo.GetUserName(F_CreateUser) as UserName "
235
+                                    + "from T_Bus_Additional where F_State=1 and F_IsDelete=0 and F_WorkOrderId ='" + strworkorderid + "'";
236
+
237
+
238
+                    #region 声音文件
239
+                    dt.Columns.Add("FilePath", typeof(string));
240
+
241
+                    if (dt.Rows[0]["F_LeaveRecordId"] != null)
242
+                    {
243
+                        dt.Rows[0]["FilePath"] = GetLeavePath(dt.Rows[0]["F_LeaveRecordId"].ToString(), config.F_ParamValue);
244
+                    }
245
+                    else if (dt.Rows[0]["F_CallRecordId"] != null)
246
+                    {
247
+                        dt.Rows[0]["FilePath"] = GetCallPath(dt.Rows[0]["F_CallRecordId"].ToString(), config.F_ParamValue);
248
+                    }
249
+                    #endregion
250
+
251
+                    #region 附件
252
+                    if (configfj != null)
253
+                    {
254
+                        dt = BindFileData(dt, configfj.F_ParamValue);
255
+                    }
256
+                    #endregion
257
+
258
+                    #region 监察信息
259
+                    var jcdt = DbHelperSQL.Query(jcsql).Tables[0];
260
+                    if (configfj != null)
261
+                    {
262
+                        jcdt = BindFileData(jcdt, configfj.F_ParamValue);
263
+                    }
264
+                    #endregion
265
+
266
+                    #region 批示信息
267
+                    var psdt = DbHelperSQL.Query(pssql).Tables[0];
268
+                    if (configfj != null)
269
+                    {
270
+                        psdt = BindFileData(psdt, configfj.F_ParamValue);
271
+                    }
272
+                    #endregion
273
+
274
+                    #region 指示信息
275
+                    var zsdt = DbHelperSQL.Query(zssql).Tables[0];
276
+                    if (configfj != null)
277
+                    {
278
+                        zsdt = BindFileData(zsdt, configfj.F_ParamValue);
279
+                    }
280
+                    #endregion
281
+
282
+                    #region 回退信息
283
+                    var htdt = DbHelperSQL.Query(htsql).Tables[0];
284
+                    #endregion
285
+
286
+                    #region 督办信息
287
+                    var dbdt = DbHelperSQL.Query(dbsql).Tables[0];
288
+                    if (configfj != null)
289
+                    {
290
+                        dbdt = BindFileData(dbdt, configfj.F_ParamValue);
291
+                    }
292
+                    #endregion
293
+
294
+                    #region 交办信息
295
+                    var jbdt = DbHelperSQL.Query(jbsql).Tables[0];
296
+                    if (configfj != null)
297
+                    {
298
+                        jbdt = BindFileData(jbdt, configfj.F_ParamValue);
299
+                    }
300
+                    #endregion
301
+
302
+                    #region 退回信息
303
+                    var thdt = DbHelperSQL.Query(thsql).Tables[0];
304
+                    #endregion
305
+
306
+                    #region 延时信息
307
+                    var ysdt = DbHelperSQL.Query(yssql).Tables[0];
308
+                    #endregion
309
+
310
+                    #region 办理情况
311
+                    var bldt = DbHelperSQL.Query(blsql).Tables[0];
312
+                    if (configfj != null)
313
+                    {
314
+                        bldt = BindFileData(bldt, configfj.F_ParamValue);
315
+                    }
316
+                    #endregion
317
+
318
+                    #region 回访信息
319
+                    var hfdt = DbHelperSQL.Query(hfsql).Tables[0];
320
+                    hfdt.Columns.Add("FilePath", typeof(string));
321
+                    foreach (DataRow bldr in hfdt.Rows)
322
+                    {
323
+                        if (bldr["F_CallRecordId"] != null && config != null)
324
+                        {
325
+                            bldr["FilePath"] = GetCallPath(bldr["F_CallRecordId"].ToString(), config.F_ParamValue);
326
+                        }
327
+                    }
328
+                    #endregion
329
+
330
+                    #region 市民催单
331
+                    var cbdt = DbHelperSQL.Query(cbsql).Tables[0];
332
+                    cbdt.Columns.Add("FilePath", typeof(string));
333
+                    foreach (DataRow bldr in cbdt.Rows)
334
+                    {
335
+                        if (bldr["F_CallRecordId"] != null && config != null)
336
+                        {
337
+                            bldr["FilePath"] = GetCallPath(bldr["F_CallRecordId"].ToString(), config.F_ParamValue);
338
+                        }
339
+                    }
340
+                    #endregion
341
+
342
+                    #region 办理过程
343
+                    var gcdt = DbHelperSQL.Query(gcsql).Tables[0];
344
+                    gcdt.Columns.Add("File", typeof(object));
345
+                    gcdt.Columns.Add("FilePath", typeof(string));
346
+                    if (configfj != null || configly != null || config != null)
347
+                    {
348
+                        foreach (DataRow bldr in gcdt.Rows)
349
+                        {
350
+                            if (bldr["F_File"] != null && bldr["F_File"].ToString() != "" && configfj != null)
351
+                            {
352
+                                bldr["File"] = GetFileData(bldr["F_File"].ToString(), configfj.F_ParamValue);
353
+                            }
354
+
355
+                            if (bldr["F_LeaveRecordId"] != null && configly != null)
356
+                            {
357
+                                bldr["FilePath"] = GetLeavePath(bldr["F_LeaveRecordId"].ToString(), config.F_ParamValue);
358
+                            }
359
+                            else if (bldr["F_CallRecordId"] != null && config != null)
360
+                            {
361
+                                bldr["FilePath"] = GetCallPath(bldr["F_CallRecordId"].ToString(), config.F_ParamValue);
362
+                            }
363
+                        }
364
+                    }
365
+                    #endregion
366
+
367
+                    var obj = new
368
+                    {
369
+                        data = dt,
370
+                        jcdata = jcdt,
371
+                        psdata = psdt,
372
+                        zsdata = zsdt,
373
+                        htdata = htdt,
374
+                        dbdata = dbdt,
375
+                        jbdata = jbdt,
376
+                        thdata = thdt,
377
+                        ysdata = ysdt,
378
+                        bldata = bldt,
379
+                        hfdata = hfdt,
380
+                        cbdata = cbdt,
381
+                        gcdata = gcdt
382
+                    };
383
+                    return Success("获取成功", obj);
384
+                }
385
+                else
386
+                {
387
+                    return Error("获取失败");
388
+                }
389
+            }
390
+            else
391
+            {
392
+                return Error("参数传输失败");
393
+            }
394
+        }
395
+
396
+        /// <summary>
397
+        /// 获取留言路径
398
+        /// </summary>
399
+        /// <param name="lid">留言id</param>
400
+        /// <param name="prefix">前缀</param>
401
+        /// <returns></returns>
402
+        public string GetLeavePath(string lid, string prefix)
403
+        {
404
+            string path = string.Empty;
405
+            var liuyan = new BLL.T_Call_LeaveRecord().GetModelList(" F_Id='" + lid + "' ").FirstOrDefault();
406
+            if (liuyan != null)
407
+            {
408
+                if (!string.IsNullOrEmpty(liuyan.F_RecFileUrl))
409
+                {
410
+                    path = prefix + liuyan.F_RecFileUrl;
411
+                }
412
+            }
413
+            return path;
414
+        }
415
+
416
+        /// <summary>
417
+        /// 获取通话录音路径
418
+        /// </summary>
419
+        /// <param name="cid">通话id</param>
420
+        /// <param name="prefix">前缀</param>
421
+        /// <returns></returns>
422
+        public string GetCallPath(string cid, string prefix)
423
+        {
424
+            string path = string.Empty;
425
+            var luyin = new BLL.T_Call_CallRecords().GetModelList(" CallRecordsId='" + cid + "' ").FirstOrDefault();
426
+            if (luyin != null)
427
+            {
428
+                if (!string.IsNullOrEmpty(luyin.FilePath))
429
+                {
430
+                    var ym = prefix;
431
+                    ym = ym.Substring(0, ym.Length - 1);
432
+                    string lujing = luyin.FilePath.Substring(luyin.FilePath.IndexOf(':') + 1).Replace('\\', '/');
433
+                    path = ym + lujing;
434
+
435
+                    //if (!CommonHelper.FileIsExist(path))
436
+                    //{
437
+                    //    path = lujing;
438
+                    //}
439
+                }
440
+            }
441
+            return path;
442
+        }
443
+
444
+        /// <summary>
445
+        /// 获取附件数据
446
+        /// </summary>
447
+        /// <param name="ids">附件id,多个用英文逗号,隔开</param>
448
+        /// <param name="prefix">前缀</param>
449
+        /// <returns></returns>
450
+        public DataTable GetFileData(string ids, string prefix)
451
+        {
452
+            DataTable dt = DbHelperSQL.Query("select * from T_Sys_Accessories where F_FileId in (" + ids + ")").Tables[0];
453
+
454
+            foreach (DataRow dr in dt.Rows)
455
+            {
456
+                dr["F_FileUrl"] = prefix + dr["F_FileUrl"].ToString();
457
+            }
458
+
459
+            return dt;
460
+        }
461
+
462
+        /// <summary>
463
+        /// 绑定附件信息
464
+        /// </summary>
465
+        /// <param name="dt"></param>
466
+        /// <param name="prefix"></param>
467
+        /// <returns></returns>
468
+        public DataTable BindFileData(DataTable dt, string prefix)
469
+        {
470
+            dt.Columns.Add("File", typeof(object));
471
+            foreach (DataRow dr in dt.Rows)
472
+            {
473
+                if (dr["F_File"] != null && dr["F_File"].ToString() != "")
474
+                {
475
+                    dr["File"] = GetFileData(dr["F_File"].ToString(), prefix);
476
+                }
477
+            }
478
+            return dt;
479
+        }
20 480
 
21 481
         /// <summary>
22 482
         /// 绩效考核

+ 1 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/EmailSendController.cs

@@ -613,6 +613,7 @@ namespace CallCenterApi.Interface.Controllers
613 613
             int smalltype = RequestString.GetInt("smalltype", 0);    //小类别
614 614
             int isprotect = RequestString.GetInt("isprotect", 0);    //0普通1保密
615 615
             int level = RequestString.GetInt("level", 1);            //1普通2紧急3特急
616
+            string files = RequestString.GetFormString("files");        //附件
616 617
             WorkOrderController wo = new WorkOrderController();
617 618
 
618 619
             BLL.T_Email_EmailMessage_Map bll = new BLL.T_Email_EmailMessage_Map();

+ 13 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/WebController.cs

@@ -1137,6 +1137,19 @@ namespace CallCenterApi.Interface.Controllers
1137 1137
         }
1138 1138
 
1139 1139
         /// <summary>
1140
+        /// 获取事发地域列表
1141
+        /// </summary>
1142
+        /// <param name="id"></param>
1143
+        /// <returns></returns>
1144
+        public ActionResult GetWebAreaListById(int id = 0)
1145
+        {
1146
+            Dictionary<string, string> paras = new Dictionary<string, string>();
1147
+            paras.Add("@Id", id.ToString());
1148
+            DataTable dt = DbHelperSQL.Query(" select * from T_Sys_Area where isnull(F_PrentId,0)=@id and F_State=0 ", paras).Tables[0];
1149
+            return Success("列表加载成功", dt);
1150
+        }
1151
+
1152
+        /// <summary>
1140 1153
         /// 获取工单类型列表
1141 1154
         /// </summary>
1142 1155
         /// <returns></returns>

+ 1 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WorkOrderReportController.cs

@@ -1577,7 +1577,7 @@ namespace CallCenterApi.Interface.Controllers.report
1577 1577
             var obj = DbHelperSQL.RunProcedure("P_DeptMonthReport", paras, "DeptMonthReport");
1578 1578
             if (isExport)
1579 1579
             {
1580
-                var cols = new string[] { "名称", "当月受理数量", "当月处理量", "往月处理量", "当月延期量", "往月延期量", "当月办理率", "当月办结率" };
1580
+                var cols = new string[] { "名称", "当月受理数量", "当月处理量", "往月处理量", "当月延期量", "往月延期量", "当月重办量", "往月重办量", "当月结案量", "当月办理率", "当月办结率" };
1581 1581
                 new NPOIHelper().ExportToExcel($"工单报表{date}", obj.Tables[0], cols);
1582 1582
                 return Success("导出excel");
1583 1583
             }

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

@@ -47,6 +47,7 @@
47 47
     <Compile Include="T_Bus_Additional.cs" />
48 48
     <Compile Include="T_Bus_AssignedInfo_Next.cs" />
49 49
     <Compile Include="T_Bus_AssignedItemInfo.cs" />
50
+    <Compile Include="T_Bus_CityTurn.cs" />
50 51
     <Compile Include="T_Bus_Feedback_Next.cs" />
51 52
     <Compile Include="T_Bus_NoticeCriticism.cs" />
52 53
     <Compile Include="T_Bus_VisitResultRecords.cs" />

+ 161 - 0
CallCenterApi/CallCenterApi.Model/T_Bus_CityTurn.cs

@@ -0,0 +1,161 @@
1
+using System;
2
+namespace CallCenterApi.Model
3
+{
4
+    /// <summary>
5
+    /// T_Bus_CityTurn:实体类(属性说明自动提取数据库字段的描述信息)
6
+    /// </summary>
7
+    [Serializable]
8
+    public partial class T_Bus_CityTurn
9
+    {
10
+        public T_Bus_CityTurn()
11
+        { }
12
+        #region Model
13
+        private int _f_id;
14
+        private string _f_workorderid;
15
+        private int? _f_type;
16
+        private string _f_citycode;
17
+        private string _f_cityname;
18
+        private string _f_cityworkorderid;
19
+        private int? _f_issure;
20
+        private string _f_sureuser;
21
+        private DateTime? _f_suretime;
22
+        private string _f_reson;
23
+        private int? _f_state;
24
+        private string _f_createuser;
25
+        private DateTime? _f_createtime;
26
+        private int? _f_isdelete;
27
+        private string _f_deleteuser;
28
+        private DateTime? _f_deletetime;
29
+        /// <summary>
30
+        /// 
31
+        /// </summary>
32
+        public int F_Id
33
+        {
34
+            set { _f_id = value; }
35
+            get { return _f_id; }
36
+        }
37
+        /// <summary>
38
+        /// 工单号
39
+        /// </summary>
40
+        public string F_WorkOrderId
41
+        {
42
+            set { _f_workorderid = value; }
43
+            get { return _f_workorderid; }
44
+        }
45
+        /// <summary>
46
+        /// 
47
+        /// </summary>
48
+        public int? F_Type
49
+        {
50
+            set { _f_type = value; }
51
+            get { return _f_type; }
52
+        }
53
+        /// <summary>
54
+        /// 市code
55
+        /// </summary>
56
+        public string F_CityCode
57
+        {
58
+            set { _f_citycode = value; }
59
+            get { return _f_citycode; }
60
+        }
61
+        /// <summary>
62
+        /// 市名称
63
+        /// </summary>
64
+        public string F_CityName
65
+        {
66
+            set { _f_cityname = value; }
67
+            get { return _f_cityname; }
68
+        }
69
+        /// <summary>
70
+        /// 市工单号
71
+        /// </summary>
72
+        public string F_CityWorkOrderId
73
+        {
74
+            set { _f_cityworkorderid = value; }
75
+            get { return _f_cityworkorderid; }
76
+        }
77
+        /// <summary>
78
+        /// 是否接收(0未接收1接收2退回)
79
+        /// </summary>
80
+        public int? F_IsSure
81
+        {
82
+            set { _f_issure = value; }
83
+            get { return _f_issure; }
84
+        }
85
+        /// <summary>
86
+        /// 接收人
87
+        /// </summary>
88
+        public string F_SureUser
89
+        {
90
+            set { _f_sureuser = value; }
91
+            get { return _f_sureuser; }
92
+        }
93
+        /// <summary>
94
+        /// 接收时间
95
+        /// </summary>
96
+        public DateTime? F_SureTime
97
+        {
98
+            set { _f_suretime = value; }
99
+            get { return _f_suretime; }
100
+        }
101
+        /// <summary>
102
+        /// 退回原因
103
+        /// </summary>
104
+        public string F_Reson
105
+        {
106
+            set { _f_reson = value; }
107
+            get { return _f_reson; }
108
+        }
109
+        /// <summary>
110
+        /// 状态
111
+        /// </summary>
112
+        public int? F_State
113
+        {
114
+            set { _f_state = value; }
115
+            get { return _f_state; }
116
+        }
117
+        /// <summary>
118
+        /// 
119
+        /// </summary>
120
+        public string F_CreateUser
121
+        {
122
+            set { _f_createuser = value; }
123
+            get { return _f_createuser; }
124
+        }
125
+        /// <summary>
126
+        /// 
127
+        /// </summary>
128
+        public DateTime? F_CreateTime
129
+        {
130
+            set { _f_createtime = value; }
131
+            get { return _f_createtime; }
132
+        }
133
+        /// <summary>
134
+        /// 
135
+        /// </summary>
136
+        public int? F_IsDelete
137
+        {
138
+            set { _f_isdelete = value; }
139
+            get { return _f_isdelete; }
140
+        }
141
+        /// <summary>
142
+        /// 
143
+        /// </summary>
144
+        public string F_DeleteUser
145
+        {
146
+            set { _f_deleteuser = value; }
147
+            get { return _f_deleteuser; }
148
+        }
149
+        /// <summary>
150
+        /// 
151
+        /// </summary>
152
+        public DateTime? F_DeleteTime
153
+        {
154
+            set { _f_deletetime = value; }
155
+            get { return _f_deletetime; }
156
+        }
157
+        #endregion Model
158
+
159
+    }
160
+}
161
+

+ 19 - 31
CallCenterCommon/CallCenter.Utility/NPOI/NPOIHelper.cs

@@ -887,41 +887,29 @@ namespace CallCenter.Utility
887 887
                 cell15.CellStyle = cellStylebt;
888 888
 
889 889
                 sheet.AddMergedRegion(new CellRangeAddress(15, 15, 0, 7));
890
+                int rowcount = (dt5.Rows.Count / 4) + 1;
890 891
 
891
-                IRow irow16 = sheet.CreateRow(16);
892
-                IRow irow17 = sheet.CreateRow(17);
893
-                IRow irow18 = sheet.CreateRow(18);
894
-                int l = 0;
895
-                foreach (DataRow dr5 in dt5.Rows)
892
+                for (int i = 0; i < rowcount; i++)
896 893
                 {
897
-                    if (l < 4)
894
+                    IRow irow = sheet.CreateRow(16 + i);
895
+                    for (int j = 0; j < 4; j++)
898 896
                     {
899
-                        ICell cell161 = irow16.CreateCell(2 * (l + 1) - 2);
900
-                        cell161.SetCellValue(dr5["areaname"].ToString());
901
-                        cell161.CellStyle = cellStyle;
902
-                        ICell cell162 = irow16.CreateCell(2 * (l + 1) - 1);
903
-                        cell162.SetCellValue(Int32.Parse(dr5["count"].ToString()));
904
-                        cell162.CellStyle = cellStyle;
905
-                    }
906
-                    else if (l < 8 && l >= 4)
907
-                    {
908
-                        ICell cell171 = irow17.CreateCell(2 * (l - 3) - 2);
909
-                        cell171.SetCellValue(dr5["areaname"].ToString());
910
-                        cell171.CellStyle = cellStyle;
911
-                        ICell cell172 = irow17.CreateCell(2 * (l - 3) - 1);
912
-                        cell172.SetCellValue(Int32.Parse(dr5["count"].ToString()));
913
-                        cell172.CellStyle = cellStyle;
914
-                    }
915
-                    else
916
-                    {
917
-                        ICell cell181 = irow18.CreateCell(2 * (l - 7) - 2);
918
-                        cell181.SetCellValue(dr5["areaname"].ToString());
919
-                        cell181.CellStyle = cellStyle;
920
-                        ICell cell182 = irow18.CreateCell(2 * (l - 7) - 1);
921
-                        cell182.SetCellValue(Int32.Parse(dr5["count"].ToString()));
922
-                        cell182.CellStyle = cellStyle;
897
+                        int num = i * 4 + j;
898
+                        if (num != dt5.Rows.Count)
899
+                        {
900
+                            var dr = dt5.Rows[num];
901
+                            ICell cellname = irow.CreateCell(2 * (j + 1) - 2);
902
+                            cellname.SetCellValue(dr["areaname"].ToString());
903
+                            cellname.CellStyle = cellStyle;
904
+                            ICell cellcount = irow.CreateCell(2 * (j + 1) - 1);
905
+                            cellcount.SetCellValue(Int32.Parse(dr["count"].ToString()));
906
+                            cellcount.CellStyle = cellStyle;
907
+                        }
908
+                        else
909
+                        {
910
+                            break;
911
+                        }
923 912
                     }
924
-                    l = l + 1;
925 913
                 }
926 914
 
927 915
                 #endregion

+ 63 - 61
CallCenterCommon/CallCenter.Utility/RedisHelper.cs

@@ -12,13 +12,15 @@ namespace CallCenter.Utility
12 12
         #region 
13 13
         //执行顺序---静态字段---静态构造函数---构造函数
14 14
         private static ConnectionMultiplexer redis;
15
-
15
+        private static IDatabase database;
16 16
         static RedisHelper()
17 17
         {
18 18
             if (redis == null || !redis.IsConnected)
19 19
             {
20 20
                 redis = ConnectionMultiplexer.Connect(Configs.GetValue("Redis_Server")+":"+Configs.GetValue("Redis_Port"));
21 21
                 //redis = ConnectionMultiplexer.Connect("192.168.4.18, abortConnect=false");
22
+
23
+                database = redis.GetDatabase(10);
22 24
             }
23 25
         }
24 26
 
@@ -34,7 +36,7 @@ namespace CallCenter.Utility
34 36
         /// <returns></returns>
35 37
         public static bool StringSet(string key, string value)
36 38
         {
37
-            return redis.GetDatabase().StringSet(key, value);
39
+            return database.StringSet(key, value);
38 40
         }
39 41
 
40 42
         /// <summary>
@@ -44,7 +46,7 @@ namespace CallCenter.Utility
44 46
         /// <returns></returns>
45 47
         public static object StringGet(string key)
46 48
         {
47
-            var rt= redis.GetDatabase().StringGet(key);
49
+            var rt= database.StringGet(key);
48 50
 
49 51
             if (rt.IsNull)
50 52
             {
@@ -65,7 +67,7 @@ namespace CallCenter.Utility
65 67
         /// <returns></returns>
66 68
         public static object StringGet(string key, int start, int end)
67 69
         {
68
-            var rt = redis.GetDatabase().StringGetRange(key, start, end);
70
+            var rt = database.StringGetRange(key, start, end);
69 71
             if (rt.IsNull)
70 72
             {
71 73
                 return null;
@@ -84,7 +86,7 @@ namespace CallCenter.Utility
84 86
         /// <returns></returns>
85 87
         public static object StringGetAndSet(string key, string value)
86 88
         {
87
-            var rt = redis.GetDatabase().StringGetSet(key, value);
89
+            var rt = database.StringGetSet(key, value);
88 90
             if (rt.IsNull)
89 91
             {
90 92
                 return null;
@@ -103,7 +105,7 @@ namespace CallCenter.Utility
103 105
         /// <returns></returns>
104 106
         public static bool StringGetBit(string key, long offset)
105 107
         {
106
-            return redis.GetDatabase().StringGetBit(key, offset);
108
+            return database.StringGetBit(key, offset);
107 109
         }
108 110
 
109 111
         /// <summary>
@@ -116,7 +118,7 @@ namespace CallCenter.Utility
116 118
             List<object> list = new List<object>();
117 119
             for (int i = 0; i < keys.Length; i++)
118 120
             {
119
-                list.Add(redis.GetDatabase().StringGet(keys[i]));
121
+                list.Add(database.StringGet(keys[i]));
120 122
             }
121 123
             return list;
122 124
         }
@@ -130,7 +132,7 @@ namespace CallCenter.Utility
130 132
         /// <returns></returns>
131 133
         public static bool StringSetBit(string key, long offset)
132 134
         {
133
-            return redis.GetDatabase().StringSetBit(key, offset, true);
135
+            return database.StringSetBit(key, offset, true);
134 136
         }
135 137
 
136 138
         /// <summary>
@@ -142,7 +144,7 @@ namespace CallCenter.Utility
142 144
         /// <returns></returns>
143 145
         public static bool StringSet(string key, string value, TimeSpan expiry)
144 146
         {
145
-            return redis.GetDatabase().StringSet(key, value, expiry);
147
+            return database.StringSet(key, value, expiry);
146 148
         }
147 149
 
148 150
         /// <summary>
@@ -153,9 +155,9 @@ namespace CallCenter.Utility
153 155
         /// <returns></returns>
154 156
         public static void StringSetIfAbsent(string key, string value)
155 157
         {
156
-            if (redis.GetDatabase().StringGet(key) == RedisValue.Null)
158
+            if (database.StringGet(key) == RedisValue.Null)
157 159
             {
158
-                redis.GetDatabase().StringSet(key, value);
160
+                database.StringSet(key, value);
159 161
             }
160 162
         }
161 163
 
@@ -168,7 +170,7 @@ namespace CallCenter.Utility
168 170
         /// <returns></returns>
169 171
         public static object StringSet(string key, long offset, string value)
170 172
         {
171
-            return redis.GetDatabase().StringSetRange(key, offset, value);
173
+            return database.StringSetRange(key, offset, value);
172 174
         }
173 175
 
174 176
         /// <summary>
@@ -178,7 +180,7 @@ namespace CallCenter.Utility
178 180
         /// <returns></returns>
179 181
         public static long StringSize(string key)
180 182
         {
181
-            return redis.GetDatabase().StringLength(key);
183
+            return database.StringLength(key);
182 184
         }
183 185
 
184 186
         /// <summary>
@@ -190,7 +192,7 @@ namespace CallCenter.Utility
190 192
         {
191 193
             foreach (KeyValuePair<string, string> key in dic)
192 194
             {
193
-                redis.GetDatabase().StringSet(key.Key, key.Value);
195
+                database.StringSet(key.Key, key.Value);
194 196
             }
195 197
         }
196 198
 
@@ -204,9 +206,9 @@ namespace CallCenter.Utility
204 206
             foreach (KeyValuePair<string, string> key in dic)
205 207
             {
206 208
                 //判断键值是否存在
207
-                if (redis.GetDatabase().StringGet(key.Key) == RedisValue.Null)
209
+                if (database.StringGet(key.Key) == RedisValue.Null)
208 210
                 {
209
-                    redis.GetDatabase().StringSet(key.Key, key.Value);
211
+                    database.StringSet(key.Key, key.Value);
210 212
                 }
211 213
             }
212 214
         }
@@ -219,7 +221,7 @@ namespace CallCenter.Utility
219 221
         /// <returns></returns>
220 222
         public static double StringIncrement(string key, double value)
221 223
         {
222
-            return redis.GetDatabase().StringIncrement(key, value);
224
+            return database.StringIncrement(key, value);
223 225
         }
224 226
 
225 227
         /// <summary>
@@ -230,7 +232,7 @@ namespace CallCenter.Utility
230 232
         /// <returns></returns>
231 233
         public static long StringAppend(string key, string value)
232 234
         {
233
-            return redis.GetDatabase().StringAppend(key, value);
235
+            return database.StringAppend(key, value);
234 236
         }
235 237
 
236 238
         /// <summary>
@@ -255,7 +257,7 @@ namespace CallCenter.Utility
255 257
         /// <returns></returns>
256 258
         public static bool HashDelete(string key, string field)
257 259
         {
258
-            return redis.GetDatabase().HashDelete(key, field);
260
+            return database.HashDelete(key, field);
259 261
         }
260 262
 
261 263
         /// <summary>
@@ -266,7 +268,7 @@ namespace CallCenter.Utility
266 268
         /// <returns></returns>
267 269
         public static bool HashHasKey(string key, string field)
268 270
         {
269
-            return redis.GetDatabase().HashExists(key, field);
271
+            return database.HashExists(key, field);
270 272
         }
271 273
 
272 274
         /// <summary>
@@ -277,7 +279,7 @@ namespace CallCenter.Utility
277 279
         /// <returns></returns>
278 280
         public static object HashGet(string key, string field)
279 281
         {
280
-            return redis.GetDatabase().HashGet(key, field);
282
+            return database.HashGet(key, field);
281 283
         }
282 284
 
283 285
         /// <summary>
@@ -288,7 +290,7 @@ namespace CallCenter.Utility
288 290
         public static Dictionary<string, object> HashGetAll(string key)
289 291
         {
290 292
             Dictionary<string, object> dic = new Dictionary<string, object>();
291
-            var collection = redis.GetDatabase().HashGetAll(key);
293
+            var collection = database.HashGetAll(key);
292 294
             foreach (var item in collection)
293 295
             {
294 296
                 dic.Add(item.Name, item.Value);
@@ -305,7 +307,7 @@ namespace CallCenter.Utility
305 307
         /// <returns></returns>
306 308
         public static double HashIncrement(string key, string field, double value)
307 309
         {
308
-            return redis.GetDatabase().HashIncrement(key, field, value);
310
+            return database.HashIncrement(key, field, value);
309 311
         }
310 312
 
311 313
         /// <summary>
@@ -315,7 +317,7 @@ namespace CallCenter.Utility
315 317
         /// <returns></returns>
316 318
         public static string[] HashKeys(string key)
317 319
         {
318
-            return redis.GetDatabase().HashKeys(key).ToStringArray();
320
+            return database.HashKeys(key).ToStringArray();
319 321
         }
320 322
 
321 323
         /// <summary>
@@ -325,7 +327,7 @@ namespace CallCenter.Utility
325 327
         /// <returns></returns>
326 328
         public static long HashSize(string key)
327 329
         {
328
-            return redis.GetDatabase().HashLength(key);
330
+            return database.HashLength(key);
329 331
         }
330 332
 
331 333
         /// <summary>
@@ -339,7 +341,7 @@ namespace CallCenter.Utility
339 341
             List<object> result = new List<object>();
340 342
             foreach (string field in hashKeys)
341 343
             {
342
-                result.Add(redis.GetDatabase().HashGet(key, field));
344
+                result.Add(database.HashGet(key, field));
343 345
             }
344 346
             return result;
345 347
         }
@@ -358,7 +360,7 @@ namespace CallCenter.Utility
358 360
                 KeyValuePair<string, string> param = dic.ElementAt(i);
359 361
                 list.Add(new HashEntry(param.Key, param.Value));
360 362
             }
361
-            redis.GetDatabase().HashSet(key, list.ToArray());
363
+            database.HashSet(key, list.ToArray());
362 364
         }
363 365
 
364 366
         /// <summary>
@@ -370,7 +372,7 @@ namespace CallCenter.Utility
370 372
         /// <returns></returns>
371 373
         public static void HashPut(string key, string field, string value)
372 374
         {
373
-            redis.GetDatabase().HashSet(key, new HashEntry[] { new HashEntry(field, value) });
375
+            database.HashSet(key, new HashEntry[] { new HashEntry(field, value) });
374 376
         }
375 377
 
376 378
         /// <summary>
@@ -384,7 +386,7 @@ namespace CallCenter.Utility
384 386
         {
385 387
             if (!HashHasKey(key, field))
386 388
             {
387
-                redis.GetDatabase().HashSet(key, new HashEntry[] { new HashEntry(field, value) });
389
+                database.HashSet(key, new HashEntry[] { new HashEntry(field, value) });
388 390
             }
389 391
         }
390 392
 
@@ -395,7 +397,7 @@ namespace CallCenter.Utility
395 397
         /// <returns></returns>
396 398
         public static string[] HashValues(string key)
397 399
         {
398
-            return redis.GetDatabase().HashValues(key).ToStringArray();
400
+            return database.HashValues(key).ToStringArray();
399 401
         }
400 402
 
401 403
         /// <summary>
@@ -406,7 +408,7 @@ namespace CallCenter.Utility
406 408
         /// <returns></returns>
407 409
         public static T GetHashValue<T>(string key)
408 410
         {
409
-            HashEntry[] array = redis.GetDatabase().HashGetAll(key);
411
+            HashEntry[] array = database.HashGetAll(key);
410 412
             Dictionary<string, object> dic = new Dictionary<string, object>();
411 413
             for (int i = 0; i < array.Length; i++)
412 414
             {
@@ -448,7 +450,7 @@ namespace CallCenter.Utility
448 450
         /// <returns></returns>
449 451
         public static long ListLeftPush(string key, string value)
450 452
         {
451
-            return redis.GetDatabase().ListLeftPush(key, value);
453
+            return database.ListLeftPush(key, value);
452 454
         }
453 455
 
454 456
         /// <summary>
@@ -458,7 +460,7 @@ namespace CallCenter.Utility
458 460
         /// <returns></returns>
459 461
         public static object ListLeftPop(string key)
460 462
         {
461
-            return redis.GetDatabase().ListLeftPop(key);
463
+            return database.ListLeftPop(key);
462 464
         }
463 465
 
464 466
         /// <summary>
@@ -468,7 +470,7 @@ namespace CallCenter.Utility
468 470
         /// <returns></returns>
469 471
         public static long ListSize(string key)
470 472
         {
471
-            return redis.GetDatabase().ListLength(key);
473
+            return database.ListLength(key);
472 474
         }
473 475
 
474 476
         /// <summary>
@@ -480,7 +482,7 @@ namespace CallCenter.Utility
480 482
         /// <returns></returns>
481 483
         public static string[] ListRange(string key, int start, int end)
482 484
         {
483
-            return redis.GetDatabase().ListRange(key, start, end).ToStringArray();
485
+            return database.ListRange(key, start, end).ToStringArray();
484 486
         }
485 487
 
486 488
         /// <summary>
@@ -492,7 +494,7 @@ namespace CallCenter.Utility
492 494
         /// <returns></returns>
493 495
         public static long ListRemove(string key, string value)
494 496
         {
495
-            return redis.GetDatabase().ListRemove(key, value);
497
+            return database.ListRemove(key, value);
496 498
         }
497 499
 
498 500
         /// <summary>
@@ -503,7 +505,7 @@ namespace CallCenter.Utility
503 505
         /// <returns></returns>
504 506
         public static object ListIndex(string key, long index)
505 507
         {
506
-            return redis.GetDatabase().ListGetByIndex(key, index);
508
+            return database.ListGetByIndex(key, index);
507 509
         }
508 510
 
509 511
         /// <summary>
@@ -515,7 +517,7 @@ namespace CallCenter.Utility
515 517
         /// <returns></returns>
516 518
         public static void ListSet(string key, int index, string value)
517 519
         {
518
-            redis.GetDatabase().ListSetByIndex(key, index, value);
520
+            database.ListSetByIndex(key, index, value);
519 521
         }
520 522
 
521 523
         /// <summary>
@@ -527,7 +529,7 @@ namespace CallCenter.Utility
527 529
         /// <returns></returns>
528 530
         public static void ListTrim(string key, int start, int end)
529 531
         {
530
-            redis.GetDatabase().ListTrim(key, start, end);
532
+            database.ListTrim(key, start, end);
531 533
         }
532 534
 
533 535
         /// <summary>
@@ -538,7 +540,7 @@ namespace CallCenter.Utility
538 540
         /// <returns></returns>
539 541
         public static object ListRightPopAndLeftPush(string sourceKey, string destinationKey)
540 542
         {
541
-            return redis.GetDatabase().ListRightPopLeftPush(sourceKey, destinationKey);
543
+            return database.ListRightPopLeftPush(sourceKey, destinationKey);
542 544
         }
543 545
 
544 546
         #endregion
@@ -552,7 +554,7 @@ namespace CallCenter.Utility
552 554
         /// <param name="value"></param>
553 555
         public static void SetAdd(string key, string value)
554 556
         {
555
-            redis.GetDatabase().SetAdd(key, value);
557
+            database.SetAdd(key, value);
556 558
         }
557 559
 
558 560
         /// <summary>
@@ -567,13 +569,13 @@ namespace CallCenter.Utility
567 569
             switch (point)
568 570
             {
569 571
                 case 0:
570
-                    array = redis.GetDatabase().SetCombine(SetOperation.Union, firstKey, secondKey);
572
+                    array = database.SetCombine(SetOperation.Union, firstKey, secondKey);
571 573
                     break;
572 574
                 case 1:
573
-                    array = redis.GetDatabase().SetCombine(SetOperation.Intersect, firstKey, secondKey);
575
+                    array = database.SetCombine(SetOperation.Intersect, firstKey, secondKey);
574 576
                     break;
575 577
                 case 2:
576
-                    array = redis.GetDatabase().SetCombine(SetOperation.Difference, firstKey, secondKey);
578
+                    array = database.SetCombine(SetOperation.Difference, firstKey, secondKey);
577 579
                     break;
578 580
                 default:
579 581
                     array = new RedisValue[0];
@@ -590,7 +592,7 @@ namespace CallCenter.Utility
590 592
         /// <returns></returns>
591 593
         public static bool SetContains(string key, string value)
592 594
         {
593
-            return redis.GetDatabase().SetContains(key, value);
595
+            return database.SetContains(key, value);
594 596
         }
595 597
 
596 598
         /// <summary>
@@ -600,7 +602,7 @@ namespace CallCenter.Utility
600 602
         /// <returns></returns>
601 603
         public static long SetLength(string key)
602 604
         {
603
-            return redis.GetDatabase().SetLength(key);
605
+            return database.SetLength(key);
604 606
         }
605 607
 
606 608
         /// <summary>
@@ -610,7 +612,7 @@ namespace CallCenter.Utility
610 612
         /// <returns></returns>
611 613
         public static string[] SetMembers(string key)
612 614
         {
613
-            return redis.GetDatabase().SetMembers(key).ToStringArray();
615
+            return database.SetMembers(key).ToStringArray();
614 616
         }
615 617
 
616 618
         /// <summary>
@@ -621,7 +623,7 @@ namespace CallCenter.Utility
621 623
         /// <param name="value"></param>
622 624
         public static bool SetMove(string sourceKey, string destinationKey, string value)
623 625
         {
624
-            return redis.GetDatabase().SetMove(sourceKey, destinationKey, value);
626
+            return database.SetMove(sourceKey, destinationKey, value);
625 627
         }
626 628
 
627 629
         /// <summary>
@@ -630,7 +632,7 @@ namespace CallCenter.Utility
630 632
         /// <param name="key"></param>
631 633
         public static string SetPop(string key)
632 634
         {
633
-            return redis.GetDatabase().SetPop(key);
635
+            return database.SetPop(key);
634 636
         }
635 637
 
636 638
         /// <summary>
@@ -640,7 +642,7 @@ namespace CallCenter.Utility
640 642
         /// <returns></returns>
641 643
         public static string SetRandomMember(string key)
642 644
         {
643
-            return redis.GetDatabase().SetRandomMember(key);
645
+            return database.SetRandomMember(key);
644 646
         }
645 647
 
646 648
         /// <summary>
@@ -650,7 +652,7 @@ namespace CallCenter.Utility
650 652
         /// <param name="count"></param>
651 653
         public static string[] SetRandomMembers(string key, long count)
652 654
         {
653
-            return redis.GetDatabase().SetRandomMembers(key, count).ToStringArray();
655
+            return database.SetRandomMembers(key, count).ToStringArray();
654 656
         }
655 657
 
656 658
         /// <summary>
@@ -660,7 +662,7 @@ namespace CallCenter.Utility
660 662
         /// <param name="value"></param>
661 663
         public static void SetRemove(string key, string value)
662 664
         {
663
-            redis.GetDatabase().SetRemove(key, value);
665
+            database.SetRemove(key, value);
664 666
         }
665 667
 
666 668
         /// <summary>
@@ -669,7 +671,7 @@ namespace CallCenter.Utility
669 671
         /// <param name="key"></param>
670 672
         public static void SetScan(string key)
671 673
         {
672
-            redis.GetDatabase().SetScan(key);
674
+            database.SetScan(key);
673 675
         }
674 676
 
675 677
         #endregion
@@ -678,7 +680,7 @@ namespace CallCenter.Utility
678 680
 
679 681
         public static void Method(string key, string value, double score)
680 682
         {
681
-            redis.GetDatabase().SortedSetAdd(key, new SortedSetEntry[] { new SortedSetEntry(value, score) });
683
+            database.SortedSetAdd(key, new SortedSetEntry[] { new SortedSetEntry(value, score) });
682 684
         }
683 685
 
684 686
         #endregion
@@ -714,7 +716,7 @@ namespace CallCenter.Utility
714 716
         /// <returns></returns>
715 717
         public static bool KeyDelete(string redisKey)
716 718
         {
717
-            return redis.GetDatabase().KeyDelete(redisKey);
719
+            return database.KeyDelete(redisKey);
718 720
         }
719 721
 
720 722
         /// <summary>
@@ -724,14 +726,14 @@ namespace CallCenter.Utility
724 726
         /// <returns></returns>
725 727
         //public static long KeysDelete(IEnumerable<RedisKey> redisKeys)
726 728
         //{
727
-        //    return redis.GetDatabase().KeyDelete(redisKeys.ToArray());
729
+        //    return database.KeyDelete(redisKeys.ToArray());
728 730
         //}
729 731
         public static long KeysDelete(List<string> redisKeys)
730 732
         {
731 733
             int n = 0;
732 734
             foreach (var r in redisKeys)
733 735
             {
734
-                if (redis.GetDatabase().KeyDelete(r))
736
+                if (database.KeyDelete(r))
735 737
                 {
736 738
                     n++;
737 739
                 }
@@ -746,7 +748,7 @@ namespace CallCenter.Utility
746 748
         /// <returns></returns>
747 749
         public static bool KeyExists(string redisKey)
748 750
         {
749
-            return redis.GetDatabase().KeyExists(redisKey);
751
+            return database.KeyExists(redisKey);
750 752
         }
751 753
 
752 754
         /// <summary>
@@ -757,7 +759,7 @@ namespace CallCenter.Utility
757 759
         /// <returns></returns>
758 760
         public static bool KeyRename(string redisKey, string redisNewKey)
759 761
         {
760
-            return redis.GetDatabase().KeyRename(redisKey, redisNewKey);
762
+            return database.KeyRename(redisKey, redisNewKey);
761 763
         }
762 764
 
763 765
         /// <summary>
@@ -768,7 +770,7 @@ namespace CallCenter.Utility
768 770
         /// <returns></returns>
769 771
         public static bool KeyExpire(string redisKey, TimeSpan? expiry)
770 772
         {
771
-            return redis.GetDatabase().KeyExpire(redisKey, expiry);
773
+            return database.KeyExpire(redisKey, expiry);
772 774
         }
773 775
 
774 776
         #endregion
@@ -782,7 +784,7 @@ namespace CallCenter.Utility
782 784
         {
783 785
             var server = redis.GetServer(Configs.GetValue("Redis_Server"), Int32.Parse(Configs.GetValue("Redis_Port")));
784 786
             var timeNow = server.Time().ToUniversalTime();
785
-            var time = redis.GetDatabase().KeyTimeToLive(redisKey);
787
+            var time = database.KeyTimeToLive(redisKey);
786 788
             var expire = time == null ? (DateTime?)null : timeNow.Add(time.Value); //返回UTC时间。
787 789
             return expire.Value.AddHours(8).ToString("yyyy-MM-dd HH:mm:ss");
788 790
         }

binární
项目其他说明/文档/商丘市12345问题沟通.docx