Browse Source

fix(permissions): restore Gu Luhui class review menus

apple 59 minutes ago
parent
commit
b9a51c3a1f

+ 46 - 0
docs/24_星级班班主任移动报表/2026-12-04_古绿晖班级评比菜单为空修复记录.md

@@ -0,0 +1,46 @@
+# 2026-12-04 古绿晖“班级评比”菜单为空修复记录
+
+## 1. 问题现象
+
+古绿晖账号 `T21270` 登录 PC 端后,“班级评比”父菜单存在,但展开后没有任何菜单项。
+
+## 2. 原因
+
+古绿晖使用个人菜单树。原菜单树中“班级评比”下只有“风纪仪容检查”一个节点,但其权限群组没有 `fjyrjc` 服务权限。PC 菜单渲染时会过滤无服务权限的菜单项,父节点因此显示为空。
+
+同时,个人菜单树缺少“升旗礼检查”“宿舍内务检查”“值班”等标准班级评比子节点。
+
+## 3. 修复内容
+
+| 项目 | 修复方式 |
+|---|---|
+| 个人菜单 | 保留原菜单,在“班级评比”下补齐 10 个当前有效子菜单 |
+| 已停用菜单 | 不复制“风纪检查”停用节点 |
+| 服务权限 | 新建古绿晖专用的 `QZ_BJPJ_1204` 权限群组 |
+| 补充权限 | 值班、学校获奖记录、风纪仪容检查及对应查询、录入、详情、提交权限 |
+| 原有权限 | 不修改基础、星级班、宿管权限群组 |
+| 其他教师 | 不修改其他教师菜单和权限 |
+
+## 4. 菜单范围
+
+升旗礼检查、宿舍内务检查、值班、学校处分记录、场室卫生检查、宿舍违纪记录、学校违纪记录、学校获奖记录、团体、风纪仪容检查。
+
+## 5. 备份
+
+```text
+C##DC.BAK_20261204_GLH_BJPJ_GRCD
+PMS_TEST.BAK_20261204_GLH_BJPJ_GRCD
+```
+
+## 6. 执行结果
+
+| 环境 | 权限群组 ID | 菜单结果 | 服务授权结果 |
+|---|---:|---|---|
+| 正式 | 5001202 | 10 个有效子菜单 | 10 项全部通过 |
+| 测试 | 5001242 | 10 个有效子菜单 | 10 项全部通过 |
+
+菜单和权限数据均已提交数据库。
+
+## 7. 生效方式
+
+修复只涉及数据库菜单和服务权限,不需要重新发布代码。古绿晖退出 PC 端后重新登录即可刷新菜单。

+ 39 - 0
docs/24_星级班班主任移动报表/sql/2026-12-04_古绿晖班级评比菜单修复_回滚.sql

@@ -0,0 +1,39 @@
+set define off
+whenever sqlerror exit sql.sqlcode
+
+alter session set container=ORCLPDB;
+
+begin
+    delete from C##DC.QZCY
+     where RYID=111148259
+       and QZID in (select QZID from C##DC.QZ where QZH='QZ_BJPJ_1204');
+    delete from C##DC.QZ where QZH='QZ_BJPJ_1204';
+
+    delete from PMS_TEST.QZCY
+     where RYID=111148259
+       and QZID in (select QZID from PMS_TEST.QZ where QZH='QZ_BJPJ_1204');
+    delete from PMS_TEST.QZ where QZH='QZ_BJPJ_1204';
+
+    delete from C##DC.GRCD where YYRYID=111148259;
+    insert into C##DC.GRCD (
+        GRCDID,SJGRCDID,GRCDMBID,CAIDLBM,YYRYID,XH,MC,YWM,DXM,GNM,
+        JLZTM,CJRYID,GLRYID,GLBMID,MS
+    )
+    select GRCDID,SJGRCDID,GRCDMBID,CAIDLBM,YYRYID,XH,MC,YWM,DXM,GNM,
+           JLZTM,CJRYID,GLRYID,GLBMID,MS
+      from C##DC.BAK_20261204_GLH_BJPJ_GRCD;
+
+    delete from PMS_TEST.GRCD where YYRYID=111148259;
+    insert into PMS_TEST.GRCD (
+        GRCDID,SJGRCDID,GRCDMBID,CAIDLBM,YYRYID,XH,MC,YWM,DXM,GNM,
+        JLZTM,CJRYID,GLRYID,GLBMID,MS
+    )
+    select GRCDID,SJGRCDID,GRCDMBID,CAIDLBM,YYRYID,XH,MC,YWM,DXM,GNM,
+           JLZTM,CJRYID,GLRYID,GLBMID,MS
+      from PMS_TEST.BAK_20261204_GLH_BJPJ_GRCD;
+
+    commit;
+end;
+/
+
+exit;

