This commit is contained in:
2026-06-10 12:32:12 +08:00
parent ac6777e5f4
commit 403833e4b6
4 changed files with 165 additions and 58 deletions
+20
View File
@@ -117,6 +117,26 @@ namespace BLL
return PostTitleName; return PostTitleName;
} }
/// <summary>
/// 根据职称ID得到职称名称
/// </summary>
/// <param name="PostTitleId"></param>
/// <returns></returns>
public static string getPostTitleNameById(Model.SGGLDB db, string PostTitleId)
{
string PostTitleName = string.Empty;
if (!string.IsNullOrEmpty(PostTitleId))
{
var q = db.Base_PostTitle.FirstOrDefault(e => e.PostTitleId == PostTitleId);
if (q != null)
{
PostTitleName = q.PostTitleName;
}
}
return PostTitleName;
}
#endregion #endregion
#region #region
+28
View File
@@ -309,6 +309,34 @@ namespace BLL
return workPostName; return workPostName;
} }
/// <summary>
/// 根据多岗位ID得到岗位名称字符串
/// </summary>
/// <param name="bigType"></param>
/// <returns></returns>
public static string getWorkPostNamesWorkPostIds(Model.SGGLDB db, object workPostIds)
{
string workPostName = string.Empty;
if (workPostIds != null)
{
string[] ids = workPostIds.ToString().Split(',');
foreach (string id in ids)
{
var q = db.Base_WorkPost.FirstOrDefault(e => e.WorkPostId == id);
if (q != null)
{
workPostName += q.WorkPostName + ",";
}
}
if (workPostName != string.Empty)
{
workPostName = workPostName.Substring(0, workPostName.Length - 1); ;
}
}
return workPostName;
}
#endregion #endregion
} }
} }
+41 -10
View File
@@ -38,7 +38,9 @@ namespace BLL
/// <returns></returns> /// <returns></returns>
public static IEnumerable getListData(string workPostId, string postTitleId, string name, string certificateId, Grid Grid1) public static IEnumerable getListData(string workPostId, string postTitleId, string name, string certificateId, Grid Grid1)
{ {
IQueryable<Model.Person_Persons> getDataList = from x in Funs.DB.Person_Persons using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
IQueryable<Model.Person_Persons> getDataList = from x in db.Person_Persons
where x.PersonId != Const.sysglyId && x.PersonId != Const.hfnbdId && x.UnitId == Const.UnitId_SEDIN where x.PersonId != Const.sysglyId && x.PersonId != Const.hfnbdId && x.UnitId == Const.UnitId_SEDIN
&& x.DepartId == Const.Depart_constructionId && x.DepartId == Const.Depart_constructionId
&& x.CurrentProjectId == null && (!x.IsOffice.HasValue || x.IsOffice == false) && x.CurrentProjectId == null && (!x.IsOffice.HasValue || x.IsOffice == false)
@@ -80,23 +82,24 @@ namespace BLL
x.UnitId, x.UnitId,
x.DepartId, x.DepartId,
x.WorkPostId, x.WorkPostId,
WorkPostName = WorkPostService.getWorkPostNamesWorkPostIds(x.WorkPostId), WorkPostName = WorkPostService.getWorkPostNamesWorkPostIds(db, x.WorkPostId),
x.Major, x.Major,
x.PostTitleId, x.PostTitleId,
PostTitleName = PostTitleService.getPostTitleNameById(x.PostTitleId), PostTitleName = PostTitleService.getPostTitleNameById(db, x.PostTitleId),
x.IsOffice, x.IsOffice,
x.RoleIds, x.RoleIds,
RoleName = RoleService.getRoleNamesRoleIds(x.RoleIds), RoleName = RoleService.getRoleNamesRoleIds(db, x.RoleIds),
x.CurrentProjectId, x.CurrentProjectId,
LastProjectName = getCurrentProjectName(x.PersonId), LastProjectName = getCurrentProjectName(db, x.PersonId),
x.CurrentProjectWorkPostId, x.CurrentProjectWorkPostId,
LastWorkPostName = getCurrentProjectWorkPostName(x.PersonId), LastWorkPostName = getCurrentProjectWorkPostName(db, x.PersonId),
IsPost = x.IsPost ?? true, IsPost = x.IsPost ?? true,
IsPostName = x.IsPost == false ? "否" : "是", IsPostName = x.IsPost == false ? "否" : "是",
x.SignatureUrl, x.SignatureUrl,
x.CertificateId, x.CertificateId,
}; };
} }
}
#endregion #endregion
#region #region
@@ -125,18 +128,46 @@ namespace BLL
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="WorkPostId"></param> /// <param name="ProjectId"></param>
/// <param name="PersonId"></param> /// <param name="PersonId"></param>
/// <returns></returns> /// <returns></returns>
public static string getCurrentProjectWorkPostName(string PersonId) public static string getCurrentProjectName(Model.SGGLDB db, string PersonId)
{ {
var getItem = (from x in Funs.DB.SitePerson_PersonItem var getItem = (from x in db.SitePerson_PersonItem
where x.PersonId == PersonId where x.PersonId == PersonId
orderby x.InTime descending orderby x.InTime descending
select x).FirstOrDefault(); select x).FirstOrDefault();
if (getItem != null) if (getItem != null)
{ {
return WorkPostService.getWorkPostNamesWorkPostIds(getItem.WorkPostId); string name = string.Empty;
var project = db.Base_Project.FirstOrDefault(e => e.ProjectId == getItem.ProjectId);
if (project != null)
{
name = project.ShortName;
}
return name;
}
else
{
return null;
}
}
/// <summary>
///
/// </summary>
/// <param name="WorkPostId"></param>
/// <param name="PersonId"></param>
/// <returns></returns>
public static string getCurrentProjectWorkPostName(Model.SGGLDB db, string PersonId)
{
var getItem = (from x in db.SitePerson_PersonItem
where x.PersonId == PersonId
orderby x.InTime descending
select x).FirstOrDefault();
if (getItem != null)
{
return WorkPostService.getWorkPostNamesWorkPostIds(db, getItem.WorkPostId);
} }
else else
{ {
+28
View File
@@ -151,6 +151,34 @@
return roleName; return roleName;
} }
/// <summary>
/// 得到角色名称字符串
/// </summary>
/// <param name="bigType"></param>
/// <returns></returns>
public static string getRoleNamesRoleIds(Model.SGGLDB db, object roleIds)
{
string roleName = string.Empty;
if (roleIds != null)
{
string[] roles = roleIds.ToString().Split(',');
foreach (string roleId in roles)
{
var q = db.Sys_Role.FirstOrDefault(x => x.RoleId == roleId);
if (q != null && !roleName.Contains(q.RoleName))
{
roleName += q.RoleName + ",";
}
}
if (roleName != string.Empty)
{
roleName = roleName.Substring(0, roleName.Length - 1); ;
}
}
return roleName;
}
/// <summary> /// <summary>
/// 角色下拉框 /// 角色下拉框
/// </summary> /// </summary>