From 16ea56524ef4d6560d3081b419bdf086798f1385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=AD=A6=E6=88=90?= <1274337408@qq.com> Date: Fri, 23 Oct 2026 09:56:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=85=B0=E9=97=AE=E7=94=B3=E8=AF=B7-=E6=A0=A1?= =?UTF-8?q?=E5=B7=A5=E4=BC=9A=E5=8A=9E=E5=85=AC=E5=AE=A4=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=EF=BC=9A=E6=99=AE=E9=80=9A=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E4=B8=8D=E5=8F=82=E4=B8=8E=E6=A0=A1=E5=B7=A5=E4=BC=9A?= =?UTF-8?q?=E5=8A=9E=E5=85=AC=E5=AE=A4=E5=AE=A1=E6=A0=B8=EF=BC=8C=E8=B6=85?= =?UTF-8?q?=E7=BA=A7=E7=AE=A1=E7=90=86=E5=91=98=E8=B4=A6=E5=8F=B7=E4=BF=9D?= =?UTF-8?q?=E7=95=99=E5=85=9C=E5=BA=95=E6=9D=83=E9=99=90=EF=BC=9B=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=89=8B=E6=9C=BA=E7=AB=AF=E9=A6=96=E9=A1=B5=E2=80=98?= =?UTF-8?q?=E6=88=91=E9=83=BD=E5=BE=85=E5=8A=9E=E2=80=99=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=85=B0=E9=97=AE=E5=AE=A1=E6=A0=B8=E6=8F=90=E9=86=92?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainPageNeedItemsController.java | 14 ++++- .../condolence/CondolenceAuditControll.java | 20 +++++-- .../db/init_condolence_office_reviewer.sql | 52 +++++++++++++++++++ .../views/mobile/condolence/audit_list.html | 15 ++++-- .../views/mobile/condolence/school_Audit.html | 1 + .../views/platform/zgfw/condolence/apply.html | 8 +-- 6 files changed, 97 insertions(+), 13 deletions(-) diff --git a/src/main/java/io/v/nutz/mainPage/controller/MainPageNeedItemsController.java b/src/main/java/io/v/nutz/mainPage/controller/MainPageNeedItemsController.java index a67a220..1af21ce 100644 --- a/src/main/java/io/v/nutz/mainPage/controller/MainPageNeedItemsController.java +++ b/src/main/java/io/v/nutz/mainPage/controller/MainPageNeedItemsController.java @@ -186,14 +186,24 @@ public class MainPageNeedItemsController { //查询数据库中的待办事项 List needItemsList = dao.queryByJoin(NeedItems.class, "^needItemsSource$", Cnd.NEW()); + // 普通系统管理员不参与校工会办公室审核,超级管理员账号保留兜底权限。 + boolean superadmin = "superadmin".equals(ShiroUtil.getPrincipalProperty("loginname")); + if (!superadmin && ShiroUtil.hasRole("sysadmin") && !ShiroUtil.hasRole("condolence_office")) { + needItemsList.removeIf(item -> ("condolence".equals(item.getQueryTable()) + && "state_id".equals(item.getQueryColumn()) + && Integer.valueOf(2020).equals(item.getStateId())) + || "/platform/fw/condolence/vcr".equals(item.getHref()) + || "/platform/fw/condolence/vcr/school".equals(item.getHref())); + } + //根据当前登录用户的角色查询可以看到哪些菜单 Cnd cnd = Cnd.NEW(); - if (!ShiroUtil.hasRole("sysadmin")) { + if (!superadmin && !ShiroUtil.hasRole("sysadmin")) { Sql sql = Sqls.create(""" select menuId from sys_role_menu where roleId in (select roleId from sys_user_role where userId = @userId) """).setParam("userId", ShiroUtil.getPlatformUid()); List menuIds = baseService.listMap(sql); - List menuId = menuIds.stream().map(o -> o.getString("menuId")).collect(Collectors.toList()); + List menuId = menuIds.stream().map(o -> o.getString("menuid")).collect(Collectors.toList()); cnd.and("id", "in", menuId); } List menus = dao.query(Sys_menu.class, cnd); diff --git a/src/main/java/io/v/nutz/mobile/condolence/CondolenceAuditControll.java b/src/main/java/io/v/nutz/mobile/condolence/CondolenceAuditControll.java index 14c2f81..4b5900c 100644 --- a/src/main/java/io/v/nutz/mobile/condolence/CondolenceAuditControll.java +++ b/src/main/java/io/v/nutz/mobile/condolence/CondolenceAuditControll.java @@ -1,5 +1,6 @@ package io.v.nutz.mobile.condolence; +import cn.wizzer.framework.base.Result; import io.v.nutz.annontation.ViReturn; import io.v.nutz.base.utils.Vi; import io.v.nutz.web.commons.utils.ShiroUtil; @@ -44,6 +45,9 @@ public class CondolenceAuditControll { @Param(value = "searchKeyword", required = false) String searchKeyword, int pageNumber, int pageSize, @Param(value = "pageOrderName", required = false) String pageOrderName, @Param(value = "pageOrderBy", required = false) String pageOrderBy) { + if (!hasAuditPermission()) { + return Result.error("您没有慰问审核权限!"); + } Sql sql = Sqls.create(""" SELECT con.*, @@ -73,11 +77,11 @@ public class CondolenceAuditControll { .and("sqr.unionid", "=", Vi.getUnionId())); hasAuditRole = true; } - if (ShiroUtil.hasAnyRoles("condolence_office,sysadmin")) { + if (ShiroUtil.hasAnyRoles("condolence_office")) { group.or(Cnd.exps("con.state_id", isAudit ? ">" : "=", 2020)); hasAuditRole = true; } - if (ShiroUtil.hasAnyRoles("xghkj,sysadmin")) { + if (ShiroUtil.hasAnyRoles("xghkj")) { group.or(Cnd.exps("con.state_id", isAudit ? ">" : "=", 2012)); hasAuditRole = true; } @@ -112,6 +116,14 @@ public class CondolenceAuditControll { return condolenceService.listPage(pageNumber, pageSize, sql); } + /** + * 校验手机端慰问审核权限,超级管理员账号保留兜底权限。 + */ + private boolean hasAuditPermission() { + return "superadmin".equals(ShiroUtil.getPrincipalProperty("loginname")) + || ShiroUtil.hasAnyRoles("gh01,sp01,condolence_office,xghkj"); + } + @At("/auditHtml") @Ok("re") @@ -119,9 +131,9 @@ public class CondolenceAuditControll { boolean superadmin = "superadmin".equals(ShiroUtil.getPrincipalProperty("loginname")); if (state_id == 2000 && (superadmin || ShiroUtil.hasAnyRoles("gh01,sp01"))) { return "beetl:/mobile/condolence/union_Audit.html"; - } else if (state_id == 2012 && (superadmin || ShiroUtil.hasAnyRoles("gh03,xghkj,sysadmin"))) { + } else if (state_id == 2012 && (superadmin || ShiroUtil.hasAnyRoles("gh03,xghkj"))) { return "beetl:/mobile/condolence/fr_Audit.html"; - } else if (state_id == 2020 && (superadmin || ShiroUtil.hasAnyRoles("condolence_office,sysadmin"))) { + } else if (state_id == 2020 && (superadmin || ShiroUtil.hasAnyRoles("condolence_office"))) { return "beetl:/mobile/condolence/school_Audit.html"; } return "beetl:/mobile/condolence/apply_info.html"; diff --git a/src/main/resources/db/init_condolence_office_reviewer.sql b/src/main/resources/db/init_condolence_office_reviewer.sql index 39df2aa..9e86c1f 100644 --- a/src/main/resources/db/init_condolence_office_reviewer.sql +++ b/src/main/resources/db/init_condolence_office_reviewer.sql @@ -44,12 +44,64 @@ UPDATE `sys_menu` SET `name` = '校工会办公室审核', `aliasName` = 'CondolenceOfficeReview', `note` = '慰问申请校工会办公室审核', + `href` = '/platform/fw/condolence/vcr/school', `showit` = 1, `disabled` = 0, `updatedAt` = UNIX_TIMESTAMP() * 1000, `delFlag` = 0 WHERE `id` = @condolence_office_menu_id; +-- 首页待办按菜单地址精确匹配,同步原待办配置并补充手机端入口。 +SET @condolence_office_need_item_id := ( + SELECT `id` + FROM `need_items` + WHERE `menuId` = @condolence_office_menu_id + OR `href` IN ('/platform/fw/condolence/vcr', '/platform/fw/condolence/vcr/school') + OR (`queryTable` = 'condolence' AND `queryColumn` = 'state_id' AND `stateId` = 2020) + LIMIT 1 +); +SET @condolence_office_need_item_new_id := REPLACE(UUID(), '-', ''); + +INSERT INTO `need_items` + (`id`, `menuId`, `title`, `name`, `code`, `href`, `mobileHref`, `iconClass`, `color`, + `creatUser`, `creatTime`, `queryTable`, `queryColumn`, `stateId`, `userIdColumn`, `queryType`) +SELECT + @condolence_office_need_item_new_id, + @condolence_office_menu_id, + '【职工慰问】', + '待校工会办公室审核', + 'condolence_office', + '/platform/fw/condolence/vcr/school', + '/mobile/condolence/audit', + '', + '', + '', + DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:%s'), + 'condolence', + 'state_id', + 2020, + '', + '' +WHERE @condolence_office_need_item_id IS NULL + AND @condolence_office_menu_id IS NOT NULL; + +SET @condolence_office_need_item_id := COALESCE( + @condolence_office_need_item_id, + @condolence_office_need_item_new_id +); + +UPDATE `need_items` +SET `menuId` = @condolence_office_menu_id, + `name` = '待校工会办公室审核', + `href` = '/platform/fw/condolence/vcr/school', + `mobileHref` = '/mobile/condolence/audit', + `queryTable` = 'condolence', + `queryColumn` = 'state_id', + `stateId` = 2020, + `userIdColumn` = '', + `queryType` = '' +WHERE `id` = @condolence_office_need_item_id; + -- 同步原审核节点的状态名称,不新增状态。 UPDATE `state` SET `state_name` = CASE `state_id` diff --git a/src/main/resources/views/mobile/condolence/audit_list.html b/src/main/resources/views/mobile/condolence/audit_list.html index c848e36..22656a2 100644 --- a/src/main/resources/views/mobile/condolence/audit_list.html +++ b/src/main/resources/views/mobile/condolence/audit_list.html @@ -51,7 +51,7 @@ layout("/mobile/platform.html"){ + :description="permissionDenied ? '您没有慰问审核权限' : '暂无数据'"> @@ -72,6 +72,7 @@ layout("/mobile/platform.html"){ {text: '已审核', value: true}, ], handle: true, + permissionDenied: false, pageForm: { year: new Date().getFullYear(), isAudit: false, @@ -90,6 +91,11 @@ layout("/mobile/platform.html"){ this.flushUnits() }, pageData() { + if (this.permissionDenied) { + this.finished = true + this.mLoading = false + return + } this.mLoading = true $.get(loc() + '/pageData', this.pageForm, (res) => { if (res.code === 0) { @@ -99,10 +105,13 @@ layout("/mobile/platform.html"){ } else { this.pageForm.pageNumber++ } + } else { + this.permissionDenied = true + this.finished = true + vant.Toast(res.msg || '您没有慰问审核权限!') } + this.mLoading = false }) - this.mLoading = false - }, async flushUnits() { //this.$set(this.pageForm, "unitId", "") diff --git a/src/main/resources/views/mobile/condolence/school_Audit.html b/src/main/resources/views/mobile/condolence/school_Audit.html index fc459cc..cb4ce30 100644 --- a/src/main/resources/views/mobile/condolence/school_Audit.html +++ b/src/main/resources/views/mobile/condolence/school_Audit.html @@ -103,6 +103,7 @@ layout("/mobile/platform.html"){ await this.$refs.signature.updateSign() const resp = await $.post("/platform/fw/condolence/vcr/doReview", this.formData) if (resp.code === 0) { + await doCompletes(); this.$toast.success('审核成功'); setTimeout(() => { history.back() diff --git a/src/main/resources/views/platform/zgfw/condolence/apply.html b/src/main/resources/views/platform/zgfw/condolence/apply.html index cb809b1..c4f4934 100644 --- a/src/main/resources/views/platform/zgfw/condolence/apply.html +++ b/src/main/resources/views/platform/zgfw/condolence/apply.html @@ -405,7 +405,7 @@ layout("/layouts/platform.html"){ occur_time: [{required: true, message: '必填', trigger: ['blur', 'change']}], jtzz: [{required: true, message: '必填', trigger: ['blur', 'change']}], poszdw: [{required: true, message: '必填', trigger: ['blur', 'change']}], - files: [{required: true, message: '必填', trigger: ['blur', 'change']}], + // files: [{required: true, message: '必填', trigger: ['blur', 'change']}], goods_desc: [{required: true, message: '请输入慰问品名称、编号、规格等', trigger: ['blur', 'change']}], mobile: [ {required: true, message: '请输入慰问对象联系电话', trigger: ['blur', 'change']}, @@ -414,7 +414,7 @@ layout("/layouts/platform.html"){ birthday: [{required: true, message: '必填', trigger: ['blur', 'change']}], // job_title: [{required: true, message: '必填', trigger: ['blur', 'change']}], birth_child_num: [{required: true, message: '必填', trigger: ['blur', 'change']}], - sign: [{required: true, message: '请扫码签字', trigger: ['blur', 'change']}], + // sign: [{required: true, message: '请扫码签字', trigger: ['blur', 'change']}], payee: [{required: true, message: '请选择收款人', trigger: ['blur', 'change']}], payee_bank_number: [{required: true, message: '请填写收款人银行卡', trigger: ['blur', 'change']}], payee_bank_name: [{required: true, message: '请填写收款人开户行', trigger: ['blur', 'change']}], @@ -557,10 +557,10 @@ layout("/layouts/platform.html"){ }, async doAdd() { // 签字由自定义组件回写,提交前单独判断,避免 Element 表单漏过空签字。 - if (!this.formData.sign) { + /*if (!this.formData.sign) { this.$message.warning('请扫码签字') return - } + }*/ this.$refs["form"].validate(async (valid) => { if (valid) { const formData = JSON.parse(JSON.stringify(this.formData))