1550076451 лет назад: 2
Родитель
Сommit
4ba9df0cfd

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

@@ -137,6 +137,7 @@
137 137
     <Compile Include="T_Sys_UserClass.cs" />
138 138
     <Compile Include="T_Sys_UserGroup.cs" />
139 139
     <Compile Include="T_Sys_Users.cs" />
140
+    <Compile Include="T_Sys_VerificationCode.cs" />
140 141
     <Compile Include="T_Sys_WorkCalendar.cs" />
141 142
     <Compile Include="T_Sys_WorkFile.cs" />
142 143
     <Compile Include="T_Sys_WorkOFFDays.cs" />

+ 158 - 0
CallCenterApi/CallCenterApi.BLL/T_Sys_VerificationCode.cs

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

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

@@ -137,6 +137,7 @@
137 137
     <Compile Include="T_Sys_UserClass.cs" />
138 138
     <Compile Include="T_Sys_UserGroup.cs" />
139 139
     <Compile Include="T_Sys_Users.cs" />
140
+    <Compile Include="T_Sys_VerificationCode.cs" />
140 141
     <Compile Include="T_Sys_WorkCalendar.cs" />
141 142
     <Compile Include="T_Sys_WorkFile.cs" />
142 143
     <Compile Include="T_Sys_WorkOFFDays.cs" />

+ 338 - 0
CallCenterApi/CallCenterApi.DAL/T_Sys_VerificationCode.cs

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

+ 3 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj

@@ -216,6 +216,7 @@
216 216
     <Compile Include="Controllers\Login\AES256Controller.cs" />
217 217
     <Compile Include="Controllers\Login\LoginController.cs" />
218 218
     <Compile Include="Controllers\FunctionController.cs" />
219
+    <Compile Include="Controllers\Login\VerificationCodeController.cs" />
219 220
     <Compile Include="Controllers\report\BusinessController.cs" />
220 221
     <Compile Include="Controllers\report\CallInController.cs" />
221 222
     <Compile Include="Controllers\report\DataAnalysisController.cs" />
@@ -394,6 +395,7 @@
394 395
     <Folder Include="Views\UserFeedback\" />
395 396
     <Folder Include="Views\UserGrade\" />
396 397
     <Folder Include="Views\Validate\" />
398
+    <Folder Include="Views\VerificationCode\" />
397 399
     <Folder Include="Views\Web\" />
398 400
     <Folder Include="Views\WeiBoReceive\" />
399 401
     <Folder Include="Views\WeiBo\" />
@@ -477,7 +479,7 @@
477 479
           <AutoAssignPort>True</AutoAssignPort>
478 480
           <DevelopmentServerPort>63662</DevelopmentServerPort>
479 481
           <DevelopmentServerVPath>/</DevelopmentServerVPath>
480
-          <IISUrl>http://localhost:63660/</IISUrl>
482
+          <IISUrl>http://localhost:63665/</IISUrl>
481 483
           <NTLMAuthentication>False</NTLMAuthentication>
482 484
           <UseCustomServer>False</UseCustomServer>
483 485
           <CustomServerUrl>

+ 48 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Login/LoginController.cs

@@ -40,6 +40,9 @@ namespace CallCenterApi.Interface.Controllers
40 40
                 log.Error(Configs.GetValue("AuthDate"));
41 41
                 log.Error(ex.ToString());
42 42
             }
43
+            if (string.IsNullOrEmpty(login.Code))
44
+                return Error("请输入验证码");
45
+
43 46
             bool appResult = LoodLoop();
44 47
             if (appResult)
45 48
             {
@@ -69,6 +72,24 @@ namespace CallCenterApi.Interface.Controllers
69 72
                     dt = DbHelperSQL.Query(sql, paras).Tables[0];
70 73
                     if (dt != null)
71 74
                     {
75
+                     
76
+                        var code  = new BLL.T_SMS_RecvSMS().GetModelList("F_Timestamp='" + login .Timestamp  + "' " +
77
+                            "and F_Code='" + login .Code  + "'order by F_CreateTime desc");
78
+                        if (code != null && code.Count > 0)
79
+                        {
80
+                            var modelSms = code.First();
81
+                            if ((DateTime.Now - modelSms.RecvTime).Minutes > 10)
82
+                            {
83
+                                return Error("验证码已失效");
84
+                            }
85
+                        }
86
+                        else
87
+                        {
88
+                            return Error("验证码错误");
89
+                        }  
90
+
91
+
92
+
72 93
                         if (dt.Rows.Count > 0)
73 94
                         {
74 95
                             if (dt.Rows[0]["F_DeleteFlag"] != null && dt.Rows[0]["F_DeleteFlag"].ToString() == "1")
@@ -167,6 +188,33 @@ namespace CallCenterApi.Interface.Controllers
167 188
                                     F_Remark = "",
168 189
                                     F_State = 0
169 190
                                 });
191
+                                if (dt.Rows[0]["F_DeleteFlag"] != null && dt.Rows[0]["F_DeleteFlag"].ToString() == "1")
192
+                                {
193
+                                    return Error("账号已锁定,请联系管理员解锁");
194
+                                }
195
+                                if (dt1.Rows[0]["F_TmId"] != null && dt1.Rows[0]["F_TmId"].ToString() != "")
196
+                                {
197
+                                    if (int.Parse(dt1.Rows[0]["F_TmId"].ToString()) >= 4)
198
+                                    {
199
+                                        string sql2 = $"update T_Sys_UserAccount set F_TmId=0,F_DeleteFlag=1 " +
200
+                                            $"where F_UserCode='{dt1.Rows[0]["F_UserCode"].ToString()}'";
201
+                                        var dt2 = DbHelperSQL.ExecuteSql(sql2);
202
+                                        return Error("账号已锁定,请联系管理员解锁");
203
+                                    }
204
+                                    else
205
+                                    {
206
+                                        int n = int.Parse(dt1.Rows[0]["F_TmId"].ToString()) + 1;
207
+                                        string sql2 = $"update T_Sys_UserAccount set F_TmId={n} where " +
208
+                                            $"F_UserCode='{dt1.Rows[0]["F_UserCode"].ToString()}'";
209
+                                        var dt2 = DbHelperSQL.ExecuteSql(sql2);
210
+                                    }
211
+                                }
212
+                                else
213
+                                {
214
+                                    string sql2 = $"update T_Sys_UserAccount set F_TmId=1 where " +
215
+                                           $"F_UserCode='{dt1.Rows[0]["F_UserCode"].ToString()}'";
216
+                                    var dt2 = DbHelperSQL.ExecuteSql(sql2);
217
+                                }
170 218
                             }
