From 8ef4bc15029a5d1774d689bb4dee47527ad21d63 Mon Sep 17 00:00:00 2001 From: lichao <506754232@qq.com> Date: Mon, 2 Jan 2023 09:22:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B1=87=E6=80=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controls/FlowOperateControl.ascx.cs | 33 +++- SGGL/FineUIPro.Web/ErrLog.txt | 107 ++++++++++ SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 8 + .../ActionPlan/ActionPlanListEdit.aspx.cs | 3 +- .../HSSE/Manager/ManagerMonthC.aspx.cs | 2 +- .../HSSEMonthReportProjectSum.aspx | 92 +++++++++ .../HSSEMonthReportProjectSum.aspx.cs | 187 ++++++++++++++++++ ...HSSEMonthReportProjectSum.aspx.designer.cs | 107 ++++++++++ SGGL/FineUIPro.Web/common/Menu_CQMS.xml | 1 + SGGL/FineUIPro.Web/common/Menu_HJGL.xml | 1 + SGGL/FineUIPro.Web/common/Menu_HSSE.xml | 1 + SGGL/FineUIPro.Web/common/Menu_ZHGL.xml | 5 + SGGL/FineUIPro.Web/common/mainProject.aspx.cs | 18 +- 13 files changed, 554 insertions(+), 11 deletions(-) create mode 100644 SGGL/FineUIPro.Web/ZHGL/ManagementReport/HSSEMonthReportProjectSum.aspx create mode 100644 SGGL/FineUIPro.Web/ZHGL/ManagementReport/HSSEMonthReportProjectSum.aspx.cs create mode 100644 SGGL/FineUIPro.Web/ZHGL/ManagementReport/HSSEMonthReportProjectSum.aspx.designer.cs diff --git a/SGGL/FineUIPro.Web/Controls/FlowOperateControl.ascx.cs b/SGGL/FineUIPro.Web/Controls/FlowOperateControl.ascx.cs index 6b6988f7..ef832e62 100644 --- a/SGGL/FineUIPro.Web/Controls/FlowOperateControl.ascx.cs +++ b/SGGL/FineUIPro.Web/Controls/FlowOperateControl.ascx.cs @@ -116,6 +116,9 @@ namespace FineUIPro.Web.Controls } #endregion + + public List drpPersonUser; + #region 加载页面 /// /// 加载页面 @@ -129,7 +132,18 @@ namespace FineUIPro.Web.Controls this.getDataId = this.DataId; this.getMenuId = this.MenuId; this.geProjectId = this.ProjectId; - BLL.UserService.InitFlowOperateControlUserDropDownList(this.drpPerson, this.ProjectId,this.UnitId, true); + if (drpPersonUser != null) + { + this.drpPerson.DataValueField = "UserId"; + this.drpPerson.DataTextField = "UserName"; + this.drpPerson.DataSource = drpPersonUser; + this.drpPerson.DataBind(); + Funs.FineUIPleaseSelect(this.drpPerson); + } + else + { + BLL.UserService.InitFlowOperateControlUserDropDownList(this.drpPerson, this.ProjectId, this.UnitId, true); + } this.GroupPanel1.TitleToolTip += BLL.MenuFlowOperateService.GetFlowOperateName(this.getMenuId); this.txtAuditFlowName.Text = "审核/审批"; var flowOperate = Funs.DB.Sys_FlowOperate.FirstOrDefault(x => x.DataId == this.getDataId && x.State == BLL.Const.State_2 && x.IsClosed == true); @@ -161,7 +175,19 @@ namespace FineUIPro.Web.Controls this.rblFlowOperate.Enabled = false; this.txtAuditFlowName.Text = nextMenuFlowOperate.AuditFlowName; this.drpPerson.Items.Clear(); - UserService.InitUserProjectIdRoleIdDropDownList(this.drpPerson, this.ProjectId, nextMenuFlowOperate.RoleId, true); + if (drpPersonUser != null) + { + this.drpPerson.DataValueField = "UserId"; + this.drpPerson.DataTextField = "UserName"; + this.drpPerson.DataSource = drpPersonUser; + this.drpPerson.DataBind(); + Funs.FineUIPleaseSelect(this.drpPerson); + } + else + { + UserService.InitUserProjectIdRoleIdDropDownList(this.drpPerson, this.ProjectId, nextMenuFlowOperate.RoleId, true); + } + if (nextMenuFlowOperate.IsFlowEnd == true) { this.rblFlowOperate.SelectedValue = Const.State_2; @@ -466,5 +492,8 @@ namespace FineUIPro.Web.Controls } } #endregion + + + } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ErrLog.txt b/SGGL/FineUIPro.Web/ErrLog.txt index 4b46a576..2b6db7c2 100644 --- a/SGGL/FineUIPro.Web/ErrLog.txt +++ b/SGGL/FineUIPro.Web/ErrLog.txt @@ -1049,3 +1049,110 @@ IP地址:::1 出错时间:12/22/2022 16:44:19 + +错误信息开始=====> +错误类型:SqlException +错误信息:执行超时已过期。完成操作之前已超时或服务器未响应。 +错误堆栈: + 在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) + 在 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) + 在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) + 在 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) + 在 System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() + 在 System.Data.SqlClient.SqlDataReader.get_MetaData() + 在 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) + 在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) + 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) + 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) + 在 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) + 在 System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) + 在 System.Data.Common.DbCommand.ExecuteReader() + 在 System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult) + 在 System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries) + 在 System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) + 在 System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute[S](Expression expression) + 在 System.Linq.Queryable.Count[TSource](IQueryable`1 source) + 在 BLL.GetDataService.CorrectingPersonInOutNumber(String projectId) 位置 D:\project\vs\gitee\sggl_cd\SGGL\BLL\OpenService\GetDataService.cs:行号 139 + 在 BLL.MonitorService.DoSynchData() 位置 D:\project\vs\gitee\sggl_cd\SGGL\BLL\OpenService\MonitorService.cs:行号 2180 + 在 BLL.MonitorService.ColligateFormConfirmProcessEve(Object sender, ElapsedEventArgs e) 位置 D:\project\vs\gitee\sggl_cd\SGGL\BLL\OpenService\MonitorService.cs:行号 112 +----错误类型:Win32Exception +----错误信息: +----等待的操作过时。 +----错误堆栈: + 出错时间:12/29/2022 11:07:35 +出错时间:12/29/2022 11:07:36 + + +错误信息开始=====> +错误类型:SqlException +错误信息:“=”附近有语法错误。 +错误堆栈: + 在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) + 在 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) + 在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) + 在 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) + 在 System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() + 在 System.Data.SqlClient.SqlDataReader.get_MetaData() + 在 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) + 在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) + 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) + 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) + 在 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) + 在 System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) + 在 System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) + 在 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) + 在 System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) + 在 System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) + 在 BLL.SQLHelper.GetDataTableRunText(String strSql, SqlParameter[] parameters) 位置 D:\project\vs\gitee\sggl_cd\SGGL\BLL\SQLHelper.cs:行号 311 + 在 FineUIPro.Web.ZHGL.ManagementReport.HSSEMonthReportProjectSum.BindGrid() 位置 D:\project\vs\gitee\sggl_cd\SGGL\FineUIPro.Web\ZHGL\ManagementReport\HSSEMonthReportProjectSum.aspx.cs:行号 95 + 在 FineUIPro.Web.ZHGL.ManagementReport.HSSEMonthReportProjectSum.tvControlItem_NodeCommand(Object sender, TreeCommandEventArgs e) 位置 D:\project\vs\gitee\sggl_cd\SGGL\FineUIPro.Web\ZHGL\ManagementReport\HSSEMonthReportProjectSum.aspx.cs:行号 67 + 在 FineUIPro.Tree.OnNodeCommand(TreeCommandEventArgs e) + 在 (Tree , TreeCommandEventArgs ) + 在 FineUIPro.Tree.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) +出错时间:01/02/2023 08:31:04 +出错文件:http://localhost:8119/ZHGL/ManagementReport/HSSEMonthReportProjectSum.aspx +IP地址:::1 +操作人员:JT + +出错时间:01/02/2023 08:31:05 + + +错误信息开始=====> +错误类型:SqlException +错误信息:“=”附近有语法错误。 +错误堆栈: + 在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) + 在 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) + 在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) + 在 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) + 在 System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() + 在 System.Data.SqlClient.SqlDataReader.get_MetaData() + 在 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) + 在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) + 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) + 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) + 在 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) + 在 System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) + 在 System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) + 在 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) + 在 System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) + 在 System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) + 在 BLL.SQLHelper.GetDataTableRunText(String strSql, SqlParameter[] parameters) 位置 D:\project\vs\gitee\sggl_cd\SGGL\BLL\SQLHelper.cs:行号 311 + 在 FineUIPro.Web.ZHGL.ManagementReport.HSSEMonthReportProjectSum.BindGrid() 位置 D:\project\vs\gitee\sggl_cd\SGGL\FineUIPro.Web\ZHGL\ManagementReport\HSSEMonthReportProjectSum.aspx.cs:行号 95 + 在 FineUIPro.Web.ZHGL.ManagementReport.HSSEMonthReportProjectSum.tvControlItem_NodeCommand(Object sender, TreeCommandEventArgs e) 位置 D:\project\vs\gitee\sggl_cd\SGGL\FineUIPro.Web\ZHGL\ManagementReport\HSSEMonthReportProjectSum.aspx.cs:行号 67 + 在 FineUIPro.Tree.OnNodeCommand(TreeCommandEventArgs e) + 在 (Tree , TreeCommandEventArgs ) + 在 FineUIPro.Tree.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) +出错时间:01/02/2023 08:31:38 +出错文件:http://localhost:8119/ZHGL/ManagementReport/HSSEMonthReportProjectSum.aspx +IP地址:::1 +操作人员:JT + +出错时间:01/02/2023 08:31:38 + diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 932a2500..9df47d68 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1873,6 +1873,7 @@ + @@ -15839,6 +15840,13 @@ CheckSpecial.aspx + + HSSEMonthReportProjectSum.aspx + ASPXCodeBehind + + + HSSEMonthReportProjectSum.aspx + HSSEMonthReport.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/HSSE/ActionPlan/ActionPlanListEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/ActionPlan/ActionPlanListEdit.aspx.cs index 7ed11589..9f107ab8 100644 --- a/SGGL/FineUIPro.Web/HSSE/ActionPlan/ActionPlanListEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/ActionPlan/ActionPlanListEdit.aspx.cs @@ -1,7 +1,7 @@ using BLL; using System; using System.Web; - +using System.Linq; namespace FineUIPro.Web.HSSE.ActionPlan { public partial class ActionPlanListEdit : PageBase @@ -100,6 +100,7 @@ namespace FineUIPro.Web.HSSE.ActionPlan this.ctlAuditFlow.DataId = this.ActionPlanListId; this.ctlAuditFlow.ProjectId = this.ProjectId; this.ctlAuditFlow.UnitId = this.CurrUser.UnitId; + this.ctlAuditFlow.drpPersonUser=Funs.DB.Sys_User.Where(x => x.UnitId == Const.UnitId_CD).ToList(); } } #endregion diff --git a/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonthC.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonthC.aspx.cs index dc28538b..42e324c2 100644 --- a/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonthC.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonthC.aspx.cs @@ -104,7 +104,7 @@ namespace FineUIPro.Web.HSSE.Manager RenderField month = Grid1.FindColumn(monthC) as RenderField; e.CellCssClasses[month.ColumnIndex] = "f-grid-cell-uneditable"; } - else + // else { string monthC = "Month" + i.ToString(); RenderField month = Grid1.FindColumn(monthC) as RenderField; diff --git a/SGGL/FineUIPro.Web/ZHGL/ManagementReport/HSSEMonthReportProjectSum.aspx b/SGGL/FineUIPro.Web/ZHGL/ManagementReport/HSSEMonthReportProjectSum.aspx new file mode 100644 index 00000000..3fee1b7d --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/ManagementReport/HSSEMonthReportProjectSum.aspx @@ -0,0 +1,92 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HSSEMonthReportProjectSum.aspx.cs" Inherits="FineUIPro.Web.ZHGL.ManagementReport.HSSEMonthReportProjectSum" %> + + + + + + HSE月报告 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/ManagementReport/HSSEMonthReportProjectSum.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/ManagementReport/HSSEMonthReportProjectSum.aspx.cs new file mode 100644 index 00000000..c16d00a8 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/ManagementReport/HSSEMonthReportProjectSum.aspx.cs @@ -0,0 +1,187 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using BLL; +using AspNet = System.Web.UI.WebControls; + +namespace FineUIPro.Web.ZHGL.ManagementReport +{ + public partial class HSSEMonthReportProjectSum : PageBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + ////权限按钮方法 + this.GetButtonPower(); + + // 绑定表格 + //BindGrid(); + InitTreeMenu(); + } + } + + private void InitTreeMenu() + { + this.tvControlItem.Nodes.Clear(); + TreeNode rootNode = new TreeNode(); + rootNode.Text = "年份"; + rootNode.NodeID = "0"; + rootNode.Expanded = true; + this.tvControlItem.Nodes.Add(rootNode); + var years=(from x in Funs.DB.HSSE_MonthReport select x.Years).Distinct(); + foreach (var year in years) + { + TreeNode tnYear = new TreeNode();//年节点 + tnYear.Text = year.ToString(); + tnYear.NodeID = year.ToString(); + tnYear.EnableClickEvent = true; + rootNode.Nodes.Add(tnYear); + + //var project = (from x in Funs.DB.HSSE_MonthReport + // join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId + // where x.Years == year + // select new { x.ProjectId, y.ProjectName }).Distinct(); + //if (project.Count() > 0) + //{ + // foreach (var pro in project) + // { + // TreeNode tnProject = new TreeNode();//年节点 + // tnProject.Text = SubStr(pro.ProjectName); + // tnProject.NodeID = pro.ProjectId+"$"+year; + // tnProject.EnableClickEvent = true; + // tnProject.ToolTip = pro.ProjectName; + // tnYear.Nodes.Add(tnProject); + + // } + //} + } + + } + + protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) + { + BindGrid(); + } + + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = @"SELECT NEWID() MonthReportItemId,ReportItem,Unit,AVG (Sort) Sort ,SUM (Month1) Month1,SUM (Month2) Month2,SUM (Month3) Month3,SUM (Month4)Month4,SUM (Month5)Month5,SUM (Month6)Month6,SUM (Month7)Month7,SUM (Month8)Month8,SUM (Month9)Month9,SUM (Month10)Month10,SUM (Month11)Month11,SUM (Month12)Month12,SUM (YearTotal)YearTotal,SUM(ProjectTotal)ProjectTotal + FROM dbo.HSSE_MonthReportItem a left join HSSE_MonthReport b on a.MonthReportId = b.MonthReportId + --WHERE MonthReportId=@MonthReportId + where b.Years = @Year and ( @ProjectId = '' or b.ProjectId = @ProjectId) + group by ReportItem,Unit + ORDER BY Sort"; + List listStr = new List(); + if (tvControlItem.SelectedNodeID.Contains("$")) + { + listStr.Add(new SqlParameter("@ProjectId", tvControlItem.SelectedNodeID.Split('$')[0])); + listStr.Add(new SqlParameter("@Year", tvControlItem.SelectedNodeID.Split('$')[1])); + } + else + { + listStr.Add(new SqlParameter("@ProjectId", "")); + listStr.Add(new SqlParameter("@Year", tvControlItem.SelectedNodeID)); + } + + + SqlParameter[] parameter = listStr.ToArray(); + DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter); + // 2.获取当前分页数据 + //var table = this.GetPagedDataTable(Grid1, tb1); + + Grid1.DataSource = dt; + Grid1.DataBind(); + + } + + private string SubStr(string str) + { + string reStr = string.Empty; + if (!string.IsNullOrEmpty(str) && str.Length > 16) + { + reStr = str.Substring(0, 16) + ".."; + } + return reStr; + } + + #region 导出按钮 + /// 导出按钮 + ///
+ /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + string filename = Funs.GetNewFileName(); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("管理月报B" + filename, System.Text.Encoding.UTF8) + ".xls"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + this.Grid1.PageSize = 500; + this.BindGrid(); + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + + /// + /// 导出方法 + /// + /// + /// + private string GetGridTableHtml(Grid grid) + { + StringBuilder sb = new StringBuilder(); + sb.Append(""); + sb.Append(""); + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + sb.AppendFormat("", column.HeaderText); + } + sb.Append(""); + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID == "tfNumber") + { + html = (row.FindControl("lblNumber") as AspNet.Label).Text; + } + sb.AppendFormat("", html); + } + + sb.Append(""); + } + + sb.Append("
{0}
{0}
"); + + return sb.ToString(); + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + + } + #endregion + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/ManagementReport/HSSEMonthReportProjectSum.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/ManagementReport/HSSEMonthReportProjectSum.aspx.designer.cs new file mode 100644 index 00000000..18f5a054 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/ManagementReport/HSSEMonthReportProjectSum.aspx.designer.cs @@ -0,0 +1,107 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.ManagementReport +{ + + + public partial class HSSEMonthReportProjectSum + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + } +} diff --git a/SGGL/FineUIPro.Web/common/Menu_CQMS.xml b/SGGL/FineUIPro.Web/common/Menu_CQMS.xml index dfbe4b7e..7bbb16d7 100644 --- a/SGGL/FineUIPro.Web/common/Menu_CQMS.xml +++ b/SGGL/FineUIPro.Web/common/Menu_CQMS.xml @@ -24,6 +24,7 @@ + diff --git a/SGGL/FineUIPro.Web/common/Menu_HJGL.xml b/SGGL/FineUIPro.Web/common/Menu_HJGL.xml index c27ff081..93657571 100644 --- a/SGGL/FineUIPro.Web/common/Menu_HJGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_HJGL.xml @@ -64,6 +64,7 @@ + diff --git a/SGGL/FineUIPro.Web/common/Menu_HSSE.xml b/SGGL/FineUIPro.Web/common/Menu_HSSE.xml index a80fbf0f..811887a3 100644 --- a/SGGL/FineUIPro.Web/common/Menu_HSSE.xml +++ b/SGGL/FineUIPro.Web/common/Menu_HSSE.xml @@ -137,5 +137,6 @@ + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml index 3a29569c..50c6ae1f 100644 --- a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml @@ -20,6 +20,7 @@ + @@ -57,4 +58,8 @@ + + + + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/common/mainProject.aspx.cs b/SGGL/FineUIPro.Web/common/mainProject.aspx.cs index 1817b3d3..b0207483 100644 --- a/SGGL/FineUIPro.Web/common/mainProject.aspx.cs +++ b/SGGL/FineUIPro.Web/common/mainProject.aspx.cs @@ -68,14 +68,18 @@ namespace FineUIPro.Web.common private void getPersonWorkTime() { this.divSafeWorkTime.InnerHtml = "0000000000"; - var getMax = Funs.DB.SeDin_MonthReport.Where(x => x.ProjectId == this.ProjectId).OrderByDescending(x=>x.ReporMonth).FirstOrDefault(); - if (getMax != null) + var ProjectTotal = (from x in Funs.DB.HSSE_MonthReportItem + join y in Funs.DB.HSSE_MonthReport on x.MonthReportId equals y.MonthReportId + where y.ProjectId == this.ProjectId && "安全生产人工时数" == x.ReportItem + select x.ProjectTotal).Sum(); + + if (ProjectTotal.HasValue) { - var getItem = Funs.DB.SeDin_MonthReport2.FirstOrDefault(x => x.MonthReportId == getMax.MonthReportId); - if (getItem != null && getItem.ProjectWorkTime.HasValue) - { - this.divSafeWorkTime.InnerHtml = getItem.ProjectWorkTime.Value.ToString("0000000000"); - } + this.divSafeWorkTime.InnerHtml = ProjectTotal.Value.ToString("0000000000"); ; + } + else + { + this.divSafeWorkTime.InnerHtml = "0000000000"; } ///整改单