From b6e254bfca6f3a06f84e7592c964a44cb9e1fca4 Mon Sep 17 00:00:00 2001
From: gaofei <231232131@163.com>
Date: Tue, 19 Oct 2021 17:50:34 +0800
Subject: [PATCH] 1019-003-gaofei
---
.gitignore | 1 +
SGGL/BLL/API/APIGetHttpService.cs | 68 ++++++++++++++++++
SGGL/BLL/Common/Funs.cs | 8 +++
SGGL/FineUIPro.Web/ErrLog.txt | 69 +++++++++++++++++++
SGGL/FineUIPro.Web/Global.asax.cs | 13 ++--
.../ProjectData/Installation.aspx | 3 +
.../ProjectData/Installation.aspx.cs | 32 ++++++++-
.../ProjectData/Installation.aspx.designer.cs | 9 +++
8 files changed, 195 insertions(+), 8 deletions(-)
diff --git a/.gitignore b/.gitignore
index 6b3ba18d..c7bc02cb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@
/SGGLPackFile/PackFile/bin
/SGGLPackFile
+/SGGL/FineUIPro.Web/File/Excel/Temp
diff --git a/SGGL/BLL/API/APIGetHttpService.cs b/SGGL/BLL/API/APIGetHttpService.cs
index 9869e3eb..9fbb9cb7 100644
--- a/SGGL/BLL/API/APIGetHttpService.cs
+++ b/SGGL/BLL/API/APIGetHttpService.cs
@@ -145,5 +145,73 @@ namespace BLL
}
}
}
+
+ ///
+ /// 不做catch处理,需要在外部做
+ ///
+ ///
+ /// 默认GET,空则补充为GET
+ /// 默认json,空则补充为json
+ /// 请求头部
+ /// 请求body内容
+ ///
+ public static string ControlHttp(string url, string method = "GET", string contenttype = "application/json;charset=utf-8", Hashtable header = null, string data = null)
+ {
+
+ HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
+ request.Method = string.IsNullOrEmpty(method) ? "GET" : method;
+ request.ContentType = string.IsNullOrEmpty(contenttype) ? "application/json;charset=utf-8" : contenttype;
+ if (header != null)
+ {
+ foreach (var i in header.Keys)
+ {
+ request.Headers.Add(i.ToString(), header[i].ToString());
+ }
+ }
+ if (!string.IsNullOrEmpty(data))
+ {
+ Stream RequestStream = request.GetRequestStream();
+ byte[] bytes = Encoding.UTF8.GetBytes(data);
+ RequestStream.Write(bytes, 0, bytes.Length);
+ RequestStream.Close();
+ }
+
+ HttpWebResponse response = null;
+ Stream ResponseStream = null;
+ StreamReader StreamReader = null;
+ try
+ {
+ response = (HttpWebResponse)request.GetResponse();
+ ResponseStream = response.GetResponseStream();
+ StreamReader = new StreamReader(ResponseStream, Encoding.GetEncoding("utf-8"));
+
+ string re = StreamReader.ReadToEnd();
+ return re;
+ }
+ catch (WebException ex)
+ {
+ response = (HttpWebResponse)ex.Response;
+ ResponseStream = response.GetResponseStream();
+ StreamReader = new StreamReader(ResponseStream, Encoding.GetEncoding("utf-8"));
+
+ string re = StreamReader.ReadToEnd();
+ return re;
+ }
+ finally
+ {
+ if (StreamReader != null)
+ {
+ StreamReader.Close();
+ }
+ if (ResponseStream != null)
+ {
+ ResponseStream.Close();
+ }
+ if (response != null)
+ {
+ response.Close();
+ }
+ }
+ }
}
}
diff --git a/SGGL/BLL/Common/Funs.cs b/SGGL/BLL/Common/Funs.cs
index 12e6ee53..4c799577 100644
--- a/SGGL/BLL/Common/Funs.cs
+++ b/SGGL/BLL/Common/Funs.cs
@@ -103,6 +103,14 @@ namespace BLL
set;
}
///
+ /// ѿַ
+ ///
+ public static string ControlApiUrl
+ {
+ get;
+ set;
+ }
+ ///
/// 汾
///
public static string SystemVersion
diff --git a/SGGL/FineUIPro.Web/ErrLog.txt b/SGGL/FineUIPro.Web/ErrLog.txt
index 30e81efa..fcd18812 100644
--- a/SGGL/FineUIPro.Web/ErrLog.txt
+++ b/SGGL/FineUIPro.Web/ErrLog.txt
@@ -17,3 +17,72 @@ IP地址:::1
出错时间:09/29/2021 15:32:37
+
+错误信息开始=====>
+错误类型:ProtocolViolationException
+错误信息:无法发送具有此谓词类型的内容正文。
+错误堆栈:
+ 在 System.Net.HttpWebRequest.CheckProtocol(Boolean onRequestStream)
+ 在 System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
+ 在 System.Net.HttpWebRequest.GetRequestStream()
+ 在 BLL.APIGetHttpService.OutsideHttp(String url, String method, String contenttype, Hashtable header, String data) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\API\APIGetHttpService.cs:行号 105
+ 在 FineUIPro.Web.ProjectData.Installation.btnMenuDown_Click(Object sender, EventArgs e) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\FineUIPro.Web\ProjectData\Installation.aspx.cs:行号 251
+ 在 FineUIPro.MenuButton.OnClick(EventArgs e)
+ 在 (MenuButton , EventArgs )
+ 在 FineUIPro.MenuButton.RaisePostBackEvent(String eventArgument)
+ 在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
+ 在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+ 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+出错时间:10/19/2021 16:10:16
+出错文件:http://localhost:8118/ProjectData/Installation.aspx
+IP地址:::1
+操作人员:JT
+
+出错时间:10/19/2021 16:10:16
+
+
+错误信息开始=====>
+错误类型:ProtocolViolationException
+错误信息:无法发送具有此谓词类型的内容正文。
+错误堆栈:
+ 在 System.Net.HttpWebRequest.CheckProtocol(Boolean onRequestStream)
+ 在 System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
+ 在 System.Net.HttpWebRequest.GetRequestStream()
+ 在 BLL.APIGetHttpService.OutsideHttp(String url, String method, String contenttype, Hashtable header, String data) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\API\APIGetHttpService.cs:行号 105
+ 在 FineUIPro.Web.ProjectData.Installation.btnMenuDown_Click(Object sender, EventArgs e) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\FineUIPro.Web\ProjectData\Installation.aspx.cs:行号 251
+ 在 FineUIPro.MenuButton.OnClick(EventArgs e)
+ 在 (MenuButton , EventArgs )
+ 在 FineUIPro.MenuButton.RaisePostBackEvent(String eventArgument)
+ 在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
+ 在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+ 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+出错时间:10/19/2021 16:10:56
+出错文件:http://localhost:8118/ProjectData/Installation.aspx
+IP地址:::1
+操作人员:JT
+
+出错时间:10/19/2021 16:10:56
+
+
+错误信息开始=====>
+错误类型:ProtocolViolationException
+错误信息:无法发送具有此谓词类型的内容正文。
+错误堆栈:
+ 在 System.Net.HttpWebRequest.CheckProtocol(Boolean onRequestStream)
+ 在 System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
+ 在 System.Net.HttpWebRequest.GetRequestStream()
+ 在 BLL.APIGetHttpService.OutsideHttp(String url, String method, String contenttype, Hashtable header, String data) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\API\APIGetHttpService.cs:行号 105
+ 在 FineUIPro.Web.ProjectData.Installation.btnMenuDown_Click(Object sender, EventArgs e) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\FineUIPro.Web\ProjectData\Installation.aspx.cs:行号 251
+ 在 FineUIPro.MenuButton.OnClick(EventArgs e)
+ 在 (MenuButton , EventArgs )
+ 在 FineUIPro.MenuButton.RaisePostBackEvent(String eventArgument)
+ 在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
+ 在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+ 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+出错时间:10/19/2021 16:11:45
+出错文件:http://localhost:8118/ProjectData/Installation.aspx
+IP地址:::1
+操作人员:JT
+
+出错时间:10/19/2021 16:11:45
+
diff --git a/SGGL/FineUIPro.Web/Global.asax.cs b/SGGL/FineUIPro.Web/Global.asax.cs
index f3a3d41c..3bc99df7 100644
--- a/SGGL/FineUIPro.Web/Global.asax.cs
+++ b/SGGL/FineUIPro.Web/Global.asax.cs
@@ -20,13 +20,14 @@
try
{
Funs.RootPath = Server.MapPath("~/");
-
+
// 日志文件所在目录
ErrLogInfo.DefaultErrLogFullPath = Server.MapPath("~/ErrLog.txt");
Funs.ConnString = ConfigurationManager.AppSettings["ConnectionString"];
Funs.SystemName = ConfigurationManager.AppSettings["SystemName"];
Funs.SGGLUrl = ConfigurationManager.AppSettings["SGGLUrl"];
Funs.RealNameApiUrl = ConfigurationManager.AppSettings["RealNameApiUrl"];
+ Funs.ControlApiUrl = ConfigurationManager.AppSettings["ControlApiUrl"];
}
catch (Exception ex)
{
@@ -38,7 +39,7 @@
try
{
string address = ConfigurationManager.AppSettings["endpoint"];
- Funs.SystemVersion = ConfigurationManager.AppSettings["SystemVersion"];
+ Funs.SystemVersion = ConfigurationManager.AppSettings["SystemVersion"];
}
catch (Exception ex)
{
@@ -49,7 +50,7 @@
{
BLL.RealNameMonitorService.StartInOutMonitor();
if (ConfigurationManager.AppSettings["EnableRealName"] == "True")
- {
+ {
BLL.RealNameMonitorService.StartMonitor();
}
}
@@ -59,7 +60,7 @@
}
////通用定时器
try
- {
+ {
BLL.MonitorService.StartMonitor();
BLL.MonitorService.StartMonitorEve();
BLL.MonitorService.StartPersonQuarterCheck();
@@ -80,7 +81,7 @@
}
protected void Application_BeginRequest(object sender, EventArgs e)
- {
+ {
}
protected void Application_AuthenticateRequest(object sender, EventArgs e)
@@ -140,7 +141,7 @@
{
if (errLog != null)
{
- db.Sys_ErrLogInfo.InsertOnSubmit(newErr);
+ db.Sys_ErrLogInfo.InsertOnSubmit(newErr);
db.SubmitChanges();
}
diff --git a/SGGL/FineUIPro.Web/ProjectData/Installation.aspx b/SGGL/FineUIPro.Web/ProjectData/Installation.aspx
index 980b2fe4..17d3aec0 100644
--- a/SGGL/FineUIPro.Web/ProjectData/Installation.aspx
+++ b/SGGL/FineUIPro.Web/ProjectData/Installation.aspx
@@ -97,6 +97,9 @@
Width="800px" Height="300px">