diff --git a/SGGL/BLL/API/HSSE/APIPageDataService.cs b/SGGL/BLL/API/HSSE/APIPageDataService.cs index 958b9c39..0ba8069e 100644 --- a/SGGL/BLL/API/HSSE/APIPageDataService.cs +++ b/SGGL/BLL/API/HSSE/APIPageDataService.cs @@ -76,7 +76,7 @@ namespace BLL public static int getSafeWorkTime(string projectId) { Model.SGGLDB db = Funs.DB; - int SafeHours = 0; + int SafeHours = 0; //// 查找当前项目 最新的人工时数量记录 int getMaxWorkHours = db.SitePerson_PersonInOutNumber.Where(x => x.ProjectId == projectId).Max(x => x.WorkHours) ?? 0; var getAllPersonInOutList = from x in db.SitePerson_PersonInOutNow @@ -125,7 +125,7 @@ namespace BLL where x.ProjectId == projectId && x.ChangeTime.Value.Year == dateValue.Year && x.ChangeTime.Value.Month == dateValue.Month && x.ChangeTime.Value.Day == dateValue.Day && x.IsIn == true select x; - return getDayAll.Select(x=>x.PersonId).Distinct().Count(); ; + return getDayAll.Select(x => x.PersonId).Distinct().Count(); ; } } #endregion @@ -141,9 +141,11 @@ namespace BLL { List getSiteInOutList = new List(); var getDayAll = from x in db.SitePerson_PersonInOutNow + join y in db.SitePerson_Person on x.PersonId equals y.PersonId + join z in db.Base_WorkPost on y.WorkPostId equals z.WorkPostId where x.ChangeTime.Value.Year == dateValue.Year && x.ChangeTime.Value.Month == dateValue.Month && x.ChangeTime.Value.Day == dateValue.Day - select x; + select new { x.PersonId, x.ChangeTime, x.IsIn, z.PostType }; if (getDayAll.Count() > 0) { var getInMaxs = from x in getDayAll diff --git a/SGGL/FineUIPro.Web/DataShow/Person1.aspx b/SGGL/FineUIPro.Web/DataShow/Person1.aspx new file mode 100644 index 00000000..96225640 --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShow/Person1.aspx @@ -0,0 +1,127 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Person1.aspx.cs" Inherits="FineUIPro.Web.DataShow.Person1" %> + + + + + + + + + 当前现场人员 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/DataShow/Person1.aspx.cs b/SGGL/FineUIPro.Web/DataShow/Person1.aspx.cs new file mode 100644 index 00000000..292f2d1b --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShow/Person1.aspx.cs @@ -0,0 +1,149 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; + +namespace FineUIPro.Web.DataShow +{ + public partial class Person1 : PageBase + { + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + BLL.ProjectService.InitProjectDropDownList(this.drpProject, true); + // 绑定表格t + BindGrid(); + this.Panel1.Title = "当前现场人员(" + BLL.UnitService.GetUnitNameByUnitId(BLL.Const.UnitId_CWCEC) + ")"; + } + } + + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = @"SELECT Person.ProjectId,Project.ProjectCode,Project.ProjectName,Unit.UnitId,Unit.UnitId,Unit.UnitName, + Person.PersonName,Person.PersonId,Person.IdentityCard,Person.Sex,Person.WorkPostId,WorkPost.WorkPostName,Person.Telephone + ,(CASE WHEN Sex=2 THEN '女' WHEN Sex=1 THEN '男' ELSE '' END) AS SexStr + FROM SitePerson_Person AS Person + LEFT JOIN Base_Project AS Project ON Person.ProjectId =Project.ProjectId + LEFT JOIN Base_Unit AS Unit ON Person.UnitId =Unit.UnitId + LEFT JOIN Base_WorkPost AS WorkPost ON Person.WorkPostId =WorkPost.WorkPostId + WHERE Person.PersonId in (select distinct PersonId from SitePerson_PersonInOutNow +where CONVERT(VARCHAR(10), GETDATE(), 23)=CONVERT(VARCHAR(10), ChangeTime, 23)) "; + List listStr = new List(); + if (this.drpProject.SelectedValue != Const._Null) + { + strSql += " AND Person.ProjectId = @ProjectId"; + listStr.Add(new SqlParameter("@ProjectId", this.drpProject.SelectedValue)); + } + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + + Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + } + #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 + + #region Grid双击事件 编辑 + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + EditData(); + } + + + /// + /// + /// + private void EditData() + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../HSSE/SitePerson/PersonListEdit.aspx?PersonId={0}&type=show", Grid1.SelectedRowID, "查看 - "))); + } + #endregion + + + protected void btnView_Click(object sender, EventArgs e) + { + EditData(); + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DataShow/Person1.aspx.designer.cs b/SGGL/FineUIPro.Web/DataShow/Person1.aspx.designer.cs new file mode 100644 index 00000000..a0aa4f6b --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShow/Person1.aspx.designer.cs @@ -0,0 +1,141 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.DataShow { + + + public partial class Person1 { + + /// + /// 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; + + /// + /// drpProject 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpProject; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// labNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label labNumber; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnView 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnView; + } +} diff --git a/SGGL/FineUIPro.Web/DataShow/Person2.aspx b/SGGL/FineUIPro.Web/DataShow/Person2.aspx new file mode 100644 index 00000000..dcbaff82 --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShow/Person2.aspx @@ -0,0 +1,127 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Person2.aspx.cs" Inherits="FineUIPro.Web.DataShow.Person2" %> + + + + + + + + + 作业人员总数 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/DataShow/Person2.aspx.cs b/SGGL/FineUIPro.Web/DataShow/Person2.aspx.cs new file mode 100644 index 00000000..bde213cd --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShow/Person2.aspx.cs @@ -0,0 +1,149 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; + +namespace FineUIPro.Web.DataShow +{ + public partial class Person2 : PageBase + { + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + BLL.ProjectService.InitProjectDropDownList(this.drpProject, true); + // 绑定表格t + BindGrid(); + this.Panel1.Title = "作业人员总数(" + BLL.UnitService.GetUnitNameByUnitId(BLL.Const.UnitId_CWCEC) + ")"; + } + } + + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = @"SELECT Person.ProjectId,Project.ProjectCode,Project.ProjectName,Unit.UnitId,Unit.UnitId,Unit.UnitName, + Person.PersonName,Person.PersonId,Person.IdentityCard,Person.Sex,Person.WorkPostId,WorkPost.WorkPostName,Person.Telephone + ,(CASE WHEN Sex=2 THEN '女' WHEN Sex=1 THEN '男' ELSE '' END) AS SexStr + FROM SitePerson_Person AS Person + LEFT JOIN Base_Project AS Project ON Person.ProjectId =Project.ProjectId + LEFT JOIN Base_Unit AS Unit ON Person.UnitId =Unit.UnitId + LEFT JOIN Base_WorkPost AS WorkPost ON Person.WorkPostId =WorkPost.WorkPostId + WHERE Person.PersonId in (select distinct PersonId from SitePerson_PersonInOutNow +where CONVERT(VARCHAR(10), GETDATE(), 23)=CONVERT(VARCHAR(10), ChangeTime, 23)) and (WorkPost.PostType is null or WorkPost.PostType!='1') "; + List listStr = new List(); + if (this.drpProject.SelectedValue != Const._Null) + { + strSql += " AND Person.ProjectId = @ProjectId"; + listStr.Add(new SqlParameter("@ProjectId", this.drpProject.SelectedValue)); + } + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + + Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + } + #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 + + #region Grid双击事件 编辑 + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + EditData(); + } + + + /// + /// + /// + private void EditData() + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../HSSE/SitePerson/PersonListEdit.aspx?PersonId={0}&type=show", Grid1.SelectedRowID, "查看 - "))); + } + #endregion + + + protected void btnView_Click(object sender, EventArgs e) + { + EditData(); + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DataShow/Person2.aspx.designer.cs b/SGGL/FineUIPro.Web/DataShow/Person2.aspx.designer.cs new file mode 100644 index 00000000..df86c51f --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShow/Person2.aspx.designer.cs @@ -0,0 +1,141 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.DataShow { + + + public partial class Person2 { + + /// + /// 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; + + /// + /// drpProject 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpProject; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// labNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label labNumber; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnView 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnView; + } +} diff --git a/SGGL/FineUIPro.Web/DataShow/Person3.aspx b/SGGL/FineUIPro.Web/DataShow/Person3.aspx new file mode 100644 index 00000000..9e836666 --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShow/Person3.aspx @@ -0,0 +1,127 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Person3.aspx.cs" Inherits="FineUIPro.Web.DataShow.Person3" %> + + + + + + + + + 管理人员总数 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/DataShow/Person3.aspx.cs b/SGGL/FineUIPro.Web/DataShow/Person3.aspx.cs new file mode 100644 index 00000000..bda66e82 --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShow/Person3.aspx.cs @@ -0,0 +1,149 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; + +namespace FineUIPro.Web.DataShow +{ + public partial class Person3 : PageBase + { + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + BLL.ProjectService.InitProjectDropDownList(this.drpProject, true); + // 绑定表格t + BindGrid(); + this.Panel1.Title = "管理人员总数(" + BLL.UnitService.GetUnitNameByUnitId(BLL.Const.UnitId_CWCEC) + ")"; + } + } + + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = @"SELECT Person.ProjectId,Project.ProjectCode,Project.ProjectName,Unit.UnitId,Unit.UnitId,Unit.UnitName, + Person.PersonName,Person.PersonId,Person.IdentityCard,Person.Sex,Person.WorkPostId,WorkPost.WorkPostName,Person.Telephone + ,(CASE WHEN Sex=2 THEN '女' WHEN Sex=1 THEN '男' ELSE '' END) AS SexStr + FROM SitePerson_Person AS Person + LEFT JOIN Base_Project AS Project ON Person.ProjectId =Project.ProjectId + LEFT JOIN Base_Unit AS Unit ON Person.UnitId =Unit.UnitId + LEFT JOIN Base_WorkPost AS WorkPost ON Person.WorkPostId =WorkPost.WorkPostId + WHERE Person.PersonId in (select distinct PersonId from SitePerson_PersonInOutNow +where CONVERT(VARCHAR(10), GETDATE(), 23)=CONVERT(VARCHAR(10), ChangeTime, 23)) and WorkPost.PostType='1' "; + List listStr = new List(); + if (this.drpProject.SelectedValue != Const._Null) + { + strSql += " AND Person.ProjectId = @ProjectId"; + listStr.Add(new SqlParameter("@ProjectId", this.drpProject.SelectedValue)); + } + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + + Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + } + #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 + + #region Grid双击事件 编辑 + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + EditData(); + } + + + /// + /// + /// + private void EditData() + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../HSSE/SitePerson/PersonListEdit.aspx?PersonId={0}&type=show", Grid1.SelectedRowID, "查看 - "))); + } + #endregion + + + protected void btnView_Click(object sender, EventArgs e) + { + EditData(); + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DataShow/Person3.aspx.designer.cs b/SGGL/FineUIPro.Web/DataShow/Person3.aspx.designer.cs new file mode 100644 index 00000000..791fe2c2 --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShow/Person3.aspx.designer.cs @@ -0,0 +1,141 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.DataShow { + + + public partial class Person3 { + + /// + /// 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; + + /// + /// drpProject 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpProject; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// labNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label labNumber; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnView 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnView; + } +} diff --git a/SGGL/FineUIPro.Web/DataShow/SafePerson.aspx b/SGGL/FineUIPro.Web/DataShow/SafePerson.aspx new file mode 100644 index 00000000..f6ccc6c5 --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShow/SafePerson.aspx @@ -0,0 +1,127 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafePerson.aspx.cs" Inherits="FineUIPro.Web.DataShow.SafePerson" %> + + + + + + + + + 安全管理人员 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/DataShow/SafePerson.aspx.cs b/SGGL/FineUIPro.Web/DataShow/SafePerson.aspx.cs new file mode 100644 index 00000000..9b40d41a --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShow/SafePerson.aspx.cs @@ -0,0 +1,149 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; + +namespace FineUIPro.Web.DataShow +{ + public partial class SafePerson : PageBase + { + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + BLL.ProjectService.InitProjectDropDownList(this.drpProject, true); + // 绑定表格t + BindGrid(); + this.Panel1.Title = "安全管理人员(" + BLL.UnitService.GetUnitNameByUnitId(BLL.Const.UnitId_CWCEC) + ")"; + } + } + + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = @"SELECT Person.ProjectId,Project.ProjectCode,Project.ProjectName,Unit.UnitId,Unit.UnitId,Unit.UnitName, + Person.PersonName,Person.PersonId,Person.IdentityCard,Person.Sex,Person.WorkPostId,WorkPost.WorkPostName,Person.Telephone + ,(CASE WHEN Sex=2 THEN '女' WHEN Sex=1 THEN '男' ELSE '' END) AS SexStr + FROM SitePerson_Person AS Person + LEFT JOIN Base_Project AS Project ON Person.ProjectId =Project.ProjectId + LEFT JOIN Base_Unit AS Unit ON Person.UnitId =Unit.UnitId + LEFT JOIN Base_WorkPost AS WorkPost ON Person.WorkPostId =WorkPost.WorkPostId + WHERE IsUsed=1 AND InTime <=GETDATE() AND (OutTime IS NULL OR OutTime > GETDATE()) "; + List listStr = new List(); + if (this.drpProject.SelectedValue != Const._Null) + { + strSql += " AND Person.ProjectId = @ProjectId"; + listStr.Add(new SqlParameter("@ProjectId", this.drpProject.SelectedValue)); + } + strSql += " AND WorkPost.IsHsse = 1"; + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + + Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + } + #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 + + #region Grid双击事件 编辑 + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + EditData(); + } + + + /// + /// + /// + private void EditData() + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../HSSE/SitePerson/PersonListEdit.aspx?PersonId={0}&type=show", Grid1.SelectedRowID, "查看 - "))); + } + #endregion + + + protected void btnView_Click(object sender, EventArgs e) + { + EditData(); + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DataShow/SafePerson.aspx.designer.cs b/SGGL/FineUIPro.Web/DataShow/SafePerson.aspx.designer.cs new file mode 100644 index 00000000..5c5c5dec --- /dev/null +++ b/SGGL/FineUIPro.Web/DataShow/SafePerson.aspx.designer.cs @@ -0,0 +1,141 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.DataShow { + + + public partial class SafePerson { + + /// + /// 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; + + /// + /// drpProject 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpProject; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// labNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label labNumber; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnView 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnView; + } +} diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 1697db4f..ced4b92e 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -619,6 +619,9 @@ + + + @@ -632,6 +635,7 @@ + @@ -8717,6 +8721,27 @@ Meeting.aspx + + Person1.aspx + ASPXCodeBehind + + + Person1.aspx + + + Person2.aspx + ASPXCodeBehind + + + Person2.aspx + + + Person3.aspx + ASPXCodeBehind + + + Person3.aspx + Project.aspx ASPXCodeBehind @@ -8808,6 +8833,13 @@ QualityTrainingItem2.aspx + + SafePerson.aspx + ASPXCodeBehind + + + SafePerson.aspx + SecurityCost.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user index 63ca13cc..9e91deff 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user @@ -1,7 +1,7 @@  - Release|Any CPU + Debug|Any CPU true false diff --git a/SGGL/FineUIPro.Web/Web.config b/SGGL/FineUIPro.Web/Web.config index 963148f2..f50b26d3 100644 --- a/SGGL/FineUIPro.Web/Web.config +++ b/SGGL/FineUIPro.Web/Web.config @@ -77,7 +77,7 @@ - + diff --git a/SGGL/FineUIPro.Web/common/main_new.aspx b/SGGL/FineUIPro.Web/common/main_new.aspx index 0c377a35..e6d60849 100644 --- a/SGGL/FineUIPro.Web/common/main_new.aspx +++ b/SGGL/FineUIPro.Web/common/main_new.aspx @@ -54,7 +54,7 @@
-
安全管理人员
+
安全管理人员
0
@@ -63,8 +63,8 @@
-
整改数据
-
+
整改数据
+
154564
@@ -161,23 +161,23 @@
-
+
人员信息
-
+
当前现场人数
0
-
+
作业人员总数
0
-
+
管理人员总数
0
- +
@@ -394,6 +394,8 @@ $('iframe').attr('src', '../DataShow/HiddenRectification.aspx') //隐患排查-一般隐患 window.open("../DataShow/HiddenRectification.aspx") + }else if (type == 'HiddenRectification') { + window.open("../DataShow/HiddenRectification.aspx") //整改数据 } else if (type == 'yhpc' && tabType == "zd") { $('iframe').attr('src', '../DataShow/HiddenRectification.aspx')//隐患排查-重大隐患 @@ -407,6 +409,22 @@ // $('iframe').attr('src', '../InterfacePopup/CQMS/QualityProblem.aspx') //质量共检数据 window.open("../DataShow/InspectionManagement.aspx") + }else if (type == 'SafePerson') { + // $('iframe').attr('src', '../InterfacePopup/CQMS/QualityProblem.aspx') //安全管理人员数据 + window.open("../DataShow/SafePerson.aspx") + + }else if (type == 'Person1') { + // $('iframe').attr('src', '../InterfacePopup/CQMS/QualityProblem.aspx') //当前现场人员数据 + window.open("../DataShow/Person1.aspx") + + }else if (type == 'Person2') { + // $('iframe').attr('src', '../InterfacePopup/CQMS/QualityProblem.aspx') //作业人员总数数据 + window.open("../DataShow/Person2.aspx") + + }else if (type == 'Person3') { + // $('iframe').attr('src', '../InterfacePopup/CQMS/QualityProblem.aspx') //管理人员总数数据 + window.open("../DataShow/Person3.aspx") + }else if (type == 'WeldOneOK') { // $('iframe').attr('src', '../InterfacePopup/CQMS/QualityProblem.aspx') //焊接一次合格数据 window.open("../DataShow/WeldOneOK.aspx") diff --git a/SGGL/FineUIPro.Web/common/main_new.aspx.cs b/SGGL/FineUIPro.Web/common/main_new.aspx.cs index 45761dd8..ad510982 100644 --- a/SGGL/FineUIPro.Web/common/main_new.aspx.cs +++ b/SGGL/FineUIPro.Web/common/main_new.aspx.cs @@ -58,7 +58,7 @@ namespace FineUIPro.Web.common //安全管理人员 var allSum = from x in Funs.DB.SitePerson_Person - where x.IsUsed == true + where x.IsUsed == true && x.InTime < DateTime.Now && (x.OutTime == null || x.OutTime > DateTime.Now) select x; var glAllPerson = from x in allSum join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId diff --git a/SGGL/FineUIPro.Web/common/main_new0.aspx b/SGGL/FineUIPro.Web/common/main_new0.aspx index f5f642b2..3cf81a61 100644 --- a/SGGL/FineUIPro.Web/common/main_new0.aspx +++ b/SGGL/FineUIPro.Web/common/main_new0.aspx @@ -77,7 +77,7 @@
-
+
项目人数
@@ -150,7 +150,7 @@
0
-
+
安全云监控
@@ -217,7 +217,7 @@
-
+
隐患排查治理数据
一般隐患 @@ -225,7 +225,7 @@
-
+
整改闭环项
@@ -253,7 +253,7 @@
-
事故事件数据 +
事故事件数据 <%--
企业级 项目级 @@ -273,9 +273,9 @@
-
+
应急管理数据
-
+
<%=GetCompanyComprehensivePlanNum() %>
综合预案
@@ -294,9 +294,9 @@
-
+
安全教育培训人次数数据
-
+
三级安全教育培训
<%=GetSafeTrainNum() %>
@@ -311,11 +311,11 @@
-
-
安全数据分析
+
+
风险数据分析
-
+
应急管理数据
危大工程 @@ -323,7 +323,7 @@
-
+
审批完成
<%=GetCompletedNum() %>
@@ -450,6 +450,11 @@ window.open("../DataShow/ConstructionEquipment.aspx") + } else if (type == 'Video') { + var videoURL ='<%=VideoURL %>' + window.open(videoURL + "#/screen", '_blank'); //视频监控 + + } else if (type == 'HighRiskWorkPermit') { $('iframe').attr('src', '../DataShow/License.aspx') //高风险作业许可 diff --git a/SGGL/FineUIPro.Web/common/main_new0.aspx.cs b/SGGL/FineUIPro.Web/common/main_new0.aspx.cs index 9e3f804d..d6d2bf81 100644 --- a/SGGL/FineUIPro.Web/common/main_new0.aspx.cs +++ b/SGGL/FineUIPro.Web/common/main_new0.aspx.cs @@ -2,6 +2,7 @@ using Newtonsoft.Json; using System; using System.Collections.Generic; +using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Linq; @@ -21,8 +22,68 @@ namespace FineUIPro.Web.common if (!IsPostBack) { //安监人员数据 - getPersonNum(); + //企业总部总监人数 + Model.SGGLDB db = Funs.DB; + var unitId = string.Empty; + var thisUnit = CommonService.GetIsThisUnit(); + if (thisUnit != null) unitId = thisUnit.UnitId; + div_qyzbzjrs.InnerHtml = (from x in db.Person_CompanyBranchPerson + where x.IsOnJob == true && x.WorkPostId == Const.WorkPost_HSSEDirector && x.UnitId == unitId + select x).Count().ToString(); + div_qyzbrs1.InnerHtml = (from x in db.SitePerson_Person + where x.IsUsed == true && x.WorkPostId == Const.WorkPost_HSSEDirector + select x).Count().ToString(); + //企业总部专职人数 + div_qyzbzzrs.InnerHtml = (from x in db.Person_CompanyBranchPerson + join y in db.Base_WorkPost on x.WorkPostId equals y.WorkPostId + where x.IsOnJob == true && y.IsHsse == true && x.UnitId == unitId + select x).Count().ToString(); + div_qyzbzzrs1.InnerHtml = (from x in db.SitePerson_Person + join y in db.Base_WorkPost on x.WorkPostId equals y.WorkPostId + where x.IsUsed == true && y.IsHsse == true + select x).Count().ToString(); + //分支机构总监人数 + div_fzjgzjrs.InnerHtml = (from x in db.Person_CompanyBranchPerson + where x.IsOnJob == true && x.WorkPostId == Const.WorkPost_HSSEDirector && x.UnitId != unitId + select x).Count().ToString(); + //分支机构专职人数 + div_fzjgzzrs.InnerHtml = (from x in db.Person_CompanyBranchPerson + join y in db.Base_WorkPost on x.WorkPostId equals y.WorkPostId + where x.IsOnJob == true && y.IsHsse == true && x.UnitId != unitId + select x).Count().ToString(); + //企业总部参建人数 + div_qyzbcjrs.InnerHtml = (from x in db.SitePerson_Person where x.IsUsed == true select x).Count().ToString(); + //项目总监 + div_xmrs.InnerHtml = (from x in db.SitePerson_Person + where x.WorkPostId == Const.WorkPost_HSSEDirector && x.IsUsed == true + select x).Count().ToString(); + //项目专职 + div_xmzzrs.InnerHtml = (from x in db.SitePerson_Person + join y in db.Base_WorkPost on x.WorkPostId equals y.WorkPostId + where y.IsHsse == true && x.IsUsed == true + select x).Count().ToString(); + //项目参建 + div_xmcjrs.InnerHtml = (from x in db.SitePerson_Person + where x.IsUsed == true + select x).Count().ToString(); + + //注安师 + var ZasSql = @"SELECT Person.ProjectId,Project.ProjectCode,Project.ProjectName,Unit.UnitId,Unit.UnitId,Unit.UnitName, + Person.PersonName,Person.PersonId,Person.IdentityCard,Person.Sex,Person.WorkPostId,WorkPost.WorkPostName,Person.Telephone + ,(CASE WHEN Sex=2 THEN '女' WHEN Sex=1 THEN '男' ELSE '' END) AS SexStr + FROM SitePerson_Person AS Person + LEFT JOIN Base_Project AS Project ON Person.ProjectId =Project.ProjectId + LEFT JOIN Base_Unit AS Unit ON Person.UnitId =Unit.UnitId + LEFT JOIN Base_WorkPost AS WorkPost ON Person.WorkPostId =WorkPost.WorkPostId + WHERE IsUsed=1 AND InTime <=GETDATE() AND (OutTime IS NULL OR OutTime > GETDATE()) + AND (SELECT COUNT(*) FROM QualityAudit_PersonQuality AS Q LEFT JOIN Base_Certificate AS Cer ON Q.CertificateId + =Cer.CertificateId WHERE Q.PersonId = Person.PersonId AND IsRegisterHSSE =1) > 0"; + List listStr = new List(); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(ZasSql, parameter); + + div_zasrs.InnerHtml = tb.Rows.Count.ToString(); //项目信息 getProjectInfo(); @@ -34,65 +95,25 @@ namespace FineUIPro.Web.common } } - #region 加载人数 - protected void getPersonNum() + protected string VideoURL { - //企业总部总监人数 - div_qyzbzjrs.InnerHtml = HSSEData_HSSEService.GetHeadOfficeInspectorGeneralNum().ToString(); - div_qyzbrs1.InnerHtml = HSSEData_HSSEService.GetHeadOfficeInspectorGeneralNum().ToString(); - //企业总部专职人数 - div_qyzbzzrs.InnerHtml = HSSEData_HSSEService.GetHeadOfficeFullTimeNum().ToString(); - div_qyzbzzrs1.InnerHtml = HSSEData_HSSEService.GetHeadOfficeFullTimeNum().ToString(); - //分支机构总监人数 - div_fzjgzjrs.InnerHtml = HSSEData_HSSEService.GetBranchInspectorGeneralNum().ToString(); - //分支机构专职人数 - div_fzjgzzrs.InnerHtml = HSSEData_HSSEService.GetBranchFullTimeNum().ToString(); - //企业总部参建人数 - div_qyzbcjrs.InnerHtml = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true select x).Count().ToString(); - - //项目总监 - div_xmrs.InnerHtml = (from x in Funs.DB.SitePerson_Person - where x.WorkPostId == Const.WorkPost_ProjectHSSEDirector && x.IsUsed == true - select x).Count().ToString(); - //项目专职 - div_xmzzrs.InnerHtml = (from x in Funs.DB.SitePerson_Person - join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId - where y.IsHsse == true && x.IsUsed == true - select x).Count().ToString(); - //项目参建 - div_xmcjrs.InnerHtml = (from x in Funs.DB.SitePerson_Person - where x.IsUsed == true - select x).Count().ToString(); - - //注安师 - var ZasSql = @"SELECT Person.ProjectId,Project.ProjectCode,Project.ProjectName,Unit.UnitId,Unit.UnitId,Unit.UnitName, - Person.PersonName,Person.PersonId,Person.IdentityCard,Person.Sex,Person.WorkPostId,WorkPost.WorkPostName,Person.Telephone - ,(CASE WHEN Sex=2 THEN '女' WHEN Sex=1 THEN '男' ELSE '' END) AS SexStr - FROM SitePerson_Person AS Person - LEFT JOIN Base_Project AS Project ON Person.ProjectId =Project.ProjectId - LEFT JOIN Base_Unit AS Unit ON Person.UnitId =Unit.UnitId - LEFT JOIN Base_WorkPost AS WorkPost ON Person.WorkPostId =WorkPost.WorkPostId - WHERE IsUsed=1 AND InTime <=GETDATE() AND (OutTime IS NULL OR OutTime > GETDATE()) - AND (SELECT COUNT(*) FROM QualityAudit_PersonQuality AS Q LEFT JOIN Base_Certificate AS Cer ON Q.CertificateId - =Cer.CertificateId WHERE Q.PersonId = Person.PersonId AND IsRegisterHSSE =1) > 0"; - List listStr = new List(); - SqlParameter[] parameter = listStr.ToArray(); - DataTable tb = SQLHelper.GetDataTableRunText(ZasSql, parameter); - - div_zasrs.InnerHtml = tb.Rows.Count.ToString(); + get + { + return ConfigurationManager.AppSettings["Video_URL"] + "#/screen"; + } } - #endregion #region 加载项目信息 protected void getProjectInfo() { - var list = Funs.DB.Base_Project; + Model.SGGLDB db = Funs.DB; + var list = db.Base_Project; //在建项目 div_zjxm.InnerHtml = list.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null)).Count().ToString(); //停工项目 div_tgxm.InnerHtml = list.Where(x => (x.ProjectState == Const.ProjectState_2 || x.ProjectState == null)).Count().ToString(); //在施危大工程 - div_wdxm.InnerHtml = Funs.DB.Solution_LargerHazard.Where(x => x.States == Const.State_2).Count().ToString(); + div_wdxm.InnerHtml = db.Solution_LargerHazard.Where(x => x.States == Const.State_2).Count().ToString(); //安全工时数 //int wHours = Funs.DB.SitePerson_PersonInOutNumber.Max(x => x.WorkHours) ?? 0; this.div_safeworktime.InnerHtml = Count3().ToString().Split('.')[0]; @@ -106,37 +127,38 @@ namespace FineUIPro.Web.common /// protected decimal Count3() { - decimal cout1 = 0; - var getAllPersonInOutList = from x in Funs.DB.SitePerson_PersonInOutNumber - select x; + Model.SGGLDB db = Funs.DB; + decimal cout1 = 0; + var getAllPersonInOutList = from x in db.SitePerson_PersonInOutNumber + select x; + if (getAllPersonInOutList.Count() > 0) + { if (getAllPersonInOutList.Count() > 0) { - if (getAllPersonInOutList.Count() > 0) - { - cout1 = getAllPersonInOutList.Sum(x => (long)x.WorkHours); - } + cout1 = getAllPersonInOutList.Sum(x => (long)x.WorkHours); } + } - var getD1 = from x in Funs.DB.Accident_AccidentHandle - join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId - where y.ProjectState == Const.ProjectState_1 - select x; - var getD2 = from x in Funs.DB.Accident_AccidentReport - join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId - where y.ProjectState == Const.ProjectState_1 - select x; - - + var getD1 = from x in db.Accident_AccidentHandle + join y in db.Base_Project on x.ProjectId equals y.ProjectId + where y.ProjectState == Const.ProjectState_1 + select x; + var getD2 = from x in db.Accident_AccidentReport + join y in db.Base_Project on x.ProjectId equals y.ProjectId + where y.ProjectState == Const.ProjectState_1 + select x; - if (getD1.Count() > 0) - { - cout1 = cout1 - getD1.Sum(x => x.WorkHoursLoss ?? 0); - } - if (getD2.Count() > 0) - { - cout1 = cout1 - getD2.Sum(x => x.WorkingHoursLoss ?? 0); - } + + + if (getD1.Count() > 0) + { + cout1 = cout1 - getD1.Sum(x => x.WorkHoursLoss ?? 0); + } + if (getD2.Count() > 0) + { + cout1 = cout1 - getD2.Sum(x => x.WorkingHoursLoss ?? 0); + } return cout1; } @@ -155,7 +177,9 @@ namespace FineUIPro.Web.common /// protected void getProjectYh() { - var list = Funs.DB.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null)).ToList(); + Model.SGGLDB db = Funs.DB; + var list = db.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null)).ToList(); + var hazardRegisters = from x in db.HSSE_Hazard_HazardRegister select x; if (list.Count > 0) { foreach (var item in list) @@ -164,17 +188,34 @@ namespace FineUIPro.Web.common //一般 allYhYb += "'" + - (Project_HSSEData_HSSEService.GetGeneralClosedNum(item.ProjectId) + - Project_HSSEData_HSSEService.GetGeneralNotClosedNum(item.ProjectId)) + - "',"; - dzgYhYb += "'" + Project_HSSEData_HSSEService.GetGeneralNotClosedNum(item.ProjectId) + "',"; + ((from x in hazardRegisters + where x.ProjectId == item.ProjectId && x.Risk_Level == "一般" && x.States == "3" && + x.CheckTime > Const.DtmarkTime + select x).Count() + + (from x in hazardRegisters + where x.ProjectId == item.ProjectId && x.Risk_Level == "一般" && x.States != "3" && + x.CheckTime > Const.DtmarkTime + select x).Count()) + "',"; + dzgYhYb += "'" + (from x in hazardRegisters + where x.ProjectId == item.ProjectId && x.Risk_Level == "一般" && x.States != "3" && + x.CheckTime > Const.DtmarkTime + select x).Count() + "',"; //重大 allYhZd += "'" + - (Project_HSSEData_HSSEService.GetMajorClosedNum(item.ProjectId) + - Project_HSSEData_HSSEService.GetMajorNotClosedNum(item.ProjectId)) + + ((from x in hazardRegisters + where x.ProjectId == item.ProjectId && x.Risk_Level == "重大" && x.States == "3" && + x.CheckTime > Const.DtmarkTime + select x).Count() + + (from x in hazardRegisters + where x.ProjectId == item.ProjectId && x.Risk_Level == "重大" && x.States != "3" && + x.CheckTime > Const.DtmarkTime + select x).Count()) + "',"; - dzgYhZd += "'" + Project_HSSEData_HSSEService.GetMajorNotClosedNum(item.ProjectId) + "',"; + dzgYhZd += "'" + (from x in hazardRegisters + where x.ProjectId == item.ProjectId && x.Risk_Level == "重大" && x.States != "3" && + x.CheckTime > Const.DtmarkTime + select x).Count() + "',"; } yhXmmc = yhXmmc.TrimEnd(','); @@ -194,7 +235,7 @@ namespace FineUIPro.Web.common //企业专题 div_qyzt.InnerHtml = HSSEData_HSSEService.GetEnterpriseTopicsMeetingNum().ToString(); //项目安全领导小组 - div_xmaqldxz.InnerHtml = Funs.DB.Meeting_SafetyLeaderGroupMeeting.Where(x=> x.CompileDate > Const.DtmarkTime).Count().ToString(); + div_xmaqldxz.InnerHtml = Funs.DB.Meeting_SafetyLeaderGroupMeeting.Where(x => x.CompileDate > Const.DtmarkTime).Count().ToString(); //项目安全例会 DateTime date = DateTime.Now; div_xmalh.InnerHtml = ((from x in Funs.DB.Meeting_WeekMeeting where x.WeekMeetingDate.Value.Year == date.Year && x.WeekMeetingDate.Value.Month == date.Month && x.WeekMeetingDate.Value.Day == date.Day select x).Count() @@ -362,7 +403,7 @@ namespace FineUIPro.Web.common return HSSEData_HSSEService.GetCompanyLeadShiftCheckNum(); } - + /// /// 获取企业综合检查次数 @@ -583,7 +624,7 @@ namespace FineUIPro.Web.common { var result = (from x in Funs.DB.EduTrain_TrainRecord join y in Funs.DB.Base_TrainType on x.TrainTypeId equals y.TrainTypeId - where y.TrainType == "3" && x.TrainStartDate > Const.DtmarkTime + where y.TrainType == "3" && x.TrainStartDate > Const.DtmarkTime select x).Count(); return result; } @@ -598,7 +639,7 @@ namespace FineUIPro.Web.common { var result = (from x in Funs.DB.Hazard_HazardSelectedItem join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId - where y.RiskLevel == 2 && (x.IsStart == true || x.State == "1") + where y.RiskLevel == 2 && (x.IsStart == true || x.State == "1") select x).Count(); return result; } @@ -611,7 +652,7 @@ namespace FineUIPro.Web.common { var result = (from x in Funs.DB.Hazard_HazardSelectedItem join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId - where y.RiskLevel == 1 && (x.IsStart == true || x.State == "1") + where y.RiskLevel == 1 && (x.IsStart == true || x.State == "1") select x).Count(); return result; } @@ -651,7 +692,7 @@ namespace FineUIPro.Web.common public static int GetCompletedNum() { var result = (from x in Funs.DB.Solution_LargerHazard - where x.States != "0" && x.IsSuperLargerHazard == false && + where x.States != "0" && x.IsSuperLargerHazard == false && x.RecordTime > Const.DtmarkTime select x).Count(); return result; diff --git a/SGGL/WebAPI/WebAPI.csproj.user b/SGGL/WebAPI/WebAPI.csproj.user index bd497c6b..5fe155da 100644 --- a/SGGL/WebAPI/WebAPI.csproj.user +++ b/SGGL/WebAPI/WebAPI.csproj.user @@ -1,7 +1,7 @@  - Release|Any CPU + Debug|Any CPU true