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; get;
set; 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> /// <summary>
/// 数据列表 /// 数据列表
@@ -67,8 +59,8 @@ namespace BLL
{ {
return null; return null;
} }
getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); var queryData = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize).ToList();
return from x in getDataList return from x in queryData
select new select new
{ {
x.PersonId, x.PersonId,
@@ -81,17 +73,17 @@ namespace BLL
x.UnitId, x.UnitId,
x.DepartId, x.DepartId,
x.WorkPostId, x.WorkPostId,
WorkPostName = WorkPostService.getWorkPostNamesWorkPostIds(db, x.WorkPostId), WorkPostName = WorkPostService.getWorkPostNamesWorkPostIds(x.WorkPostId),
x.Major, x.Major,
x.PostTitleId, x.PostTitleId,
PostTitleName = PostTitleService.getPostTitleNameById(db, x.PostTitleId), PostTitleName = PostTitleService.getPostTitleNameById(x.PostTitleId),
x.IsOffice, x.IsOffice,
x.RoleIds, x.RoleIds,
RoleName = RoleService.getRoleNamesRoleIds(db, x.RoleIds), RoleName = RoleService.getRoleNamesRoleIds(x.RoleIds),
x.CurrentProjectId, x.CurrentProjectId,
LastProjectName = getCurrentProjectName(db, x.PersonId), LastProjectName = getCurrentProjectName(x.PersonId),
x.CurrentProjectWorkPostId, x.CurrentProjectWorkPostId,
LastWorkPostName = getCurrentProjectWorkPostName(db, x.PersonId), LastWorkPostName = getCurrentProjectWorkPostName(x.PersonId),
IsPost = x.IsPost ?? true, IsPost = x.IsPost ?? true,
IsPostName = x.IsPost == false ? "否" : "是", IsPostName = x.IsPost == false ? "否" : "是",
x.SignatureUrl, x.SignatureUrl,
@@ -172,6 +164,21 @@ namespace BLL
return null; 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 #endregion
/// <summary> /// <summary>