1550076451 1 rok temu
rodzic
commit
595b227ae4

Plik diff jest za duży
+ 808 - 20
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/APPController.cs


Plik diff jest za duży
+ 17 - 66
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Sms/SmsNewController.cs


+ 2 - 2
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/UserAccountController.cs

@@ -626,12 +626,12 @@ namespace CallCenterApi.Interface.Controllers
626 626
             {
627 627
                 return Error("请输入将要发送的号码");
628 628
             }
629
-            int codes = new Random().Next(1000, 9999);
629
+            int codes = new Random().Next(100000, 999999);
630 630
            // string msg = codes.ToString ();
631 631
            // bool n = SMSController.AddSmS(0, msg, "你的验证码是"+ codes+".十分钟有效.", mobile, "168411", "");
632 632
 
633 633
             string mag = "[\"" + codes.ToString() + "\"]";
634
-            string v = SmsNewController.AddSmS(0, "你的验证码是" + codes + ".十分钟有效.", mobile, "681240638956277760", mag,
634
+            string v = SmsNewController.AddSmS(0, "您本次登录的验证码是"+ codes.ToString() + ",10分钟内有效。", mobile, "1053396176871632896", mag,
635 635
           "");
636 636
             if (v=="")
637 637
             {

+ 3 - 3
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/weixin/WxLoginController.cs

@@ -144,10 +144,10 @@ namespace CallCenterApi.Interface.Controllers.weixin
144 144
         public ActionResult SendCode(string mobile)
145 145
         {
146 146
 
147
-            int codes = new Random().Next(1000, 9999);
147
+            int codes = new Random().Next(100000, 999999);
148 148
             string mag = "[\"" + codes.ToString() + "\"]";
149
-            string v = SmsNewController.AddSmS(0, "您的验证码是" + codes + ",10分钟内有效。", mobile, "681240638956277760", mag,
150
-          "");
149
+            string v = SmsNewController.AddSmS(0, "您本次登录的验证码是" + codes.ToString() + ",10分钟内有效。", mobile, "1053396176871632896", mag,
150
+           "");
151 151
             if (v == "")
152 152
             {
153 153
                 return Error("发送成功");

Plik diff jest za duży
+ 748 - 260
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs


+ 1 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/hb_affairsController.cs

@@ -558,6 +558,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
558 558
 
559 559
                             }
560 560
                         }
561
+                        new BLL.T_Sys_Affairs().Update(affairs.FirstOrDefault());
561 562
                         #region 插入操作记录
562 563
                         Model.T_Bus_Operation oper = new Model.T_Bus_Operation();
563 564
                         oper.F_WorkOrderId = modelT_Bus_WorkOrder.F_WorkOrderId;

+ 10 - 3
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Global.asax.cs

@@ -33,18 +33,23 @@ namespace CallCenterApi.Interface
33 33
                 {
34 34
                     _worker = new QuartzWorker(port);
35 35
                     _worker.AddWork(new PushWorkorder());
36
+                   
36 37
                     if (ISfiring=="1")
37 38
                     {
38 39
                         _worker.AddWork(new ZhengWuDuiJie());
39
-                        _worker.AddWork(new Peoplewebsite());
40
+                      
40 41
                     }
41
-                   
42
+                    else if (ISfiring == "2")
43
+                    {
44
+                        _worker.AddWork(new SatisfactionClose());
45
+                    }
46
+
42 47
                     _worker.Start();
43 48
                 }
44 49
 
45 50
             }).ContinueWith(p =>
46 51
             {
47
-                System.Diagnostics.Debug.WriteLine(DateTime.Now);
52
+                //System.Diagnostics.Debug.WriteLine(DateTime.Now);
48 53
             });
49 54
         }
50 55
 
@@ -59,6 +64,8 @@ namespace CallCenterApi.Interface
59 64
 
60 65
         protected void Application_AuthenticateRequest(object sender, EventArgs e)
61 66
         {
67
+            SqlChecker SqlChecker = new SqlChecker(this.Request, this.Response);
68
+            SqlChecker.Check();
62 69
             HttpApplication app = (HttpApplication)sender;
63 70
             var context = app.Context;
64 71
             if (context == null) throw new ArgumentNullException("context");

+ 18 - 2
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Common/ButtonGroup.cs

@@ -257,7 +257,22 @@ namespace CallCenterApi.Interface.Models.Common
257 257
         {
258 258
             return new button(69, "呼叫");
259 259
         }
260
-       
260
+        public static button Contentment()
261
+        {
262
+            return new button(70, "插入");
263
+        }
264
+        public static button BackVisit()
265
+        {
266
+            return new button(71, "回退");
267
+        }
268
+        public static button RemoveContentment()
269
+        {
270
+            return new button(72, "移除");
271
+        }
272
+        public static button TransferOut()
273
+        {
274
+            return new button(73, "转出");
275
+        }
261 276
         /// <summary>
262 277
         /// 已办未果通过
263 278
         /// </summary>
@@ -769,12 +784,13 @@ namespace CallCenterApi.Interface.Models.Common
769 784
                     if ((code == "ZXLD" || code == "ZXLDGLYGLY" || code == "GLY" || code == "DDZG" || code == "ZXHWY" || code == "SPZ" || code == "SPZJZ") && iszb == "0")
770 785
                     {
771 786
                         buttons.Add(statistics());
772
-                        
787
+                      
773 788
                         // buttons.Add(back());
774 789
                     }
775 790
                     if (code == "ZXLD" || code == "YSZY" || code == "ZXLDGLYGLY" || code == "GLY" || code == "DDZG"  || code == "SPZ" || code == "SPZJZ")
776 791
                     {
777 792
                         buttons.Add(modify());
793
+                        
778 794
                     }
779 795
                     break;
780 796
                 case "10":

Plik diff jest za duży
+ 1 - 1516
CallCenterCommon/CallCenter.QuartzService/Peoplewebsite.cs


Plik diff jest za duży
+ 62 - 27
CallCenterCommon/CallCenter.QuartzService/SatisfactionClose.cs


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

@@ -105,6 +105,7 @@
105 105
     <Compile Include="SM2CryptoUtil.cs" />
106 106
     <Compile Include="Sms\SmsNewHelper.cs" />
107 107
     <Compile Include="Sms\SmsHelper.cs" />
108
+    <Compile Include="SqlChecker.cs" />
108 109
     <Compile Include="SysInformationHelper.cs" />
109 110
     <Compile Include="Time\DateTimeConvert.cs" />
110 111
     <Compile Include="Time\DateTools.cs" />

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

@@ -0,0 +1,191 @@
1
+
2
+using System;
3
+using System.Collections.Generic;
4
+using System.IO;
5
+using System.Linq;
6
+using System.Text;
7
+using System.Web;
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
+}