171 219
                             else
172 220
                             {

+ 105 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Login/VerificationCodeController.cs

@@ -0,0 +1,105 @@
1
+using CallCenterApi.Interface.Controllers.Base;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Drawing;
5
+using System.Linq;
6
+using System.Text;
7
+using System.Web;
8
+using System.Web.Mvc;
9
+
10
+namespace CallCenterApi.Interface.Controllers.Login
11
+{
12
+    public class VerificationCodeController : BaseController
13
+    {
14
+
15
+        public HttpResponseBase CreateCheckCodeImage(string timestamp)
16
+        {
17
+            string checkCode = VerficationCodeSrc(4);
18
+
19
+            if (checkCode == null || checkCode.Trim() == String.Empty)
20
+                return null ;
21
+
22
+            //string checkCode = "asfd2";
23
+            Bitmap image = new Bitmap(90, 28);
24
+
25
+            Graphics g = Graphics.FromImage(image);
26
+            try
27
+            {
28
+                //生成随机生成器 
29
+                Random random = new Random();
30
+                //清空图片背景色 
31
+                g.Clear(Color.White);
32
+                //画图片的背景噪音线 
33
+                for (int i = 0; i < 2; i++)
34
+                {
35
+                    int x1 = random.Next(image.Width);
36
+                    int x2 = random.Next(image.Width);
37
+                    int y1 = random.Next(image.Height);
38
+                    int y2 = random.Next(image.Height);
39
+                    g.DrawLine(new Pen(Color.Black), x1, y1, x2, y2);
40
+                }
41
+                Font font = new Font("Arial", 16, (FontStyle.Bold));
42
+
43
+                System.Drawing.Drawing2D.LinearGradientBrush brush = new System.Drawing.Drawing2D.
44
+                    LinearGradientBrush(new Rectangle(0, 0, image.Width, image.Height), Color.Blue, Color.DarkRed, 1.2f, true);
45
+
46
+                g.DrawString(checkCode, font, brush, 2, 2);
47
+                //画图片的前景噪音点 
48
+                for (int i = 0; i < 100; i++)
49
+                {
50
+                    int x = random.Next(image.Width);
51
+                    int y = random.Next(image.Height);
52
+                    image.SetPixel(x, y, Color.FromArgb(random.Next()));
53
+                }
54
+                //画图片的边框线 
55
+                g.DrawRectangle(new Pen(Color.Silver), 0, 0, image.Width - 1, image.Height - 1);
56
+                System.IO.MemoryStream ms = new System.IO.MemoryStream();
57
+                image.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
58
+                Response.ClearContent();
59
+                Response.ContentType = "image/Gif";
60
+                Response.BinaryWrite(ms.ToArray());
61
+                Model.T_Sys_VerificationCode code = new Model.T_Sys_VerificationCode();
62
+                code.F_CreateTime = DateTime.Now;
63
+                code.F_Timestamp = timestamp;
64
+                code.F_Code  = checkCode;
65
+                new BLL.T_Sys_VerificationCode().Add(code);
66
+                return Response;
67
+            }
68
+            finally
69
+            {
70
+                g.Dispose();
71
+                image.Dispose();
72
+               
73
+            }
74
+        }
75
+
76
+        /// <summary>
77
+        /// 生成验证码字符串
78
+        /// </summary>
79
+        /// <param name="numberOfChars"></param>
80
+        /// <returns></returns>
81
+        private string VerficationCodeSrc(int numberOfChars)
82
+        {
83
+            if (numberOfChars > 36)
84
+            {
85
+                throw new InvalidOperationException("Random Word Charecters can not be greater than 36.");
86
+            }
87
+            char[] columns = new char[36];
88
+            //字母
89
+            for (int charPos = 97; charPos < 97 + 26; charPos++)
90
+                columns[charPos - 97] = (char)charPos;
91
+            //数字
92
+            for (int intPos = 48; intPos <= 57; intPos++)
93
+                columns[intPos - 22] = (char)intPos;
94
+
95
+            StringBuilder randomBuilder = new StringBuilder();
96
+            Random randomSeed = new Random();
97
+            for (int incr = 0; incr < numberOfChars; incr++)
98
+            {
99
+                randomBuilder.Append(columns[randomSeed.Next(36)].ToString());
100
+            }
101
+
102
+            return randomBuilder.ToString();
103
+        }
104
+    }
105
+}

+ 152 - 58
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -325,9 +325,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
325 325
                 var dtdc = DbHelperSQL.Query(" select " + top + " F_CreateTime 日期, F_OldWorkOrderId 工单号,F_ComTitle 诉求标题,F_CusName 反映人,F_CusPhone 电话号码,F_ComContent 诉求内容,dbo.GetDictionaryName(F_Key) 主题词, "
326 326
                    + " dbo.GetDeptNames(F_MainDeptId) 承办单位, "
327 327
                    + " (select top 1 F_Situation from T_Bus_Feedback WITH(NOLOCK) where F_State=1 and F_Type!=3 and F_IsDelete=0 and  F_WorkOrderId =wo.F_WorkOrderId order by F_CreateTime) 办理结果,"
328
-                   + " (select top 1 (case F_IsSatisfie when 1 then'满意' when 0 then '不满意'when 2 then '基本满意' else '未评价' end) F_Satisfie from T_Bus_VisitResult WITH(NOLOCK) where F_State = 1 and F_IsDelete = 0 and F_WorkOrderId = wo.F_WorkOrderId order by F_Id desc) 承办单位回访结果, case F_Satisfaction when 0 then '不满意'when 1 then" +
329
-                   "'基本满意' when 2 then '满意' else '未评价'end 郑州回访结果"
330
-                   + " from T_Bus_WorkOrder wo WITH(NOLOCK) where 1=1 " + sql + sort).Tables[0];
328
+                   + " (select top 1 (case F_IsSatisfie when 1 then'满意' when 0 then '不满意'when 2 then '基本满意' else '未评价' end) F_Satisfie from T_Bus_VisitResult WITH(NOLOCK) where F_State = 1 and F_IsDelete = 0 and F_WorkOrderId = wo.F_WorkOrderId order by F_Id desc) 承办单位回访结果" +
329
+                          " from T_Bus_WorkOrder wo WITH(NOLOCK) where 1=1 " + sql + sort).Tables[0];
331 330
 