+ 125 - 0
docs/24_星级班班主任移动报表/sql/2026-12-04_古绿晖班级评比菜单修复_正式.sql

@@ -0,0 +1,125 @@
+set define off
+whenever sqlerror exit sql.sqlcode
+
+alter session set container=ORCLPDB;
+
+declare
+    v_count number;
+    v_parent_id number;
+begin
+    select count(*)
+      into v_count
+      from C##DC.RY
+     where RYID = 111148259
+       and RYH = 'T21270';
+    if v_count <> 1 then
+        raise_application_error(-20001, '未找到唯一的古绿晖账号');
+    end if;
+
+    select count(*)
+      into v_count
+      from C##DC.GRCD
+     where YYRYID = 111148259
+       and MC = '班级评比'
+       and SJGRCDID is null;
+    if v_count <> 1 then
+        raise_application_error(-20002, '古绿晖班级评比父菜单异常');
+    end if;
+
+    select GRCDID
+      into v_parent_id
+      from C##DC.GRCD
+     where YYRYID = 111148259
+       and MC = '班级评比'
+       and SJGRCDID is null;
+
+    select count(*)
+      into v_count
+      from all_tables
+     where owner = 'C##DC'
+       and table_name = 'BAK_20261204_GLH_BJPJ_GRCD';
+    if v_count = 0 then
+        execute immediate q'[
+            create table C##DC.BAK_20261204_GLH_BJPJ_GRCD as
+            select * from C##DC.GRCD where YYRYID = 111148259
+        ]';
+    end if;
+
+    insert into C##DC.GRCD (
+        SJGRCDID, GRCDMBID, CAIDLBM, YYRYID, XH, MC, YWM, DXM, GNM,
+        JLZTM, CJRYID, GLRYID, GLBMID, MS
+    )
+    select v_parent_id, 1011, 1, 111148259, src.XH, src.MC, null,
+           src.DXM, 'search', 1, 111152547, 111152547, null, src.MC
+      from (
+            select 0 XH, '升旗礼检查' MC, 'sqljc' DXM from dual
+            union all select 1, '宿舍内务检查', 'ssnwjc' from dual
+            union all select 2, '值班', 'xyttZb' from dual
+            union all select 3, '学校处分记录', 'xxcfjl' from dual
+            union all select 4, '场室卫生检查', 'cswsjc' from dual
+            union all select 5, '宿舍违纪记录', 'sswjjl' from dual
+            union all select 6, '学校违纪记录', 'xxwjjl' from dual
+            union all select 7, '学校获奖记录', 'xxhjjl' from dual
+            union all select 8, '团体', 'xsh' from dual
+            union all select 9, '风纪仪容检查', 'fjyrjc' from dual
+      ) src
+     where not exists (
+           select 1
+             from C##DC.GRCD m
+            where m.YYRYID = 111148259
+              and m.SJGRCDID = v_parent_id
+              and m.DXM = src.DXM
+     );
+
+    update C##DC.GRCD
+       set XH = 9
+     where YYRYID = 111148259
+       and SJGRCDID = v_parent_id
+       and DXM = 'fjyrjc';
+
+    select count(*)
+      into v_count
+      from C##DC.QZ
+     where QZH = 'QZ_BJPJ_1204';
+
+    if v_count = 0 then
+        insert into C##DC.QZ (
+            QZLBM, MC, MS, JLZTM, CJRYID, GLRYID, FWC, QZH
+        ) values (
+            1,
+            '古绿晖班级评比补充权限-20261204',
+            '补齐值班、学校获奖、风纪仪容检查权限',
+            51,
+            111152547,
+            111152547,
+            '{"bjpj":["ssnwjc","ssnwjc_ck","ssnwjc_lr","xxhjjl","xxhjjl_ck","xxhjjl_lr","xxhjjlMp_save","fjyrjc","fjyrjc_ck","fjyrjc_lr","fjyrjc_mpPlay","xxcfjlWjjlcy","xxcfjlWjjlcy_ck","xxcfjlWjjlcy_lr"],"xygz":["xytt","xytt_ck","xyttZb","xyttZb_ck","xyttZb_lr","xyttZb_save","xyttZb_upd","xyttZb_chgPreview","xyttZb_subm","xyttZb_stateSus","xyttZb_stateRes","xyttZb_search","xyttZb_cxsy","xyttZb_cxlb"]}',
+            'QZ_BJPJ_1204'
+        );
+    else
+        update C##DC.QZ
+           set MC = '古绿晖班级评比补充权限-20261204',
+               MS = '补齐值班、学校获奖、风纪仪容检查权限',
+               JLZTM = 51,
+               FWC = '{"bjpj":["ssnwjc","ssnwjc_ck","ssnwjc_lr","xxhjjl","xxhjjl_ck","xxhjjl_lr","xxhjjlMp_save","fjyrjc","fjyrjc_ck","fjyrjc_lr","fjyrjc_mpPlay","xxcfjlWjjlcy","xxcfjlWjjlcy_ck","xxcfjlWjjlcy_lr"],"xygz":["xytt","xytt_ck","xyttZb","xyttZb_ck","xyttZb_lr","xyttZb_save","xyttZb_upd","xyttZb_chgPreview","xyttZb_subm","xyttZb_stateSus","xyttZb_stateRes","xyttZb_search","xyttZb_cxsy","xyttZb_cxlb"]}'
+         where QZH = 'QZ_BJPJ_1204';
+    end if;
+
+    insert into C##DC.QZCY (
+        QZID, RYID, NC, JLZTM, CJRYID, GLRYID, RYH
+    )
+    select q.QZID, 111148259, '古绿晖', 51, 111152547, 111152547, 'T21270'
+      from C##DC.QZ q
+     where q.QZH = 'QZ_BJPJ_1204'
+       and not exists (
+           select 1
+             from C##DC.QZCY c
+            where c.QZID = q.QZID
+              and c.RYID = 111148259
+              and c.JLZTM = 51
+       );
+
+    commit;
+end;
+/
+
+exit;

