From 4bb579d6614950e819c1ed41b5a0ec166d84c45e Mon Sep 17 00:00:00 2001 From: xiaju <1784803958@qq.com> Date: Wed, 23 Sep 2026 17:55:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataBase/版本日志/SGGLDB_V2026-09-19-xiaj.sql | 11 + ...iaj(Sp_HazardFactorOccHealth_Statistics).sql | 39 +++ ...6-09-21-xiaj(Sp_HazardFactor_Statistics).sql | 35 +++ SGGL/BLL/Common/CommonService.cs | 46 +++- SGGL/BLL/Common/Funs.cs | 1 + SGGL/BLL/SysManage/UserService.cs | 12 +- SGGL/FineUIPro.Web/DataShow/HazardFactor.aspx | 175 +++++++++++++ .../DataShow/HazardFactor.aspx.cs | 234 ++++++++++++++++++ .../DataShow/HazardFactor.aspx.designer.cs | 179 ++++++++++++++ .../DataShow/HazardFactorOccHealth.aspx | 175 +++++++++++++ .../DataShow/HazardFactorOccHealth.aspx.cs | 234 ++++++++++++++++++ .../HazardFactorOccHealth.aspx.designer.cs | 179 ++++++++++++++ SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 16 ++ .../HSSE/SitePerson/PersonList.aspx.cs | 6 +- SGGL/FineUIPro.Web/Login.aspx.cs | 47 ++-- .../ProjectData/ProjectInformation.aspx.cs | 2 +- .../ProjectData/ProjectList.aspx.cs | 2 +- .../ProjectData/ProjectSet.aspx.cs | 2 +- .../HazardFactorOccHealthSummary.aspx | 7 +- .../HazardFactorOccHealthSummary.aspx.cs | 21 +- ...ardFactorOccHealthSummary.aspx.designer.cs | 4 +- .../HazardFactorSafetySummary.aspx | 7 +- .../HazardFactorSafetySummary.aspx.cs | 21 +- ...HazardFactorSafetySummary.aspx.designer.cs | 4 +- .../SafeEnvBudget/SafeEnvBudgetEdit.aspx.cs | 5 - SGGL/FineUIPro.Web/common/PageBase.cs | 155 ++++++------ SGGL/FineUIPro.Web/common/main.aspx | 165 ++++++------ SGGL/FineUIPro.Web/common/main.aspx.cs | 100 +++++++- SGGL/FineUIPro.Web/common/mainProject.aspx | 47 ++-- SGGL/FineUIPro.Web/common/mainProject.aspx.cs | 22 +- SGGL/FineUIPro.Web/index.aspx | 88 ++++++- SGGL/FineUIPro.Web/index.aspx.cs | 95 ++++++- SGGL/FineUIPro.Web/index.aspx.designer.cs | 13 +- SGGL/FineUIPro.Web/indexProject.aspx | 3 +- SGGL/FineUIPro.Web/indexProject.aspx.cs | 11 +- SGGL/FineUIPro.Web/res/homecss/index.css | 36 +-- SGGL/FineUIPro.Web/res/homecss/safe.css | 36 +-- SGGL/Model/Model.cs | 72 ++++-- SGGL/Model/ModelProc.cs | 25 +- 39 files changed, 2012 insertions(+), 320 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2026-09-19-xiaj.sql create mode 100644 DataBase/版本日志/SGGLDB_V2026-09-21-xiaj(Sp_HazardFactorOccHealth_Statistics).sql create mode 100644 DataBase/版本日志/SGGLDB_V2026-09-21-xiaj(Sp_HazardFactor_Statistics).sql create mode 100644 SGGL/FineUIPro.Web/DataShow/HazardFactor.aspx create mode 100644 SGGL/FineUIPro.Web/DataShow/HazardFactor.aspx.cs create mode 100644 SGGL/FineUIPro.Web/DataShow/HazardFactor.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/DataShow/HazardFactorOccHealth.aspx create mode 100644 SGGL/FineUIPro.Web/DataShow/HazardFactorOccHealth.aspx.cs create mode 100644 SGGL/FineUIPro.Web/DataShow/HazardFactorOccHealth.aspx.designer.cs diff --git a/DataBase/版本日志/SGGLDB_V2026-09-19-xiaj.sql b/DataBase/版本日志/SGGLDB_V2026-09-19-xiaj.sql new file mode 100644 index 00000000..1696f3e8 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2026-09-19-xiaj.sql @@ -0,0 +1,11 @@ +--Ա䣺˾ѡķֹ˾Id +IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Sys_User' AND COLUMN_NAME = 'LastUnitId') +BEGIN + --˾ѡUnitId + ALTER TABLE Sys_User ADD LastUnitId nvarchar(50); + + EXEC sp_addextendedproperty 'MS_Description', N'˾ѡUnitId','SCHEMA', N'dbo','TABLE', N'Sys_User','COLUMN', N'LastUnitId'; +END +GO + + diff --git a/DataBase/版本日志/SGGLDB_V2026-09-21-xiaj(Sp_HazardFactorOccHealth_Statistics).sql b/DataBase/版本日志/SGGLDB_V2026-09-21-xiaj(Sp_HazardFactorOccHealth_Statistics).sql new file mode 100644 index 00000000..2727b4f9 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2026-09-21-xiaj(Sp_HazardFactorOccHealth_Statistics).sql @@ -0,0 +1,39 @@ + +CREATE OR ALTER PROCEDURE [dbo].[Sp_HazardFactorOccHealth_Statistics] + @year NVARCHAR(20)=NULL, + @month NVARCHAR(20)=NULL, + @unitId NVARCHAR(200)=NULL, + @projectId NVARCHAR(200)=NULL +AS +BEGIN + SET NOCOUNT ON; + WITH CTE AS ( + SELECT + ROW_NUMBER() OVER ( + PARTITION BY tba.Year,tba.Month,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.Illegality, + tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity, + tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel, + tba.NetRiskAcceptabity,tba.AdditionalControlMeasures + ORDER BY CompileDate desc + ) as rn, + --tbb.ProjectName, + tba.BaseRiskLevel + FROM HazardFactor_OccHealth AS tba WITH(NOLOCK) + --LEFT JOIN Base_Project AS tbb WITH(NOLOCK) ON tbb.ProjectId = tba.ProjectId + WHERE 1=1 + AND tba.State = 1 + AND tba.Year = @year + AND tba.Month = @month + --λ@unitIdΪղУֵ˵λ + AND (@unitId IS NULL OR @unitId = '' OR tba.UnitId = @unitId) + --ĿΪղ + AND (@projectId IS NULL OR @projectId = '' OR tba.ProjectId = @projectId) + ) + SELECT BaseRiskLevel AS Title,COUNT(1) AS Num + FROM CTE + WHERE rn = 1 + GROUP BY BaseRiskLevel +END +GO + + diff --git a/DataBase/版本日志/SGGLDB_V2026-09-21-xiaj(Sp_HazardFactor_Statistics).sql b/DataBase/版本日志/SGGLDB_V2026-09-21-xiaj(Sp_HazardFactor_Statistics).sql new file mode 100644 index 00000000..15c3f047 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2026-09-21-xiaj(Sp_HazardFactor_Statistics).sql @@ -0,0 +1,35 @@ +CREATE OR ALTER PROCEDURE [dbo].[Sp_HazardFactor_Statistics] + @year NVARCHAR(20)=NULL, + @month NVARCHAR(20)=NULL, + @unitId NVARCHAR(200)=NULL, + @projectId NVARCHAR(200)=NULL +AS +BEGIN + SET NOCOUNT ON; + WITH CTE AS ( + SELECT + ROW_NUMBER() OVER ( + PARTITION BY tba.Year,tba.Month,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.Illegality, + tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity, + tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel, + tba.NetRiskAcceptabity,tba.AdditionalControlMeasures + ORDER BY CompileDate desc + ) as rn, + --tbb.ProjectName, + tba.BaseRiskLevel + FROM HazardFactor_Safety AS tba WITH(NOLOCK) + --LEFT JOIN Base_Project AS tbb WITH(NOLOCK) ON tbb.ProjectId = tba.ProjectId + WHERE 1=1 + AND tba.State = 1 + AND tba.Year = @year + AND tba.Month = @month + --λ@unitIdΪղУֵ˵λ + AND (@unitId IS NULL OR @unitId = '' OR tba.UnitId = @unitId) + --ĿΪղ + AND (@projectId IS NULL OR @projectId = '' OR tba.ProjectId = @projectId) + ) + SELECT BaseRiskLevel AS Title,COUNT(1) AS Num + FROM CTE + WHERE rn = 1 + GROUP BY BaseRiskLevel +END diff --git a/SGGL/BLL/Common/CommonService.cs b/SGGL/BLL/Common/CommonService.cs index 9d7189fc..4efc82af 100644 --- a/SGGL/BLL/Common/CommonService.cs +++ b/SGGL/BLL/Common/CommonService.cs @@ -137,8 +137,6 @@ namespace BLL { int result = 0; var user = UserService.GetUserByUserId(userId); - - if ((userId == Const.hfnbdId || userId == Const.sysglyId) || (!string.IsNullOrEmpty(user.UnitId) && user.UnitId == CommonService.GetThisUnitId()))//公司级别 { result = 0; @@ -154,6 +152,30 @@ namespace BLL return result; } + /// + /// 根据unitId获取当前的单位类型(0总公司,1分公司,2其他) + /// + /// + /// + public static int GetUnitTypeByUnitId(string unitId) + { + int result = 0; + //var unit = UnitService.GetUnitByUnitId(unitId); + if (!string.IsNullOrEmpty(unitId) && unitId == CommonService.GetThisUnitId())//公司级别 + { + result = 0; + } + else if (!string.IsNullOrEmpty(unitId) && UnitService.GetUnitByUnitId(unitId).IsBranch == true) //子公司级数据 + { + result = 1; + } + else //外来账户 + { + result = 2; + } + return result; + } + #region 根据登陆id菜单id判断是否有权限 /// /// 根据登陆id菜单id判断是否有权限 @@ -265,11 +287,12 @@ namespace BLL #region 用户Id判断 #region 根据用户ID判断是超管 + /// - /// 根据用户ID判断是超管 + /// 部分人员账号给超管权限控制 /// /// - public static bool IsSuperAdminManage(string userId) + public static bool IsSuperAdminManageAuth(string userId) { bool result = false; if (userId == Const.luofeiId || userId == Const.shizhiyangId || userId == Const.hfnbdId || userId == Const.sysglyId) @@ -278,6 +301,21 @@ namespace BLL } return result; } + + /// + /// 根据用户ID判断是超管 + /// + /// + public static bool IsSuperAdminManage(string userId) + { + bool result = false; + if (userId == Const.hfnbdId || userId == Const.sysglyId) + {//JT、管理员账号 + result = true; + } + return result; + } + #endregion #region 获取当前人是否具有按钮操作权限 diff --git a/SGGL/BLL/Common/Funs.cs b/SGGL/BLL/Common/Funs.cs index 5114d1fe..227afcf5 100644 --- a/SGGL/BLL/Common/Funs.cs +++ b/SGGL/BLL/Common/Funs.cs @@ -1267,6 +1267,7 @@ namespace BLL int weekOfYear = gc.GetWeekOfYear(dtWeek, System.Globalization.CalendarWeekRule.FirstDay, DayOfWeek.Monday); return weekOfYear; } + } } diff --git a/SGGL/BLL/SysManage/UserService.cs b/SGGL/BLL/SysManage/UserService.cs index b60c7115..335df22d 100644 --- a/SGGL/BLL/SysManage/UserService.cs +++ b/SGGL/BLL/SysManage/UserService.cs @@ -82,7 +82,7 @@ namespace BLL /// /// ûId /// ûϢ - public static void UpdateLastUserInfo(string userId, string LastMenuType, bool LastIsOffice, string LastProjectId) + public static void UpdateLastUserInfo(string userId, string LastMenuType, bool LastIsOffice, string LastProjectId, string LastUnitId) { using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString)) { @@ -92,7 +92,15 @@ namespace BLL uU.LastMenuType = LastMenuType; uU.LastIsOffice = LastIsOffice; uU.LastMenuType = LastMenuType; - uU.LastProjectId = LastProjectId; + if (!string.IsNullOrWhiteSpace(LastProjectId)) + { + uU.LastProjectId = LastProjectId; + uU.LoginProjectId = LastProjectId; + } + if (!string.IsNullOrWhiteSpace(LastUnitId)) + { + uU.LastUnitId = LastUnitId; + } db.SubmitChanges(); } } diff --git a/SGGL/FineUIPro.Web/DataShow/HazardFactor.aspx b/SGGL/FineUIPro.Web/DataShow/HazardFactor.aspx new file mode 100644 index 00000000..e03b9d2e --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShow/HazardFactor.aspx @@ -0,0 +1,175 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HazardFactor.aspx.cs" + Inherits="FineUIPro.Web.DataShow.HazardFactor" %> + + + + + + + + 安全危害因素 + + +
+ + + + + + + + + + + + + <%-- + --%> + + + + + <%-- + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%><%--单位项目名称--%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/DataShow/HazardFactor.aspx.cs b/SGGL/FineUIPro.Web/DataShow/HazardFactor.aspx.cs new file mode 100644 index 00000000..2919802a --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShow/HazardFactor.aspx.cs @@ -0,0 +1,234 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Text; + +namespace FineUIPro.Web.DataShow +{ + public partial class HazardFactor : PageBase + { + /// + /// 单位id + /// + public string UnitId + { + get + { + return (string)ViewState["UnitId"]; + } + set + { + ViewState["UnitId"] = value; + } + } + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, true); + BLL.ConstValue.InitConstValueDropDownList(this.drpMonth, ConstValue.Group_0009, true); + BLL.UnitService.InitBranchUnitDropDownList(this.drpUnit, true, true); + BLL.RiskLevelService.InitRiskLevelDropDownListByRiskLevelName(this.drpBaseRiskLevel, true); + BLL.RiskLevelService.InitRiskLevelDropDownListByRiskLevelName(this.drpNetRiskLevel, true); + this.UnitId = this.CurrUser.UnitId; + if (CommonService.IsSuperAdminManage(this.CurrUser.UserId) || (!string.IsNullOrWhiteSpace(this.UnitId) && this.UnitId == Const.UnitId_XJYJ)) + { + this.drpUnit.Hidden = false; + this.UnitId = this.CurrUser.LastUnitId; + } + if (!string.IsNullOrWhiteSpace(this.UnitId)) + { + this.drpUnit.SelectedValue = this.UnitId; + } + var dateYearMon = DateTime.Now.ToString("yyyy-M"); + this.drpYear.SelectedValue = dateYearMon.Split('-')[0]; + this.drpMonth.SelectedValue = dateYearMon.Split('-')[1]; + + Funs.DropDownPageSize(this.ddlPageSize); + ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + BindGrid(); + this.Panel1.Title = "安全危害因素"; + } + } + + /// + /// 绑定数据 + /// + private void BindGrid() + { + StringBuilder sb = new StringBuilder(); + List listStr = new List(); + + string dedupe = rbDedupe.SelectedValue; + + if (!string.IsNullOrWhiteSpace(dedupe)) + { + sb.Append("WITH CTE AS ( "); + if (dedupe == "0") + {//按月 + sb.Append("SELECT ROW_NUMBER() OVER (PARTITION BY tba.Year,tba.Month,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.AccidentType,tba.Illegality,tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity,tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel,tba.NetRiskAcceptabity,tba.AdditionalControlMeasures ORDER BY CompileDate desc) as rn,tba.* "); + } + else + {//按年 + sb.Append("SELECT ROW_NUMBER() OVER (PARTITION BY tba.Year,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.AccidentType,tba.Illegality,tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity,tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel,tba.NetRiskAcceptabity,tba.AdditionalControlMeasures ORDER BY CompileDate desc) as rn,tba.* "); + } + } + else + { + sb.Append("SELECT tba.* "); + } + sb.Append("FROM HazardFactor_Safety AS tba WITH(NOLOCK) "); + //sb.Append("LEFT JOIN Base_Project AS tbb WITH(NOLOCK) ON tbb.ProjectId = tba.ProjectId "); + sb.Append("WHERE 1=1 AND tba.State = 1 ");//取已提交数据 + + if (!string.IsNullOrWhiteSpace(this.CurrUser.UnitId) && this.CurrUser.UnitId != Const.UnitId_XJYJ) + {//分公司只能查看本单位的数据 + sb.Append("AND tba.UnitId = @UnitId "); + listStr.Add(new SqlParameter("@UnitId", this.CurrUser.UnitId)); + } + else + { + if (!string.IsNullOrWhiteSpace(this.drpUnit.SelectedValue) && this.drpUnit.SelectedValue != Const._Null && this.drpUnit.SelectedValue != Const.UnitId_XJYJ) + { + sb.Append("AND tba.UnitId = @UnitId "); + listStr.Add(new SqlParameter("@UnitId", this.drpUnit.SelectedValue)); + } + } + //if (!string.IsNullOrWhiteSpace(this.drpProject.SelectedValue) && this.drpProject.SelectedValue != Const._Null) + //{ + // sb.Append("AND tba.ProjectId = @ProjectId "); + // listStr.Add(new SqlParameter("@ProjectId", this.drpProject.SelectedValue)); + //} + if (!string.IsNullOrWhiteSpace(this.drpYear.SelectedValue) && this.drpYear.SelectedValue != Const._Null) + { + sb.Append("AND tba.Year = @Year "); + listStr.Add(new SqlParameter("@Year", this.drpYear.SelectedValue)); + } + if (!string.IsNullOrWhiteSpace(this.drpMonth.SelectedValue) && this.drpMonth.SelectedValue != Const._Null) + { + string month = this.drpMonth.SelectedValue; + sb.Append("AND tba.Month = @Month "); + listStr.Add(new SqlParameter("@Month", month.Length == 1 ? $"0{month}" : month)); + } + if (!string.IsNullOrWhiteSpace(this.drpBaseRiskLevel.SelectedValue) && this.drpBaseRiskLevel.SelectedValue != Const._Null) + { + sb.Append("AND tba.BaseRiskLevel = @BaseRiskLevel "); + listStr.Add(new SqlParameter("@BaseRiskLevel", this.drpBaseRiskLevel.SelectedValue)); + } + if (!string.IsNullOrWhiteSpace(this.drpNetRiskLevel.SelectedValue) && this.drpNetRiskLevel.SelectedValue != Const._Null) + { + sb.Append("AND tba.NetRiskLevel = @NetRiskLevel "); + listStr.Add(new SqlParameter("@NetRiskLevel", this.drpNetRiskLevel.SelectedValue)); + } + //if (!string.IsNullOrEmpty(this.rbState.SelectedValue)) + //{ + // sb.Append("AND tba.State = @State "); + // listStr.Add(new SqlParameter("@State", this.rbState.SelectedValue)); + //} + if (!string.IsNullOrEmpty(this.rbIllegality.SelectedValue)) + { + sb.Append("AND tba.Illegality = @Illegality "); + listStr.Add(new SqlParameter("@Illegality", this.rbIllegality.SelectedValue == "1" ? true : false)); + } + + if (!string.IsNullOrWhiteSpace(dedupe)) + { + sb.Append(") "); + sb.Append("SELECT * FROM CTE WHERE rn = 1; "); + } + + string sqlStr = sb.ToString(); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(sqlStr, parameter); + + Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + + Grid1.DataSource = table; + Grid1.DataBind(); + } + + + /// + /// 格式化数据 + /// + /// + /// + protected string ConvertDataState(object data) + { + string result = string.Empty; + string dataStr = data.ToString(); + if (data != null) + { + result = dataStr == "1" ? "已提交" : "未提交"; + } + return result; + } + #endregion + + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 表排序、分页、关闭窗口 + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DataShow/HazardFactor.aspx.designer.cs b/SGGL/FineUIPro.Web/DataShow/HazardFactor.aspx.designer.cs new file mode 100644 index 00000000..e7a784b1 --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShow/HazardFactor.aspx.designer.cs @@ -0,0 +1,179 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.DataShow +{ + + + public partial class HazardFactor + { + + /// + /// 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; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// drpMonth 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpMonth; + + /// + /// drpUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnit; + + /// + /// drpBaseRiskLevel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpBaseRiskLevel; + + /// + /// drpNetRiskLevel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpNetRiskLevel; + + /// + /// rbIllegality 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList rbIllegality; + + /// + /// rbDedupe 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList rbDedupe; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// lbState 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lbState; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + } +} diff --git a/SGGL/FineUIPro.Web/DataShow/HazardFactorOccHealth.aspx b/SGGL/FineUIPro.Web/DataShow/HazardFactorOccHealth.aspx new file mode 100644 index 00000000..1c420817 --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShow/HazardFactorOccHealth.aspx @@ -0,0 +1,175 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HazardFactorOccHealth.aspx.cs" + Inherits="FineUIPro.Web.DataShow.HazardFactorOccHealth" %> + + + + + + + + 职业健康危害因素 + + +
+ + + + + + + + + + + + + <%-- + --%> + + + + + <%-- + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%><%--单位项目名称--%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/DataShow/HazardFactorOccHealth.aspx.cs b/SGGL/FineUIPro.Web/DataShow/HazardFactorOccHealth.aspx.cs new file mode 100644 index 00000000..12aa67e1 --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShow/HazardFactorOccHealth.aspx.cs @@ -0,0 +1,234 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Text; + +namespace FineUIPro.Web.DataShow +{ + public partial class HazardFactorOccHealth : PageBase + { + /// + /// 单位id + /// + public string UnitId + { + get + { + return (string)ViewState["UnitId"]; + } + set + { + ViewState["UnitId"] = value; + } + } + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, true); + BLL.ConstValue.InitConstValueDropDownList(this.drpMonth, ConstValue.Group_0009, true); + BLL.UnitService.InitBranchUnitDropDownList(this.drpUnit, true, true); + BLL.RiskLevelService.InitRiskLevelDropDownListByRiskLevelName(this.drpBaseRiskLevel, true); + BLL.RiskLevelService.InitRiskLevelDropDownListByRiskLevelName(this.drpNetRiskLevel, true); + this.UnitId = this.CurrUser.UnitId; + if (CommonService.IsSuperAdminManage(this.CurrUser.UserId) || (!string.IsNullOrWhiteSpace(this.UnitId) && this.UnitId == Const.UnitId_XJYJ)) + { + this.drpUnit.Hidden = false; + this.UnitId = this.CurrUser.LastUnitId; + } + if (!string.IsNullOrWhiteSpace(this.UnitId)) + { + this.drpUnit.SelectedValue = this.UnitId; + } + var dateYearMon = DateTime.Now.ToString("yyyy-M"); + this.drpYear.SelectedValue = dateYearMon.Split('-')[0]; + this.drpMonth.SelectedValue = dateYearMon.Split('-')[1]; + + Funs.DropDownPageSize(this.ddlPageSize); + ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + BindGrid(); + this.Panel1.Title = "职业健康危害因素"; + } + } + + /// + /// 绑定数据 + /// + private void BindGrid() + { + StringBuilder sb = new StringBuilder(); + List listStr = new List(); + + string dedupe = rbDedupe.SelectedValue; + + if (!string.IsNullOrWhiteSpace(dedupe)) + { + sb.Append("WITH CTE AS ( "); + if (dedupe == "0") + {//按月 + sb.Append("SELECT ROW_NUMBER() OVER (PARTITION BY tba.Year,tba.Month,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.AccidentType,tba.Illegality,tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity,tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel,tba.NetRiskAcceptabity,tba.AdditionalControlMeasures ORDER BY CompileDate desc) as rn,tba.* "); + } + else + {//按年 + sb.Append("SELECT ROW_NUMBER() OVER (PARTITION BY tba.Year,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.AccidentType,tba.Illegality,tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity,tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel,tba.NetRiskAcceptabity,tba.AdditionalControlMeasures ORDER BY CompileDate desc) as rn,tba.* "); + } + } + else + { + sb.Append("SELECT tba.* "); + } + sb.Append("FROM HazardFactor_OccHealth AS tba WITH(NOLOCK) "); + //sb.Append("LEFT JOIN Base_Project AS tbb WITH(NOLOCK) ON tbb.ProjectId = tba.ProjectId "); + sb.Append("WHERE 1=1 AND tba.State = 1 ");//取已提交数据 + + if (!string.IsNullOrWhiteSpace(this.CurrUser.UnitId) && this.CurrUser.UnitId != Const.UnitId_XJYJ) + {//分公司只能查看本单位的数据 + sb.Append("AND tba.UnitId = @UnitId "); + listStr.Add(new SqlParameter("@UnitId", this.CurrUser.UnitId)); + } + else + { + if (!string.IsNullOrWhiteSpace(this.drpUnit.SelectedValue) && this.drpUnit.SelectedValue != Const._Null && this.drpUnit.SelectedValue != Const.UnitId_XJYJ) + { + sb.Append("AND tba.UnitId = @UnitId "); + listStr.Add(new SqlParameter("@UnitId", this.drpUnit.SelectedValue)); + } + } + //if (!string.IsNullOrWhiteSpace(this.drpProject.SelectedValue) && this.drpProject.SelectedValue != Const._Null) + //{ + // sb.Append("AND tba.ProjectId = @ProjectId "); + // listStr.Add(new SqlParameter("@ProjectId", this.drpProject.SelectedValue)); + //} + if (!string.IsNullOrWhiteSpace(this.drpYear.SelectedValue) && this.drpYear.SelectedValue != Const._Null) + { + sb.Append("AND tba.Year = @Year "); + listStr.Add(new SqlParameter("@Year", this.drpYear.SelectedValue)); + } + if (!string.IsNullOrWhiteSpace(this.drpMonth.SelectedValue) && this.drpMonth.SelectedValue != Const._Null) + { + string month = this.drpMonth.SelectedValue; + sb.Append("AND tba.Month = @Month "); + listStr.Add(new SqlParameter("@Month", month.Length == 1 ? $"0{month}" : month)); + } + if (!string.IsNullOrWhiteSpace(this.drpBaseRiskLevel.SelectedValue) && this.drpBaseRiskLevel.SelectedValue != Const._Null) + { + sb.Append("AND tba.BaseRiskLevel = @BaseRiskLevel "); + listStr.Add(new SqlParameter("@BaseRiskLevel", this.drpBaseRiskLevel.SelectedValue)); + } + if (!string.IsNullOrWhiteSpace(this.drpNetRiskLevel.SelectedValue) && this.drpNetRiskLevel.SelectedValue != Const._Null) + { + sb.Append("AND tba.NetRiskLevel = @NetRiskLevel "); + listStr.Add(new SqlParameter("@NetRiskLevel", this.drpNetRiskLevel.SelectedValue)); + } + //if (!string.IsNullOrEmpty(this.rbState.SelectedValue)) + //{ + // sb.Append("AND tba.State = @State "); + // listStr.Add(new SqlParameter("@State", this.rbState.SelectedValue)); + //} + if (!string.IsNullOrEmpty(this.rbIllegality.SelectedValue)) + { + sb.Append("AND tba.Illegality = @Illegality "); + listStr.Add(new SqlParameter("@Illegality", this.rbIllegality.SelectedValue == "1" ? true : false)); + } + + if (!string.IsNullOrWhiteSpace(dedupe)) + { + sb.Append(") "); + sb.Append("SELECT * FROM CTE WHERE rn = 1; "); + } + + string sqlStr = sb.ToString(); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(sqlStr, parameter); + + Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + + Grid1.DataSource = table; + Grid1.DataBind(); + } + + + /// + /// 格式化数据 + /// + /// + /// + protected string ConvertDataState(object data) + { + string result = string.Empty; + string dataStr = data.ToString(); + if (data != null) + { + result = dataStr == "1" ? "已提交" : "未提交"; + } + return result; + } + #endregion + + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 表排序、分页、关闭窗口 + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DataShow/HazardFactorOccHealth.aspx.designer.cs b/SGGL/FineUIPro.Web/DataShow/HazardFactorOccHealth.aspx.designer.cs new file mode 100644 index 00000000..54fc4529 --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShow/HazardFactorOccHealth.aspx.designer.cs @@ -0,0 +1,179 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.DataShow +{ + + + public partial class HazardFactorOccHealth + { + + /// + /// 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; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// drpMonth 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpMonth; + + /// + /// drpUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnit; + + /// + /// drpBaseRiskLevel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpBaseRiskLevel; + + /// + /// drpNetRiskLevel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpNetRiskLevel; + + /// + /// rbIllegality 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList rbIllegality; + + /// + /// rbDedupe 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList rbDedupe; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// lbState 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lbState; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + } +} diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index e03430d3..17678014 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -624,6 +624,8 @@ + + @@ -10108,6 +10110,20 @@ Check.aspx + + HazardFactorOccHealth.aspx + ASPXCodeBehind + + + HazardFactorOccHealth.aspx + + + HazardFactor.aspx + ASPXCodeBehind + + + HazardFactor.aspx + CompanyPerson.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.cs index 22c9a248..450f4038 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.cs @@ -68,7 +68,7 @@ namespace FineUIPro.Web.HSSE.SitePerson //权限按钮方法 this.GetButtonPower(); } - if (CommonService.IsSuperAdminManage(this.CurrUser.UserId)) + if (CommonService.IsSuperAdminManageAuth(this.CurrUser.UserId)) { //权限按钮方法 this.GetButtonPower(); @@ -92,7 +92,7 @@ namespace FineUIPro.Web.HSSE.SitePerson this.InitTreeMenu(); this.BindGrid(); this.GetButtonPower(); - if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId) && !CommonService.IsSuperAdminManage(this.CurrUser.UserId)) + if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId) && !CommonService.IsSuperAdminManageAuth(this.CurrUser.UserId)) { btnNew.Hidden = true; btnImport.Hidden = true; @@ -806,7 +806,7 @@ namespace FineUIPro.Web.HSSE.SitePerson this.btnPersonUnit.Hidden = false; } } - if (CommonService.IsSuperAdminManage(this.CurrUser.UserId)) + if (CommonService.IsSuperAdminManageAuth(this.CurrUser.UserId)) {//罗菲、史志扬、管理员账号 this.btnSearchUserAdd.Hidden = false; } diff --git a/SGGL/FineUIPro.Web/Login.aspx.cs b/SGGL/FineUIPro.Web/Login.aspx.cs index 69118c81..03ce4052 100644 --- a/SGGL/FineUIPro.Web/Login.aspx.cs +++ b/SGGL/FineUIPro.Web/Login.aspx.cs @@ -69,25 +69,25 @@ namespace FineUIPro.Web if (!IsPostBack) { bool IsSSO = false; - Sys_User user=new Sys_User(); - string message=""; + Sys_User user = new Sys_User(); + string message = ""; var ThisUnit = CommonService.GetIsThisUnit(); string token; switch (ThisUnit.CollCropCode) { case "913201001349030968": - + token = Request.Params["token"]; if (string.IsNullOrEmpty(token)) return; IsSSO = true; break; } - if (IsSSO ) + if (IsSSO) { if (message != "") - { + { Response.Write(""); } else @@ -97,9 +97,10 @@ namespace FineUIPro.Web string url = ""; //Funs.SystemUrl = "http://" + HttpContext.Current.Request.Url.Host + ":" + HttpContext.Current.Request.Url.Port + "/cncechsse/"; BLL.LogService.AddLog(this.CurrUser.UserId, "登录成功!"); - if (this.CurrUser.IsOffice==true) //本部人员跳转到公司级 - { - url = "index.aspx"; + if (this.CurrUser.IsOffice == true) //本部人员跳转到公司级 + { + //url = "index.aspx"; + url = "index.aspx?unitId=" + this.CurrUser.UnitId; } else //非本部人员跳转到项目级 { @@ -116,24 +117,24 @@ namespace FineUIPro.Web //// 项目菜单 url = "indexProject.aspx?projectId=" + this.CurrUser.LastProjectId; } - - + + HttpContext.Current.Response.Write(""); HttpContext.Current.Response.End(); // Response.Redirect( url); - // Server.Execute( url); - // Response.Write(""); + // Server.Execute( url); + // Response.Write(""); } } } - + } } #endregion [WebMethod] - public static string LoginPost(string user, string pwd,string rbSys) + public static string LoginPost(string user, string pwd, string rbSys) { return new Login().btnLogin_Click(user, pwd, rbSys); } @@ -240,11 +241,17 @@ namespace FineUIPro.Web //} if (rbSys == "工程") { - this.SysType = "GONGCHENG"; + this.SysType = "GONGCHENG"; } else if (rbSys == "公司/分公司") { - url = "index.aspx"; + //url = "index.aspx"; + string unitId = Const.UnitId_XJYJ; + if (!string.IsNullOrWhiteSpace(this.CurrUser.UnitId) && this.CurrUser.Base_Unit.IsBranch == true) + { + unitId = this.CurrUser.UnitId; + } + url = "index.aspx?unitId=" + unitId; this.SysType = "GONGCHENG"; } else if (rbSys == "实业") @@ -262,7 +269,7 @@ namespace FineUIPro.Web } if (string.IsNullOrEmpty(error)) - { + { return url; } else @@ -282,11 +289,11 @@ namespace FineUIPro.Web [WebMethod] public static string ResetPost(string accout, string name, string idcard) { - + Model.Sys_User sysUser = (from y in Funs.DB.Sys_User where y.Account == accout && y.IsPost == true select y).FirstOrDefault(); - if (sysUser ==null) + if (sysUser == null) { return "用户名或密码错误,请重新输入"; } @@ -294,7 +301,7 @@ namespace FineUIPro.Web { return "用户名或密码错误,请重新输入"; } - else if(name != sysUser.UserName) + else if (name != sysUser.UserName) { return "用户名或密码错误,请重新输入"; } diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectInformation.aspx.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectInformation.aspx.cs index 6b9a61c0..613d4c50 100644 --- a/SGGL/FineUIPro.Web/ProjectData/ProjectInformation.aspx.cs +++ b/SGGL/FineUIPro.Web/ProjectData/ProjectInformation.aspx.cs @@ -80,7 +80,7 @@ namespace FineUIPro.Web.ProjectData if (this.tvControlItem.SelectedNode != null ) { string url = "~/indexProject.aspx?projectId=" + this.tvControlItem.SelectedNode.NodeID; - UserService.UpdateLastUserInfo(this.CurrUser.UserId, null, false, this.tvControlItem.SelectedNode.NodeID); + UserService.UpdateLastUserInfo(this.CurrUser.UserId, null, false, this.tvControlItem.SelectedNode.NodeID,string.Empty); PageContext.Redirect(url, "_top"); } else diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectList.aspx.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectList.aspx.cs index 2e0cd991..5e3b3895 100644 --- a/SGGL/FineUIPro.Web/ProjectData/ProjectList.aspx.cs +++ b/SGGL/FineUIPro.Web/ProjectData/ProjectList.aspx.cs @@ -288,7 +288,7 @@ namespace FineUIPro.Web.ProjectData if (!string.IsNullOrEmpty(Grid1.SelectedRowID)) { string url = "~/indexProject.aspx?projectId=" + Grid1.SelectedRowID; - UserService.UpdateLastUserInfo(this.CurrUser.UserId, null, false, Grid1.SelectedRowID); + UserService.UpdateLastUserInfo(this.CurrUser.UserId, null, false, Grid1.SelectedRowID, string.Empty); PageContext.Redirect(url, "_top"); } else diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectSet.aspx.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectSet.aspx.cs index 316f0be6..c18767b8 100644 --- a/SGGL/FineUIPro.Web/ProjectData/ProjectSet.aspx.cs +++ b/SGGL/FineUIPro.Web/ProjectData/ProjectSet.aspx.cs @@ -423,7 +423,7 @@ namespace FineUIPro.Web.ProjectData if (!string.IsNullOrEmpty(Grid1.SelectedRowID)) { string url = "~/indexProject.aspx?projectId=" + Grid1.SelectedRowID; - UserService.UpdateLastUserInfo(this.CurrUser.UserId, null, false, Grid1.SelectedRowID); + UserService.UpdateLastUserInfo(this.CurrUser.UserId, null, false, Grid1.SelectedRowID, string.Empty); PageContext.Redirect(url, "_top"); } else diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx index cf76f2c7..ddd4c7db 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx @@ -40,9 +40,12 @@ - + + <%-- + --%> diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx.cs b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx.cs index 53560795..6d96800f 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx.cs +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx.cs @@ -35,7 +35,12 @@ namespace FineUIPro.Web.ReportManage.HazardFactor { if (!IsPostBack) { - BLL.ProjectService.InitProjectDropDownList(this.drpProject, true); + //BLL.ProjectService.InitProjectDropDownList(this.drpProject, true); + if (string.IsNullOrWhiteSpace(this.CurrUser.UnitId) || this.CurrUser.UnitId == Const.UnitId_XJYJ) + { + this.drpUnit.Hidden = false; + UnitService.InitBranchUnitDropDownList(this.drpUnit, true, true); + } BLL.ConstValue.InitConstValueDropDownList(this.drpMonth, ConstValue.Group_0009, true); BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, true); BLL.RiskLevelService.InitRiskLevelDropDownListByRiskLevelName(this.drpBaseRiskLevel, true); @@ -85,11 +90,19 @@ namespace FineUIPro.Web.ReportManage.HazardFactor sb.Append("AND tba.UnitId = @UnitId "); listStr.Add(new SqlParameter("@UnitId", this.CurrUser.UnitId)); } - if (!string.IsNullOrWhiteSpace(this.drpProject.SelectedValue) && this.drpProject.SelectedValue != Const._Null) + else { - sb.Append("AND tba.ProjectId = @ProjectId "); - listStr.Add(new SqlParameter("@ProjectId", this.drpProject.SelectedValue)); + if (!string.IsNullOrWhiteSpace(this.drpUnit.SelectedValue) && this.drpUnit.SelectedValue != Const._Null) + { + sb.Append("AND tba.UnitId = @UnitId "); + listStr.Add(new SqlParameter("@UnitId", this.drpUnit.SelectedValue)); + } } + //if (!string.IsNullOrWhiteSpace(this.drpProject.SelectedValue) && this.drpProject.SelectedValue != Const._Null) + //{ + // sb.Append("AND tba.ProjectId = @ProjectId "); + // listStr.Add(new SqlParameter("@ProjectId", this.drpProject.SelectedValue)); + //} if (!string.IsNullOrWhiteSpace(this.drpYear.SelectedValue) && this.drpYear.SelectedValue != Const._Null) { sb.Append("AND tba.Year = @Year "); diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx.designer.cs b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx.designer.cs index 96c115c3..cd8c75d5 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx.designer.cs @@ -78,13 +78,13 @@ namespace FineUIPro.Web.ReportManage.HazardFactor protected global::FineUIPro.DropDownList drpMonth; /// - /// drpProject 控件。 + /// drpUnit 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.DropDownList drpProject; + protected global::FineUIPro.DropDownList drpUnit; /// /// drpBaseRiskLevel 控件。 diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx index d6887bdb..81a46d1c 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx @@ -40,9 +40,12 @@ - + + <%-- + --%> diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx.cs b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx.cs index b6b1c0f1..67b69810 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx.cs +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx.cs @@ -35,7 +35,12 @@ namespace FineUIPro.Web.ReportManage.HazardFactor { if (!IsPostBack) { - BLL.ProjectService.InitProjectDropDownList(this.drpProject, true); + //BLL.ProjectService.InitProjectDropDownList(this.drpProject, true); + if (string.IsNullOrWhiteSpace(this.CurrUser.UnitId) || this.CurrUser.UnitId == Const.UnitId_XJYJ) + { + this.drpUnit.Hidden = false; + UnitService.InitBranchUnitDropDownList(this.drpUnit, true, true); + } BLL.ConstValue.InitConstValueDropDownList(this.drpMonth, ConstValue.Group_0009, true); BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, true); BLL.RiskLevelService.InitRiskLevelDropDownListByRiskLevelName(this.drpBaseRiskLevel, true); @@ -85,11 +90,19 @@ namespace FineUIPro.Web.ReportManage.HazardFactor sb.Append("AND tba.UnitId = @UnitId "); listStr.Add(new SqlParameter("@UnitId", this.CurrUser.UnitId)); } - if (!string.IsNullOrWhiteSpace(this.drpProject.SelectedValue) && this.drpProject.SelectedValue != Const._Null) + else { - sb.Append("AND tba.ProjectId = @ProjectId "); - listStr.Add(new SqlParameter("@ProjectId", this.drpProject.SelectedValue)); + if (!string.IsNullOrWhiteSpace(this.drpUnit.SelectedValue) && this.drpUnit.SelectedValue != Const._Null) + { + sb.Append("AND tba.UnitId = @UnitId "); + listStr.Add(new SqlParameter("@UnitId", this.drpUnit.SelectedValue)); + } } + //if (!string.IsNullOrWhiteSpace(this.drpProject.SelectedValue) && this.drpProject.SelectedValue != Const._Null) + //{ + // sb.Append("AND tba.ProjectId = @ProjectId "); + // listStr.Add(new SqlParameter("@ProjectId", this.drpProject.SelectedValue)); + //} if (!string.IsNullOrWhiteSpace(this.drpYear.SelectedValue) && this.drpYear.SelectedValue != Const._Null) { sb.Append("AND tba.Year = @Year "); diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx.designer.cs b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx.designer.cs index 768996fc..ffb2e41d 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx.designer.cs @@ -78,13 +78,13 @@ namespace FineUIPro.Web.ReportManage.HazardFactor protected global::FineUIPro.DropDownList drpMonth; /// - /// drpProject 控件。 + /// drpUnit 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.DropDownList drpProject; + protected global::FineUIPro.DropDownList drpUnit; /// /// drpBaseRiskLevel 控件。 diff --git a/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/SafeEnvBudgetEdit.aspx.cs b/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/SafeEnvBudgetEdit.aspx.cs index 8ea2b4de..610ff37a 100644 --- a/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/SafeEnvBudgetEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/SafeEnvBudgetEdit.aspx.cs @@ -43,7 +43,6 @@ namespace FineUIPro.Web.ReportManage.SafeEnvBudget #endregion - #region 加载页面 /// /// 加载页面 @@ -189,10 +188,6 @@ namespace FineUIPro.Web.ReportManage.SafeEnvBudget } #endregion - - - - #region 提交按钮 /// /// 提交按钮 diff --git a/SGGL/FineUIPro.Web/common/PageBase.cs b/SGGL/FineUIPro.Web/common/PageBase.cs index 79847ebf..38e6e0bf 100644 --- a/SGGL/FineUIPro.Web/common/PageBase.cs +++ b/SGGL/FineUIPro.Web/common/PageBase.cs @@ -28,13 +28,16 @@ namespace FineUIPro.Web { string account = string.Empty; string password = string.Empty; - if (Request.Cookies["u"] != null) + if (HttpContext.Current != null && HttpContext.Current.Request != null) { - account = HttpUtility.UrlDecode(Request.Cookies["u"].Value); - } - if (Request.Cookies["p"] != null) - { - password = Request.Cookies["p"].Value; + if (Request.Cookies["u"] != null) + { + account = HttpUtility.UrlDecode(Request.Cookies["u"].Value); + } + if (Request.Cookies["p"] != null) + { + password = Request.Cookies["p"].Value; + } } Session["CurrUser"] = BLL.Funs.DB.Sys_User.FirstOrDefault(x => x.Account == account && x.Password == Funs.EncryptionPassword(password)); } @@ -58,66 +61,66 @@ namespace FineUIPro.Web #region OnInit protected override void OnInit(EventArgs e) - { - if (Session["CurrUser"] == null && !Request.Path.Contains("/Login.aspx") && !Request.Path.Contains("DataShow")) - { - //string ticket = Request.Params["ticket"]; - //if (!string.IsNullOrEmpty(ticket)) - //{ - // string jsonCameras = APIGetHttpService.Http("https://=" + ticket); + { + if (Session["CurrUser"] == null && !Request.Path.Contains("/Login.aspx") && !Request.Path.Contains("DataShow")) + { + //string ticket = Request.Params["ticket"]; + //if (!string.IsNullOrEmpty(ticket)) + //{ + // string jsonCameras = APIGetHttpService.Http("https://=" + ticket); - // XmlDocument xml = new XmlDocument(); - // xml.LoadXml(jsonCameras); - // XmlElement root = xml.DocumentElement; - // XmlNode node = root.ChildNodes[0];//遍历输出. - // if (node.LocalName == "authenticationSuccess") - // { - // string user = node.ChildNodes[0].InnerText;//InnerText节点包合的所有文本内容 - // //if ("zyk" == user) - // //{ - // // user = "hfnbd"; - // //} - // Model.Sys_User sysUser = (from y in Funs.DB.Sys_User - // where (y.DomainAccount == user || y.Account ==user) && y.IsPost == true - // select y).FirstOrDefault(); - // if (user != null) - // { - // string accValue = HttpUtility.UrlEncode(user); - // FormsAuthentication.SetAuthCookie(accValue, false); - // Page.Session[SessionName.CurrUser] = sysUser; - // string url = ""; - // this.CurrUser.RoleType = RoleService.GetRoleTypeByRoleId(this.CurrUser.RoleId); - // if (!this.CurrUser.LastIsOffice.HasValue) - // { - // this.CurrUser.LastIsOffice = this.CurrUser.IsOffice; - // } - // if (this.CurrUser.LastIsOffice == true) - // { - // this.CurrUser.LoginProjectId = null; - // ////本部菜单 - // url = "index.aspx"; - // } - // else - // { - // this.CurrUser.LoginProjectId = this.CurrUser.LastProjectId; - // //// 项目菜单 - // url = "indexProject.aspx?projectId=" + this.CurrUser.LastProjectId; - // } - // this.SysType = "GONGCHENG"; - // Response.Redirect(url); - // } - // else - // { - // Response.Redirect("Login.aspx"); - // } - // } - //} - //else - //{ - // Response.Redirect("https://sggl/indexProject.aspx"); - //} - } - var pm = PageManager.Instance; + // XmlDocument xml = new XmlDocument(); + // xml.LoadXml(jsonCameras); + // XmlElement root = xml.DocumentElement; + // XmlNode node = root.ChildNodes[0];//遍历输出. + // if (node.LocalName == "authenticationSuccess") + // { + // string user = node.ChildNodes[0].InnerText;//InnerText节点包合的所有文本内容 + // //if ("zyk" == user) + // //{ + // // user = "hfnbd"; + // //} + // Model.Sys_User sysUser = (from y in Funs.DB.Sys_User + // where (y.DomainAccount == user || y.Account ==user) && y.IsPost == true + // select y).FirstOrDefault(); + // if (user != null) + // { + // string accValue = HttpUtility.UrlEncode(user); + // FormsAuthentication.SetAuthCookie(accValue, false); + // Page.Session[SessionName.CurrUser] = sysUser; + // string url = ""; + // this.CurrUser.RoleType = RoleService.GetRoleTypeByRoleId(this.CurrUser.RoleId); + // if (!this.CurrUser.LastIsOffice.HasValue) + // { + // this.CurrUser.LastIsOffice = this.CurrUser.IsOffice; + // } + // if (this.CurrUser.LastIsOffice == true) + // { + // this.CurrUser.LoginProjectId = null; + // ////本部菜单 + // url = "index.aspx"; + // } + // else + // { + // this.CurrUser.LoginProjectId = this.CurrUser.LastProjectId; + // //// 项目菜单 + // url = "indexProject.aspx?projectId=" + this.CurrUser.LastProjectId; + // } + // this.SysType = "GONGCHENG"; + // Response.Redirect(url); + // } + // else + // { + // Response.Redirect("Login.aspx"); + // } + // } + //} + //else + //{ + // Response.Redirect("https://sggl/indexProject.aspx"); + //} + } + var pm = PageManager.Instance; if (pm != null) { HttpCookie themeCookie = Request.Cookies["Theme"]; @@ -248,15 +251,15 @@ namespace FineUIPro.Web /// protected void PageBase_Load(object sender, EventArgs e) { - //这是后置式的权限管理策略. - //页面装载完成以后才检查是否有权限打开此页.... - //anyway,its ok. - + //这是后置式的权限管理策略. + //页面装载完成以后才检查是否有权限打开此页.... + //anyway,its ok. - this.Title = BLL.Funs.SystemName; + + this.Title = BLL.Funs.SystemName; //if (CurrUser == null) //{ // if (this.Page.Request.AppRelativeCurrentExecutionFilePath != "~/Login.aspx") @@ -557,12 +560,12 @@ namespace FineUIPro.Web /// 数据表 protected DataTable GetPagedDataTable(FineUIPro.Grid Grid1, DataTable tb) { - int pageIndex = Grid1.PageIndex; + int pageIndex = Grid1.PageIndex; int pageSize = Grid1.PageSize; string sortField = Grid1.SortField; string sortDirection = Grid1.SortDirection; - + //DataTable table2 = DataSourceUtil.GetDataTable2(); DataView view = tb.DefaultView; // view.Sort = String.Format("{0} {1}", sortField, sortDirection); @@ -957,7 +960,7 @@ namespace FineUIPro.Web sb.Append(""); sb.Append(""); sb.Append(""); - + foreach (GridColumn column in grid.Columns) { sb.AppendFormat("", column.HeaderText); @@ -968,8 +971,8 @@ namespace FineUIPro.Web sb.Append(""); foreach (GridColumn column in grid.Columns) { - string html = row.Values[column.ColumnIndex].ToString(); - + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID == "tfNumber" && (row.FindControl("lblNumber") as AspNet.Label) != null) { html = (row.FindControl("lblNumber") as AspNet.Label).Text; @@ -995,7 +998,7 @@ namespace FineUIPro.Web } } sb.AppendFormat("", html); - // sb.AppendFormat("", html); + // sb.AppendFormat("", html); } sb.Append(""); diff --git a/SGGL/FineUIPro.Web/common/main.aspx b/SGGL/FineUIPro.Web/common/main.aspx index 2b2b34cc..6e9893fe 100644 --- a/SGGL/FineUIPro.Web/common/main.aspx +++ b/SGGL/FineUIPro.Web/common/main.aspx @@ -10,7 +10,7 @@ - + <%----%> @@ -170,7 +170,6 @@ - <%--
--%>
{{mapType ? '中国地图' : '世界地图'}}
@@ -186,10 +185,10 @@
- -
-

风险分级管控

-
+
+
+

安全危害因素

+
@@ -220,27 +219,36 @@
-
-

高风险作业许可

-
-
+
+

职业健康危害因素

+
+
-
许可
-

- 0 -

+
重大风险
+

{{form?.hazardFactorOcc?.majorRiskNum}}

- -
-
-
关闭
-

- 0 -

-
+
+
+
较大风险
+

{{form?.hazardFactorOcc?.largerRiskNum}}

+
+
+
+ +
+
一般风险
+

{{form?.hazardFactorOcc?.generalRiskNum}}

+
+
+
+ +
+
低风险
+

{{form?.hazardFactorOcc?.lowRiskNum}}

+
@@ -311,11 +319,11 @@ } }, mounted() { - // 组件挂载后执行的操作 - this.show = true; // 显示内容 - hoverEvent(); + //组件挂载后执行的操作 + this.show = true; //显示内容 this.createChinaMap(); - this.loadData(); // 加载数据 + this.loadData(); //加载数据 + hoverEvent();//模块数据穿透 // this.startTimer(); //启动时间定时器 }, methods: { @@ -328,6 +336,9 @@ url: "main.aspx/GetMainData", //调用后台WebMethod contentType: "application/json; charset=utf-8", dataType: "json", + <%--data: JSON.stringify({ + unitId: '<%=UnitId%>' + }),--%> success: function (response) { //console.log("请求结果:", response.d) if (response.d.success) { @@ -383,7 +394,7 @@ this.createChinaMap(this.chinaData) } }, - // 创建中国地图 + //创建中国地图 createChinaMap(data) { let list = data || []; //console.log("地图数据", data); @@ -470,8 +481,10 @@ borderColor: '#fff', borderWidth: 1, padding: 10, - formatter: function (params) { - console.log("地图数据明细", params) + formatter: function(params) { + // debugger + // console.log("地图数据明细", params) + // console.log("地图数据明细", params) // 自定义 tooltip 内容 if (params.seriesType === 'effectScatter') { return `
@@ -541,12 +554,47 @@ this.chainaMap.setOption(chinaOption); this.chainaMap.on('click', function (params) { // 控制台打印点击的地区名称 - //if (params.seriesType == 'effectScatter') { - // alert('点击了' + params.name); - //} + if (params.seriesType == 'effectScatter') { + // alert('点击了' + params.name + ';' + params.data.id); + + // debugger; + $.ajax({ + type: "POST", + url: "main.aspx/ViewProject", //调用后台WebMethod + contentType: "application/json; charset=utf-8", + dataType: "json", + data: JSON.stringify({ + projectId: params.data.id + }), + success: function (response) { + + //console.log("请求结果:", response.d) + if (response.d.success) { + var url = response.d.data; + var msg = response.d.msg; + if (url != "") { + // 当前页面跳转 + top.window.location.href = url; + } else { + alert("跳转失败:" + msg); + } + } else { + // 更新数据失败 + alert("跳转失败:" + response.d.msg); + } + // $(".loading").hide() + }, + error: function(xhr, status, error) { + // AJAX请求错误处理 + // $(".loading").hide() + alert("请求失败:" + error); + } + }); + } // 你可以在这里添加你的逻辑代码 }); }, + //创建世界地图 createWorldMap(data) { //let data = list || [ // { value: [116.407394, 39.904211], name: "北京" }, // 北京 @@ -713,14 +761,13 @@ //} //// 你可以在这里添加你的逻辑代码 }) - }, + } } }) function hoverEvent() { $(".jshover").click(function (e) { e.stopPropagation() - if ($(".popu").css("display") == "block") { $(".popu").hide() return @@ -728,57 +775,21 @@ let type = this.getAttribute("data-type") let iframe = $('iframe') switch (type) { - case "1": - // 组织人员 - // iframe.attr('src', '../DataShow/CompanyPerson.aspx') - window.open('../DataShow/CompanyPerson.aspx') + case "HazardFactor"://安全危害因素 + window.open('../DataShow/HazardFactor.aspx') break - case "2": - // 教育培训/安全工时 - // iframe.attr('src', '../DataShow/EduTrain.aspx') - window.open('../DataShow/EduTrain.aspx') - break - case "3": - // 安全隐患排查治理 - // iframe.attr('src', '../DataShow/HiddenRectification.aspx')//一般隐患 - window.open('../DataShow/HiddenRectification.aspx') - break - case "4": - // 费用及机具 - // iframe.attr('src', '../DataShow/SecurityCost.aspx') - window.open('../DataShow/SecurityCost.aspx') - break - case "5": - // 危大工程管控数据 - // iframe.attr('src', '../DataShow/LargeEngineering.aspx') - window.open('../DataShow/LargeEngineering.aspx') - break - case "6": - // 风险分级管控 - // iframe.attr('src', '../DataShow/SecurityRisk.aspx') - window.open('../DataShow/SecurityRisk.aspx') - break - case "7": - // 高风险作业许可 - // iframe.attr('src', '../DataShow/License.aspx') - window.open('../DataShow/License.aspx') - break - case "8": - // 应急管理数据 - // iframe.attr('src', '../DataShow/Emergency.aspx') - window.open('../DataShow/Emergency.aspx') + case "HazardFactorOccHealth"://职业健康危害因素 + window.open('../DataShow/HazardFactorOccHealth.aspx') break } - // $("#hover").hide() $(".popu").show() }) $(".container").css({ position: "relative", }) - $(".container") - .click(function (e) { - $(".popu").hide() - }) + $(".container").click(function (e) { + $(".popu").hide() + }) } diff --git a/SGGL/FineUIPro.Web/common/main.aspx.cs b/SGGL/FineUIPro.Web/common/main.aspx.cs index 4bda02c8..15c922de 100644 --- a/SGGL/FineUIPro.Web/common/main.aspx.cs +++ b/SGGL/FineUIPro.Web/common/main.aspx.cs @@ -1,14 +1,11 @@ using BLL; using FineUIPro.Web.DataShow; -using FineUIPro.Web.SysManage; -using FineUIPro.Web.ZHGL.DataSync; using Model; -using NPOI.SS.Formula.Functions; +using NPOI.POIFS.Crypt.Dsig; using System; using System.Collections.Generic; using System.Data; using System.Linq; -using System.Runtime.Remoting.Metadata.W3cXsd2001; using System.Threading.Tasks; using System.Web.Services; using System.Web.UI.WebControls; @@ -17,11 +14,40 @@ namespace FineUIPro.Web.common { public partial class main : PageBase { + ///// + ///// 单位id + ///// + //public string UnitId + //{ + // get + // { + // return (string)ViewState["UnitId"]; + // } + // set + // { + // ViewState["UnitId"] = value; + // } + //} + protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { - + //var ssss = Request; + //string unitId = string.Empty; + //unitId = this.CurrUser.LastUnitId; + //string unitIdw = string.Empty; + //string urlReferrer = Request.UrlReferrer.ToString(); + //if (!string.IsNullOrWhiteSpace(urlReferrer)) + //{ + // unitId = urlReferrer.Split('=')[1]; + // this.UnitId = unitId; + //} + //var sss = this.CurrUser; + //if (!string.IsNullOrEmpty(Request.QueryString["unitId"])) + //{ + // this.UnitId = Request.QueryString["unitId"]; + //} } } @@ -37,12 +63,19 @@ namespace FineUIPro.Web.common var page = new main(); MainSevice mainSevice = new MainSevice(page.CurrUser.UserId); + string unitId = page.CurrUser.UnitId; + if (CommonService.IsSuperAdminManage(page.CurrUser.UserId) || (!string.IsNullOrWhiteSpace(unitId) && unitId == Const.UnitId_XJYJ)) + { + unitId = !string.IsNullOrWhiteSpace(page.CurrUser.LastUnitId) ? page.CurrUser.LastUnitId : Const.UnitId_XJYJ; + } + //获取数据 var hsseData = Task.Run(() => mainSevice.GetHsseData()).Result; //var hiddenDangerList = mainSevice.GetDataHiddenDangerDetailItems(); //获取项目数据 - int unitType = CommonService.GetUnitTypeByUserId(page.CurrUser.UserId); + //int unitType = CommonService.GetUnitTypeByUserId(page.CurrUser.UserId); + int unitType = CommonService.GetUnitTypeByUnitId(unitId); var projects = new List(); if (unitType == 0) @@ -51,7 +84,8 @@ namespace FineUIPro.Web.common } else if (unitType == 1) { - projects = Funs.DB.Base_Project.Where(x => x.UnitId == page.CurrUser.UnitId && x.MapCoordinates != null && (x.IsDelete == null || x.IsDelete == false)).ToList(); + projects = Funs.DB.Base_Project.Where(x => x.UnitId == unitId && x.MapCoordinates != null && (x.IsDelete == null || x.IsDelete == false)).ToList(); + //projects = Funs.DB.Base_Project.Where(x => x.UnitId == page.CurrUser.UnitId && x.MapCoordinates != null && (x.IsDelete == null || x.IsDelete == false)).ToList(); } //获取安全生产开始日期 @@ -62,14 +96,20 @@ namespace FineUIPro.Web.common //事故事件 var list = AccidentWarningService.GetYearsTodayList(); - var dateNow = DateTime.Now.ToString("yyyy-MM"); - //风险 - var getHazardFactorList = Funs.DB.Sp_HazardFactor_Statistics(dateNow.Split('-')[0], dateNow.Split('-')[1], "").ToList(); + string hfUnitId = !string.IsNullOrWhiteSpace(unitId) && unitId == Const.UnitId_XJYJ ? string.Empty : unitId; + //安全危害因素 + var getHazardFactorList = Funs.DB.Sp_HazardFactor_Statistics(dateNow.Split('-')[0], dateNow.Split('-')[1], hfUnitId, string.Empty).ToList(); var lowRisk = getHazardFactorList.Where(x => x.Title == "低风险").FirstOrDefault(); var generalRisk = getHazardFactorList.Where(x => x.Title == "一般风险").FirstOrDefault(); var largerRisk = getHazardFactorList.Where(x => x.Title == "较大风险").FirstOrDefault(); var majorRisk = getHazardFactorList.Where(x => x.Title == "重大风险").FirstOrDefault(); + //职业健康危害因素 + var getHazardFactorOccHealthList = Funs.DB.Sp_HazardFactorOccHealth_Statistics(dateNow.Split('-')[0], dateNow.Split('-')[1], hfUnitId, string.Empty).ToList(); + var lowRiskOcc = getHazardFactorOccHealthList.Where(x => x.Title == "低风险").FirstOrDefault(); + var generalRiskOcc = getHazardFactorOccHealthList.Where(x => x.Title == "一般风险").FirstOrDefault(); + var largerRiskOcc = getHazardFactorOccHealthList.Where(x => x.Title == "较大风险").FirstOrDefault(); + var majorRiskOcc = getHazardFactorOccHealthList.Where(x => x.Title == "重大风险").FirstOrDefault(); //构造返回数据 return new @@ -96,7 +136,7 @@ namespace FineUIPro.Web.common }, projectInfo = new { - workSafetyStartDateTip= $"安全生产开始日期:{workSafetyStartDate}", + workSafetyStartDateTip = $"安全生产开始日期:{workSafetyStartDate}", workSafetyDay1 = (workSafetyDays % 10), workSafetyDay10 = ((workSafetyDays % 100) / 10), workSafetyDay100 = ((workSafetyDays % 1000) / 100), @@ -118,11 +158,18 @@ namespace FineUIPro.Web.common value = p.MapCoordinates.Split(','), }).ToList(), hazardFactor = new - { + {//安全危害因素 lowRiskNum = lowRisk != null ? lowRisk.Num : 0, generalRiskNum = generalRisk != null ? generalRisk.Num : 0, largerRiskNum = largerRisk != null ? largerRisk.Num : 0, majorRiskNum = majorRisk != null ? majorRisk.Num : 0, + }, + hazardFactorOcc = new + {//职业健康危害因素 + lowRiskNum = lowRiskOcc != null ? lowRiskOcc.Num : 0, + generalRiskNum = generalRiskOcc != null ? generalRiskOcc.Num : 0, + largerRiskNum = largerRiskOcc != null ? largerRiskOcc.Num : 0, + majorRiskNum = majorRiskOcc != null ? majorRiskOcc.Num : 0, } } }; @@ -132,5 +179,34 @@ namespace FineUIPro.Web.common return new { success = false, msg = ex.Message }; } } + + /// + /// 获取项目跳转地址 + /// + /// + /// + [WebMethod] + public static object ViewProject(string projectId) + { + try + { + var page = new main(); + string url = string.Empty; + string msg = string.Empty; + if ((page.CurrUser.IsOffice == true && !string.IsNullOrEmpty(page.CurrUser.RoleId)) || (page.CurrUser.IsOffice == false || !page.CurrUser.IsOffice.HasValue)) + { + url = "../indexProject.aspx?projectId=" + projectId; + } + else + { + msg = "您没有权限进入项目管理模块!"; + } + return new { success = true, data = url, msg = msg }; + } + catch (Exception ex) + { + return new { success = false, msg = ex.Message }; + } + } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/common/mainProject.aspx b/SGGL/FineUIPro.Web/common/mainProject.aspx index 3e7f68b1..bdec0d3c 100644 --- a/SGGL/FineUIPro.Web/common/mainProject.aspx +++ b/SGGL/FineUIPro.Web/common/mainProject.aspx @@ -200,8 +200,8 @@
-

风险分级管控

-
+

安全危害因素

+
@@ -232,28 +232,37 @@
- -
-

高风险作业许可

-
-
+ +
+

职业健康危害因素

+
+
-
许可
-

- 0 -

+
重大风险
+

{{form?.hazardFactorOcc?.majorRiskNum}}

- -
-
-
关闭
-

- 0 -

-
+
+
+
较大风险
+

{{form?.hazardFactorOcc?.largerRiskNum}}

+
+
+
+ +
+
一般风险
+

{{form?.hazardFactorOcc?.generalRiskNum}}

+
+
+
+ +
+
低风险
+

{{form?.hazardFactorOcc?.lowRiskNum}}

+
diff --git a/SGGL/FineUIPro.Web/common/mainProject.aspx.cs b/SGGL/FineUIPro.Web/common/mainProject.aspx.cs index 6afcf49c..bc98a4f1 100644 --- a/SGGL/FineUIPro.Web/common/mainProject.aspx.cs +++ b/SGGL/FineUIPro.Web/common/mainProject.aspx.cs @@ -38,11 +38,10 @@ namespace FineUIPro.Web.common // 获取项目数据 var project = ProjectService.GetProjectByProjectId(projectId); - //项目总工期 int projectDays = 0; int endDays = 0; - if (project.StartDate.HasValue && project.EndDate.HasValue) + if (project != null && project.StartDate.HasValue && project.EndDate.HasValue) { int pdays = (project.EndDate.Value - project.StartDate.Value).Days; if (pdays >= 0) @@ -70,12 +69,18 @@ namespace FineUIPro.Web.common var list = AccidentWarningService.GetYearsTodayList(); var dateNow = DateTime.Now.ToString("yyyy-MM"); - //风险 - var getHazardFactorList = Funs.DB.Sp_HazardFactor_Statistics(dateNow.Split('-')[0], dateNow.Split('-')[1], projectId).ToList(); + //安全危害因素 + var getHazardFactorList = Funs.DB.Sp_HazardFactor_Statistics(dateNow.Split('-')[0], dateNow.Split('-')[1], string.Empty, projectId).ToList(); var lowRisk = getHazardFactorList.Where(x => x.Title == "低风险").FirstOrDefault(); var generalRisk = getHazardFactorList.Where(x => x.Title == "一般风险").FirstOrDefault(); var largerRisk = getHazardFactorList.Where(x => x.Title == "较大风险").FirstOrDefault(); var majorRisk = getHazardFactorList.Where(x => x.Title == "重大风险").FirstOrDefault(); + //职业健康危害因素 + var getHazardFactorOccHealthList = Funs.DB.Sp_HazardFactorOccHealth_Statistics(dateNow.Split('-')[0], dateNow.Split('-')[1], string.Empty, projectId).ToList(); + var lowRiskOcc = getHazardFactorOccHealthList.Where(x => x.Title == "低风险").FirstOrDefault(); + var generalRiskOcc = getHazardFactorOccHealthList.Where(x => x.Title == "一般风险").FirstOrDefault(); + var largerRiskOcc = getHazardFactorOccHealthList.Where(x => x.Title == "较大风险").FirstOrDefault(); + var majorRiskOcc = getHazardFactorOccHealthList.Where(x => x.Title == "重大风险").FirstOrDefault(); // 构造返回数据 return new @@ -90,7 +95,7 @@ namespace FineUIPro.Web.common participateInNum = hsseData != null ? hsseData.JoinConstructionPersonNum ?? 0 : 0, dangerousProject = hsseData != null ? hsseData.MajorProjectsUnderConstructionNum ?? 0 : 0, projectDays = projectDays,//项目总工期 - projectEndDate = project.EndDate != null ? string.Format("{0:yyyy-MM-dd}", project.EndDate) : string.Empty,//项目到期时间 + projectEndDate = project != null && project.EndDate != null ? string.Format("{0:yyyy-MM-dd}", project.EndDate) : string.Empty,//项目到期时间 projectEndDays = endDays > 0 ? endDays : 0,//合同倒计时 }, hazardFactor = new @@ -99,6 +104,13 @@ namespace FineUIPro.Web.common generalRiskNum = generalRisk != null ? generalRisk.Num : 0, largerRiskNum = largerRisk != null ? largerRisk.Num : 0, majorRiskNum = majorRisk != null ? majorRisk.Num : 0, + }, + hazardFactorOcc = new + {//职业健康危害因素 + lowRiskNum = lowRiskOcc != null ? lowRiskOcc.Num : 0, + generalRiskNum = generalRiskOcc != null ? generalRiskOcc.Num : 0, + largerRiskNum = largerRiskOcc != null ? largerRiskOcc.Num : 0, + majorRiskNum = majorRiskOcc != null ? majorRiskOcc.Num : 0, } //meetAnEmergency = new //{ diff --git a/SGGL/FineUIPro.Web/index.aspx b/SGGL/FineUIPro.Web/index.aspx index 9078b85b..e32aca79 100644 --- a/SGGL/FineUIPro.Web/index.aspx +++ b/SGGL/FineUIPro.Web/index.aspx @@ -24,6 +24,47 @@ color: white !important; } + #index .selectedStyle { + margin: 0; + padding: 0; + background-color: transparent; + } + + #index .set .f-widget-content { + border: none; + padding: 0; + margin: 0; + background-color: transparent; + color: #ffffff; + } + + #index .gridStyle { + background-color: #01284f; + border-radius: 0; + } + + #index .gridStyle .f-state-default, .f-widget-content .f-state-default, .f-widget-header .f-state-default { + background-color: #01284f; + color: #ffffff; + } + + #index .gridStyle .f-grid-bodyct::-webkit-scrollbar { + display: none; + } + + #index .gridStyle .f-grid-table .f-grid-row, #index .gridStyle .f-grid-row-alt { + background-color: #01284f; + color: #ffffff; + } + + #index .gridStyle .f-grid-table .f-state-hover, #index .gridStyle .f-state-active, #index .gridStyle .f-widget-content .f-state-active, #index .gridStyle .f-widget-header .f-state-active { + color: #2694e8; + } + + #index .gridStyle .f-grid-column-lines .f-grid-cell { + border: none; + } + #index .f-widget-content { border: none; } @@ -196,9 +237,42 @@
-
+ +
+ +
+ <%--
-
+
--%>
@@ -295,8 +369,11 @@ ShowBorder="true" EnableTabCloseMenu="true" runat="server"> <%--.f-tabstrip-noheader>.f-panel-header--%> - + --%> + @@ -751,6 +828,11 @@ document.msExitFullscreen(); } } + function onGridDataLoad(event) { + this.mergeColumns(['UnitName'], { + depends: true + }); + } diff --git a/SGGL/FineUIPro.Web/index.aspx.cs b/SGGL/FineUIPro.Web/index.aspx.cs index c056ffcf..ce053921 100644 --- a/SGGL/FineUIPro.Web/index.aspx.cs +++ b/SGGL/FineUIPro.Web/index.aspx.cs @@ -58,10 +58,66 @@ namespace FineUIPro.Web if (!IsPostBack) { - this.CurrUser.LoginProjectId = null; } } + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + BindGrid(); + } + #endregion + + #region 分公司下拉框绑定数据 + + /// + /// 绑定数据 + /// + private void BindGrid() + { + if (!string.IsNullOrWhiteSpace(this.CurrUser.UnitId) && this.CurrUser.Base_Unit.IsBranch == true) + {//当前人员为分公司人员 + return; + } + string userId = this.CurrUser.UserId; + string unitName = string.Empty; + //string unitName = this.txtUnitName.Text.Trim(); + var getUser = UserService.GetUserByUserId(userId); + var unitlist = BLL.UnitService.GetBranchUnitList(true); + //if (!string.IsNullOrWhiteSpace(unitName)) + //{ + // unitlist = unitlist.Where(x => x.UnitName.Contains(unitName)).ToList(); + //} + unitlist = unitlist.OrderBy(x => x.UnitCode).ToList(); + Grid1.RecordCount = unitlist.Count; + Grid1.DataSource = unitlist; + Grid1.DataBind(); + } + + #endregion + + protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) + { + this.Tab1.RefreshIFrame(); + string dUnitId = this.drpUnit.Value; + if (!string.IsNullOrEmpty(dUnitId)) + { + this.CurrUser.LastUnitId = this.drpUnit.Value; + UserService.UpdateLastUserInfo(this.CurrUser.UserId, null, true, string.Empty, this.drpUnit.Value); + } + PageContext.Redirect("~/index.aspx?unitId=" + this.drpUnit.Value, "_top"); + + PageContext.RegisterStartupScript("parent.removeActiveTab();"); + //this.CurrUser.LoginProjectId = this.drpProject.Value; + //PageContext.RegisterStartupScript("parent.removeActiveTab();"); + //MenuSwitchMethod(this.CurrUser.LastMenuType); + } + #endregion #region InitTreeMenu @@ -290,7 +346,11 @@ namespace FineUIPro.Web { if (!IsPostBack) { + //string menuType = Request.Params["menuType"] != null ? Request.Params["menuType"].ToString() : string.Empty; + //if (!string.IsNullOrWhiteSpace(menuType)) + //{ this.MenuSwitchMethod(Request.Params["menuType"]); + //} this.InitMenuStyleButton(); this.InitMenuModeButton(); this.InitLangMenuButton(); @@ -314,6 +374,33 @@ namespace FineUIPro.Web // //divWeather.InnerHtml = getW.WeatherRef + " " + getW.CurrTem+ "°C"; //} + this.CurrUser.LoginProjectId = null; + this.drpUnit.Hidden = true; + if (CommonService.IsSuperAdminManage(this.CurrUser.UserId) || !string.IsNullOrWhiteSpace(this.CurrUser.UnitId)) + { + if (CommonService.IsSuperAdminManage(this.CurrUser.UserId) || this.CurrUser.UnitId == Const.UnitId_XJYJ) + { + this.drpUnit.Hidden = false; + BindGrid(); + string dUnitId = Const.UnitId_XJYJ; + if (!string.IsNullOrEmpty(this.CurrUser.LastUnitId)) + { + dUnitId = this.CurrUser.LastUnitId; + } + //var su = UserService.GetUserByUserId(this.CurrUser.UserId); + //if (!string.IsNullOrEmpty(su.LastUnitId)) + //{ + // dUnitId = su.LastUnitId; + //} + this.drpUnit.Value = dUnitId; + UserService.UpdateLastUserInfo(this.CurrUser.UserId, null, true, string.Empty, dUnitId); + } + else if (this.CurrUser.Base_Unit.IsBranch == true) + { + this.drpUnit.Hidden = true; + } + } + if (!string.IsNullOrEmpty(this.CurrUser.UnitId) && this.CurrUser.UnitId != CommonService.GetThisUnitId()) { this.Title = "安全数据采集平台(分公司)"; @@ -393,7 +480,7 @@ namespace FineUIPro.Web /// 功能模块切换方法 /// /// - protected void MenuSwitchMethod(string type) + protected void MenuSwitchMethod(string type) { if (!string.IsNullOrEmpty(type)) { @@ -421,7 +508,7 @@ namespace FineUIPro.Web this.Tab1.IFrameUrl = "~/common/main.aspx"; } - UserService.UpdateLastUserInfo(this.CurrUser.UserId, type, true, string.Empty); + //UserService.UpdateLastUserInfo(this.CurrUser.UserId, type, true, string.Empty, this.CurrUser.UnitId); InitTreeMenu(); } @@ -442,7 +529,7 @@ namespace FineUIPro.Web if ((this.CurrUser.IsOffice == true && !string.IsNullOrEmpty(this.CurrUser.RoleId)) || (this.CurrUser.IsOffice == false || !this.CurrUser.IsOffice.HasValue)) { string url = "~/indexProject.aspx?projectId=" + this.CurrUser.LastProjectId; - UserService.UpdateLastUserInfo(this.CurrUser.UserId, null, false, this.CurrUser.LastProjectId); + UserService.UpdateLastUserInfo(this.CurrUser.UserId, null, false, this.CurrUser.LastProjectId, string.Empty); PageContext.Redirect(url, "_top"); } else diff --git a/SGGL/FineUIPro.Web/index.aspx.designer.cs b/SGGL/FineUIPro.Web/index.aspx.designer.cs index 7687054a..88afec92 100644 --- a/SGGL/FineUIPro.Web/index.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/index.aspx.designer.cs @@ -123,13 +123,22 @@ namespace FineUIPro.Web protected global::FineUIPro.Button btnSysSet; /// - /// btnIcon1 控件。 + /// drpUnit 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.Button btnIcon1; + protected global::FineUIPro.DropDownBox drpUnit; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; /// /// userName 控件。 diff --git a/SGGL/FineUIPro.Web/indexProject.aspx b/SGGL/FineUIPro.Web/indexProject.aspx index c1350ca0..99006c89 100644 --- a/SGGL/FineUIPro.Web/indexProject.aspx +++ b/SGGL/FineUIPro.Web/indexProject.aspx @@ -186,7 +186,8 @@ a { text-decoration: none; } - .centerregion{ + + .centerregion { border: none !important; } diff --git a/SGGL/FineUIPro.Web/indexProject.aspx.cs b/SGGL/FineUIPro.Web/indexProject.aspx.cs index 6d0bd72b..d111138b 100644 --- a/SGGL/FineUIPro.Web/indexProject.aspx.cs +++ b/SGGL/FineUIPro.Web/indexProject.aspx.cs @@ -728,7 +728,7 @@ namespace FineUIPro.Web } this.CurrUser.LastMenuType = type; - UserService.UpdateLastUserInfo(this.CurrUser.UserId, type, false, this.CurrUser.LoginProjectId); + UserService.UpdateLastUserInfo(this.CurrUser.UserId, type, false, this.CurrUser.LoginProjectId, string.Empty); InitTreeMenu(); } @@ -737,12 +737,15 @@ namespace FineUIPro.Web if (string.IsNullOrEmpty(this.CurrUser.LastProjectId) && ((this.CurrUser.UnitId == Const.UnitId_XJYJ && this.CurrUser.IsOffice == true) || this.CurrUser.UserId == Const.sysglyId || this.CurrUser.UserId == Const.hfnbdId)) { - UserService.UpdateLastUserInfo(this.CurrUser.UserId, this.CurrUser.LastMenuType, false, this.CurrUser.LoginProjectId); - this.CurrUser.LastProjectId = this.CurrUser.LoginProjectId; - PageContext.Redirect("~/index.aspx", "_top"); + UserService.UpdateLastUserInfo(this.CurrUser.UserId, this.CurrUser.LastMenuType, false, this.CurrUser.LoginProjectId, this.CurrUser.UnitId); + this.CurrUser.LastUnitId = this.CurrUser.UnitId; + PageContext.Redirect("~/index.aspx?unitId=" + this.CurrUser.UnitId, "_top"); + //PageContext.Redirect("~/index.aspx", "_top"); } else { + UserService.UpdateLastUserInfo(this.CurrUser.UserId, this.CurrUser.LastMenuType, false, this.CurrUser.LoginProjectId, string.Empty); + this.CurrUser.LastProjectId = this.CurrUser.LoginProjectId; //this.MenuSwitchMethod(string.Empty); PageContext.Redirect("~/indexProject.aspx?projectId=" + this.CurrUser.LoginProjectId, "_top"); } diff --git a/SGGL/FineUIPro.Web/res/homecss/index.css b/SGGL/FineUIPro.Web/res/homecss/index.css index 99b76190..fc62dd14 100644 --- a/SGGL/FineUIPro.Web/res/homecss/index.css +++ b/SGGL/FineUIPro.Web/res/homecss/index.css @@ -376,7 +376,7 @@ color: #C2D5E7; } -#risk { +.risk { padding: 0.25rem; display: grid; grid-template-columns: 1fr 1fr; @@ -385,83 +385,83 @@ row-gap: 0.25rem; } - #risk > div > i { + .risk > div > i { height: 0.825rem; width: 0.9375rem; } - #risk > div > div { + .risk > div > div { margin-left: 0.125rem; height: 0.825rem; } - #risk > div > div > h6 { + .risk > div > div > h6 { font-size: 0.225rem; font-weight: bold; } - #risk > div > div > p { + .risk > div > div > p { font-size: 0.3rem; } - #risk > div > div > p > span:nth-child(1) { + .risk > div > div > p > span:nth-child(1) { font-size: 0.3rem; color: #C2D5E7; } - #risk > div:nth-child(1) > i { + .risk > div:nth-child(1) > i { background-image: url(../images/1-2/r5.png); } - #risk > div:nth-child(1) > div > h6 { + .risk > div:nth-child(1) > div > h6 { background: linear-gradient(180deg, #FFFFFF 0%, #EF3B49 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; } - #risk > div:nth-child(1) > div > p > span:nth-child(1) { + .risk > div:nth-child(1) > div > p > span:nth-child(1) { color: #EF3B49; } - #risk > div:nth-child(2) > i { + .risk > div:nth-child(2) > i { background-image: url(../images/1-2/r6.png); } - #risk > div:nth-child(2) > div > h6 { + .risk > div:nth-child(2) > div > h6 { background: linear-gradient(180deg, #FFFFFF 0%, #EF893B 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; } - #risk > div:nth-child(2) > div > p > span:nth-child(1) { + .risk > div:nth-child(2) > div > p > span:nth-child(1) { color: #EF893B; } - #risk > div:nth-child(3) > i { + .risk > div:nth-child(3) > i { background-image: url(../images/1-2/r7.png); } - #risk > div:nth-child(3) > div > h6 { + .risk > div:nth-child(3) > div > h6 { background: linear-gradient(180deg, #FFFFFF 0%, #EFCB3B 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; } - #risk > div:nth-child(3) > div > p > span:nth-child(1) { + .risk > div:nth-child(3) > div > p > span:nth-child(1) { color: #EFCB3B; } - #risk > div:nth-child(4) > i { + .risk > div:nth-child(4) > i { background-image: url(../images/1-2/r8.png); } - #risk > div:nth-child(4) > div > h6 { + .risk > div:nth-child(4) > div > h6 { background: linear-gradient(180deg, #FFFFFF 0%, #3B8CEF 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; } - #risk > div:nth-child(4) > div > p > span:nth-child(1) { + .risk > div:nth-child(4) > div > p > span:nth-child(1) { color: #3B8CEF; } diff --git a/SGGL/FineUIPro.Web/res/homecss/safe.css b/SGGL/FineUIPro.Web/res/homecss/safe.css index 3a5593d4..88ca66a9 100644 --- a/SGGL/FineUIPro.Web/res/homecss/safe.css +++ b/SGGL/FineUIPro.Web/res/homecss/safe.css @@ -389,7 +389,7 @@ color: #C2D5E7; } -#risk { +.risk { padding: 0.25rem; display: grid; grid-template-columns: 1fr 1fr; @@ -398,83 +398,83 @@ row-gap: 0.25rem; } - #risk > div > i { + .risk > div > i { height: 0.825rem; width: 0.9375rem; } - #risk > div > div { + .risk > div > div { margin-left: 0.125rem; height: 0.825rem; } - #risk > div > div > h6 { + .risk > div > div > h6 { font-size: 0.225rem; font-weight: bold; } - #risk > div > div > p { + .risk > div > div > p { font-size: 0.3rem; } - #risk > div > div > p > span:nth-child(1) { + .risk > div > div > p > span:nth-child(1) { font-size: 0.3rem; color: #C2D5E7; } - #risk > div:nth-child(1) > i { + .risk > div:nth-child(1) > i { background-image: url(../images/1-2/r5.png); } - #risk > div:nth-child(1) > div > h6 { + .risk > div:nth-child(1) > div > h6 { background: linear-gradient(180deg, #FFFFFF 0%, #EF3B49 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; } - #risk > div:nth-child(1) > div > p > span:nth-child(1) { + .risk > div:nth-child(1) > div > p > span:nth-child(1) { color: #EF3B49; } - #risk > div:nth-child(2) > i { + .risk > div:nth-child(2) > i { background-image: url(../images/1-2/r6.png); } - #risk > div:nth-child(2) > div > h6 { + .risk > div:nth-child(2) > div > h6 { background: linear-gradient(180deg, #FFFFFF 0%, #EF893B 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; } - #risk > div:nth-child(2) > div > p > span:nth-child(1) { + .risk > div:nth-child(2) > div > p > span:nth-child(1) { color: #EF893B; } - #risk > div:nth-child(3) > i { + .risk > div:nth-child(3) > i { background-image: url(../images/1-2/r7.png); } - #risk > div:nth-child(3) > div > h6 { + .risk > div:nth-child(3) > div > h6 { background: linear-gradient(180deg, #FFFFFF 0%, #EFCB3B 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; } - #risk > div:nth-child(3) > div > p > span:nth-child(1) { + .risk > div:nth-child(3) > div > p > span:nth-child(1) { color: #EFCB3B; } - #risk > div:nth-child(4) > i { + .risk > div:nth-child(4) > i { background-image: url(../images/1-2/r8.png); } - #risk > div:nth-child(4) > div > h6 { + .risk > div:nth-child(4) > div > h6 { background: linear-gradient(180deg, #FFFFFF 0%, #3B8CEF 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; } - #risk > div:nth-child(4) > div > p > span:nth-child(1) { + .risk > div:nth-child(4) > div > p > span:nth-child(1) { color: #3B8CEF; } diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 5374871b..6fe8e317 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -156047,9 +156047,9 @@ namespace Model private string _ProjectId; - private System.Nullable _EnergySavingIndex; + private System.Nullable _EnergySavingIndex; - private System.Nullable _WaterSavingIndex; + private System.Nullable _WaterSavingIndex; private string _EnergySavingSchemes; @@ -156061,13 +156061,13 @@ namespace Model private string _SupportingDocuments; - private System.Nullable _ActualEnergySaving; + private System.Nullable _ActualEnergySaving; - private System.Nullable _ActualWaterSaving; + private System.Nullable _ActualWaterSaving; - private System.Nullable _EnergySavingCompletionRate; + private System.Nullable _EnergySavingCompletionRate; - private System.Nullable _WaterSavingCompletionRate; + private System.Nullable _WaterSavingCompletionRate; private string _CompileMan; @@ -156087,9 +156087,9 @@ namespace Model partial void OnEnergyWaterConservationIdChanged(); partial void OnProjectIdChanging(string value); partial void OnProjectIdChanged(); - partial void OnEnergySavingIndexChanging(System.Nullable value); + partial void OnEnergySavingIndexChanging(System.Nullable value); partial void OnEnergySavingIndexChanged(); - partial void OnWaterSavingIndexChanging(System.Nullable value); + partial void OnWaterSavingIndexChanging(System.Nullable value); partial void OnWaterSavingIndexChanged(); partial void OnEnergySavingSchemesChanging(string value); partial void OnEnergySavingSchemesChanged(); @@ -156101,13 +156101,13 @@ namespace Model partial void OnSummaryChanged(); partial void OnSupportingDocumentsChanging(string value); partial void OnSupportingDocumentsChanged(); - partial void OnActualEnergySavingChanging(System.Nullable value); + partial void OnActualEnergySavingChanging(System.Nullable value); partial void OnActualEnergySavingChanged(); - partial void OnActualWaterSavingChanging(System.Nullable value); + partial void OnActualWaterSavingChanging(System.Nullable value); partial void OnActualWaterSavingChanged(); - partial void OnEnergySavingCompletionRateChanging(System.Nullable value); + partial void OnEnergySavingCompletionRateChanging(System.Nullable value); partial void OnEnergySavingCompletionRateChanged(); - partial void OnWaterSavingCompletionRateChanging(System.Nullable value); + partial void OnWaterSavingCompletionRateChanging(System.Nullable value); partial void OnWaterSavingCompletionRateChanged(); partial void OnCompileManChanging(string value); partial void OnCompileManChanged(); @@ -156168,8 +156168,8 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EnergySavingIndex", DbType="Int")] - public System.Nullable EnergySavingIndex + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EnergySavingIndex", DbType="Decimal(18,2)")] + public System.Nullable EnergySavingIndex { get { @@ -156188,8 +156188,8 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WaterSavingIndex", DbType="Int")] - public System.Nullable WaterSavingIndex + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WaterSavingIndex", DbType="Decimal(18,2)")] + public System.Nullable WaterSavingIndex { get { @@ -156308,8 +156308,8 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ActualEnergySaving", DbType="Int")] - public System.Nullable ActualEnergySaving + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ActualEnergySaving", DbType="Decimal(18,2)")] + public System.Nullable ActualEnergySaving { get { @@ -156328,8 +156328,8 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ActualWaterSaving", DbType="Int")] - public System.Nullable ActualWaterSaving + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ActualWaterSaving", DbType="Decimal(18,2)")] + public System.Nullable ActualWaterSaving { get { @@ -156348,8 +156348,8 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EnergySavingCompletionRate", DbType="Int")] - public System.Nullable EnergySavingCompletionRate + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EnergySavingCompletionRate", DbType="Decimal(18,2)")] + public System.Nullable EnergySavingCompletionRate { get { @@ -156368,8 +156368,8 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WaterSavingCompletionRate", DbType="Int")] - public System.Nullable WaterSavingCompletionRate + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WaterSavingCompletionRate", DbType="Decimal(18,2)")] + public System.Nullable WaterSavingCompletionRate { get { @@ -375141,6 +375141,8 @@ namespace Model private System.Nullable _GetStarTime; + private string _LastUnitId; + private EntitySet _Comprehensive_NCRManagement; private EntitySet _Comprehensive_PressurePipe; @@ -375939,6 +375941,8 @@ namespace Model partial void OnStarLevelIdChanged(); partial void OnGetStarTimeChanging(System.Nullable value); partial void OnGetStarTimeChanged(); + partial void OnLastUnitIdChanging(string value); + partial void OnLastUnitIdChanged(); #endregion public Sys_User() @@ -377442,6 +377446,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastUnitId", DbType="NVarChar(50)")] + public string LastUnitId + { + get + { + return this._LastUnitId; + } + set + { + if ((this._LastUnitId != value)) + { + this.OnLastUnitIdChanging(value); + this.SendPropertyChanging(); + this._LastUnitId = value; + this.SendPropertyChanged("LastUnitId"); + this.OnLastUnitIdChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Comprehensive_NCRManagement_Sys_User", Storage="_Comprehensive_NCRManagement", ThisKey="UserId", OtherKey="CompileMan", DeleteRule="NO ACTION")] public EntitySet Comprehensive_NCRManagement { diff --git a/SGGL/Model/ModelProc.cs b/SGGL/Model/ModelProc.cs index 57b3f5cc..91bbd782 100644 --- a/SGGL/Model/ModelProc.cs +++ b/SGGL/Model/ModelProc.cs @@ -11,13 +11,30 @@ namespace Model /// /// ȫΣͳ /// - /// + /// + /// + /// /// /// [Function(Name = "[dbo].[Sp_HazardFactor_Statistics]")] - public IEnumerable Sp_HazardFactor_Statistics([Parameter(DbType = "nvarchar(20)")] string year, [Parameter(DbType = "nvarchar(20)")] string month, [Parameter(DbType = "nvarchar(200)")] string projectId) + public IEnumerable Sp_HazardFactor_Statistics([Parameter(DbType = "nvarchar(20)")] string year, [Parameter(DbType = "nvarchar(20)")] string month, [Parameter(DbType = "nvarchar(200)")] string unitId, [Parameter(DbType = "nvarchar(200)")] string projectId) { - IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)MethodInfo.GetCurrentMethod()), year, month, projectId); + IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)MethodInfo.GetCurrentMethod()), year, month, unitId, projectId); + return (ISingleResult)result.ReturnValue; + } + + /// + /// ְҵΣͳ + /// + /// + /// + /// + /// + /// + [Function(Name = "[dbo].[Sp_HazardFactorOccHealth_Statistics]")] + public IEnumerable Sp_HazardFactorOccHealth_Statistics([Parameter(DbType = "nvarchar(20)")] string year, [Parameter(DbType = "nvarchar(20)")] string month, [Parameter(DbType = "nvarchar(200)")] string unitId, [Parameter(DbType = "nvarchar(200)")] string projectId) + { + IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)MethodInfo.GetCurrentMethod()), year, month, unitId, projectId); return (ISingleResult)result.ReturnValue; } @@ -86,7 +103,7 @@ namespace Model [Function(Name = "[dbo].[spInOutManHoursReport]")] public IEnumerable spInOutManHoursReport([Parameter(DbType = "nvarchar(50)")] string projectId, [Parameter(DbType = "nvarchar(max)")] string unitId, [Parameter(DbType = "nvarchar(max)")] string postId, [Parameter(DbType = "DateTime")] DateTime? startTime, [Parameter(DbType = "DateTime")] DateTime? endTime) { - IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)MethodInfo.GetCurrentMethod()), projectId, unitId, postId, startTime,endTime); + IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)MethodInfo.GetCurrentMethod()), projectId, unitId, postId, startTime, endTime); return (ISingleResult)result.ReturnValue; }
{0}
{0}{0}{0}