332 331
                 var msg = new NPOIHelper().ExportToExcel("工单列表", dtdc);
333 332
                 if (msg == "")
@@ -797,9 +796,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
797 796
                 var dtdc = DbHelperSQL.Query(" select " + top + " F_CreateTime 日期, F_OldWorkOrderId 工单号,F_ComTitle 诉求标题,F_CusName 反映人,F_CusPhone 电话号码,F_ComContent 诉求内容,dbo.GetDictionaryName(F_Key) 主题词, "
798 797
                    + " dbo.GetDeptNames(F_MainDeptId) 承办单位, "
799 798
                    + " (select top 1 F_Situation from T_Bus_Feedback WITH(NOLOCK) where F_State=1 and F_Type!=3 and F_IsDelete=0 and  F_WorkOrderId =wo.F_WorkOrderId order by F_CreateTime) 办理结果,"
800
-                   + " (select top 1 (case F_IsSatisfie when 1 then'满意' when 0 then '不满意'when 2 then '基本满意' else '未评价' end) F_Satisfie from T_Bus_VisitResult WITH(NOLOCK) where F_State = 1 and F_IsDelete = 0 and F_WorkOrderId = wo.F_WorkOrderId order by F_Id desc) 承办单位回访结果, case F_Satisfaction when 0 then '不满意'when 1 then" +
801
-                   "'基本满意' when 2 then '满意' else '未评价'end 郑州回访结果"
802
-                   + " from T_Bus_WorkOrder wo WITH(NOLOCK) where 1=1 " + sql + sort).Tables[0];
799
+                   + " (select top 1 (case F_IsSatisfie when 1 then'满意' when 0 then '不满意'when 2 then '基本满意' else '未评价' end) F_Satisfie from T_Bus_VisitResult WITH(NOLOCK) where F_State = 1 and F_IsDelete = 0 and F_WorkOrderId = wo.F_WorkOrderId order by F_Id desc) 承办单位回访结果" +
800
+                    " from T_Bus_WorkOrder wo WITH(NOLOCK) where 1=1 " + sql + sort).Tables[0];
803 801
 
804 802
                 var msg = new NPOIHelper().ExportToExcel("工单列表", dtdc);
805 803
                 if (msg == "")
@@ -862,7 +860,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
862 860
                     var dtjb = DbHelperSQL.Query(sqljb).Tables[0];
863 861
                     if (dtjb.Rows.Count > 0)
864 862
                     {
865
-                        //if (dtjb.Rows[0]["F_MainDeptId"].ToString().Split(',').Contains(userModel.F_DeptId.ToString())) { iszbdw = "1"; }
863
+                    
866 864
                         if (dr["F_MainDeptId"].ToString() == userModel.F_DeptId.ToString()) { iszbdw = "1"; }
867 865
                         dr["DeptName"] = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + dr["F_MainDeptId"].ToString() + "')");
868 866
                         if (dr["F_OtherDeptIds"] != null && dr["F_OtherDeptIds"].ToString() != "")
@@ -870,43 +868,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
870 868
                             dr["OtherDeptName"] = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + dr["F_OtherDeptIds"].ToString() + "')");
871 869
                         }
872 870
                         #region 20191016
873
-                        //if (dtjb.Rows[0]["F_MainDeptId"].ToString() == userModel.F_DeptId.ToString()) { iszbdw = "1"; }
874
-                        //dr["DeptName"] = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + dtjb.Rows[0]["F_MainDeptId"].ToString() + "')");
875
-                        //if (dtjb.Rows[0]["F_OtherDeptIds"] != null && dtjb.Rows[0]["F_OtherDeptIds"].ToString() != "")
876
-                        //{
877
-                        //    dr["OtherDeptName"] = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + dtjb.Rows[0]["F_OtherDeptIds"].ToString() + "')");
878
-                        //}
871
+                      
879 872
                         #endregion
880 873
                         dr["AssignTime"] = dtjb.Rows[0]["F_CreateTime"].ToString();
881 874
                         #region
882
-                        //int did = Int32.Parse(dtjb.Rows[0]["F_MainDeptId"].ToString());
883
-                        //var deptinfo = new BLL.T_Sys_Department().GetModel(did);
884
-                        //if (deptinfo != null)
885
-                        //{
886
-                        //    if (did == userModel.F_DeptId) { iszbdw = "1"; }
887
-                        //    dr["DeptName"] = deptinfo.F_DeptName;//交办单位
888
-                        //}
889
-                        //if (dtjb.Rows[0]["F_OtherDeptIds"] != null && dtjb.Rows[0]["F_OtherDeptIds"].ToString() != "")
890
-                        //{
891
-                        //    string[] strids = dtjb.Rows[0]["F_OtherDeptIds"].ToString().Split(',');
892
-                        //    string dns = string.Empty;
893
-                        //    foreach (string strid in strids)
894
-                        //    {
895
-                        //        var dinfo = new BLL.T_Sys_Department().GetModel(Int32.Parse(strid));
896
-                        //        if (dinfo != null)
897
-                        //        {
898
-                        //            if (string.IsNullOrEmpty(dns))
899
-                        //            {
900
-                        //                dns = dinfo.F_DeptName;//交办单位
901
-                        //            }
902
-                        //            else
903
-                        //            {
904
-                        //                dns += "," + dinfo.F_DeptName;//交办单位
905
-                        //            }
906
-                        //        }
907
-                        //    }
908
-                        //    dr["OtherDeptName"] = dns;
909
-                        //}
875
+                     
910 876
                         #endregion
911 877
                         var lt = dr["F_LimitTime"].ToString();//限制时间
912 878
                         dr["LimitTime"] = lt;