+ 125 - 0
docs/24_星级班班主任移动报表/sql/2026-12-04_古绿晖班级评比菜单修复_测试.sql

@@ -0,0 +1,125 @@
+set define off
+whenever sqlerror exit sql.sqlcode
+
+alter session set container=ORCLPDB;
+
+declare
+    v_count number;
+    v_parent_id number;
+begin
+    select count(*)
+      into v_count
+      from PMS_TEST.RY
+     where RYID = 111148259
+       and RYH = 'T21270';
+    if v_count <> 1 then
+        raise_application_error(-20001, '未找到唯一的古绿晖账号');
+    end if;
+
+    select count(*)
+      into v_count
+      from PMS_TEST.GRCD
+     where YYRYID = 111148259
+       and MC = '班级评比'
+       and SJGRCDID is null;
+    if v_count <> 1 then
+        raise_application_error(-20002, '古绿晖班级评比父菜单异常');
+    end if;
+
+    select GRCDID
+      into v_parent_id
+      from PMS_TEST.GRCD
+     where YYRYID = 111148259
+       and MC = '班级评比'
+       and SJGRCDID is null;
+
+    select count(*)
+      into v_count
+      from all_tables
+     where owner = 'PMS_TEST'
+       and table_name = 'BAK_20261204_GLH_BJPJ_GRCD';
+    if v_count = 0 then
+        execute immediate q'[
+            create table PMS_TEST.BAK_20261204_GLH_BJPJ_GRCD as
+            select * from PMS_TEST.GRCD where YYRYID = 111148259
+        ]';
+    end if;
+
+    insert into PMS_TEST.GRCD (
+        SJGRCDID, GRCDMBID, CAIDLBM, YYRYID, XH, MC, YWM, DXM, GNM,
+        JLZTM, CJRYID, GLRYID, GLBMID, MS
+    )
+    select v_parent_id, 1011, 1, 111148259, src.XH, src.MC, null,
+           src.DXM, 'search', 1, 111152547, 111152547, null, src.MC
+      from (
+            select 0 XH, '升旗礼检查' MC, 'sqljc' DXM from dual
+            union all select 1, '宿舍内务检查', 'ssnwjc' from dual
+            union all select 2, '值班', 'xyttZb' from dual
+            union all select 3, '学校处分记录', 'xxcfjl' from dual
+            union all select 4, '场室卫生检查', 'cswsjc' from dual
+            union all select 5, '宿舍违纪记录', 'sswjjl' from dual
+            union all select 6, '学校违纪记录', 'xxwjjl' from dual
+            union all select 7, '学校获奖记录', 'xxhjjl' from dual
+            union all select 8, '团体', 'xsh' from dual
+            union all select 9, '风纪仪容检查', 'fjyrjc' from dual
+      ) src
+     where not exists (
+           select 1
+             from PMS_TEST.GRCD m
+            where m.YYRYID = 111148259
+              and m.SJGRCDID = v_parent_id
+              and m.DXM = src.DXM
+     );
+
+    update PMS_TEST.GRCD
+       set XH = 9
+     where YYRYID = 111148259
+       and SJGRCDID = v_parent_id
+       and DXM = 'fjyrjc';
+
+    select count(*)
+      into v_count
+      from PMS_TEST.QZ
+     where QZH = 'QZ_BJPJ_1204';
+
+    if v_count = 0 then
+        insert into PMS_TEST.QZ (
+            QZLBM, MC, MS, JLZTM, CJRYID, GLRYID, FWC, QZH
+        ) values (
+            1,
+            '古绿晖班级评比补充权限-20261204',
+            '补齐值班、学校获奖、风纪仪容检查权限',
+            51,
+            111152547,
+            111152547,
+            '{"bjpj":["ssnwjc","ssnwjc_ck","ssnwjc_lr","xxhjjl","xxhjjl_ck","xxhjjl_lr","xxhjjlMp_save","fjyrjc","fjyrjc_ck","fjyrjc_lr","fjyrjc_mpPlay","xxcfjlWjjlcy","xxcfjlWjjlcy_ck","xxcfjlWjjlcy_lr"],"xygz":["xytt","xytt_ck","xyttZb","xyttZb_ck","xyttZb_lr","xyttZb_save","xyttZb_upd","xyttZb_chgPreview","xyttZb_subm","xyttZb_stateSus","xyttZb_stateRes","xyttZb_search","xyttZb_cxsy","xyttZb_cxlb"]}',
+            'QZ_BJPJ_1204'
+        );
+    else
+        update PMS_TEST.QZ
+           set MC = '古绿晖班级评比补充权限-20261204',
+               MS = '补齐值班、学校获奖、风纪仪容检查权限',
+               JLZTM = 51,
+               FWC = '{"bjpj":["ssnwjc","ssnwjc_ck","ssnwjc_lr","xxhjjl","xxhjjl_ck","xxhjjl_lr","xxhjjlMp_save","fjyrjc","fjyrjc_ck","fjyrjc_lr","fjyrjc_mpPlay","xxcfjlWjjlcy","xxcfjlWjjlcy_ck","xxcfjlWjjlcy_lr"],"xygz":["xytt","xytt_ck","xyttZb","xyttZb_ck","xyttZb_lr","xyttZb_save","xyttZb_upd","xyttZb_chgPreview","xyttZb_subm","xyttZb_stateSus","xyttZb_stateRes","xyttZb_search","xyttZb_cxsy","xyttZb_cxlb"]}'
+         where QZH = 'QZ_BJPJ_1204';
+    end if;
+
+    insert into PMS_TEST.QZCY (
+        QZID, RYID, NC, JLZTM, CJRYID, GLRYID, RYH
+    )
+    select q.QZID, 111148259, '古绿晖', 51, 111152547, 111152547, 'T21270'
+      from PMS_TEST.QZ q
+     where q.QZH = 'QZ_BJPJ_1204'
+       and not exists (
+           select 1
+             from PMS_TEST.QZCY c
+            where c.QZID = q.QZID
+              and c.RYID = 111148259
+              and c.JLZTM = 51
+       );
+
+    commit;
+end;
+/
+
+exit;

