1019-003-gaofei

This commit is contained in:
gaofei 2021-10-19 17:50:34 +08:00
parent fbe44ac308
commit b6e254bfca
8 changed files with 195 additions and 8 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@
/SGGLPackFile/PackFile/bin /SGGLPackFile/PackFile/bin
/SGGLPackFile /SGGLPackFile
/SGGL/FineUIPro.Web/File/Excel/Temp

View File

@ -145,5 +145,73 @@ namespace BLL
} }
} }
} }
/// <summary>
/// 不做catch处理需要在外部做
/// </summary>
/// <param name="url"></param>
/// <param name="method">默认GET空则补充为GET</param>
/// <param name="contenttype">默认json空则补充为json</param>
/// <param name="header">请求头部</param>
/// <param name="data">请求body内容</param>
/// <returns></returns>
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();
}
}
}
} }
} }

View File

@ -103,6 +103,14 @@ namespace BLL
set; set;
} }
/// <summary> /// <summary>
/// 费控软件地址
/// </summary>
public static string ControlApiUrl
{
get;
set;
}
/// <summary>
/// 软件版本 /// 软件版本
/// </summary> /// </summary>
public static string SystemVersion public static string SystemVersion

View File

@ -17,3 +17,72 @@ IP地址:::1
出错时间:09/29/2021 15:32:37 出错时间: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

View File

@ -27,6 +27,7 @@
Funs.SystemName = ConfigurationManager.AppSettings["SystemName"]; Funs.SystemName = ConfigurationManager.AppSettings["SystemName"];
Funs.SGGLUrl = ConfigurationManager.AppSettings["SGGLUrl"]; Funs.SGGLUrl = ConfigurationManager.AppSettings["SGGLUrl"];
Funs.RealNameApiUrl = ConfigurationManager.AppSettings["RealNameApiUrl"]; Funs.RealNameApiUrl = ConfigurationManager.AppSettings["RealNameApiUrl"];
Funs.ControlApiUrl = ConfigurationManager.AppSettings["ControlApiUrl"];
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -140,7 +141,7 @@
{ {
if (errLog != null) if (errLog != null)
{ {
db.Sys_ErrLogInfo.InsertOnSubmit(newErr); db.Sys_ErrLogInfo.InsertOnSubmit(newErr);
db.SubmitChanges(); db.SubmitChanges();
} }

View File

@ -97,6 +97,9 @@
Width="800px" Height="300px"> Width="800px" Height="300px">
</f:Window> </f:Window>
<f:Menu ID="Menu1" runat="server"> <f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuDown" OnClick="btnMenuDown_Click" EnablePostBack="true" runat="server" Icon="ArrowDown" Hidden="true"
Text="抽取">
</f:MenuButton>
<f:MenuButton ID="btnMenuAdd" OnClick="btnMenuAdd_Click" EnablePostBack="true" runat="server" Icon="Add" Hidden="true" <f:MenuButton ID="btnMenuAdd" OnClick="btnMenuAdd_Click" EnablePostBack="true" runat="server" Icon="Add" Hidden="true"
Text="增加"> Text="增加">
</f:MenuButton> </f:MenuButton>

View File

@ -8,6 +8,7 @@ using System.Web.UI;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
using BLL; using BLL;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
namespace FineUIPro.Web.ProjectData namespace FineUIPro.Web.ProjectData
{ {
@ -46,6 +47,7 @@ namespace FineUIPro.Web.ProjectData
{ {
if (buttonList.Contains(BLL.Const.BtnAdd)) if (buttonList.Contains(BLL.Const.BtnAdd))
{ {
this.btnMenuDown.Hidden = false;
this.btnMenuAdd.Hidden = false; this.btnMenuAdd.Hidden = false;
} }
if (buttonList.Contains(BLL.Const.BtnModify)) if (buttonList.Contains(BLL.Const.BtnModify))
@ -227,7 +229,33 @@ namespace FineUIPro.Web.ProjectData
} }
#endregion #endregion
#region #region
/// <summary>
/// 抽取
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuDown_Click(object sender, EventArgs e)
{
if (this.trProjects.SelectedNode != null)
{
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectInstallationMenuId, BLL.Const.BtnAdd))
{
string url = Funs.RealNameApiUrl + "/Projects/GetConstructionWbsList";
string contenttype = "application/json;charset=utf-8";
var returndata = BLL.APIGetHttpService.ControlHttp(Funs.ControlApiUrl + "/Projects/GetConstructionWbsList?ProjId=" + 2370, "GET", contenttype, null, null);
}
else
{
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
}
}
else
{
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
}
}
/// <summary> /// <summary>
/// 右键修改事件 /// 右键修改事件
/// </summary> /// </summary>
@ -348,7 +376,7 @@ namespace FineUIPro.Web.ProjectData
private void DeleteBaseData(string installationId) private void DeleteBaseData(string installationId)
{ {
Model.Project_Installation installation=BLL.Project_InstallationService.GetInstallationByInstallationId(installationId); Model.Project_Installation installation = BLL.Project_InstallationService.GetInstallationByInstallationId(installationId);
if (installation.IsEnd == false) if (installation.IsEnd == false)
{ {
BLL.Project_InstallationService.DeleteInstallation(installationId); BLL.Project_InstallationService.DeleteInstallation(installationId);

View File

@ -174,6 +174,15 @@ namespace FineUIPro.Web.ProjectData {
/// </remarks> /// </remarks>
protected global::FineUIPro.Menu Menu1; protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuDown 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuDown;
/// <summary> /// <summary>
/// btnMenuAdd 控件。 /// btnMenuAdd 控件。
/// </summary> /// </summary>