diff --git a/SGGL/BLL/ProjectData/TeamGroupService.cs b/SGGL/BLL/ProjectData/TeamGroupService.cs index 28261cbe..c5b9463f 100644 --- a/SGGL/BLL/ProjectData/TeamGroupService.cs +++ b/SGGL/BLL/ProjectData/TeamGroupService.cs @@ -42,7 +42,7 @@ namespace BLL EntryTime = teamGroup.EntryTime, ExitTime = teamGroup.ExitTime, GroupLeaderId = teamGroup.GroupLeaderId, - RealNamePushTime= null, + RealNamePushTime = null, }; db.ProjectData_TeamGroup.InsertOnSubmit(newTeamGroup); db.SubmitChanges(); @@ -119,14 +119,28 @@ namespace BLL /// public static object GetTeamGroupListByUnitId(string projectId, string unitId) { - return (from x in Funs.DB.ProjectData_TeamGroup - where x.ProjectId == projectId && x.UnitId == unitId - orderby x.TeamGroupCode select x).ToList(); + //return (from x in Funs.DB.ProjectData_TeamGroup + // where x.ProjectId == projectId && x.UnitId == unitId + // orderby x.TeamGroupCode select x).ToList(); + + + var list = (from x in Funs.DB.ProjectData_TeamGroup + orderby x.TeamGroupCode + select x).ToList(); + if (!string.IsNullOrWhiteSpace(projectId)) + { + list = list.Where(x => x.ProjectId == projectId).ToList(); + } + if (!string.IsNullOrWhiteSpace(unitId)) + { + list = list.Where(x => x.UnitId == unitId).ToList(); + } + return list; } - public static Model.ProjectData_TeamGroup getTeamGroupByTeamGroupName(string projectId,string unitId, string name) + public static Model.ProjectData_TeamGroup getTeamGroupByTeamGroupName(string projectId, string unitId, string name) { - return Funs.DB.ProjectData_TeamGroup.FirstOrDefault(x => x.ProjectId == projectId && x.UnitId== unitId && x.TeamGroupName == name); + return Funs.DB.ProjectData_TeamGroup.FirstOrDefault(x => x.ProjectId == projectId && x.UnitId == unitId && x.TeamGroupName == name); } #region 表下拉框 diff --git a/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx b/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx index db1e93ad..e2fdf4a0 100644 --- a/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx +++ b/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx @@ -20,6 +20,21 @@ + + + + + + + + diff --git a/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx.cs b/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx.cs index fcf294a0..8cdc5284 100644 --- a/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx.cs +++ b/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx.cs @@ -36,8 +36,11 @@ namespace FineUIPro.Web.DataShow { if (!IsPostBack) { - Funs.DropDownPageSize(this.ddlPageSize); this.ProjectId = this.CurrUser.LoginProjectId; + Funs.DropDownPageSize(this.ddlPageSize); + UnitService.InitUnitDownList(this.drpUnit, this.ProjectId, true); + TeamGroupService.InitTeamGroupProjectUnitDropDownList(this.drpWorkTeam, this.ProjectId, null, true); + WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true); this.Panel1.Title = $"项目当前现场人员({BLL.ProjectService.GetProjectNameByProjectId(this.ProjectId)})"; ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); //BLL.ProjectService.InitProjectDropDownList(this.drpProject, true); @@ -59,7 +62,7 @@ namespace FineUIPro.Web.DataShow var query = from x in db.SitePerson_PersonInOutNow where x.ChangeTime >= startDate && x.ChangeTime < endDate && x.ProjectId == this.ProjectId - group x by new { x.PersonId, x.ProjectId} into g + group x by new { x.PersonId, x.ProjectId } into g select new { g.Key.PersonId, @@ -80,10 +83,13 @@ namespace FineUIPro.Web.DataShow { PersonId = record.PersonId, PersonName = y.PersonName, + WorkPostId = y.WorkPostId, WorkPostName = z.WorkPostName, IdentityCard = y.IdentityCard, + UnitId = y.UnitId, UnitName = u.UnitName, - TeamGroupName= tg.TeamGroupName, + TeamGroupId = y.TeamGroupId, + TeamGroupName = tg.TeamGroupName, ProjectId = record.ProjectId, ChangeTime = record.MaxChangeTime, PostType = z.PostType, @@ -94,6 +100,26 @@ namespace FineUIPro.Web.DataShow { finalQuery = finalQuery.Where(x => x.PostType == Const.PostType_1); } + if (!string.IsNullOrWhiteSpace(this.txtPersonName.Text.Trim())) + { + finalQuery = finalQuery.Where(x => x.PersonName.Contains(this.txtPersonName.Text.Trim())); + } + + if (this.drpUnit.SelectedValue != Const._Null && !string.IsNullOrEmpty(this.drpUnit.SelectedValue)) + { + finalQuery = finalQuery.Where(x => x.UnitId == this.drpUnit.SelectedValue); + } + + if (this.drpWorkPost.SelectedValue != Const._Null && !string.IsNullOrEmpty(this.drpWorkPost.SelectedValue)) + { + finalQuery = finalQuery.Where(x => x.WorkPostId == this.drpWorkPost.SelectedValue); + } + + if (this.drpWorkTeam.SelectedValue != Const._Null && !string.IsNullOrEmpty(this.drpWorkTeam.SelectedValue)) + { + finalQuery = finalQuery.Where(x => x.TeamGroupId == this.drpWorkTeam.SelectedValue); + } + DataTable tb = this.LINQToDataTable(finalQuery); @@ -172,7 +198,7 @@ namespace FineUIPro.Web.DataShow { Response.ClearContent(); string filename = Funs.GetNewFileName(); - Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("项目当前现场" + filename+DateTime.Now.ToString("yyyyMMddHHmmss"), System.Text.Encoding.UTF8) + ".xls"); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("项目当前现场" + filename + DateTime.Now.ToString("yyyyMMddHHmmss"), System.Text.Encoding.UTF8) + ".xls"); Response.ContentType = "application/excel"; Response.ContentEncoding = System.Text.Encoding.UTF8; this.Grid1.PageSize = this.Grid1.RecordCount; diff --git a/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx.designer.cs b/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx.designer.cs index 2f49f452..29332efc 100644 --- a/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx.designer.cs @@ -59,6 +59,42 @@ namespace FineUIPro.Web.DataShow /// protected global::FineUIPro.Toolbar Toolbar1; + /// + /// txtPersonName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPersonName; + + /// + /// drpUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnit; + + /// + /// drpWorkTeam 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpWorkTeam; + + /// + /// drpWorkPost 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpWorkPost; + /// /// chManager 控件。 ///