+ 81 - 0
docs/24_星级班班主任移动报表/sql/2026-12-04_古绿晖班级评比菜单修复_验证.sql

@@ -0,0 +1,81 @@
+set pagesize 300 linesize 320 heading on feedback off verify off trimspool on
+
+alter session set container=ORCLPDB;
+
+prompt ==== 正式环境古绿晖班级评比菜单 ====
+select c.GRCDID,c.SJGRCDID,c.XH,c.MC,c.DXM,c.GNM,c.JLZTM
+  from C##DC.GRCD c
+ where c.YYRYID=111148259
+   and (c.MC='班级评比'
+        or c.SJGRCDID=(select p.GRCDID from C##DC.GRCD p where p.YYRYID=111148259 and p.MC='班级评比' and p.SJGRCDID is null))
+ order by nvl(c.SJGRCDID,0),c.XH,c.GRCDID;
+
+prompt ==== 正式环境古绿晖补充权限群组 ====
+select q.QZID,q.QZH,q.MC,q.JLZTM,c.RYID,c.RYH,c.JLZTM MEMBER_STATUS
+  from C##DC.QZ q
+  join C##DC.QZCY c on c.QZID=q.QZID
+ where q.QZH='QZ_BJPJ_1204'
+   and c.RYID=111148259;
+
+prompt ==== 测试环境古绿晖班级评比菜单 ====
+select c.GRCDID,c.SJGRCDID,c.XH,c.MC,c.DXM,c.GNM,c.JLZTM
+  from PMS_TEST.GRCD c
+ where c.YYRYID=111148259
+   and (c.MC='班级评比'
+        or c.SJGRCDID=(select p.GRCDID from PMS_TEST.GRCD p where p.YYRYID=111148259 and p.MC='班级评比' and p.SJGRCDID is null))
+ order by nvl(c.SJGRCDID,0),c.XH,c.GRCDID;
+
+prompt ==== 测试环境古绿晖补充权限群组 ====
+select q.QZID,q.QZH,q.MC,q.JLZTM,c.RYID,c.RYH,c.JLZTM MEMBER_STATUS
+  from PMS_TEST.QZ q
+  join PMS_TEST.QZCY c on c.QZID=q.QZID
+ where q.QZH='QZ_BJPJ_1204'
+   and c.RYID=111148259;
+
+prompt ==== 正式环境菜单有效服务授权检查 ====
+select '正式' ENV, src.DXM,
+       case when exists (
+           select 1
+             from C##DC.QZ q
+             join C##DC.QZCY c on c.QZID=q.QZID and c.RYID=111148259 and c.JLZTM=51
+            where q.JLZTM=51
+              and json_exists(q.FWC, '$.*[*]?(@ == $v)' passing src.DXM as "v")
+       ) then 'AUTHORIZED' else 'MISSING' end AUTH_STATUS
+  from (
+        select 'sqljc' DXM from dual
+        union all select 'ssnwjc' from dual
+        union all select 'xyttZb' from dual
+        union all select 'xxcfjl' from dual
+        union all select 'cswsjc' from dual
+        union all select 'sswjjl' from dual
+        union all select 'xxwjjl' from dual
+        union all select 'xxhjjl' from dual
+        union all select 'xsh' from dual
+        union all select 'fjyrjc' from dual
+  ) src
+ order by src.DXM;
+
+prompt ==== 测试环境菜单有效服务授权检查 ====
+select '测试' ENV, src.DXM,
+       case when exists (
+           select 1
+             from PMS_TEST.QZ q
+             join PMS_TEST.QZCY c on c.QZID=q.QZID and c.RYID=111148259 and c.JLZTM=51
+            where q.JLZTM=51
+              and json_exists(q.FWC, '$.*[*]?(@ == $v)' passing src.DXM as "v")
+       ) then 'AUTHORIZED' else 'MISSING' end AUTH_STATUS
+  from (
+        select 'sqljc' DXM from dual
+        union all select 'ssnwjc' from dual
+        union all select 'xyttZb' from dual
+        union all select 'xxcfjl' from dual
+        union all select 'cswsjc' from dual
+        union all select 'sswjjl' from dual
+        union all select 'xxwjjl' from dual
+        union all select 'xxhjjl' from dual
+        union all select 'xsh' from dual
+        union all select 'fjyrjc' from dual
+  ) src
+ order by src.DXM;
+
+exit;