@@ -2409,9 +2375,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
2409 2375
                 var dtdc = DbHelperSQL.Query(" select " + top + " F_CreateTime 日期, F_OldWorkOrderId 工单号,F_ComTitle 诉求标题,F_CusName 反映人,F_CusPhone 电话号码,F_ComContent 诉求内容,dbo.GetDictionaryName(F_Key) 主题词, "
2410 2376
                    + " dbo.GetDeptNames(F_MainDeptId) 承办单位, "
2411 2377
                    + " (select top 1 F_Situation from T_Bus_Feedback WITH(NOLOCK) where F_State=1 and F_Type!=3 and F_IsDelete=0 and  F_WorkOrderId =wo.F_WorkOrderId order by F_CreateTime) 办理结果,"
2412
-                   + " (select top 1 (case F_IsSatisfie when 1 then'满意' when 0 then '不满意'when 2 then '基本满意' else '未评价' end) F_Satisfie from T_Bus_VisitResult WITH(NOLOCK) where F_State = 1 and F_IsDelete = 0 and F_WorkOrderId = wo.F_WorkOrderId order by F_Id desc) 承办单位回访结果, case F_Satisfaction when 0 then '不满意'when 1 then" +
2413
-                   "'基本满意' when 2 then '满意' else '未评价'end 郑州回访结果"
2414
-                   + " from T_Bus_WorkOrder wo WITH(NOLOCK) where 1=1 " + sql + sort).Tables[0];
2378
+                   + " (select top 1 (case F_IsSatisfie when 1 then'满意' when 0 then '不满意'when 2 then '基本满意' else '未评价' end) F_Satisfie from T_Bus_VisitResult WITH(NOLOCK) where F_State = 1 and F_IsDelete = 0 and F_WorkOrderId = wo.F_WorkOrderId order by F_Id desc) 承办单位回访结果" +
2379
+                  " from T_Bus_WorkOrder wo WITH(NOLOCK) where 1=1 " + sql + sort).Tables[0];
2415 2380
 
2416 2381
                 //var dtdc = DbHelperSQL.Query(" select " + colst + " from T_Bus_WorkOrder WITH(NOLOCK) where 1=1 " + sql).Tables[0];
2417 2382
                 var msg = new NPOIHelper().ExportToExcel("工单列表", dtdc);
@@ -3053,9 +3018,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
3053 3018
                 var dtdc = DbHelperSQL.Query(" select " + top + " F_CreateTime 日期, F_OldWorkOrderId 工单号,F_ComTitle 诉求标题,F_CusName 反映人,F_CusPhone 电话号码,F_ComContent 诉求内容,dbo.GetDictionaryName(F_Key) 主题词, "
3054 3019
                     + " dbo.GetDeptNames(F_MainDeptId) 承办单位, "
3055 3020
                     + " (select top 1 F_Situation from T_Bus_Feedback WITH(NOLOCK) where F_State=1 and F_Type!=3 and F_IsDelete=0 and  F_WorkOrderId =wo.F_WorkOrderId order by F_CreateTime) 办理结果,"
3056
-                    + " (select top 1 (case F_IsSatisfie when 1 then'满意' when 0 then '不满意'when 2 then '基本满意' else '未评价' end) F_Satisfie from T_Bus_VisitResult WITH(NOLOCK) where F_State = 1 and F_IsDelete = 0 and F_WorkOrderId = wo.F_WorkOrderId order by F_Id desc) 承办单位回访结果, case F_Satisfaction when 0 then '不满意'when 1 then" +
3057
-                    "'基本满意' when 2 then '满意' else '未评价'end 郑州回访结果"
3058
-                    + " from T_Bus_WorkOrder wo WITH(NOLOCK) where 1=1 " + sql + orderby).Tables[0];
3021
+                    + " (select top 1 (case F_IsSatisfie when 1 then'满意' when 0 then '不满意'when 2 then '基本满意' else '未评价' end) F_Satisfie from T_Bus_VisitResult WITH(NOLOCK) where F_State = 1 and F_IsDelete = 0 and F_WorkOrderId = wo.F_WorkOrderId order by F_Id desc) 承办单位回访结果" +
3022
+                   " from T_Bus_WorkOrder wo WITH(NOLOCK) where 1=1 " + sql + orderby).Tables[0];
3059 3023
                 var msg = new NPOIHelper().ExportToExcel("工单列表", dtdc);
3060 3024
                 if (msg == "")
3061 3025
                 {
@@ -3244,11 +3208,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
3244 3208
                     var butt = btns.Find(c => c.key == ButtonGroup.turnsee().key);
3245 3209
                     if (recount > 0 && butt != null)
3246 3210
                         btns.Remove(butt);
3247
-                    if (dr["F_Files"].ToString() == "")
3248
-                    {
3249
-                        if (userModel.F_RoleCode.ToUpper() == "WLDW")
3250
-                            btns.Add(ButtonGroup.Upload());
3251
-                    }
3211
+                   
3252 3212
                     #endregion
3253 3213
                 }
3254 3214
                 else
@@ -3269,11 +3229,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
3269 3229
                     {//履职界定待审核
3270 3230
                         if (dr["F_WorkState"].ToString()=="6")
3271 3231
                         btns.Add(ButtonGroup.visit());
3272
-                        if (dr["F_Files"].ToString() == "")
3273
-                        {
3274
-                            if (userModel.F_RoleCode.ToUpper() == "WLDW")
3275
-                                btns.Add(ButtonGroup.Upload());
3276
-                        }
3232
+                        //if (dr["F_Files"].ToString() == "")
3233
+                        //{
3234
+                        //    if (userModel.F_RoleCode.ToUpper() == "WLDW")
3235
+                        //        btns.Add(ButtonGroup.Upload());
3236
+                        //}
3277 3237
                             
3278 3238
                     }
3279 3239
                     else if (Int32.Parse(strtab) == 7 && strisaudit=="0")
@@ -7538,7 +7498,33 @@ namespace CallCenterApi.Interface.Controllers.workorder
7538 7498
                         modelT_Bus_WorkOrder.F_IsClosed = 1;
7539 7499
                         modelT_Bus_WorkOrder.F_CloseUser = userModel.F_UserCode;
7540 7500
                         modelT_Bus_WorkOrder.F_CloseTime = DateTime.Now;
7501
+
7502
+
7503
+
7504
+
7541 7505
                     }
