duhongyu лет назад: 4
Родитель
Сommit
f762806cb8

+ 3 - 2
CallCenterApi/CallCenterApi.DAL/T_Bus_Feedback.cs

@@ -412,6 +412,7 @@ namespace CallCenterApi.DAL
412 412
                 {
413 413
                     model.F_Situation = row["F_Situation"].ToString();
414 414
                 }
415
+              
415 416
             }
416 417
             return model;
417 418
         }
@@ -422,7 +423,7 @@ namespace CallCenterApi.DAL
422 423
         public DataSet GetList(string strWhere)
423 424
         {
424 425
             StringBuilder strSql = new StringBuilder();
425
-            strSql.Append("select F_Id,F_AssignedId,F_WorkOrderId,F_Result,F_CreateTime,F_CreateUser,F_CreateDeptId,F_IsFeedEnd,F_File,F_Type,F_State,F_IsAudit,F_AuditUser,F_AuditTime,F_IsDelete,F_DeleteUser,F_DeleteTime,F_DealUser,F_AuditReason ");
426
+            strSql.Append("select  * ");
426 427
             strSql.Append(" FROM T_Bus_Feedback ");
427 428
             if (strWhere.Trim() != "")
428 429
             {
@@ -442,7 +443,7 @@ namespace CallCenterApi.DAL
442 443
             {
443 444
                 strSql.Append(" top " + Top.ToString());
444 445
             }
445
-            strSql.Append(" F_Id,F_AssignedId,F_WorkOrderId,F_Result,F_CreateTime,F_CreateUser,F_CreateDeptId,F_IsFeedEnd,F_File,F_Type,F_State,F_IsAudit,F_AuditUser,F_AuditTime,F_IsDelete,F_DeleteUser,F_DeleteTime,F_DealUser,F_AuditReason ");
446
+            strSql.Append(" F_Id,F_AssignedId,F_WorkOrderId,F_Result,F_CreateTime,F_CreateUser,F_CreateDeptId,F_IsFeedEnd,F_File,F_Type,F_State,F_IsAudit,F_AuditUser,F_AuditTime,F_IsDelete,F_DeleteUser,F_DeleteTime,F_DealUser,F_AuditReason,F_IsProResult,F_ProSituation ");
446 447
             strSql.Append(" FROM T_Bus_Feedback ");
447 448
             if (strWhere.Trim() != "")
448 449
             {

+ 1 - 1
CallCenterApi/CallCenterApi.DAL/T_Sys_Users.cs

@@ -296,7 +296,7 @@ namespace CallCenterApi.DAL
296 296
         {
297 297
             StringBuilder strSql = new StringBuilder();
298 298
             strSql.Append("select F_Id,F_OpenId,F_CreateTime,F_Type,F_Password,F_Name,F_Telphone,F_Sex,F_Province,F_City,F_County,F_Address ");
299
-            strSql.Append(" FROM T_Sys_Users ");
299
+            strSql.Append(" FROM T_Sys_Users WITH(NOLOCK)");
300 300
             if (strWhere.Trim() != "")
301 301
             {
302 302
                 strSql.Append(" where " + strWhere);

+ 389 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/App_Start/SqlErrorAttribute.cs

@@ -0,0 +1,389 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Data;
4
+using System.Linq;
5
+using System.Text;
6
+using System.Web;
7
+using System.Web.Mvc;
8
+using CallCenter.Utility;
9
+using CallCenterApi.Common;
10
+using CallCenterApi.DB;
11
+using CallCenterApi.Interface.Controllers.Login;
12
+
13
+namespace CallCenterApi.Interface.App_Start
14
+{
15
+    public class SqlErrorAttribute : ActionFilterAttribute
16
+    {
17
+
18
+
19
+        //sql注入式攻击检查
20
+
21
+        public override void OnActionExecuting(ActionExecutingContext filterContext)
22
+        {
23
+            if (filterContext.HttpContext.Request.CurrentExecutionFilePath.Contains("CallOpt"))
24
+            {
25
+
26
+            }
27
+            else
28
+            {
29
+
30
+                if (filterContext.HttpContext.Request.CurrentExecutionFilePath.Contains("GetList"))
31
+                {
32
+                    int qw = 0;
33
+                }
34
+                //当前角色导航判断 
35
+                var token1 = filterContext.HttpContext.Request["token"];
36
+                if (token1 != null)
37
+                {
38
+                    var userDatastr = RedisHelper.StringGet(token1);
39
+                    if (userDatastr != null)
40
+                    {
41
+                        Dictionary<string, string> userData = new Dictionary<string, string>();
42
+                        userData = userDatastr.ToString().ToObject<Dictionary<string, string>>();
43
+                        var roleId = Utils.StrToInt(userData["F_RoleID"], 0);
44
+                        var F_UserID = Utils.StrToInt(userData["F_UserID"], 0);
45
+                        int qq = geturl(roleId.ToString(), F_UserID);
46
+                        if (qq > 0)
47
+                        {
48
+                            //报错无权限
49
+                            throw new Exception("操作失败:无权限!");
50
+
51
+                        }
52
+                    }
53
+                }
54
+                IList<string> tname = new List<string>();
55
+                if (filterContext.HttpContext.Request.Form.Keys.Count > 0)
56
+                {
57
+                    for (int q = 0; q < filterContext.HttpContext.Request.Form.Keys.Count; q++)
58
+                    {
59
+                        var tid = filterContext.HttpContext.Request.Form.Keys[q];
60
+                        if (!tname.Contains(tid))
61
+                        {
62
+                            tname.Add(tid);
63
+                        }
64
+                    }
65
+                }
66
+                if (filterContext.HttpContext.Request.QueryString.Count > 0)
67
+                {
68
+                    for (int q = 0; q < filterContext.HttpContext.Request.QueryString.Count; q++)
69
+                    {
70
+                        var tid = filterContext.HttpContext.Request.QueryString.AllKeys[q];
71
+                        if (!tname.Contains(tid))
72
+                        {
73
+                            tname.Add(tid);
74
+                        }
75
+
76
+                    }
77
+                }
78
+                var actionParameters = filterContext.ActionDescriptor.GetParameters();
79
+                var otherController = DependencyResolver.Current.GetService<AES256Controller>();
80
+                string urls = filterContext.ActionDescriptor.ActionName;
81
+                if (urls != null
82
+                    && (filterContext.HttpContext.Request.QueryString.Count > 0
83
+                    || filterContext.HttpContext.Request.Form.Keys.Count > 0))
84
+                {
85
+                    if (filterContext.HttpContext.Request.Form.Keys.Count > 0)
86
+                    {//post
87
+                     //遍历字典
88
+                     //foreach (KeyValuePair<string, object> kvp in filterContext.ActionParameters)
89
+                     //{
90
+                     //取值,赋值
91
+                     //var key = kvp.Key;
92
+
93
+                        ////var tt= filterContext.ActionParameters[key].GetType();
94
+                        ////var tt2 = filterContext.ActionParameters[key];
95
+                        ////var t1 = filterContext.ActionParameters.Keys.Count;
96
+                        ////var t2 = filterContext.ActionParameters.Values.Count;
97
+                        //object o = filterContext.ActionParameters;
98
+                        //PropertyDescriptorCollection PropertyList = System.ComponentModel.TypeDescriptor.GetProperties(o);
99
+                        //Type t = o.GetType();
100
+                        //PropertyInfo[] pList = t.GetProperties();
101
+                        //foreach (PropertyInfo item in pList)
102
+                        //{
103
+                        //    string name = item.Name;
104
+                        //object value = item.GetValue(o, null);
105
+
106
+                        //if (name == "Values")
107
+                        //{
108
+                        for (int w = 0; w < tname.Count; w++)
109
+                        {
110
+                            //时间去掉 tname[w]
111
+                            string v1 = tname[w].ToString();
112
+                            //&& v1 != "cont"
113
+                            //编辑器编辑内容排除
114
+                            if (v1 != "con" && v1 != "cont")
115
+                            {
116
+
117
+
118
+                                var v = filterContext.HttpContext.Request.Form[tname[w]];
119
+
120
+                                FilterSql(v);
121
+                            }
122
+
123
+                        }
124
+
125
+                        //   }
126
+
127
+                        //   }
128
+
129
+                        //}
130
+                    }
131
+                    else if (filterContext.HttpContext.Request.QueryString.Count > 0)
132
+                    {//get
133
+                        for (int w = 0; w < tname.Count; w++)
134
+                        {
135
+                            var v = filterContext.HttpContext.Request.QueryString[tname[w]];
136
+                            FilterSql(v);
137
+                        }
138
+
139
+                    }
140
+
141
+                }
142
+            }
143
+        }
144
+
145
+
146
+
147
+        public static void FilterSql(string s)
148
+        {
149
+            // if (string.IsNullOrEmpty(s)) return string.Empty;
150
+            s = s.Trim().ToLower();
151
+            string s1 = "";
152
+            int i = 0;
153
+            string message = "操作失败!!!异常提醒:符号";
154
+            if (s.Contains("=")) { i++; message += (s1 + "=,"); };
155
+            if (s.Contains("'")) { i++; message += (s1 + "',"); };
156
+            if (s.Contains(";")) { i++; message += (s1 + ";,"); };
157
+            if (s.Contains(" or ")) { i++; message += (s1 + " or ,"); };
158
+            if (s.Contains("select")) { i++; message += (s1 + "select,"); };
159
+            if (s.Contains("update")) { i++; message += (s1 + "update,"); };
160
+            if (s.Contains("insert")) { i++; message += (s1 + "insert,"); };
161
+            if (s.Contains("delete")) { i++; message += (s1 + "delete,"); };
162
+            if (s.Contains("declare")) { i++; message += (s1 + "declare,"); };
163
+            if (s.Contains("exec")) { i++; message += (s1 + "exec,"); };
164
+            if (s.Contains("drop")) { i++; message += (s1 + "drop,"); };
165
+            if (s.Contains("create")) { i++; message += (s1 + "create,"); };
166
+            if (s.Contains("%")) { i++; message += (s1 + "%,"); };
167
+            if (s.Contains("--")) { i++; message += (s1 + "--,"); };
168
+            if (s.Contains("_")) { i++; message += (s1 + "_,"); };
169
+            if (s.Contains("convert")) { i++; message += (s1 + "convert,"); };
170
+            if (s.Contains("@version")) { i++; message += (s1 + "@version,"); };
171
+            if (i > 0)
172
+            {
173
+                throw new Exception(message);
174
+            }
175
+
176
+
177
+        }
178
+
179
+
180
+        /// <summary>
181
+        /// 导航权限判断
182
+        /// </summary>
183
+        /// <param name="url">当前进入导航</param>
184
+        ///  <param name="roleId">当前登陆人角色id </param>
185
+        ///  <param name="userId">当前登陆人id </param>
186
+        /// <returns></returns>
187
+        public static int geturl(string roleId, int userId)
188
+        {
189
+            int a = 0;
190
+            int b = 0;
191
+            //1:检测用户是否禁用
192
+            var u = new BLL.T_Sys_UserAccount().GetModel(userId);
193
+            //1-禁用 0-启用
194
+            if (u == null)
195
+            {
196
+                a = 1;
197
+            }
198
+            else if (u.F_DeleteFlag == 1)
199
+            {
200
+                a = 1;
201
+            }
202
+            #region MyRegion
203
+            // return ds;
204
+
205
+
206
+
207
+
208
+            //         string url1 = HttpContext.Current.Request.Url.AbsolutePath;
209
+            //         string url2 = HttpContext.Current.Request.Path;
210
+
211
+            //         DataSet dt = new DataSet();
212
+            //         Dictionary<String, String> para = new Dictionary<string, String>();
213
+
214
+
215
+            //         String sql = @"  select   f.F_OptUrl
216
+            //from dbo.T_Sys_RoleFunction rf 
217
+            //left join T_Sys_Function  f on   rf.F_FunctionId=f.F_FunctionId 
218
+            //where    F_RoleId=@RoleId  group by f.F_OptUrl ";
219
+            //         para.Add("@RoleId", roleId);
220
+            //         dt = DbHelperSQL.Query(sql, para);
221
+
222
+            //         if (dt.Tables.Count > 0)
223
+            //         {
224
+            //             for (int i = 0; i < dt.Tables.Count; i++)
225
+            //             {
226
+            //                 DataTable t = dt.Tables[i];
227
+            //                 string t1=t.Columns[i].ToString();
228
+
229
+
230
+
231
+
232
+            //                 //if (url==t.) { }
233
+            //             }
234
+            //         }
235
+            #endregion
236
+
237
+            return a;
238
+
239
+        }
240
+
241
+
242
+
243
+        //根据接口找Id 找到 则判断 导航权限
244
+        public static int getItemBYUrl(string url, int roleId)
245
+        {
246
+            int a = 0;
247
+            StringBuilder strSql = new StringBuilder();
248
+            strSql.Append(@" 	select F_RoleId
249
+from  dbo.T_Sys_RoleFunction f  left join  T_Sys_RoleUrl  t 
250
+on  t.F_FunctionId=f.F_FunctionId
251
+     ");
252
+            strSql.Append(" where     [F_UrlInfo] ='" + url + "'");
253
+            strSql.Append(" group by     F_RoleId");
254
+            var ds = DbHelperSQL.Query(strSql.ToString());
255
+            DataTable dt = new DataTable();
256
+
257
+            dt = ds.Tables[0];
258
+
259
+            if (dt.Rows.Count > 0)
260
+            {
261
+
262
+                for (int i = 0; i < dt.Rows.Count; i++)
263
+                {
264
+                    //列
265
+                    for (int j = 0; j < dt.Columns.Count; j++)
266
+                    {
267
+                        if (dt.Rows[i][j] != null && dt.Rows[i][j].ToString() != "")
268
+                        {
269
+                            if (roleId == Convert.ToInt32(dt.Rows[i][j]))
270
+                            {
271
+                                a++;
272
+                            }
273
+                        }
274
+                    }
275
+                }
276
+            }
277
+            else
278
+            {
279
+                a = 1;
280
+            }
281
+
282
+
283
+
284
+            return a;
285
+
286
+
287
+        }
288
+
289
+
290
+
291
+
292
+        /// <summary>
293
+        /// 检测接口方法权限
294
+        /// </summary>
295
+        /// <param name="FuntionId">导航id </param>
296
+        /// <param name="url">当前接口导航</param>
297
+        public static int getItemUrl(int FuntionId, string url, int roleId)
298
+        {
299
+            if (FuntionId == 19)
300
+            {
301
+                int qw = 1;
302
+            }
303
+            int a = 0;
304
+            int b = 0;
305
+            StringBuilder strSql = new StringBuilder();
306
+            strSql.Append(@" 	select [F_UrlInfo]  
307
+from T_Sys_RoleUrl  t  left join dbo.T_Sys_RoleFunction f 
308
+on  t.F_FunctionId=f.F_FunctionId
309
+     ");
310
+            strSql.Append(" where     f.F_FunctionId=" + FuntionId);
311
+            string str = " and      F_RoleId=" + roleId;
312
+            //strSql.Append(" group by f.F_OptUrl ,f.F_FunctionId");
313
+
314
+            var ds = DbHelperSQL.Query(strSql.ToString() + str);
315
+            var ds2 = DbHelperSQL.Query(strSql.ToString());
316
+            DataTable dt = new DataTable();
317
+            DataTable dt2 = new DataTable();
318
+            dt = ds.Tables[0];
319
+            dt2 = ds2.Tables[0];
320
+            if (dt.Rows.Count > 0)
321
+            {
322
+
323
+                for (int i = 0; i < dt.Rows.Count; i++)
324
+                {
325
+                    //列
326
+                    for (int j = 0; j < dt.Columns.Count; j++)
327
+                    {
328
+                        //用户所具有权限的页面
329
+                        string f1 = dt.Rows[i][j].ToString();
330
+                        if (f1 == url)
331
+                        {
332
+                            a++;
333
+                        }
334
+
335
+
336
+                    }
337
+                }
338
+            }
339
+            else
340
+            {
341
+
342
+                if (dt2.Rows.Count > 0)
343
+                {
344
+                    a = 0;
345
+                }
346
+                else
347
+                { //T_Sys_RoleUrl  没存数据
348
+                    a = 1;
349
+                }
350
+
351
+            }
352
+
353
+            //a>0 / b>0
354
+            //a=0 
355
+            //if (a==0) {
356
+            //    throw new Exception("操作失败,无权限");
357
+            //}
358
+            return a;
359
+
360
+        }
361
+
362
+
363
+        public static int PageFuoction(string Pagename)
364
+        {
365
+            int a = 0;
366
+            StringBuilder strSql = new StringBuilder();
367
+            strSql.Append(@"  select F_FunctionId from dbo.T_Sys_Function 
368
+     ");
369
+            strSql.Append(" where  F_OptUrl like '%" + Pagename + "%'");
370
+            //  strSql.Append(" group by f.F_OptUrl ,f.F_FunctionId");
371
+
372
+            var ds = DbHelperSQL.Query(strSql.ToString());
373
+            DataTable dt = new DataTable();
374
+            dt = ds.Tables[0];
375
+            if (dt.Rows.Count > 0)
376
+            {
377
+
378
+                a = Convert.ToInt32(dt.Rows[0][0]);
379
+
380
+            }
381
+
382
+
383
+            return a;
384
+        }
385
+
386
+
387
+    }
388
+
389
+}

+ 137 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Login/AES256Controller.cs

@@ -0,0 +1,137 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Security.Cryptography;
5
+using System.Text;
6
+using System.Web;
7
+using System.Web.Mvc;
8
+using CallCenterApi.Interface.Controllers.Base;
9
+
10
+namespace CallCenterApi.Interface.Controllers.Login
11
+{
12
+    public class AES256Controller : BaseController
13
+    {
14
+        // GET: AES256
15
+        public ActionResult Index()
16
+        {
17
+            return View();
18
+
19
+        }
20
+
21
+        private static string Key
22
+        {
23
+            //get { return @")O[NB]6,YF}+efcaj{+oESb9d8>Z'e9M"; }
24
+            get { return @")O[9d]6,YF}+efcaj{+8>Z'e9M"; }
25
+        }
26
+
27
+        #region 注释掉
28
+        /*private static string IV
29
+        {
30
+            get { return @"L+\~f4,Ir)b$=pkf"; }
31
+        }
32
+
33
+        
34
+        /// <summary>
35
+        /// AES加密
36
+        /// </summary>
37
+        /// <param name="plainStr">明文字符串</param>
38
+        /// <returns>密文</returns>
39
+        public static string AESEncrypt(string plainStr)
40
+        {
41
+            byte[] bKey = Encoding.UTF8.GetBytes(Key);
42
+            byte[] bIV = Encoding.UTF8.GetBytes(IV);
43
+            byte[] byteArray = Encoding.UTF8.GetBytes(plainStr);
44
+
45
+            string encrypt = null;
46
+            Rijndael aes = Rijndael.Create();
47
+            using (MemoryStream mStream = new MemoryStream())
48
+            {
49
+                using (CryptoStream cStream = new CryptoStream(mStream, aes.CreateEncryptor(bKey, bIV), CryptoStreamMode.Write))
50
+                {
51
+                    cStream.Write(byteArray, 0, byteArray.Length);
52
+                    cStream.FlushFinalBlock();
53
+                    encrypt = Convert.ToBase64String(mStream.ToArray());
54
+                }
55
+            }
56
+            aes.Clear();
57
+            return encrypt;
58
+        }
59
+
60
+        public static string AESDecrypt(string encryptStr)
61
+        {
62
+            byte[] bKey = Encoding.UTF8.GetBytes(Key);
63
+            byte[] bIV = Encoding.UTF8.GetBytes(IV);
64
+            byte[] byteArray = Convert.FromBase64String(encryptStr);
65
+
66
+            string decrypt = null;
67
+            Rijndael aes = Rijndael.Create();
68
+            // 开辟一块内存流
69
+            using (MemoryStream mStream = new MemoryStream())
70
+            {
71
+                // 把内存流对象包装成加密流对象
72
+                using (CryptoStream cStream = new CryptoStream(mStream, aes.CreateDecryptor(bKey, bIV), CryptoStreamMode.Write))
73
+                {
74
+                    // 明文数据写入加密流
75
+                    cStream.Write(byteArray, 0, byteArray.Length);
76
+                    cStream.FlushFinalBlock();
77
+                    decrypt = Encoding.UTF8.GetString(mStream.ToArray());
78
+                }
79
+            }
80
+            aes.Clear();
81
+            return decrypt;
82
+        }
83
+
84
+        public ActionResult Encryption(string str)
85
+        {
86
+            var text = AESEncrypt(str);
87
+            return Json(text, JsonRequestBehavior.AllowGet);
88
+        }
89
+
90
+        public ActionResult Decode(string str)
91
+        {
92
+            var text = AESDecrypt(str);
93
+            return Json(text, JsonRequestBehavior.AllowGet);
94
+        }*/
95
+        #endregion
96
+
97
+
98
+        /// <summary>
99
+        /// AES加密
100
+        /// </summary>
101
+        /// <param name="encryptStr">明文</param>
102
+        /// <param name="key">32位密钥</param>
103
+        /// <returns></returns>
104
+        public string Encrypt(string encryptStr, string ltime)
105
+        {
106
+            byte[] keyArray = UTF8Encoding.UTF8.GetBytes(Key + ltime);
107
+            byte[] toEncryptArray = UTF8Encoding.UTF8.GetBytes(encryptStr);
108
+            RijndaelManaged rDel = new RijndaelManaged();
109
+            rDel.Key = keyArray;
110
+            rDel.Mode = CipherMode.ECB;
111
+            rDel.Padding = PaddingMode.PKCS7;
112
+            ICryptoTransform cTransform = rDel.CreateEncryptor();
113
+            byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
114
+            return Convert.ToBase64String(resultArray, 0, resultArray.Length);
115
+        }
116
+
117
+        /// <summary>
118
+        /// AES解密
119
+        /// </summary>
120
+        /// <param name="decryptStr">密文</param>
121
+        /// <param name="key">密钥</param>
122
+        /// <returns></returns>
123
+        public string Decrypt(string decryptStr, string ltime)
124
+        {
125
+            byte[] keyArray = UTF8Encoding.UTF8.GetBytes(Key + ltime);
126
+            byte[] toEncryptArray = Convert.FromBase64String(decryptStr);
127
+            RijndaelManaged rDel = new RijndaelManaged();
128
+            rDel.Key = keyArray;
129
+            rDel.Mode = CipherMode.ECB;
130
+            rDel.Padding = PaddingMode.PKCS7;
131
+            ICryptoTransform cTransform = rDel.CreateDecryptor();
132
+            byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
133
+            return UTF8Encoding.UTF8.GetString(resultArray);
134
+        }
135
+
136
+    }
137
+}

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

@@ -13,9 +13,11 @@ using CallCenterApi.Model;
13 13
 using CallCenterApi.Interface.Models.Input;
14 14
 using CallCenterApi.DB;
15 15
 using System.Web.Caching;
16
+using CallCenterApi.Interface.App_Start;
16 17
 
17 18
 namespace CallCenterApi.Interface.Controllers
18 19
 {
20
+    [SqlError]
19 21
     public class LoginController : BaseController
20 22
     {
21 23
         private BLL.T_Sys_RoleFunction roleFunctionBLL = new BLL.T_Sys_RoleFunction();

+ 1 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/information/InternalMessagesController.cs

@@ -323,7 +323,7 @@ namespace CallCenterApi.Interface.Controllers.information
323 323
                 //model.SMS_DeleteTime = SMS_DeleteTime;
324 324
                 model.SMS_IsDelete = 0;
325 325
                 model.SMS_Order = 0;
326
-                model.SMS_IsTop = 0;
326
+                model.SMS_IsTop = smstop;
327 327
                 model.SMS_Type = smstype;
328 328
                 int n = bll.Add(model);
329 329
                 if (n > 0)

+ 14 - 4
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/weixin/WechatDockingController.cs

@@ -2,10 +2,16 @@
2 2
 using CallCenter.Utility.log;
3 3
 using CallCenterApi.DB;
4 4
 using CallCenterApi.Interface.Controllers.Base;
5
+using Newtonsoft.Json;
6
+using Newtonsoft.Json.Linq;
5 7
 using System;
6 8
 using System.Collections.Generic;
7 9
 using System.Data;
10
+using System.IO;
8 11
 using System.Linq;
12
+using System.Net;
13
+using System.Security.Cryptography;
14
+using System.Text;
9 15
 using System.Transactions;
10 16
 using System.Web;
11 17
 using System.Web.Mvc;
@@ -298,7 +304,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
298 304
 
299 305
                 #region 筛选工单
300 306
                 var sql = " and (F_IsEnabled=0 or F_IsDelete=0) ";
301
-                sql += " and F_WorkOrderId in (select distinct F_WorkOrderId from T_Bus_UserWorkOrder where F_UserId='" + wxuser.F_Id + "') ";
307
+                sql += " and F_WorkOrderId in (select distinct F_WorkOrderId from T_Bus_UserWorkOrder WITH(NOLOCK) where F_UserId='" + wxuser.F_Id + "') ";
302 308
                 if (!string.IsNullOrWhiteSpace(workorderid))
303 309
                 {
304 310
                     sql += " and F_WorkOrderId like '%" + workorderid + "%' ";
@@ -518,12 +524,13 @@ namespace CallCenterApi.Interface.Controllers.weixin
518 524
             return Process();
519 525
         }
520 526
 
527
+      
521 528
         /// <summary>
522 529
         /// 添加工单
523 530
         /// </summary>
524 531
         /// <returns></returns>
525 532
         [HttpPost]
526
-        public ActionResult AddWxOrders(string uuid, string port_password, string openid, string timesamp, string cusname, string cusphone, string title, string content, string sourceaddress, string files, int sourcearea = 0, int keys = 0, int type = 0, int isprotect = 0)
533
+        public ActionResult AddWxOrders(string uuid, string port_password, string openid, string timesamp, string cusname, string cusphone, string title, string content, string sourceaddress, string files, int sourcearea = 0, int keys = 0, int type = 0, int isprotect = 0,int source=0)
527 534
         {
528 535
             using (TransactionScope trans = new TransactionScope())
529 536
             {
@@ -573,9 +580,12 @@ namespace CallCenterApi.Interface.Controllers.weixin
573 580
                     ajresult.message = "用户无效";
574 581
                     return Process();
575 582
                 }
576
-
583
+                if (source > 0)
584
+                    source = 72;
585
+                else
586
+                    source = 5;
577 587
                 workorder.WorkOrderController wo = new workorder.WorkOrderController();
578
-                string workorderid = wo.AddWorkOrderBySource(5, cusname, "", cusphone, "", "", "", "", cusphone, title,content, sourcearea, sourceaddress, keys.ToString(), "", type, 0, 0, isprotect, 0, files);
588
+                string workorderid = wo.AddWorkOrderBySource(source, cusname, "", cusphone, "", "", "", "", cusphone, title,content, sourcearea, sourceaddress, keys.ToString(), "", type, 0, 0, isprotect, 0, files);
579 589
 
580 590
                 int mapid = AddMap(uuid, port_password, "receive", "AddWxOrders", openid, workorderid);
581 591
 

Разница между файлами не показана из-за своего большого размера
+ 234 - 22
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs


+ 5 - 3
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Common/ButtonGroup.cs

@@ -176,7 +176,7 @@ namespace CallCenterApi.Interface.Models.Common
176 176
         /// <param name="code"></param>
177 177
         /// <param name="iszb"></param>
178 178
         /// <returns></returns>
179
-        public static List<button> GetButtons(string isobservation, string state, string code, string iszb, string iszbdw = "", string ispd = "")
179
+        public static List<button> GetButtons( string state, string code, string iszb, string iszbdw = "", string ispd = "", string isobservation="",string IsResult="")
180 180
         {
181 181
             List<button> buttons = new List<button>();
182 182
             buttons.Add(query());
@@ -290,14 +290,16 @@ namespace CallCenterApi.Interface.Models.Common
290 290
                     }
291 291
                     break;
292 292
                 case "9":
293
-                    if ((code == "ZXLD" || code == "ZXLDGLY" || code == "GLY") && iszb == "1" && isobservation == "1")
293
+                    if ((code == "ZXLD" || code == "ZXLDGLY" || code == "GLY") && iszb == "1")
294 294
                     {
295
-                        buttons.Add(back()); buttons.Add(RemoveOrders());
295
+                        buttons.Add(back()); 
296 296
                     }
297 297
                     if ((code == "ZXLD" || code == "ZXLDGLY" || code == "GLY")  && isobservation == "1")
298 298
                     {
299 299
                          buttons.Add(RemoveOrders());
300 300
                     }
301
+                   
302
+                    
301 303
                     break;
302 304
             }
303 305
             //buttons.Add(export());