This commit is contained in:
2026-06-10 13:20:33 +08:00
parent 04ff51015a
commit b4dc0bf4a7
+23 -16
View File
@@ -15,15 +15,7 @@ namespace BLL
get;
set;
}
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.Person_Persons> getDataLists = from x in Funs.DB.Person_Persons
where x.PersonId != Const.sysglyId && x.PersonId != Const.hfnbdId && x.UnitId == Const.UnitId_SEDIN
&& x.DepartId == Const.Depart_constructionId
&& x.CurrentProjectId == null && (!x.IsOffice.HasValue || x.IsOffice == false)
select x;
/// <summary>
/// 数据列表
@@ -67,8 +59,8 @@ namespace BLL
{
return null;
}
getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in getDataList
var queryData = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize).ToList();
return from x in queryData
select new
{
x.PersonId,
@@ -81,17 +73,17 @@ namespace BLL
x.UnitId,
x.DepartId,
x.WorkPostId,
WorkPostName = WorkPostService.getWorkPostNamesWorkPostIds(db, x.WorkPostId),
WorkPostName = WorkPostService.getWorkPostNamesWorkPostIds(x.WorkPostId),
x.Major,
x.PostTitleId,
PostTitleName = PostTitleService.getPostTitleNameById(db, x.PostTitleId),
PostTitleName = PostTitleService.getPostTitleNameById(x.PostTitleId),
x.IsOffice,
x.RoleIds,
RoleName = RoleService.getRoleNamesRoleIds(db, x.RoleIds),
RoleName = RoleService.getRoleNamesRoleIds(x.RoleIds),
x.CurrentProjectId,
LastProjectName = getCurrentProjectName(db, x.PersonId),
LastProjectName = getCurrentProjectName(x.PersonId),
x.CurrentProjectWorkPostId,
LastWorkPostName = getCurrentProjectWorkPostName(db, x.PersonId),
LastWorkPostName = getCurrentProjectWorkPostName(x.PersonId),
IsPost = x.IsPost ?? true,
IsPostName = x.IsPost == false ? "否" : "是",
x.SignatureUrl,
@@ -172,6 +164,21 @@ namespace BLL
return null;
}
}
public static string getCurrentProjectWorkPostName(string PersonId)
{
var getItem = (from x in Funs.DB.SitePerson_PersonItem
where x.PersonId == PersonId
orderby x.InTime descending
select x).FirstOrDefault();
if (getItem != null)
{
return WorkPostService.getWorkPostNamesWorkPostIds(getItem.WorkPostId);
}
else
{
return null;
}
}
#endregion
/// <summary>