7506
+                    //else if(userModel .F_RoleCode =="WLDW")
7507
+                    //{
7508
+                    //    #region 插入交办记录
7509
+                    //    Model.T_Bus_AssignedInfo modelT_Bus_AssignedInfo = new T_Bus_AssignedInfo();
7510
+                    //    modelT_Bus_AssignedInfo.F_WorkOrderId = modelT_Bus_WorkOrder.F_WorkOrderId;
7511
+                    //    modelT_Bus_AssignedInfo.F_LimitTime = limittime;//办理时限
7512
+                    //    modelT_Bus_AssignedInfo.F_MainDeptId = maindeptid;//主办单位id
7513
+                    //    modelT_Bus_AssignedInfo.F_OtherDeptIds = otherdeptids;//协办单位id
7514
+                    //    modelT_Bus_AssignedInfo.F_AssignedOpinion = assignedopinion;//交办意见
7515
+                    //    modelT_Bus_AssignedInfo.F_State = 1;//0草稿  1正式
7516
+                    //    modelT_Bus_AssignedInfo.F_CreateUser = userModel.F_UserCode;
7517
+                    //    modelT_Bus_AssignedInfo.F_CreateTime = DateTime.Now;
7518
+                    //    modelT_Bus_AssignedInfo.F_IsDelete = 0;
7519
+                    //    modelT_Bus_AssignedInfo.F_IsOverdue = 0;
7520
+                    //    modelT_Bus_AssignedInfo.F_IsSure = 0;
7521
+                    //    modelT_Bus_AssignedInfo.F_IsReload = 0;
7522
+                    //    modelT_Bus_AssignedInfo.F_IsNext = 0;
7523
+                    //    modelT_Bus_AssignedInfo.F_TimeResp = assignBLL.GetRepTimly(DateTime.Now);//及时查收时间点
7524
+                    //    int  aid = assignBLL.Add(modelT_Bus_AssignedInfo);
7525
+                    //    #endregion
7526
+
7527
+                    //}
7542 7528
                     else if (issubmit == 1)
7543 7529
                     {
7544 7530
                         modelT_Bus_WorkOrder.F_SubmitTime = DateTime.Now;
@@ -8898,7 +8884,6 @@ namespace CallCenterApi.Interface.Controllers.workorder
8898 8884
                 int state = RequestString.GetInt("state", 0);
8899 8885
                 int assignid = RequestString.GetInt("assignid", 0);
8900 8886
                 int maindeptid = RequestString.GetInt("maindeptid", 0);
8901
-                //string maindeptid = RequestString.GetFormString("maindeptid");
8902 8887
                 string otherdeptids = RequestString.GetFormString("otherdeptids");
8903 8888
                 DateTime limittime = DateTime.Parse(RequestString.GetFormString("limittime") + " 23:59:59");
8904 8889
                 string assignedopinion = RequestString.GetFormString("assignedopinion");
@@ -10204,6 +10189,115 @@ namespace CallCenterApi.Interface.Controllers.workorder
10204 10189
             }
10205 10190
         }
10206 10191
 
10192
+
10193
+
10194
+
10195
+
10196
+
10197
+
10198
+        /// <summary>
10199
+        /// 上报工单
10200
+        /// </summary>
10201
+        /// <returns></returns>
10202
+        [Authority]
10203
+        public ActionResult Escalation()
10204
+        {
10205
+            int userId = Utils.StrToInt(User.UserData["F_UserID"], 0);
10206
+
10207
+            Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
10208
+
10209
+            if (userModel.F_RoleCode == "WLDW" )
10210
+            {
10211
+                string workorderid = RequestString.GetFormString("workorderid");
10212
+
10213
+                Model.T_Bus_WorkOrder modelT_Bus_WorkOrder = workorderBLL.GetModel(workorderid);
10214
+                Model.T_Bus_AssignedInfo modelT_Bus_AssignedInfo = assignBLL.GetNewModelByWorkOrderID(workorderid);
10215
+
10216
+                if (modelT_Bus_WorkOrder != null && modelT_Bus_AssignedInfo != null)
10217
+                {
10218
+                    if (modelT_Bus_AssignedInfo.F_CreateUser != userModel.F_UserCode)
10219
+                    {
10220
+                        return Error("操作失败");
10221
+                    }
10222
+
10223
+                    //if (modelT_Bus_AssignedInfo.F_IsSure == 0 || (modelT_Bus_AssignedInfo.F_IsSure == 1 && modelT_Bus_WorkOrder.F_WorkState == 4))
10224
+                    if (modelT_Bus_AssignedInfo.F_IsSure == 0 || (modelT_Bus_AssignedInfo.F_IsSure == 1 && modelT_Bus_WorkOrder.F_WorkState == (int)EnumWorkState.dealing))
10225
+                    {
10226
+                        using (TransactionScope trans = new TransactionScope())
10227
+                        {
10228
+                           
10229
+
10230
+                            #region 保存工单信息
10231
+                            //modelT_Bus_WorkOrder.F_WorkState = 1;//待交办
10232
+                            modelT_Bus_WorkOrder.F_WorkState = (int)EnumWorkState.submit;//待交办
10233
+                            modelT_Bus_WorkOrder.F_MainDeptId = null;
10234
+                            modelT_Bus_WorkOrder.F_OtherDeptIds = "";
10235
+                            modelT_Bus_WorkOrder.ReminderNum = 0;//清空催办记录
10236
+                            workorderBLL.Update(modelT_Bus_WorkOrder);
10237
+                            #endregion
10238
+
10239
+                            #region 删除交办信息
10240
+                            modelT_Bus_AssignedInfo.F_State = 0;
10241
+
10242
+                            assignBLL.Update(modelT_Bus_AssignedInfo);
10243
+                            #endregion
10244
+
10245
+                            #region 删除派单信息
10246
+                            var pdlist = new BLL.T_Bus_AssignedInfo_Next().GetModelList
10247
+                                (" F_IsDelete=0 and F_WorkOrderId='" + modelT_Bus_WorkOrder.F_WorkOrderId + "' ");
10248
+
10249
+                            foreach (var cg in pdlist)
10250
+                            {
10251
+                                cg.F_State = 0;
10252
+                                new BLL.T_Bus_AssignedInfo_Next().Update(cg);
10253
+                            }
10254
+                            #endregion
10255
+
10256
+                            #region 删除二级单位处理信息
10257
+                            var cglist = new BLL.T_Bus_Feedback_Next().GetModelList(" F_IsDelete=0 and F_WorkOrderId='" + modelT_Bus_WorkOrder.F_WorkOrderId + "' ");
10258
+
10259
+                            foreach (var cg in cglist)
10260
+                            {
10261
+                                cg.F_State = 0;
10262
+                                new BLL.T_Bus_Feedback_Next().Update(cg);
10263
+                            }
10264
+                            #endregion
10265
+
10266
+                            #region 插入操作记录
10267
+                            Model.T_Bus_Operation oper = new Model.T_Bus_Operation();
10268
+                            oper.F_WorkOrderId = modelT_Bus_WorkOrder.F_WorkOrderId;
10269
+                            oper.F_AssignedId = modelT_Bus_AssignedInfo.F_Id;
10270
+                            oper.F_State = modelT_Bus_WorkOrder.F_WorkState;
10271
+
10272
+                            string userinfo = userModel.depname + "-" + userModel.F_UserName + "(" + userModel.F_UserCode + ")";
10273
+                            oper.F_Message = userinfo + " 上报了工单";
10274
+                            oper.F_CreateUser = userModel.F_UserCode;
10275
+                            oper.F_CreateTime = DateTime.Now;
10276
+                            oper.F_IsDelete = 0;
10277
+
10278
+                            operBLL.Add(oper);
10279
+                            #endregion
10280
+
10281
+                            trans.Complete();
10282
+                        }
10283
+                        return Success("操作成功");
10284
+                    }
10285
+                    else
10286
+                    {
10287
+                        return Error("单位已查收,不能收回");
10288
+                    }
10289
+                }
10290
+                else
10291
+                {
10292
+                    return Error("操作失败");
10293
+                }
10294
+            }
10295
+            else
10296
+            {
10297
+                return Error("权限不足");
10298
+            }
10299
+        }
10300
+
10207 10301
         /// <summary>
