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

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

View File

@ -42,7 +42,7 @@ namespace BLL
EntryTime = teamGroup.EntryTime, EntryTime = teamGroup.EntryTime,
ExitTime = teamGroup.ExitTime, ExitTime = teamGroup.ExitTime,
GroupLeaderId = teamGroup.GroupLeaderId, GroupLeaderId = teamGroup.GroupLeaderId,
RealNamePushTime= null, RealNamePushTime = null,
}; };
db.ProjectData_TeamGroup.InsertOnSubmit(newTeamGroup); db.ProjectData_TeamGroup.InsertOnSubmit(newTeamGroup);
db.SubmitChanges(); db.SubmitChanges();
@ -119,14 +119,28 @@ namespace BLL
/// <returns></returns> /// <returns></returns>
public static object GetTeamGroupListByUnitId(string projectId, string unitId) public static object GetTeamGroupListByUnitId(string projectId, string unitId)
{ {
return (from x in Funs.DB.ProjectData_TeamGroup //return (from x in Funs.DB.ProjectData_TeamGroup
where x.ProjectId == projectId && x.UnitId == unitId // where x.ProjectId == projectId && x.UnitId == unitId
orderby x.TeamGroupCode select x).ToList(); // 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 #region

View File

@ -20,6 +20,21 @@
<Toolbars> <Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left"> <f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
<Items> <Items>
<f:TextBox runat="server" Label="人员名称" ID="txtPersonName" EmptyText="输入查询条件"
Width="220px" LabelWidth="80px" AutoPostBack="true" OnTextChanged="TextBox_TextChanged">
</f:TextBox>
<f:DropDownList runat="server" ID="drpUnit" Label="单位名称" EnableEdit="true" EnableCheckBoxSelect="false"
Width="360px" LabelWidth="80px" LabelAlign="Right" EnableMultiSelect="false"
AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged">
</f:DropDownList>
<f:DropDownList runat="server" ID="drpWorkTeam" Label="班组" EnableEdit="true" EnableCheckBoxSelect="false"
EnableMultiSelect="false" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged"
Width="350px" LabelAlign="Right" LabelWidth="70px">
</f:DropDownList>
<f:DropDownList runat="server" ID="drpWorkPost" Label="岗位" EnableEdit="true" EnableCheckBoxSelect="false"
EnableMultiSelect="false" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged"
Width="250px" LabelAlign="Right" LabelWidth="50px">
</f:DropDownList>
<f:CheckBox runat="server" ID="chManager" Label="管理人员" LabelAlign="right" LabelWidth="80px" <f:CheckBox runat="server" ID="chManager" Label="管理人员" LabelAlign="right" LabelWidth="80px"
AutoPostBack="true" OnCheckedChanged="TextBox_TextChanged"> AutoPostBack="true" OnCheckedChanged="TextBox_TextChanged">
</f:CheckBox> </f:CheckBox>

View File

@ -36,8 +36,11 @@ namespace FineUIPro.Web.DataShow
{ {
if (!IsPostBack) if (!IsPostBack)
{ {
Funs.DropDownPageSize(this.ddlPageSize);
this.ProjectId = this.CurrUser.LoginProjectId; 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)}"; this.Panel1.Title = $"项目当前现场人员({BLL.ProjectService.GetProjectNameByProjectId(this.ProjectId)}";
ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
//BLL.ProjectService.InitProjectDropDownList(this.drpProject, true); //BLL.ProjectService.InitProjectDropDownList(this.drpProject, true);
@ -59,7 +62,7 @@ namespace FineUIPro.Web.DataShow
var query = var query =
from x in db.SitePerson_PersonInOutNow from x in db.SitePerson_PersonInOutNow
where x.ChangeTime >= startDate && x.ChangeTime < endDate && x.ProjectId == this.ProjectId 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 select new
{ {
g.Key.PersonId, g.Key.PersonId,
@ -80,10 +83,13 @@ namespace FineUIPro.Web.DataShow
{ {
PersonId = record.PersonId, PersonId = record.PersonId,
PersonName = y.PersonName, PersonName = y.PersonName,
WorkPostId = y.WorkPostId,
WorkPostName = z.WorkPostName, WorkPostName = z.WorkPostName,
IdentityCard = y.IdentityCard, IdentityCard = y.IdentityCard,
UnitId = y.UnitId,
UnitName = u.UnitName, UnitName = u.UnitName,
TeamGroupName= tg.TeamGroupName, TeamGroupId = y.TeamGroupId,
TeamGroupName = tg.TeamGroupName,
ProjectId = record.ProjectId, ProjectId = record.ProjectId,
ChangeTime = record.MaxChangeTime, ChangeTime = record.MaxChangeTime,
PostType = z.PostType, PostType = z.PostType,
@ -94,6 +100,26 @@ namespace FineUIPro.Web.DataShow
{ {
finalQuery = finalQuery.Where(x => x.PostType == Const.PostType_1); 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); DataTable tb = this.LINQToDataTable(finalQuery);
@ -172,7 +198,7 @@ namespace FineUIPro.Web.DataShow
{ {
Response.ClearContent(); Response.ClearContent();
string filename = Funs.GetNewFileName(); 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.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8; Response.ContentEncoding = System.Text.Encoding.UTF8;
this.Grid1.PageSize = this.Grid1.RecordCount; this.Grid1.PageSize = this.Grid1.RecordCount;

View File

@ -59,6 +59,42 @@ namespace FineUIPro.Web.DataShow
/// </remarks> /// </remarks>
protected global::FineUIPro.Toolbar Toolbar1; protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// txtPersonName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPersonName;
/// <summary>
/// drpUnit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpUnit;
/// <summary>
/// drpWorkTeam 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpWorkTeam;
/// <summary>
/// drpWorkPost 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpWorkPost;
/// <summary> /// <summary>
/// chManager 控件。 /// chManager 控件。
/// </summary> /// </summary>