From 4eb967565814d83cc9ab757e20545dbc0af48e01 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Wed, 5 Jun 2024 13:33:08 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E8=80=83=E8=AF=95=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=A1=B5=E9=9D=A2=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=EF=BC=8C=E5=9F=B9=E8=AE=AD=5F=E8=80=83=E8=AF=95=5F=E6=88=90?= =?UTF-8?q?=E7=BB=A9=E3=80=81=E5=A4=8D=E5=88=B6=E3=80=81=E5=BD=92=E6=A1=A3?= =?UTF-8?q?=E3=80=81=E5=8F=96=E6=B6=88=E5=8F=91=E5=B8=83=E3=80=81=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E3=80=81=E8=80=83=E8=AF=95=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ghre/Ghre_ExamServices.cs | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs index 53a55a43..ed3e2c43 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs @@ -59,9 +59,6 @@ public class Ghre_ExamServices : BaseServices(); - - - #region 定义页面的操作按钮 string sql = @"SELECT fnKey, fnKeyValue, @@ -218,6 +215,14 @@ public class Ghre_ExamServices : BaseServices(sql); + 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 'TrainingExam%'"; + var toolbarRoles = DbAccess.QueryList(sql); + if (toolbars.Any(x => x.fnKey == "NewYN")) Toolbar.Add(new Toolbar() { @@ -241,10 +246,10 @@ public class Ghre_ExamServices : BaseServices x.RoleNo == "TrainingExamCancelRelease")) Toolbar.Add(new Toolbar() { - fnKey = "Release", + fnKey = "CancelRelease", fnKeyValue = null, fnTitle = "取消发布", fnType = "table", @@ -1018,15 +1023,19 @@ public class Ghre_ExamServices : BaseServices UpdateStatus(long[] ids, string status) { - string sql = $@"SELECT A.RoleId, B.RoleNo, B.RoleName + + if (status == "Draft") + { + string 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 ='TrainingExamCancelRelease'"; - var toolbarRoles = DbAccess.QueryList(sql); - if (!toolbarRoles.Any()) - return ServiceResult.OprateFailed("暂无取消发布权限!"); + var toolbarRoles = DbAccess.QueryList(sql); + if (!toolbarRoles.Any()) + return ServiceResult.OprateFailed("暂无取消发布权限!"); + } if (status != "Released" && status != "Disabled" && status != "Draft") throw new Exception("无效的状态");