10208 10302
         /// 查收工单
10209 10303
         /// </summary>

+ 2 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Global.asax.cs

@@ -27,6 +27,8 @@ namespace CallCenterApi.Interface
27 27
 
28 28
         protected void Application_AuthenticateRequest(object sender, EventArgs e)
29 29
         {
30
+            SqlChecker SqlChecker = new SqlChecker(this.Request, this.Response);
31
+            SqlChecker.Check();
30 32
             HttpApplication app = (HttpApplication)sender;
31 33
             var context = app.Context;
32 34
             if (context == null) throw new ArgumentNullException("context");

+ 20 - 20
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Common/ButtonGroup.cs

@@ -143,18 +143,18 @@ namespace CallCenterApi.Interface.Models.Common
143 143
         {
144 144
             return new button(34, "界定审核");
145 145
         }
146
-        public static button IsExport()
147
-        {
148
-            return new button(34, "回传");
149
-        }
146
+        //public static button IsExport()
147
+        //{
148
+        //    return new button(34, "回传");
149
+        //}
150 150
         public static button Result()
151 151
         {
152 152
             return new button(35, "编辑");
153 153
         }
154
-        public static button Upload()
155
-        {
156
-            return new button(36, "上传");
157
-        }
154
+        //public static button Upload()
155
+        //{
156
+        //    return new button(36, "上传");
157
+        //}
158 158
         public static button Remkers()
159 159
         {
160 160
             return new button(37, "备注");
@@ -171,11 +171,11 @@ namespace CallCenterApi.Interface.Models.Common
171 171
         {
172 172
             return new button(40, "催办");
173 173
         }
174
-        public static button thirdBack()
175
-        {
176
-            return new button(41, "退回郑州市");
174
+        //public static button thirdBack()
175
+        //{
176
+        //    return new button(41, "退回郑州市");
177 177
 
178
-        }
178
+        //}
179 179
 
180 180
         #region 知识库操作按钮
181 181
         public static button zsk_query()
@@ -244,7 +244,7 @@ namespace CallCenterApi.Interface.Models.Common
244 244
                     {
245 245
                         buttons.Add(delete());
246 246
                         buttons.Add(edit());
247
-                        buttons.Add(thirdBack());
247
+                      //  buttons.Add(thirdBack());
248 248
                     }
249 249
                        
250 250
                     //中心话务员 坐席班长 管理员
@@ -252,7 +252,7 @@ namespace CallCenterApi.Interface.Models.Common
252 252
                     {
253 253
                         buttons.Add(submit());
254 254
                         buttons.Add(edit()); buttons.Add(delete());
255
-                        buttons.Add(thirdBack());
255
+                      //  buttons.Add(thirdBack());
256 256
                     }
257 257
                     break;
258 258
                 case "1":
@@ -262,7 +262,7 @@ namespace CallCenterApi.Interface.Models.Common
262 262
                     //调度专员 中心领导管理员 管理员
263 263
                     if (code == "ZXLD" || code == "ZXLDGLYGLY" || code == "GLY" || code == "DDZG")
264 264
                     {
265
-                        buttons.Add(thirdBack());
265
+                       // buttons.Add(thirdBack());
266 266
                         //    buttons.Add(approval());
267 267
                         buttons.Add(edit());
268 268
                      //   buttons.Add(back());
@@ -404,8 +404,8 @@ namespace CallCenterApi.Interface.Models.Common
404 404
                         buttons.Add(subreload());
405 405
                         //   buttons.Add(approval());
406 406
                     }
407
-                    if (code == "WLDW")
408
-                    buttons.Add(Upload());
407
+                    //if (code == "WLDW")
408
+                    //buttons.Add(Upload());
409 409
                     break;
410 410
                 case "8":
411 411
                     //二级网络单位 管理员
@@ -438,15 +438,15 @@ namespace CallCenterApi.Interface.Models.Common
438 438
 
439 439
                         if (ishc !="1")
440 440
                         {
441
-                            buttons.Add(IsExport());
441
+                          //  buttons.Add(IsExport());
442 442
                            // buttons.Add(subreload());
443 443
                             buttons.Add(subreload());
444 444
                         }
445 445
 
446 446
                        
447 447
                     }
448
-                    if (code == "WLDW")
449
-                        buttons.Add(Upload());
448
+                    //if (code == "WLDW")
449
+                    //    buttons.Add(Upload());
450 450
                     break;
451 451
                 case "10":
452 452
                     //坐席班长 管理员

+ 2 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/LoginModel.cs

@@ -11,5 +11,7 @@ namespace CallCenterApi.Interface.Models.Input
11 11
         public string ExtensionPhone { get; set; }
12 12
         public string Password { get; set; }
13 13
         public string LoginTime { get; set; }
14
+        public string Timestamp { get; set; }
15
+        public string Code { get; set; }
14 16
     }
