diff --git a/DataBase/版本日志/SGGLDB_V2023-09-15.sql b/DataBase/版本日志/SGGLDB_V2023-09-15.sql new file mode 100644 index 00000000..11bc14c7 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-09-15.sql @@ -0,0 +1,3 @@ +INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +VALUES('70282169-C09D-4D46-BAA3-9457535EAEA2','ǰֳԱͳ','HSSE/SitePerson/SitePersonNowStatistic.aspx',62,'EE260447-028F-46AF-8864-9A5DC9DAA5BD','Menu_HSSE',0,1,1) +GO \ No newline at end of file diff --git a/DataBase/菜单初始化脚本/1-3安全管理(Menu_HSSE).sql b/DataBase/菜单初始化脚本/1-3安全管理(Menu_HSSE).sql index 6a91ac74..88d645b9 100644 --- a/DataBase/菜单初始化脚本/1-3安全管理(Menu_HSSE).sql +++ b/DataBase/菜单初始化脚本/1-3安全管理(Menu_HSSE).sql @@ -340,7 +340,10 @@ GO INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) VALUES('7D36E853-CC79-48B9-9E7F-E34797B4E87E','ֳԱͳ','HSSE/SitePerson/PersonStatistic.aspx',60,'EE260447-028F-46AF-8864-9A5DC9DAA5BD','Menu_HSSE',0,1,1) GO - + + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('70282169-C09D-4D46-BAA3-9457535EAEA2','ǰֳԱͳ','HSSE/SitePerson/SitePersonNowStatistic.aspx',62,'EE260447-028F-46AF-8864-9A5DC9DAA5BD','Menu_HSSE',0,1,1) + GO INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) VALUES('F291CAE4-2E53-48FC-BF44-382D42EA4DEC','ֳλ˹ʱͳ','HSSE/SitePerson/WorkPostStatistic.aspx',65,'EE260447-028F-46AF-8864-9A5DC9DAA5BD','Menu_HSSE',0,1,1) GO diff --git a/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs b/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs index 09cd0116..7c164beb 100644 --- a/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs +++ b/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs @@ -137,7 +137,7 @@ namespace BLL /// 页码 /// 每页数量 /// - public static IEnumerable getInPsersonListData(string projectId, string unitId, string personName, string identityCard, Grid Grid1) + public static IEnumerable getInPersonListData(string projectId, string unitId, string personName, string identityCard, Grid Grid1) { IQueryable getInPersonList = getInPersonLists.Where(x => x.ProjectId == projectId); if (!string.IsNullOrEmpty(unitId) && unitId != Const._Null) @@ -183,6 +183,103 @@ namespace BLL } #endregion + #region 现场当前人员列表 + /// + /// 记录数 + /// + public static int nowCount + { + get; + set; + } + + /// + /// 定义变量 + /// + private static IQueryable getNowPersonLists = from x in db.SitePerson_PersonInOutNow + select x; + + /// + /// 获取分页列表 + /// + /// 页码 + /// 每页数量 + /// + public static IEnumerable getNowPersonListData(string projectId, string unitId, string workPostId, string personName, string identityCard, DateTime dateValue, Grid Grid1) + { + IQueryable getDayAll = getNowPersonLists.Where(x=>x.ProjectId == projectId + && x.ChangeTime.Value.Year == dateValue.Year && x.ChangeTime.Value.Month == dateValue.Month + && x.ChangeTime.Value.Day == dateValue.Day); + if (!string.IsNullOrEmpty(unitId) && unitId != Const._Null) + { + getDayAll = getDayAll.Where(x => x.UnitId == unitId); + } + if (!string.IsNullOrEmpty(personName)) + { + getDayAll = getDayAll.Where(x => x.PersonName.Contains(personName)); + } + if (!string.IsNullOrEmpty(identityCard)) + { + getDayAll = getDayAll.Where(x => x.IdentityCard.Contains(identityCard)); + } + if (!string.IsNullOrEmpty(workPostId) && workPostId != Const._Null) + { + getDayAll = getDayAll.Where(x => x.WorkPostId == workPostId); + } + + if (getDayAll.Count() > 0) + { + var getInMaxs = from x in getDayAll + group x by x.PersonId into g + select new + { + ProjectId = g.First().ProjectId, + PersonId = g.First().PersonId, + personName = g.First().PersonName, + identityCard = g.First().IdentityCard, + UnitId = g.First().UnitId, + UnitName = g.First().UnitName, + WorkPostName = g.First().WorkPostName, + ChangeTime = g.Max(x => x.ChangeTime), + IsIn = g.First().IsIn, + PostType = g.First().PostType, + WorkPostId = g.First().WorkPostId, + }; + + if (getInMaxs.Count() > 0) + { + getInMaxs = getInMaxs.Where(x => x.IsIn == true); + } + inCount = getInMaxs.Count(); + if (inCount == 0) + { + return null; + } + + getInMaxs = SortConditionHelper.SortingAndPaging(getInMaxs, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in getInMaxs + select new + { + x.PersonId, + x.personName, + x.identityCard, + CardNo =db.SitePerson_Person.First(p=>p.PersonId == x.PersonId && p.ProjectId ==x.ProjectId).CardNo, + x.UnitName, + x.UnitId, + x.WorkPostId, + x.WorkPostName, + TeamGroupName=TeamGroupService.GetTeamGroupNameByPersonId(x.ProjectId,x.PersonId), + x.ChangeTime, + }; + } + else + { + inCount =0; + return null; + } + } + #endregion + #region 获取项目人员 -- 按条件查询 #region 根据现场人员主键获取现场人员信息 /// diff --git a/SGGL/BLL/ProjectData/TeamGroupService.cs b/SGGL/BLL/ProjectData/TeamGroupService.cs index 6eaa579c..f4ef60c2 100644 --- a/SGGL/BLL/ProjectData/TeamGroupService.cs +++ b/SGGL/BLL/ProjectData/TeamGroupService.cs @@ -167,5 +167,20 @@ namespace BLL } return name; } + + public static string GetTeamGroupNameByPersonId(string projectId, string personId) + { + string name = string.Empty; + var getSitePerson = Funs.DB.SitePerson_Person.FirstOrDefault(x => x.ProjectId == projectId && x.PersonId == personId); + if (getSitePerson != null) + { + var TeamGroup = Funs.DB.ProjectData_TeamGroup.FirstOrDefault(x => x.TeamGroupId == getSitePerson.TeamGroupId); + if (TeamGroup != null) + { + name = TeamGroup.TeamGroupName; + } + } + return name; + } } } diff --git a/SGGL/FineUIPro.Web/ErrLog.txt b/SGGL/FineUIPro.Web/ErrLog.txt index e69de29b..b6c9349c 100644 --- a/SGGL/FineUIPro.Web/ErrLog.txt +++ b/SGGL/FineUIPro.Web/ErrLog.txt @@ -0,0 +1,32 @@ + +错误信息开始=====> +错误类型:NullReferenceException +错误信息:未将对象引用设置到对象的实例。 +错误堆栈: + 在 (Object ) + 在 FineUIPro.GridRow.kxpUEMXYxcbykrOznAFBzkoxlAnb() + 在 (GridRow ) + 在 FineUIPro.GridRow.InitTemplateContainers() + 在 (GridRow ) + 在 FineUIPro.Grid.BkpgFeAELTFlAvoTrOBrConfcLJbA(Int32 , Object ) + 在 (Grid , Int32 , Object ) + 在 FineUIPro.Grid.CRTRkdQFrrBRFQuCddjZPswlTORP(IEnumerable , Boolean ) + 在 (Grid , IEnumerable , Boolean ) + 在 FineUIPro.Grid.DataBind(Boolean keepCurrentData) + 在 (Grid , Boolean ) + 在 FineUIPro.Grid.DataBind() + 在 FineUIPro.Web.HSSE.SitePerson.SitePersonNowStatistic.BindGrid() 位置 E:\SEDIN\SGGL_SeDin_New\SGGL\FineUIPro.Web\HSSE\SitePerson\SitePersonNowStatistic.aspx.cs:行号 58 + 在 FineUIPro.Web.HSSE.SitePerson.SitePersonNowStatistic.btnSearch_Click(Object sender, EventArgs e) 位置 E:\SEDIN\SGGL_SeDin_New\SGGL\FineUIPro.Web\HSSE\SitePerson\SitePersonNowStatistic.aspx.cs:行号 65 + 在 FineUIPro.Button.OnClick(EventArgs e) + 在 (Button , EventArgs ) + 在 FineUIPro.Button.RaisePostBackEvent(String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) + 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +出错时间:09/15/2023 11:18:13 +出错文件:http://localhost:9243/HSSE/SitePerson/SitePersonNowStatistic.aspx +IP地址:::1 +操作人员:JT + +出错时间:09/15/2023 11:18:13 + diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 4cc3fbb9..a5e8716e 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1058,6 +1058,7 @@ + @@ -11319,6 +11320,13 @@ PersonOut.aspx + + SitePersonNowStatistic.aspx + ASPXCodeBehind + + + SitePersonNowStatistic.aspx + WorkPostStatistic.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonUnitList.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonUnitList.aspx.cs index 7f972f89..b112e73a 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonUnitList.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonUnitList.aspx.cs @@ -60,7 +60,7 @@ namespace FineUIPro.Web.HSSE.SitePerson /// private void BindGrid() { - var getData = SitePerson_PersonService.getInPsersonListData(this.ProjectId, this.drpUnit.SelectedValue, this.txtPersonName.Text.Trim(), this.txtIdentityCard.Text.Trim(), Grid1); + var getData = SitePerson_PersonService.getInPersonListData(this.ProjectId, this.drpUnit.SelectedValue, this.txtPersonName.Text.Trim(), this.txtIdentityCard.Text.Trim(), Grid1); Grid1.RecordCount = SitePerson_PersonService.inCount; Grid1.DataSource = getData; Grid1.DataBind(); diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/SitePersonNowStatistic.aspx b/SGGL/FineUIPro.Web/HSSE/SitePerson/SitePersonNowStatistic.aspx new file mode 100644 index 00000000..8748b642 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/SitePersonNowStatistic.aspx @@ -0,0 +1,90 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SitePersonNowStatistic.aspx.cs" Inherits="FineUIPro.Web.HSSE.SitePerson.SitePersonNowStatistic" %> + + + + + 当前人员统计 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/SitePersonNowStatistic.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/SitePersonNowStatistic.aspx.cs new file mode 100644 index 00000000..cccd2a25 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/SitePersonNowStatistic.aspx.cs @@ -0,0 +1,116 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; + +namespace FineUIPro.Web.HSSE.SitePerson +{ + public partial class SitePersonNowStatistic : PageBase + { + /// + /// 项目id + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.ProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true); + this.drpUnit.SelectedValue = string.IsNullOrEmpty(this.CurrUser.UnitId) ? Const.UnitId_SEDIN : this.CurrUser.UnitId; + if (ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId)) + { + this.drpUnit.Enabled = false; + } + WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true); + this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + // 绑定表格 + this.BindGrid(); + } + } + + #region 绑定数据 + /// + /// 绑定数据 + /// + private void BindGrid() + { + var getData = SitePerson_PersonService.getNowPersonListData(this.ProjectId, this.drpUnit.SelectedValue, this.drpWorkPost.SelectedValue + , this.txtPersonName.Text.Trim(),this.txtIdcard.Text.Trim(),Funs.GetNewDateTimeOrNow(this.txtStartDate.Text), Grid1); + Grid1.RecordCount = SitePerson_PersonService.nowCount; + Grid1.DataSource = getData; + Grid1.DataBind(); + } + #endregion + + protected void btnSearch_Click(object sender, EventArgs e) + { + // 绑定表格 + this.BindGrid(); + } + + #region 分页选择下拉改变事件 + /// + /// 分页选择下拉改变事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + #endregion + + #region 页索引改变事件 + /// + /// 页索引改变事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + Grid1.PageIndex = e.NewPageIndex; + BindGrid(); + } + #endregion + + #region 导出按钮 + /// 导出按钮 + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + string filename = Funs.GetNewFileName(); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("现场岗位人工时统计" + filename, System.Text.Encoding.UTF8) + ".xls"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + this.Grid1.PageSize = this.Grid1.RecordCount; + this.BindGrid(); + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + #endregion + + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/SitePersonNowStatistic.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/SitePersonNowStatistic.aspx.designer.cs new file mode 100644 index 00000000..0dcfb8f4 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/SitePersonNowStatistic.aspx.designer.cs @@ -0,0 +1,161 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.SitePerson +{ + + + public partial class SitePersonNowStatistic + { + + /// + /// 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; + + /// + /// drpUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnit; + + /// + /// drpWorkPost 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpWorkPost; + + /// + /// txtPersonName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPersonName; + + /// + /// txtIdcard 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtIdcard; + + /// + /// txtStartDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtStartDate; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// 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; + } +} diff --git a/SGGL/FineUIPro.Web/common/Menu_DigData.xml b/SGGL/FineUIPro.Web/common/Menu_DigData.xml index b532a9bb..b3d0385c 100644 --- a/SGGL/FineUIPro.Web/common/Menu_DigData.xml +++ b/SGGL/FineUIPro.Web/common/Menu_DigData.xml @@ -3,7 +3,7 @@ - + @@ -12,7 +12,7 @@ - + diff --git a/SGGL/FineUIPro.Web/common/Menu_HSSE.xml b/SGGL/FineUIPro.Web/common/Menu_HSSE.xml index 5ce095a2..2edfbe00 100644 --- a/SGGL/FineUIPro.Web/common/Menu_HSSE.xml +++ b/SGGL/FineUIPro.Web/common/Menu_HSSE.xml @@ -31,6 +31,7 @@ + diff --git a/SGGL/FineUIPro.Web/common/Menu_JDGL.xml b/SGGL/FineUIPro.Web/common/Menu_JDGL.xml index b241c0a1..8d4aa005 100644 --- a/SGGL/FineUIPro.Web/common/Menu_JDGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_JDGL.xml @@ -1,6 +1,6 @@  - + diff --git a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml index 8cc2c0a1..342d91b8 100644 --- a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml @@ -1,8 +1,12 @@  - - + + + + + + @@ -15,11 +19,19 @@ - + - + + + + + + + + + @@ -78,4 +90,9 @@ + + + + + \ No newline at end of file