From e744b7c271373711a897a73dd9814a23ad7b3164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=AD=A6=E6=88=90?= <1274337408@qq.com> Date: Tue, 27 Oct 2026 20:45:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=97=E4=BA=AC=E7=90=86=E5=B7=A5-=E5=88=86?= =?UTF-8?q?=E7=BA=A7=E6=A0=B8=E5=AF=B9=EF=BC=9A=E5=B7=A5=E4=BC=9A=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E4=BB=85=E7=BB=99?= =?UTF-8?q?=E2=80=98=E6=9C=BA=E5=85=B3=E5=85=9A=E5=A7=94=E5=B7=A5=E4=BC=9A?= =?UTF-8?q?=E2=80=99=E7=9A=84=E6=88=90=E5=91=98=E5=8D=95=E4=BD=8D=E5=88=97?= =?UTF-8?q?=E8=A1=A8=EF=BC=8C=E4=B8=89=E7=BA=A7=E5=8D=95=E4=BD=8D=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=91=98=E8=AE=BE=E7=BD=AE=E6=8C=89=E9=92=AE=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v/nutz/levelcheck/service/LevelCheckService.java | 6 ++++-- .../controllers/platform/sys/SysUnionMangeCon.java | 3 ++- src/main/resources/db/init_3_level_check.sql | 11 ++++++++--- .../views/platform/sys/union/unionMange.html | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/main/java/io/v/nutz/levelcheck/service/LevelCheckService.java b/src/main/java/io/v/nutz/levelcheck/service/LevelCheckService.java index ab41512..86261b6 100644 --- a/src/main/java/io/v/nutz/levelcheck/service/LevelCheckService.java +++ b/src/main/java/io/v/nutz/levelcheck/service/LevelCheckService.java @@ -50,6 +50,7 @@ public class LevelCheckService { "薪酬单位代码", "职工号", "姓名", "扣工会会费", "年月", "所在单位" ); private static final String UNIT_HEADER = "所在单位"; + private static final String THIRD_UNIT_MANAGER_UNION_CODE = "28"; private static final ZoneId TASK_ZONE_ID = ZoneId.of("Asia/Shanghai"); @Inject @@ -745,11 +746,12 @@ public class LevelCheckService { String unionId = Strings.trim(config.getConfigValue()); Sys_union configuredUnion = dao.fetch(Sys_union.class, unionId); if (configuredUnion != null - && "机关党委工会".equals(Strings.trim(configuredUnion.getUnionname()))) { + && THIRD_UNIT_MANAGER_UNION_CODE.equals(Strings.trim(configuredUnion.getUnioncode()))) { return unionId; } } - Sys_union union = dao.fetch(Sys_union.class, Cnd.where("unionname", "=", "机关党委工会")); + Sys_union union = dao.fetch(Sys_union.class, + Cnd.where("unioncode", "=", THIRD_UNIT_MANAGER_UNION_CODE)); return union == null ? "" : union.getId(); } diff --git a/src/main/java/io/v/nutz/web/controllers/platform/sys/SysUnionMangeCon.java b/src/main/java/io/v/nutz/web/controllers/platform/sys/SysUnionMangeCon.java index afe8995..8fabf65 100644 --- a/src/main/java/io/v/nutz/web/controllers/platform/sys/SysUnionMangeCon.java +++ b/src/main/java/io/v/nutz/web/controllers/platform/sys/SysUnionMangeCon.java @@ -50,6 +50,7 @@ import java.util.stream.Collectors; @Ok("json") public class SysUnionMangeCon { private static final Log log = Logs.get(); + private static final String THIRD_UNIT_MANAGER_UNION_CODE = "28"; @Inject private SysUnionService sysUnionService; @@ -452,7 +453,7 @@ public class SysUnionMangeCon { throw new SecurityException("仅校工会管理员可设置三级管理员"); } Sys_union union = sysUnionService.fetch(unionId); - if (union == null || !"机关党委工会".equals(Strings.trim(union.getUnionname()))) { + if (union == null || !THIRD_UNIT_MANAGER_UNION_CODE.equals(Strings.trim(union.getUnioncode()))) { throw new IllegalArgumentException("仅机关党委工会的成员单位可设置三级管理员"); } Sys_unit unit = sysUnitService.fetch(unitId); diff --git a/src/main/resources/db/init_3_level_check.sql b/src/main/resources/db/init_3_level_check.sql index 804139f..172c357 100644 --- a/src/main/resources/db/init_3_level_check.sql +++ b/src/main/resources/db/init_3_level_check.sql @@ -10,6 +10,7 @@ SET @sysadmin_role_id = (SELECT id FROM sys_role WHERE code = 'sysadmin' LIMIT 1 SET @level_check_root_menu_id = 'a63f7fd56f594b29b2b5616d0d7f0101'; SET @level_check_school_menu_id = 'a63f7fd56f594b29b2b5616d0d7f0102'; SET @level_check_unit_menu_id = 'a63f7fd56f594b29b2b5616d0d7f0103'; +SET @third_admin_union_id = (SELECT id FROM sys_union WHERE unioncode = '28' ORDER BY id LIMIT 1); INSERT INTO sys_role (id, name, code, aliasName, disabled, note, createdBy, createdAt, updatedBy, updatedAt, delFlag) @@ -64,9 +65,13 @@ WHERE NOT EXISTS ( INSERT INTO sys_config (configKey, configValue, note, createdBy, createdAt, updatedBy, updatedAt, delFlag) -SELECT 'LevelCheckThirdAdminUnionId', IFNULL(( - SELECT id FROM sys_union WHERE unionname = '机关党委工会' ORDER BY id LIMIT 1 - ), ''), '允许设置三级管理员的特殊工会ID', '', 0, '', 0, 0 +SELECT 'LevelCheckThirdAdminUnionId', IFNULL(@third_admin_union_id, ''), + '允许设置三级管理员的特殊工会ID', '', 0, '', 0, 0 WHERE NOT EXISTS ( SELECT 1 FROM sys_config WHERE configKey = 'LevelCheckThirdAdminUnionId' ); + +UPDATE sys_config +SET configValue = IFNULL(@third_admin_union_id, configValue), + note = '允许设置三级管理员的特殊工会ID' +WHERE configKey = 'LevelCheckThirdAdminUnionId'; diff --git a/src/main/resources/views/platform/sys/union/unionMange.html b/src/main/resources/views/platform/sys/union/unionMange.html index 28f8970..1128f8e 100644 --- a/src/main/resources/views/platform/sys/union/unionMange.html +++ b/src/main/resources/views/platform/sys/union/unionMange.html @@ -806,7 +806,7 @@ layout("/layouts/platform.html"){ computed: { isSpecialUnion() { return this.sysadmin && this.node && this.node.data - && this.node.data.unionname === '机关党委工会' + && String(this.node.data.unioncode) === '28' } }, methods: {