15 17
 }

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

@@ -87,6 +87,7 @@
87 87
     <Compile Include="T_Sys_SeatPermissionConfig.cs" />
88 88
     <Compile Include="T_Sys_UserClass.cs" />
89 89
     <Compile Include="T_Sys_Users.cs" />
90
+    <Compile Include="T_Sys_VerificationCode.cs" />
90 91
     <Compile Include="T_Sys_WorkOFFDays.cs" />
91 92
     <Compile Include="WeiBoCommentList.cs" />
92 93
     <Compile Include="PageData.cs" />

+ 76 - 0
CallCenterApi/CallCenterApi.Model/T_Sys_VerificationCode.cs

@@ -0,0 +1,76 @@
1
+
2
+using System;
3
+using System.Collections.Generic;
4
+using System.IO;
5
+using System.Linq;
6
+using System.Text;
7
+
8
+namespace CallCenterApi.Model
9
+{
10
+    /// <summary>
11
+    /// T_Sys_VerificationCode:实体类(属性说明自动提取数据库字段的描述信息)
12
+    /// </summary>
13
+    [Serializable]
14
+    public partial class T_Sys_VerificationCode
15
+    {
16
+        public T_Sys_VerificationCode()
17
+        { }
18
+        #region Model
19
+        private int _f_id;
20
+        private string _f_code;
21
+        private DateTime? _f_createtime;
22
+        private string _f_usercode;
23
+        private string _f_notes;
24
+        private string _f_timestamp;
25
+        /// <summary>
26
+        /// 
27
+        /// </summary>
28
+        public int F_ID
29
+        {
30
+            set { _f_id = value; }
31
+            get { return _f_id; }
32
+        }
33
+        /// <summary>
34
+        /// 
35
+        /// </summary>
36
+        public string F_Code
37
+        {
38
+            set { _f_code = value; }
39
+            get { return _f_code; }
40
+        }
41
+        /// <summary>
42
+        /// 
43
+        /// </summary>
44
+        public DateTime? F_CreateTime
45
+        {
46
+            set { _f_createtime = value; }
47
+            get { return _f_createtime; }
48
+        }
49
+        /// <summary>
50
+        /// 
51
+        /// </summary>
52
+        public string F_UserCode
53
+        {
54
+            set { _f_usercode = value; }
55
+            get { return _f_usercode; }
56
+        }
57
+        /// <summary>
58
+        /// 
59
+        /// </summary>
60
+        public string F_Notes
61
+        {
62
+            set { _f_notes = value; }
63
+            get { return _f_notes; }
64
+        }
65
+        /// <summary>
66
+        /// 
67
+        /// </summary>
68
+        public string F_Timestamp
69
+        {
70
+            set { _f_timestamp = value; }
71
+            get { return _f_timestamp; }
72
+        }
73
+        #endregion Model
74
+
75
+    }
76
+}

+ 1 - 1
CallCenterCommon/CallCenter.QuartzService/QuartzWorker.cs

@@ -19,7 +19,7 @@ namespace CallCenter.QuartzService
19 19
 
20 20
             // 远程输出配置
21 21
             properties["quartz.scheduler.exporter.type"] = "Quartz.Simpl.RemotingSchedulerExporter, Quartz";
22
-            properties["quartz.scheduler.exporter.port"] = "556";
22
+            properties["quartz.scheduler.exporter.port"] = "557";
23 23
             properties["quartz.scheduler.exporter.bindName"] = "QuartzScheduler";
24 24
             properties["quartz.scheduler.exporter.channelType"] = "tcp";
25 25
 

+ 1 - 0
CallCenterCommon/CallCenter.Utility/CallCenter.Utility.csproj

@@ -86,6 +86,7 @@
86 86
     <Compile Include="NPOI\InPutType.cs" />
87 87
     <Compile Include="RedisHelper.cs" />
88 88
     <Compile Include="SaltAndHashHelper.cs" />
89
+    <Compile Include="SqlChecker.cs" />
89 90
     <Compile Include="SysInformationHelper.cs" />
90 91
     <Compile Include="Time\DateTimeConvert.cs" />
91 92
     <Compile Include="Time\DateTools.cs" />

+ 191 - 0
CallCenterCommon/CallCenter.Utility/SqlChecker.cs

