From bfb4cdc4288315e36357ad6eb3c278c491188d35 Mon Sep 17 00:00:00 2001 From: 10191 <506754232@qq.com> Date: Tue, 24 Oct 2023 10:48:05 +0800 Subject: [PATCH] 20231024 --- .../版本日志/SGGLDB_CD_V2023-10-13-001.sql | 1 + SGGL/FineUIPro.Web/CQMS/Check/CheckList.aspx | 21 +- .../CQMS/Check/CheckList.aspx.cs | 47 +- .../CQMS/Check/CheckList.aspx.designer.cs | 559 +++++++++-------- .../HSSE/Manager/ManagerMonthC.aspx.cs | 576 +++++++++--------- .../QualityAudit/EquipmentPersonQuality.aspx | 6 + .../EquipmentPersonQuality.aspx.cs | 17 +- .../EquipmentPersonQuality.aspx.designer.cs | 363 +++++------ .../HSSE/SitePerson/PersonList.aspx.cs | 128 +++- SGGL/FineUIPro.Web/common/Menu_CQMS.xml | 6 +- SGGL/FineUIPro.Web/common/Menu_PZHGL.xml | 6 +- SGGL/FineUIPro.Web/common/mainProject.aspx.cs | 52 +- 12 files changed, 961 insertions(+), 821 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_CD_V2023-10-13-001.sql diff --git a/DataBase/版本日志/SGGLDB_CD_V2023-10-13-001.sql b/DataBase/版本日志/SGGLDB_CD_V2023-10-13-001.sql new file mode 100644 index 00000000..316edc54 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_CD_V2023-10-13-001.sql @@ -0,0 +1 @@ +UPDATE TOP(1) [dbo].[Sys_Menu] SET [MenuId]=N'68A54450-557C-4C33-9121-797C15AF1047', [MenuName]=N'', [Icon]=NULL, [Url]=N'PZHGL/StartWorkReport.aspx', [SortIndex]='10', [SuperMenu]=N'0', [MenuType]=N'Menu_CQMS', [IsOffice]='0', [IsEnd]='1', [IsUsed]='1' WHERE ([MenuId]=N'68A54450-557C-4C33-9121-797C15AF1047'); diff --git a/SGGL/FineUIPro.Web/CQMS/Check/CheckList.aspx b/SGGL/FineUIPro.Web/CQMS/Check/CheckList.aspx index e27b8c84..7c51f910 100644 --- a/SGGL/FineUIPro.Web/CQMS/Check/CheckList.aspx +++ b/SGGL/FineUIPro.Web/CQMS/Check/CheckList.aspx @@ -73,22 +73,26 @@ - - + - + - + - + @@ -96,16 +100,15 @@ - - - - + 0) + { + string subQuery = ""; + if (dpHandelStatus.SelectedValueArray.Contains("1")) + { + subQuery += " ((chec.state='5' or chec.state='6')) OR"; + } + if (dpHandelStatus.SelectedValueArray.Contains("2")) + { + subQuery += " (chec.state='7') OR"; + } + if (dpHandelStatus.SelectedValueArray.Contains("3")) + { + subQuery += " (DATEADD(day,1,chec.LimitDate)< GETDATE() and chec.state<>5 and chec.state<>6 and chec.state<>7) OR"; + } + if (dpHandelStatus.SelectedValueArray.Contains("4")) + { + subQuery += " (DATEADD(day,1,chec.LimitDate)> GETDATE() and chec.state<>5 and chec.state<>6 and chec.state<>7) OR"; + } + + subQuery = subQuery.TrimEnd('R').TrimEnd('O'); + if (!string.IsNullOrEmpty(subQuery)) + { + strSql += " and " + subQuery; + } + } SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); return tb; diff --git a/SGGL/FineUIPro.Web/CQMS/Check/CheckList.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Check/CheckList.aspx.designer.cs index 452bcab4..32f53f2e 100644 --- a/SGGL/FineUIPro.Web/CQMS/Check/CheckList.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/CQMS/Check/CheckList.aspx.designer.cs @@ -11,322 +11,313 @@ namespace FineUIPro.Web.CQMS.Check { - public partial class CheckList - { + public partial class CheckList + { - /// - /// form1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::System.Web.UI.HtmlControls.HtmlForm form1; + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; - /// - /// PageManager1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.PageManager PageManager1; + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; - /// - /// Panel1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Panel Panel1; + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; - /// - /// Grid1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Grid Grid1; + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; - /// - /// Toolbar1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Toolbar Toolbar1; + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; - /// - /// drpSponsorUnit 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DropDownList drpSponsorUnit; + /// + /// drpSponsorUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpSponsorUnit; - /// - /// drpUnitWork 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DropDownList drpUnitWork; + /// + /// drpUnitWork 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnitWork; - /// - /// drpCNProfessional 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DropDownList drpCNProfessional; + /// + /// drpCNProfessional 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpCNProfessional; - /// - /// drpQuestionType 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DropDownList drpQuestionType; + /// + /// drpQuestionType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpQuestionType; - /// - /// Toolbar2 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Toolbar Toolbar2; + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; - /// - /// dpHandelStatus 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DropDownList dpHandelStatus; + /// + /// dpHandelStatus 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList dpHandelStatus; - /// - /// txtStartTime 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DatePicker txtStartTime; + /// + /// txtStartTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtStartTime; - /// - /// txtEndTime 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DatePicker txtEndTime; + /// + /// txtEndTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtEndTime; - /// - /// btnQuery 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnQuery; + /// + /// btnRset 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnRset; - /// - /// btnRset 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnRset; + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; - /// - /// btnNew 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnNew; + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; - /// - /// btnOut 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnOut; + /// + /// labNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label labNumber; - /// - /// labNumber 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::System.Web.UI.WebControls.Label labNumber; + /// + /// lbImageUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lbImageUrl; - /// - /// lbImageUrl 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::System.Web.UI.WebControls.Label lbImageUrl; + /// + /// lbImageUrl2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lbImageUrl2; - /// - /// lbImageUrl2 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::System.Web.UI.WebControls.Label lbImageUrl2; + /// + /// labState 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label labState; - /// - /// labState 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::System.Web.UI.WebControls.Label labState; + /// + /// lbAuditMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lbAuditMan; - /// - /// lbAuditMan 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::System.Web.UI.WebControls.Label lbAuditMan; + /// + /// lbState2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lbState2; - /// - /// lbState2 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::System.Web.UI.WebControls.Label lbState2; + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; - /// - /// ToolbarSeparator1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; - /// - /// ToolbarText1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.ToolbarText ToolbarText1; + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; - /// - /// ddlPageSize 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DropDownList ddlPageSize; + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; - /// - /// Window1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Window Window1; + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; - /// - /// Window2 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Window Window2; + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; - /// - /// Menu1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Menu Menu1; + /// + /// btnMenuModify 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuModify; - /// - /// btnMenuModify 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.MenuButton btnMenuModify; + /// + /// btnMenuView 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuView; - /// - /// btnMenuView 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.MenuButton btnMenuView; + /// + /// MenuButton1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton MenuButton1; - /// - /// MenuButton1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.MenuButton MenuButton1; + /// + /// MenuButton2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton MenuButton2; - /// - /// MenuButton2 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.MenuButton MenuButton2; + /// + /// MenuButton3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton MenuButton3; - /// - /// MenuButton3 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.MenuButton MenuButton3; - - /// - /// btnMenuDel 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.MenuButton btnMenuDel; - } + /// + /// btnMenuDel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDel; + } } diff --git a/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonthC.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonthC.aspx.cs index 43a1f5cb..8f699481 100644 --- a/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonthC.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/Manager/ManagerMonthC.aspx.cs @@ -96,313 +96,319 @@ namespace FineUIPro.Web.HSSE.Manager protected void Grid1_RowDataBound(object sender, GridRowEventArgs e) { - int cm = GetCurMonth(); + int cm = GetCurMonth(); for (int i = 1; i <= 12; i++) { - if (i != cm) - { - //string monthC = "Month" + i.ToString(); - //RenderField month = Grid1.FindColumn(monthC) as RenderField; - //e.CellCssClasses[month.ColumnIndex] = "f-grid-cell-uneditable"; - } - else - { - string monthC = "Month" + i.ToString(); - RenderField month = Grid1.FindColumn(monthC) as RenderField; - RenderField yearTotal = Grid1.FindColumn("YearTotal") as RenderField; - RenderField projectTotal = Grid1.FindColumn("ProjectTotal") as RenderField; - RenderField sumProjectTotal = Grid1.FindColumn("SumProjectTotal") as RenderField; - if (e.RowIndex == 0) // 成达公司现场人数 - { - var person = from x in Funs.DB.SitePerson_Person - join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId - where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode == "CHENGDA" - select x; - if (e.Values[month.ColumnIndex].ToString() == "") - { - e.Values[month.ColumnIndex] = person.Count(); - } - } - if (e.RowIndex == 1) // 成达公司HSE管理人数 - { - var person = from x in Funs.DB.SitePerson_Person - join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId - join z in Funs.DB.Base_WorkPost on x.WorkPostId equals z.WorkPostId - where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode == "CHENGDA" - && z.WorkPostName.Contains("安全") - select x; - if (e.Values[month.ColumnIndex].ToString() == "") - { - e.Values[month.ColumnIndex] = person.Count(); - } - } - if (e.RowIndex == 2) // 分包商现场人数 - { - var person = from x in Funs.DB.SitePerson_Person - join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId - where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode != "CHENGDA" - select x; - if (e.Values[month.ColumnIndex].ToString() == "") - { - e.Values[month.ColumnIndex] = person.Count(); - } - } - if (e.RowIndex == 3) // 分包商HSE管理人数 - { - var person = from x in Funs.DB.SitePerson_Person - join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId - join z in Funs.DB.Base_WorkPost on x.WorkPostId equals z.WorkPostId - where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode != "CHENGDA" - && z.WorkPostName.Contains("安全") - select x; - if (e.Values[month.ColumnIndex].ToString() == "") - { - e.Values[month.ColumnIndex] = person.Count(); - } - } + if (i != cm) + { + DateTime temp = DateTime.Parse(DateTime.Now.Year + "-" + i + "-10"); + if (temp.AddMonths(1) < DateTime.Now) + { + string monthC = "Month" + i.ToString(); + RenderField month = Grid1.FindColumn(monthC) as RenderField; + e.CellCssClasses[month.ColumnIndex] = "f-grid-cell-uneditable"; + } - if (e.RowIndex == 4 || e.RowIndex == 5) // 人工时数,安全生产人工时数 - { - DateTime? sDate = Convert.ToDateTime(tvControlItem.SelectedNode.Text + "-" + i.ToString()); - var dayReports = BLL.SitePerson_MonthReportService.getMonthReports(this.CurrUser.LoginProjectId, sDate); - if (e.Values[month.ColumnIndex].ToString() == "" && dayReports.Count() > 0) - { - e.Values[month.ColumnIndex] = dayReports.First().DayWorkTime; - } - else if (e.Values[month.ColumnIndex].ToString() == "") - { - e.Values[month.ColumnIndex] = 0; - } - } + } + else + { + string monthC = "Month" + i.ToString(); + RenderField month = Grid1.FindColumn(monthC) as RenderField; + RenderField yearTotal = Grid1.FindColumn("YearTotal") as RenderField; + RenderField projectTotal = Grid1.FindColumn("ProjectTotal") as RenderField; + RenderField sumProjectTotal = Grid1.FindColumn("SumProjectTotal") as RenderField; - DateTime startDate = Convert.ToDateTime(tvControlItem.SelectedNode.Text + "-" + i.ToString() + "-01"); - if (e.RowIndex == 6) // HSE记录事故数量 - { - var accident = from x in Funs.DB.Accident_AccidentPersonRecord - where x.ProjectId == this.CurrUser.LoginProjectId - && x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1) - select x; - if (e.Values[month.ColumnIndex].ToString() == "") - { - e.Values[month.ColumnIndex] = accident.Count(); - } - } + if (e.RowIndex == 0) // 成达公司现场人数 + { + var person = from x in Funs.DB.SitePerson_Person + join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId + where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode == "CHENGDA" + select x; + if (e.Values[month.ColumnIndex].ToString() == "") + { + e.Values[month.ColumnIndex] = person.Count(); + } + } + if (e.RowIndex == 1) // 成达公司HSE管理人数 + { + var person = from x in Funs.DB.SitePerson_Person + join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId + join z in Funs.DB.Base_WorkPost on x.WorkPostId equals z.WorkPostId + where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode == "CHENGDA" + && z.WorkPostName.Contains("安全") + select x; + if (e.Values[month.ColumnIndex].ToString() == "") + { + e.Values[month.ColumnIndex] = person.Count(); + } + } + if (e.RowIndex == 2) // 分包商现场人数 + { + var person = from x in Funs.DB.SitePerson_Person + join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId + where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode != "CHENGDA" + select x; + if (e.Values[month.ColumnIndex].ToString() == "") + { + e.Values[month.ColumnIndex] = person.Count(); + } + } + if (e.RowIndex == 3) // 分包商HSE管理人数 + { + var person = from x in Funs.DB.SitePerson_Person + join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId + join z in Funs.DB.Base_WorkPost on x.WorkPostId equals z.WorkPostId + where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode != "CHENGDA" + && z.WorkPostName.Contains("安全") + select x; + if (e.Values[month.ColumnIndex].ToString() == "") + { + e.Values[month.ColumnIndex] = person.Count(); + } + } - if (e.RowIndex == 7) // 死亡 - { - var accident = from x in Funs.DB.Accident_AccidentPersonRecord - where x.ProjectId == this.CurrUser.LoginProjectId - && x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1) - && x.Injury == "1" - select x; - if (e.Values[month.ColumnIndex].ToString() == "") - { - e.Values[month.ColumnIndex] = accident.Count(); - } - } + if (e.RowIndex == 4 || e.RowIndex == 5) // 人工时数,安全生产人工时数 + { + DateTime? sDate = Convert.ToDateTime(tvControlItem.SelectedNode.Text + "-" + i.ToString()); + var dayReports = BLL.SitePerson_MonthReportService.getMonthReports(this.CurrUser.LoginProjectId, sDate); + if (e.Values[month.ColumnIndex].ToString() == "" && dayReports.Count() > 0) + { + e.Values[month.ColumnIndex] = dayReports.First().DayWorkTime; + } + else if (e.Values[month.ColumnIndex].ToString() == "") + { + e.Values[month.ColumnIndex] = 0; + } + } - if (e.RowIndex == 8) // 重伤 - { - var accident = from x in Funs.DB.Accident_AccidentPersonRecord - where x.ProjectId == this.CurrUser.LoginProjectId - && x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1) - && x.Injury == "2" - select x; - if (e.Values[month.ColumnIndex].ToString() == "") - { - e.Values[month.ColumnIndex] = accident.Count(); - } - } + DateTime startDate = Convert.ToDateTime(tvControlItem.SelectedNode.Text + "-" + i.ToString() + "-01"); + if (e.RowIndex == 6) // HSE记录事故数量 + { + var accident = from x in Funs.DB.Accident_AccidentPersonRecord + where x.ProjectId == this.CurrUser.LoginProjectId + && x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1) + select x; + if (e.Values[month.ColumnIndex].ToString() == "") + { + e.Values[month.ColumnIndex] = accident.Count(); + } + } - if (e.RowIndex == 9) // 轻伤 - { - var accident = from x in Funs.DB.Accident_AccidentPersonRecord - where x.ProjectId == this.CurrUser.LoginProjectId - && x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1) - && x.Injury == "3" - select x; - if (e.Values[month.ColumnIndex].ToString() == "") - { - e.Values[month.ColumnIndex] = accident.Count(); - } - } + if (e.RowIndex == 7) // 死亡 + { + var accident = from x in Funs.DB.Accident_AccidentPersonRecord + where x.ProjectId == this.CurrUser.LoginProjectId + && x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1) + && x.Injury == "1" + select x; + if (e.Values[month.ColumnIndex].ToString() == "") + { + e.Values[month.ColumnIndex] = accident.Count(); + } + } - if (e.RowIndex == 10) // 未遂事故 - { - var accident = from x in Funs.DB.Accident_AccidentHandle - where x.ProjectId == this.CurrUser.LoginProjectId - && x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1) - select x; - if (e.Values[month.ColumnIndex].ToString() == "") - { - e.Values[month.ColumnIndex] = accident.Count(); - } - } + if (e.RowIndex == 8) // 重伤 + { + var accident = from x in Funs.DB.Accident_AccidentPersonRecord + where x.ProjectId == this.CurrUser.LoginProjectId + && x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1) + && x.Injury == "2" + select x; + if (e.Values[month.ColumnIndex].ToString() == "") + { + e.Values[month.ColumnIndex] = accident.Count(); + } + } - if (e.RowIndex == 11) // 现场环境事故 - { - if (e.Values[month.ColumnIndex].ToString() == "") - { - e.Values[month.ColumnIndex] = "0"; - } - } - if (e.RowIndex == 12) // 现场发生设备材料盗窃案件 - { - if (e.Values[month.ColumnIndex].ToString() == "") - { - e.Values[month.ColumnIndex] = "0"; - } - } + if (e.RowIndex == 9) // 轻伤 + { + var accident = from x in Funs.DB.Accident_AccidentPersonRecord + where x.ProjectId == this.CurrUser.LoginProjectId + && x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1) + && x.Injury == "3" + select x; + if (e.Values[month.ColumnIndex].ToString() == "") + { + e.Values[month.ColumnIndex] = accident.Count(); + } + } - if (e.RowIndex == 13) // HSE周会 - { - var weekMeeting = from x in Funs.DB.Meeting_WeekMeeting - where x.ProjectId == this.CurrUser.LoginProjectId - && x.WeekMeetingDate >= startDate && x.WeekMeetingDate < startDate.AddMonths(1) - select x; - if (e.Values[month.ColumnIndex].ToString() == "") - { - e.Values[month.ColumnIndex] = weekMeeting.Count(); - } - } + if (e.RowIndex == 10) // 未遂事故 + { + var accident = from x in Funs.DB.Accident_AccidentHandle + where x.ProjectId == this.CurrUser.LoginProjectId + && x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1) + select x; + if (e.Values[month.ColumnIndex].ToString() == "") + { + e.Values[month.ColumnIndex] = accident.Count(); + } + } - if (e.RowIndex == 14) // HSE委员会会议 - { - var weekMeeting = from x in Funs.DB.Meeting_AttendMeeting - where x.ProjectId == this.CurrUser.LoginProjectId - && x.AttendMeetingDate >= startDate && x.AttendMeetingDate < startDate.AddMonths(1) - select x; - if (e.Values[month.ColumnIndex].ToString() == "") - { - e.Values[month.ColumnIndex] = weekMeeting.Count(); - } - } + if (e.RowIndex == 11) // 现场环境事故 + { + if (e.Values[month.ColumnIndex].ToString() == "") + { + e.Values[month.ColumnIndex] = "0"; + } + } + if (e.RowIndex == 12) // 现场发生设备材料盗窃案件 + { + if (e.Values[month.ColumnIndex].ToString() == "") + { + e.Values[month.ColumnIndex] = "0"; + } + } - if (e.RowIndex == 15) // 施工现场HSE联检 - { - if (e.Values[month.ColumnIndex].ToString() == "") - { - e.Values[month.ColumnIndex] = "0"; - } - } + if (e.RowIndex == 13) // HSE周会 + { + var weekMeeting = from x in Funs.DB.Meeting_WeekMeeting + where x.ProjectId == this.CurrUser.LoginProjectId + && x.WeekMeetingDate >= startDate && x.WeekMeetingDate < startDate.AddMonths(1) + select x; + if (e.Values[month.ColumnIndex].ToString() == "") + { + e.Values[month.ColumnIndex] = weekMeeting.Count(); + } + } - if (e.RowIndex == 16) // 发布HSE整改通知书 - { - var check = from x in Funs.DB.Check_RectifyNotices - where x.ProjectId == this.CurrUser.LoginProjectId - && x.CheckedDate >= startDate && x.CheckedDate < startDate.AddMonths(1) - select x; - if (e.Values[month.ColumnIndex].ToString() == "") - { - e.Values[month.ColumnIndex] = check.Count(); - } - } + if (e.RowIndex == 14) // HSE委员会会议 + { + var weekMeeting = from x in Funs.DB.Meeting_AttendMeeting + where x.ProjectId == this.CurrUser.LoginProjectId + && x.AttendMeetingDate >= startDate && x.AttendMeetingDate < startDate.AddMonths(1) + select x; + if (e.Values[month.ColumnIndex].ToString() == "") + { + e.Values[month.ColumnIndex] = weekMeeting.Count(); + } + } - if (e.RowIndex == 17) // 关闭HSE整改通知书 - { - var check = from x in Funs.DB.Check_RectifyNotices - where x.ProjectId == this.CurrUser.LoginProjectId - && x.CompleteDate >= startDate && x.CompleteDate < startDate.AddMonths(1) - select x; - if (e.Values[month.ColumnIndex].ToString() == "") - { - e.Values[month.ColumnIndex] = check.Count(); - } - } + if (e.RowIndex == 15) // 施工现场HSE联检 + { + if (e.Values[month.ColumnIndex].ToString() == "") + { + e.Values[month.ColumnIndex] = "0"; + } + } - if (e.RowIndex == 18) // 发布HSE处罚书 - { - var check = from x in Funs.DB.Check_PunishNotice - where x.ProjectId == this.CurrUser.LoginProjectId - && x.PunishNoticeDate >= startDate && x.PunishNoticeDate < startDate.AddMonths(1) - select x; - if (e.Values[month.ColumnIndex].ToString() == "") - { - e.Values[month.ColumnIndex] = check.Count(); - } - } + if (e.RowIndex == 16) // 发布HSE整改通知书 + { + var check = from x in Funs.DB.Check_RectifyNotices + where x.ProjectId == this.CurrUser.LoginProjectId + && x.CheckedDate >= startDate && x.CheckedDate < startDate.AddMonths(1) + select x; + if (e.Values[month.ColumnIndex].ToString() == "") + { + e.Values[month.ColumnIndex] = check.Count(); + } + } - if (e.RowIndex == 19) // 发布应急预案 - { - var em = from x in Funs.DB.Emergency_EmergencyList - where x.ProjectId == this.CurrUser.LoginProjectId - && x.CompileDate >= startDate && x.CompileDate < startDate.AddMonths(1) - select x; - if (e.Values[month.ColumnIndex].ToString() == "") - { - e.Values[month.ColumnIndex] = em.Count(); - } - } + if (e.RowIndex == 17) // 关闭HSE整改通知书 + { + var check = from x in Funs.DB.Check_RectifyNotices + where x.ProjectId == this.CurrUser.LoginProjectId + && x.CompleteDate >= startDate && x.CompleteDate < startDate.AddMonths(1) + select x; + if (e.Values[month.ColumnIndex].ToString() == "") + { + e.Values[month.ColumnIndex] = check.Count(); + } + } - if (e.RowIndex == 20) // 人员培训 - { - var edu = from x in Funs.DB.EduTrain_TrainRecord - where x.ProjectId == this.CurrUser.LoginProjectId - && x.TrainStartDate >= startDate && x.TrainStartDate < startDate.AddMonths(1) - select x; - if (e.Values[month.ColumnIndex].ToString() == "") - { - if (edu.Count() > 0) - { - e.Values[month.ColumnIndex] = edu.Sum(x => x.TrainPersonNum); - } - else - { - e.Values[month.ColumnIndex] = 0; - } - } - } + if (e.RowIndex == 18) // 发布HSE处罚书 + { + var check = from x in Funs.DB.Check_PunishNotice + where x.ProjectId == this.CurrUser.LoginProjectId + && x.PunishNoticeDate >= startDate && x.PunishNoticeDate < startDate.AddMonths(1) + select x; + if (e.Values[month.ColumnIndex].ToString() == "") + { + e.Values[month.ColumnIndex] = check.Count(); + } + } - if (e.RowIndex == 21) // 设备HSE检验 - { - var equ = from x in Funs.DB.License_EquipmentSafetyList - where x.ProjectId == this.CurrUser.LoginProjectId - && x.CompileDate >= startDate && x.CompileDate < startDate.AddMonths(1) - select x; - if (e.Values[month.ColumnIndex].ToString() == "") - { - if (equ.Count() > 0) - { - e.Values[month.ColumnIndex] = equ.Sum(x => x.EquipmentSafetyListCount); - } - else - { - e.Values[month.ColumnIndex] = 0; - } - } - } + if (e.RowIndex == 19) // 发布应急预案 + { + var em = from x in Funs.DB.Emergency_EmergencyList + where x.ProjectId == this.CurrUser.LoginProjectId + && x.CompileDate >= startDate && x.CompileDate < startDate.AddMonths(1) + select x; + if (e.Values[month.ColumnIndex].ToString() == "") + { + e.Values[month.ColumnIndex] = em.Count(); + } + } - RenderField month1 = Grid1.FindColumn("Month1") as RenderField; - RenderField month2 = Grid1.FindColumn("Month2") as RenderField; - RenderField month3 = Grid1.FindColumn("Month3") as RenderField; - RenderField month4 = Grid1.FindColumn("Month4") as RenderField; - RenderField month5 = Grid1.FindColumn("Month5") as RenderField; - RenderField month6 = Grid1.FindColumn("Month6") as RenderField; - RenderField month7 = Grid1.FindColumn("Month7") as RenderField; - RenderField month8 = Grid1.FindColumn("Month8") as RenderField; - RenderField month9 = Grid1.FindColumn("Month9") as RenderField; - RenderField month10 = Grid1.FindColumn("Month10") as RenderField; - RenderField month11 = Grid1.FindColumn("Month11") as RenderField; - RenderField month12 = Grid1.FindColumn("Month12") as RenderField; - // 年度总计 - e.Values[yearTotal.ColumnIndex] = Convert.ToInt32(e.Values[month1.ColumnIndex].ToString() != "" ? e.Values[month1.ColumnIndex] : 0) - + Convert.ToInt32(e.Values[month2.ColumnIndex].ToString() != "" ? e.Values[month2.ColumnIndex] : 0) - + Convert.ToInt32(e.Values[month3.ColumnIndex].ToString() != "" ? e.Values[month3.ColumnIndex] : 0) - + Convert.ToInt32(e.Values[month4.ColumnIndex].ToString() != "" ? e.Values[month4.ColumnIndex] : 0) - + Convert.ToInt32(e.Values[month5.ColumnIndex].ToString() != "" ? e.Values[month5.ColumnIndex] : 0) - + Convert.ToInt32(e.Values[month6.ColumnIndex].ToString() != "" ? e.Values[month6.ColumnIndex] : 0) - + Convert.ToInt32(e.Values[month7.ColumnIndex].ToString() != "" ? e.Values[month7.ColumnIndex] : 0) - + Convert.ToInt32(e.Values[month8.ColumnIndex].ToString() != "" ? e.Values[month8.ColumnIndex] : 0) - + Convert.ToInt32(e.Values[month9.ColumnIndex].ToString() != "" ? e.Values[month9.ColumnIndex] : 0) - + Convert.ToInt32(e.Values[month10.ColumnIndex].ToString() != "" ? e.Values[month10.ColumnIndex] : 0) - + Convert.ToInt32(e.Values[month11.ColumnIndex].ToString() != "" ? e.Values[month11.ColumnIndex] : 0) - + Convert.ToInt32(e.Values[month12.ColumnIndex].ToString() != "" ? e.Values[month12.ColumnIndex] : 0); - // 项目总计 - e.Values[projectTotal.ColumnIndex] = Convert.ToInt32(e.Values[yearTotal.ColumnIndex]) + Convert.ToInt32(e.Values[sumProjectTotal.ColumnIndex]); + if (e.RowIndex == 20) // 人员培训 + { + var edu = from x in Funs.DB.EduTrain_TrainRecord + where x.ProjectId == this.CurrUser.LoginProjectId + && x.TrainStartDate >= startDate && x.TrainStartDate < startDate.AddMonths(1) + select x; + if (e.Values[month.ColumnIndex].ToString() == "") + { + if (edu.Count() > 0) + { + e.Values[month.ColumnIndex] = edu.Sum(x => x.TrainPersonNum); + } + else + { + e.Values[month.ColumnIndex] = 0; + } + } + } - } + if (e.RowIndex == 21) // 设备HSE检验 + { + var equ = from x in Funs.DB.License_EquipmentSafetyList + where x.ProjectId == this.CurrUser.LoginProjectId + && x.CompileDate >= startDate && x.CompileDate < startDate.AddMonths(1) + select x; + if (e.Values[month.ColumnIndex].ToString() == "") + { + if (equ.Count() > 0) + { + e.Values[month.ColumnIndex] = equ.Sum(x => x.EquipmentSafetyListCount); + } + else + { + e.Values[month.ColumnIndex] = 0; + } + } + } + + RenderField month1 = Grid1.FindColumn("Month1") as RenderField; + RenderField month2 = Grid1.FindColumn("Month2") as RenderField; + RenderField month3 = Grid1.FindColumn("Month3") as RenderField; + RenderField month4 = Grid1.FindColumn("Month4") as RenderField; + RenderField month5 = Grid1.FindColumn("Month5") as RenderField; + RenderField month6 = Grid1.FindColumn("Month6") as RenderField; + RenderField month7 = Grid1.FindColumn("Month7") as RenderField; + RenderField month8 = Grid1.FindColumn("Month8") as RenderField; + RenderField month9 = Grid1.FindColumn("Month9") as RenderField; + RenderField month10 = Grid1.FindColumn("Month10") as RenderField; + RenderField month11 = Grid1.FindColumn("Month11") as RenderField; + RenderField month12 = Grid1.FindColumn("Month12") as RenderField; + // 年度总计 + e.Values[yearTotal.ColumnIndex] = Convert.ToInt32(e.Values[month1.ColumnIndex].ToString() != "" ? e.Values[month1.ColumnIndex] : 0) + + Convert.ToInt32(e.Values[month2.ColumnIndex].ToString() != "" ? e.Values[month2.ColumnIndex] : 0) + + Convert.ToInt32(e.Values[month3.ColumnIndex].ToString() != "" ? e.Values[month3.ColumnIndex] : 0) + + Convert.ToInt32(e.Values[month4.ColumnIndex].ToString() != "" ? e.Values[month4.ColumnIndex] : 0) + + Convert.ToInt32(e.Values[month5.ColumnIndex].ToString() != "" ? e.Values[month5.ColumnIndex] : 0) + + Convert.ToInt32(e.Values[month6.ColumnIndex].ToString() != "" ? e.Values[month6.ColumnIndex] : 0) + + Convert.ToInt32(e.Values[month7.ColumnIndex].ToString() != "" ? e.Values[month7.ColumnIndex] : 0) + + Convert.ToInt32(e.Values[month8.ColumnIndex].ToString() != "" ? e.Values[month8.ColumnIndex] : 0) + + Convert.ToInt32(e.Values[month9.ColumnIndex].ToString() != "" ? e.Values[month9.ColumnIndex] : 0) + + Convert.ToInt32(e.Values[month10.ColumnIndex].ToString() != "" ? e.Values[month10.ColumnIndex] : 0) + + Convert.ToInt32(e.Values[month11.ColumnIndex].ToString() != "" ? e.Values[month11.ColumnIndex] : 0) + + Convert.ToInt32(e.Values[month12.ColumnIndex].ToString() != "" ? e.Values[month12.ColumnIndex] : 0); + // 项目总计 + e.Values[projectTotal.ColumnIndex] = Convert.ToInt32(e.Values[yearTotal.ColumnIndex]) + Convert.ToInt32(e.Values[sumProjectTotal.ColumnIndex]); + + } } } diff --git a/SGGL/FineUIPro.Web/HSSE/QualityAudit/EquipmentPersonQuality.aspx b/SGGL/FineUIPro.Web/HSSE/QualityAudit/EquipmentPersonQuality.aspx index e9eefd68..6913c98a 100644 --- a/SGGL/FineUIPro.Web/HSSE/QualityAudit/EquipmentPersonQuality.aspx +++ b/SGGL/FineUIPro.Web/HSSE/QualityAudit/EquipmentPersonQuality.aspx @@ -32,6 +32,12 @@ + + + + + //------------------------------------------------------------------------------ -namespace FineUIPro.Web.HSSE.QualityAudit { - - - public partial class EquipmentPersonQuality { - - /// - /// form1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - - /// - /// PageManager1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.PageManager PageManager1; - - /// - /// Panel1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Panel Panel1; - - /// - /// Grid1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Grid Grid1; - - /// - /// Toolbar2 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Toolbar Toolbar2; - - /// - /// txtCardNo 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox txtCardNo; - - /// - /// drpUnitId 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DropDownList drpUnitId; - - /// - /// txtPersonName 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox txtPersonName; - - /// - /// txtWorkPostName 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox txtWorkPostName; - - /// - /// ToolbarFill1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.ToolbarFill ToolbarFill1; - - /// - /// btnOut 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnOut; - - /// - /// lblNumber 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::System.Web.UI.WebControls.Label lblNumber; - - /// - /// ToolbarSeparator1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; - - /// - /// ToolbarText1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.ToolbarText ToolbarText1; - - /// - /// ddlPageSize 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DropDownList ddlPageSize; - - /// - /// Window1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Window Window1; - - /// - /// WindowAtt 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Window WindowAtt; - - /// - /// Menu1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Menu Menu1; - - /// - /// btnMenuEdit 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.MenuButton btnMenuEdit; - } +namespace FineUIPro.Web.HSSE.QualityAudit +{ + + + public partial class EquipmentPersonQuality + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// txtCardNo 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCardNo; + + /// + /// drpUnitId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnitId; + + /// + /// txtPersonName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPersonName; + + /// + /// txtWorkPostName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWorkPostName; + + /// + /// drpIsUsedName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpIsUsedName; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + } } diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.cs index b9b475e7..e5068195 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.cs @@ -1,6 +1,7 @@ using BLL; using FineUIPro.Web.DataShow; using Model; +using NPOI.SS.Formula.Functions; using System; using System.Collections.Generic; using System.Data; @@ -82,26 +83,61 @@ namespace FineUIPro.Web.HSSE.SitePerson var project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId); if (project != null) { - var personLists = BLL.PersonService.GetPersonList(project.ProjectId); + string strSql1 = @"select UnitId,count(1) num from SitePerson_Person + where ProjectId=@ProjectId + group by UnitId"; + List listStr1 = new List + { + new SqlParameter("@ProjectId", this.ProjectId) + }; + SqlParameter[] parameter1 = listStr1.ToArray(); + DataTable tb1 = SQLHelper.GetDataTableRunText(strSql1, parameter1); + string strSql2 = @"select UnitId,count(1) num from SitePerson_Person + where ProjectId=@ProjectId and IsUsed =1 and InTime getdate()) + group by UnitId"; + List listStr2 = new List + { + new SqlParameter("@ProjectId", this.ProjectId) + }; + SqlParameter[] parameter2 = listStr2.ToArray(); + DataTable tb2 = SQLHelper.GetDataTableRunText(strSql2, parameter2); + int total = 0; + int totalIn = 0; + Dictionary dicTotal = new Dictionary(); + Dictionary dicTotalIn = new Dictionary(); + + if (tb1 != null) + { + foreach (DataRow row in tb1.Rows) + { + total += int.Parse(row["num"].ToString()); + dicTotal.Add(row["UnitId"].ToString(), int.Parse(row["num"].ToString())); + } + } + if (tb2 != null) + { + foreach (DataRow row in tb2.Rows) + { + totalIn += int.Parse(row["num"].ToString()); + dicTotalIn.Add(row["UnitId"].ToString(), int.Parse(row["num"].ToString())); + + } + } TreeNode rootNode = new TreeNode(); rootNode = new TreeNode { Text = project.ProjectName, NodeID = project.ProjectId }; - if (personLists.Count() > 0) - { - var personIn = personLists.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.IsUsed == 1 - && x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime > DateTime.Now)).ToList(); - rootNode.ToolTip = "当前项目人员总数:" + personLists.Count() + ";在场人员数:" + personIn.Count() + ";离场人员数:" + (personLists.Count() - personIn.Count()); - } - else - { - rootNode.ToolTip = "当前项目人员总数:0"; - } + + + + rootNode.ToolTip = "当前项目人员总数:" + total + ";在场人员数:" + totalIn + ";离场人员数:" + (total - totalIn); + + rootNode.Expanded = true; this.tvProjectAndUnit.Nodes.Add(rootNode); - GetUnitLists(rootNode.Nodes, this.ProjectId, personLists); + GetUnitLists(rootNode.Nodes, this.ProjectId, dicTotal, dicTotalIn); } } @@ -165,6 +201,66 @@ namespace FineUIPro.Web.HSSE.SitePerson } } } + private void GetUnitLists(TreeNodeCollection nodes, string parentId, Dictionary dicTotal, Dictionary dicTotalIn) + { + List unitLists = BLL.UnitService.GetUnitByProjectIdList(parentId); + if (unitLists.Count() > 0) + { + if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(parentId, this.CurrUser.UnitId)) + { + unitLists = unitLists.Where(x => x.UnitId == this.CurrUser.UnitId).ToList(); + } + + //添加其他单位/无单位人员 + Model.Base_Unit otherUnit = new Model.Base_Unit + { + UnitId = "0", + UnitName = "其他" + }; + unitLists.Add(otherUnit); + + TreeNode newNode = null; + foreach (var q in unitLists) + { + int total = 0; + int totalIn = 0; + if (q.UnitId != "0") + { + if (dicTotal.ContainsKey(q.UnitId)) + { + total = dicTotal[q.UnitId]; + } + if (dicTotalIn.ContainsKey(q.UnitId)) + { + totalIn = dicTotalIn[q.UnitId]; + } + } + else + { + if (dicTotal.ContainsKey("")) + { + total = dicTotal[""]; + } + if (dicTotalIn.ContainsKey("")) + { + totalIn = dicTotalIn[""]; + } + } + newNode = new TreeNode + { + Text = q.UnitName, + NodeID = q.UnitId + "|" + parentId, + ToolTip = q.UnitName + }; + + + newNode.ToolTip = q.UnitName + "人员总数:" + total + ";在场人员数:" + totalIn + ";离场人员数:" + (total - totalIn); + + newNode.EnableClickEvent = true; + nodes.Add(newNode); + } + } + } /// /// 绑定数据 @@ -197,10 +293,10 @@ namespace FineUIPro.Web.HSSE.SitePerson strSql += " AND UnitId =@UnitId "; listStr.Add(new SqlParameter("@UnitId", unitId)); } - //else - //{ - // strSql += " AND UnitId IS NULL"; - //} + else if( unitId == "0") + { + strSql += " AND UnitId IS NULL"; + } if (drpIsUsedName.SelectedValue == "待审核") { strSql += " AND IsUsed = @IsUsed"; diff --git a/SGGL/FineUIPro.Web/common/Menu_CQMS.xml b/SGGL/FineUIPro.Web/common/Menu_CQMS.xml index e22ab11b..16810fef 100644 --- a/SGGL/FineUIPro.Web/common/Menu_CQMS.xml +++ b/SGGL/FineUIPro.Web/common/Menu_CQMS.xml @@ -1,8 +1,8 @@  - - - + + + diff --git a/SGGL/FineUIPro.Web/common/Menu_PZHGL.xml b/SGGL/FineUIPro.Web/common/Menu_PZHGL.xml index 3239f01b..482b7832 100644 --- a/SGGL/FineUIPro.Web/common/Menu_PZHGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_PZHGL.xml @@ -1,8 +1,8 @@  - - - + + + diff --git a/SGGL/FineUIPro.Web/common/mainProject.aspx.cs b/SGGL/FineUIPro.Web/common/mainProject.aspx.cs index 27102321..95e508c0 100644 --- a/SGGL/FineUIPro.Web/common/mainProject.aspx.cs +++ b/SGGL/FineUIPro.Web/common/mainProject.aspx.cs @@ -70,30 +70,34 @@ namespace FineUIPro.Web.common private void getPersonWorkTime() { this.divSafeWorkTime.InnerHtml = "0000000000"; - //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.YearTotal).Sum(); - decimal sumMonthCount = 0; - var getMonts = Funs.DB.SeDin_MonthReport.Where(x => x.ProjectId == this.ProjectId).OrderBy(x => x.ReporMonth); - var getmax = getMonts.FirstOrDefault(); - if (getMonts.Count() > 0) - { - foreach (var item in getMonts) - { - decimal monthCount = 0; - var getItem = Funs.DB.SeDin_MonthReport2.FirstOrDefault(x => x.MonthReportId == item.MonthReportId); - if (getItem != null && getItem.MonthWorkTime.HasValue) - { - monthCount = getItem.MonthWorkTime ?? 0; - sumMonthCount += monthCount; - if (sumMonthCount < getItem.ProjectWorkTime) - { - sumMonthCount = getItem.ProjectWorkTime ?? 0; - } - } - } - } + 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.YearTotal).Sum(); + decimal sumMonthCount = 0; + if (ProjectTotal.HasValue) + { + sumMonthCount = ProjectTotal.Value; + } + //var getMonts = Funs.DB.SeDin_MonthReport.Where(x => x.ProjectId == this.ProjectId).OrderBy(x => x.ReporMonth); + //var getmax = getMonts.FirstOrDefault(); + //if (getMonts.Count() > 0) + //{ + // foreach (var item in getMonts) + // { + // decimal monthCount = 0; + // var getItem = Funs.DB.SeDin_MonthReport2.FirstOrDefault(x => x.MonthReportId == item.MonthReportId); + // if (getItem != null && getItem.MonthWorkTime.HasValue) + // { + // monthCount = getItem.MonthWorkTime ?? 0; + // sumMonthCount += monthCount; + // if (sumMonthCount < getItem.ProjectWorkTime) + // { + // sumMonthCount = getItem.ProjectWorkTime ?? 0; + // } + // } + // } + //} if (sumMonthCount>0) {