diff --git a/SGGL/BLL/Person/Person_ShuntService.cs b/SGGL/BLL/Person/Person_ShuntService.cs index 842db6be..de559300 100644 --- a/SGGL/BLL/Person/Person_ShuntService.cs +++ b/SGGL/BLL/Person/Person_ShuntService.cs @@ -15,15 +15,7 @@ namespace BLL get; set; } - - /// - /// 定义变量 - /// - private static IQueryable 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; + /// /// 数据列表 @@ -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 ///