@@ -0,0 +1,191 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.IO;
4
+using System.Linq;
5
+using System.Text;
6
+using System.Web;
7
+
8
+
9
+namespace CallCenter.Utility
10
+{
11
+    public class SqlChecker
12
+    { //当前请求对象
13
+        private HttpRequest request;
14
+        //当前响应对象
15
+        private HttpResponse response;
16
+        //安全Url,当出现Sql注入时,将导向到的安全页面,如果没赋值,则停留在当前页面
17
+        private string safeUrl = String.Empty;
18
+
19
+        //Sql注入时,可能出现的sql关键字,可根据自己的实际情况进行初始化,每个关键字由'|'分隔开来
20
+        //private const string StrKeyWord = @"select|insert|delete|from|count(|drop table|update|truncate|asc(|mid(|char(|xp_cmdshell|exec master|netlocalgroup administrators|:|net user|""|or|and";
21
+        private const string StrKeyWord = @"select|insert|delete|from|drop table|update|truncate|exec master|netlocalgroup administrators|net user|or|and|waitfor delay|waitfor|delay";
22
+        //Sql注入时,可能出现的特殊符号,,可根据自己的实际情况进行初始化,每个符号由'|'分隔开来
23
+        //  private const string StrRegex = @"@|*";
24
+        //private const string StrRegex = @"=|!|'";
25
+        public SqlChecker()
26
+        {
27
+            //
28
+            // TODO: 在此处添加构造函数逻辑
29
+            //
30
+        }
31
+        /// <summary>
32
+        /// 由此构造函数创建的对象,在验证Sql注入之后将停留在原来页面上
33
+        /// </summary>
34
+        /// <param name="_request">当前请求的 Request 对象</param>
35
+        /// <param name="_response">当前请求的 Response 对象</param>
36
+        public SqlChecker(HttpRequest _request, HttpResponse _response)
37
+        {
38
+            this.request = _request;
39
+            this.response = _response;
40
+        }
41
+        /// <summary>
42
+        /// 由此构造函数创建的对象,在验证Sql注入之后将请求将导向由 _safeUrl 指定的安全url页面上
43
+        /// </summary>
44
+        /// <param name="_request">当前请求的 Request 对象</param>
45
+        /// <param name="_response">当前请求的 Response 对象</param>
46
+        /// <param name="_safeUrl">验证Sql注入之后将导向的安全 url</param>
47
+        public SqlChecker(HttpRequest _request, HttpResponse _response, string _safeUrl)
48
+        {
49
+            this.request = _request;
50
+            this.response = _response;
51
+            this.safeUrl = _safeUrl;
52
+        }
53
+        /// <summary>
54
+        /// 只读属性 SQL关键字
55
+        /// </summary>
56
+        public string KeyWord
57
+        {
58
+            get
59
+            {
60
+                return StrKeyWord;
61
+            }
62
+        }
63
+        ///// <summary>
64
+        ///// 只读属性过滤特殊字符
65
+        ///// </summary>
66
+        //public string RegexString
67
+        //{
68
+        //    get
69
+        //    {
70
+        //        return StrRegex;
71
+        //    }
72
+        //}
73
+        /// <summary>
74
+        /// 当出现Sql注入时需要提示的错误信息(主要是运行一些客户端的脚本)
75
+        /// </summary>
76
+        public string Msg
77
+        {
78
+            get
79
+            {
80
+                string msg = "<script type='text/javascript'> "
81
+                + " alert('请勿输入非法字符!'); ";
82
+
83
+                if (this.safeUrl == String.Empty)
84
+                    msg += " window.location.href = '" + request.RawUrl + "'";
85
+                else
86
+                    msg += " window.location.href = '" + safeUrl + "'";
87
+
88
+                msg += "</script>";
89
+                return msg;
90
+            }
91
+        }
92
+        /// <summary>
93
+        /// 检查URL参数中是否带有SQL注入的可能关键字。
94
+        /// </summary>
95
+        /// <returns>存在SQL注入关键字时返回 true,否则返回 false</returns>
96
+        public bool CheckRequestQuery()
97
+        {
98
+            bool result = false;
99
+            if (request.QueryString.Count != 0)
100
+            {
101
+                //若URL中参数存在,则逐个检验参数。
102
+                foreach (string queryName in this.request.QueryString)
103
+                {
104
+                    //过虑一些特殊的请求状态值,主要是一些有关页面视图状态的参数
105
+                    if (queryName == "__VIEWSTATE" || queryName == "__EVENTVALIDATION")
106
+                        continue;
107
+                    //开始检查请求参数值是否合法
108
+                    if (CheckKeyWord(request.QueryString[queryName]))
109
+                    {
110
+                        //只要存在一个可能出现Sql注入的参数,则直接退出
111
+                        result = true;
112
+                        break;
113
+                    }
114
+                }
115
+            }
116
+            return result;
117
+        }
118
+        /// <summary>
119
+        /// 检查提交表单中是否存在SQL注入的可能关键字
120
+        /// </summary>
121
+        /// <returns>存在SQL注入关键字时返回 true,否则返回 false</returns>
122
+        public bool CheckRequestForm()
123
+        {
124
+            bool result = false;
125
+            if (request.Form.Count > 0)
126
+            {
127
+                //若获取提交的表单项个数不为0,则逐个比较参数
128
+                foreach (string queryName in this.request.Form)
129
+                {
130
+                    //过虑一些特殊的请求状态值,主要是一些有关页面视图状态的参数
131
+                    if (queryName == "__VIEWSTATE" || queryName == "__EVENTVALIDATION")
132
+                        continue;
133
+                    //开始检查提交的表单参数值是否合法
134
+                    if (CheckKeyWord(request.Form[queryName]))
135
+                    {
136
+                        //只要存在一个可能出现Sql注入的参数,则直接退出
137
+                        result = true;
138
+                        break;
139
+                    }
140
+                }
141
+            }
142
+            return result;
143
+        }
144
+        /// <summary>
145
+        /// 检查_sword是否包涵SQL关键字
146
+        /// </summary>
147
+        /// <param name="_sWord">需要检查的字符串</param>
148
+        /// <returns>存在SQL注入关键字时返回 true,否则返回 false</returns>
149
+        public bool CheckKeyWord(string _sWord)
150
+        {
151
+            bool result = false;
152
+            //模式1 : 对应Sql注入的可能关键字
153
+            string[] patten1 = StrKeyWord.Split('|');
154
+            //模式2 : 对应Sql注入的可能特殊符号
155
+            // string[] patten2 = StrRegex.Split('|');
156
+            //开始检查 模式1:Sql注入的可能关键字 的注入情况
157
+            foreach (string sqlKey in patten1)
158
+            {
159
+                if (_sWord.IndexOf(" " + sqlKey) >= 0 || _sWord.IndexOf(sqlKey + " ") >= 0)
160
+                {
161
+                    //只要存在一个可能出现Sql注入的参数,则直接退出
162
+                    result = true;
163
+                    break;
164
+                }
165
+            }
166
+            //开始检查 模式1:Sql注入的可能特殊符号 的注入情况
167
+            //foreach (string sqlKey in patten2)
168
+            //{
169
+            //    if (_sWord.IndexOf(sqlKey) >= 0)
170
+            //    {
171
+            //        //只要存在一个可能出现Sql注入的参数,则直接退出
172
+            //        result = true;
173
+            //        break;
174
+            //    }
175
+            //}
176
+            return result;
177
+        }
178
+        /// <summary>
179
+        /// 执行Sql注入验证
180
+        /// </summary>
181
+        public void Check()
182
+        {
183
+            if (CheckRequestQuery() || CheckRequestForm())
184
+            {
185
+                response.Write(Msg);
186
+                response.End();
187
+            }
188
+        }
189
+
190
+    }
191
+}