项目当前现场人员界面补充查询条件

This commit is contained in:
2025-12-08 10:02:06 +08:00
parent 2b1680c9bc
commit 3d4009617e
4 changed files with 101 additions and 10 deletions
@@ -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;