diff --git a/Tiobon.Core.Services/CommonServices.cs b/Tiobon.Core.Services/CommonServices.cs index 394073c0..cbb76f25 100644 --- a/Tiobon.Core.Services/CommonServices.cs +++ b/Tiobon.Core.Services/CommonServices.cs @@ -1227,51 +1227,67 @@ public partial class CommonServices : BaseServices>, ICommon break; case "F_ResumeMaintenance_All": - result.JM_PageControlT1.Toolbar.Add(new Toolbar() - { - display = true, - fnKey = "TBD5YN", - fnTitle = "推荐", - fnType = "row", - icon = "ess-icon-reject", - position = "left" - }); - result.JM_PageControlT1.Toolbar.Add(new Toolbar() - { - display = true, - fnKey = "TBD6YN", - fnTitle = "标签", - fnType = "row", - icon = "ess-icon-reject", - position = "left" - }); - result.JM_PageControlT1.Toolbar.Add(new Toolbar() - { - display = true, - fnKey = "TBD7YN", - fnTitle = "回收", - fnType = "row", - icon = "ess-icon-reject", - position = "left" - }); - result.JM_PageControlT1.Toolbar.Add(new Toolbar() - { - display = true, - fnKey = "TBD8YN", - fnTitle = "加入人才库", - fnType = "row", - icon = "ess-icon-reject", - position = "left" - }); - result.JM_PageControlT1.Toolbar.Add(new Toolbar() + + sql = $@"SELECT A.RoleId, B.RoleNo, B.RoleName + FROM Ghrs_UserRole A LEFT JOIN Ghrs_Role B ON A.RoleId = B.RoleId + WHERE A.UserID = {App.User.ID} + AND A.IsEnable = 1 + AND B.IsEnable = 1 + AND B.RoleNo LIKE 'RecruitResume%'"; + toolbarRoles = DbAccess.QueryList(sql); + if (toolbarRoles != null && toolbarRoles.Any()) { - display = true, - fnKey = "TBD9YN", - fnTitle = "加入黑名单", - fnType = "row", - icon = "ess-icon-reject", - position = "left" - }); + if (toolbarRoles.Where(x => x.RoleNo == "RecruitResumeRecommend").Any()) + result.JM_PageControlT1.Toolbar.Add(new Toolbar() + { + display = true, + fnKey = "TBD5YN", + fnTitle = "推荐", + fnType = "row", + icon = "ess-icon-reject", + position = "left" + }); + if (toolbarRoles.Where(x => x.RoleNo == "RecruitResumeTag").Any()) + result.JM_PageControlT1.Toolbar.Add(new Toolbar() + { + display = true, + fnKey = "TBD6YN", + fnTitle = "标签", + fnType = "row", + icon = "ess-icon-reject", + position = "left" + }); + if (toolbarRoles.Where(x => x.RoleNo == "RecruitResumeRecycle").Any()) + result.JM_PageControlT1.Toolbar.Add(new Toolbar() + { + display = true, + fnKey = "TBD7YN", + fnTitle = "回收", + fnType = "row", + icon = "ess-icon-reject", + position = "left" + }); + if (toolbarRoles.Where(x => x.RoleNo == "RecruitResumeTalentPool").Any()) + result.JM_PageControlT1.Toolbar.Add(new Toolbar() + { + display = true, + fnKey = "TBD8YN", + fnTitle = "加入人才库", + fnType = "row", + icon = "ess-icon-reject", + position = "left" + }); + if (toolbarRoles.Where(x => x.RoleNo == "RecruitResumeBlacklist").Any()) + result.JM_PageControlT1.Toolbar.Add(new Toolbar() + { + display = true, + fnKey = "TBD9YN", + fnTitle = "加入黑名单", + fnType = "row", + icon = "ess-icon-reject", + position = "left" + }); + } break; }