Просмотр исходного кода

fix(starclass): keep test class active outside production scoring

apple 1 неделя назад
Родитель
Сommit
b0fe3654a3

+ 8 - 1
docs/06_生产运维与部署/starclass_qa_20261101_11/03_cleanup.sql

@@ -78,6 +78,13 @@ begin
        )
      where b.BJID = v_bjid;
 
+    -- QA 数据清理不再停用 A 班,保留给 bzr01 做星级班功能测试。
+    -- 测试岗位关联班级已从正式月结和正式排名背景中排除。
+    update BJ
+       set JLZTM = 51
+     where BJID = v_bjid
+       and MC = 'PMS测试班主任A班(勿用于教学)';
+
     update BJCY b
        set b.SFZS = (
            select case x.OLD_SFZS when 1 then true else false end
@@ -95,7 +102,7 @@ begin
 
     commit;
     dbms_output.put_line('QA_DATA=CLEANED');
-    dbms_output.put_line('TEST_CLASS_STATE=RESTORED');
+    dbms_output.put_line('TEST_CLASS_STATE=ACTIVE_FOR_TEST');
 end;
 /
 

+ 11 - 6
docs/06_生产运维与部署/正式环境测试账号.md

@@ -231,10 +231,15 @@ GRCDID=1026036  SJGRCDID=1025606  MC=学校处分记录  DXM/GNM=xxcfjl/search
 
 ## 10. 2026-11-18 星级班问题整改后的状态
 
-星级班 2026-11 QA 数据已备份后清理,测试班 `40211004`、`40211005`
-均已停用。因此 `bzr01`、`bzr02` 当前不再关联在用班主任班级,
-`bjStarClass_mpInit` 会返回“当前账号未关联班主任班级”。
+星级班 2026-11 QA 数据已备份后清理:
 
-账号仍可登录,课程表、请假、学工等不受影响的测试功能继续保留。后续如需
-重新进行星级班班主任端测试,应先在独立测试环境构造数据;不要重新启用正式环境
-测试班来生成正式月结。
+```text
+40211004 PMS测试班主任A班:保持启用,供 bzr01 测试
+40211005 PMS测试班主任B班:停用(无专业关系)
+```
+
+`bzr01` 可继续进入星级班并查看 `2025-01` 测试月结。测试班虽然保持启用,
+但班主任(测试)岗位关联的班级已从正式全校月结、部门月结和移动端排名计算中排除,
+不会进入正式月结或影响真实班级排名。
+
+`bzr02` 因 B 班没有专业关系,当前不具备星级班测试班级。

+ 25 - 7
docs/24_星级班班主任移动报表/2026-11-18_星级班正式环境核验问题整改实施记录.md

@@ -58,6 +58,18 @@ src/biz/bj/XjbMonthCloseServ.java
 `XJB_PM.DWID` 改为保存部门排名实际使用的 `ZY.FZBMID`,不再保存班级所属单位
 `BJ.DWID`。已有快照也已回填。
 
+### 2.4 测试班与正式计算隔离
+
+班主任(测试)岗位 `GWID=1015464` 关联的班级:
+
+- 保留在用状态,`bzr01` 可以正常进入星级班测试。
+- 从正式全校月结的班级集合中排除。
+- 从部门月结的班级集合中排除。
+- 从移动端正式排名计算背景集合中排除。
+
+测试班主任查询自己的测试班时,服务会把该班临时加入当前请求的单班计算上下文,
+因此测试入口仍可使用,但不会进入真实班级排名或正式月结快照。
+
 ## 3. 正式数据库备份
 
 QA 数据清理前备份:
@@ -114,13 +126,16 @@ QA 业务子记录      0
 QA 增扣分 TEST 记录 0
 ```
 
-原测试班:
+测试班处理:
 
 ```text
-40211004 PMS测试班主任A班(勿用于教学):JLZTM 55
+40211004 PMS测试班主任A班(勿用于教学):JLZTM 51,保留给 bzr01 测试
 40211005 PMS测试班主任B班(勿用于教学):JLZTM 55
 ```
 
+班主任(测试)岗位关联的班级不会进入正式全校月结、部门月结和移动端排名计算;
+测试班可正常进入星级班页面,但不会污染生产排名。
+
 原六个空测试团体:
 
 ```text
@@ -181,7 +196,7 @@ ROOT/WEB-INF/backup/20261118_starclass_remediation
 Pod:
 
 ```text
-tomcat-pms-6f96b4d745-4bmzc
+tomcat-pms-8fd84469b-cvkm4
 ```
 
 状态:
@@ -195,15 +210,15 @@ SerCfg.jsp:HTTP 200
 发布前 class 备份:
 
 ```text
-/opt/data/pms/backup/20261118_starclass_remediation
+/opt/data/pms/backup/20261118_starclass_testclass_keep
 ```
 
 关键 class SHA-256:
 
 | class | SHA-256 |
 |---|---|
-| `BjStarClassMpServ.class` | `1e501d88167245a14b8b6df5a7665e5cf2bbd3c69b9f08b6ec912e624e6f6977` |
-| `XjbMonthCloseServ.class` | `f0677cc1849b0ee19ff924422dc7929c53b43a7158b1b75f1e4ce17b293f7426` |
+| `BjStarClassMpServ.class` | `cbbe12f81445874116666e79db273079b6b1848837092c8a9b486dfd3b679836` |
+| `XjbMonthCloseServ.class` | `de470f66ecb5d341fa00d93ea516b2ee31320852dd8be7f8f81730f9501a19f9` |
 
 ## 7. 正式冒烟
 
@@ -212,6 +227,9 @@ SerCfg.jsp:HTTP 200
 a 账号 PC 菜单:班级评比 8 个入口完整
 PC 报表默认:2026-09 / 批次 41 / 86 个班
 2026-10:按预期提示暂无已发布月结
+bzr01 星级班初始化:ssCode=0,默认班级 40211004
+bzr01 2025-01 测试月报:ssCode=0,87.17 分,四星级
+bzr01 2025-01 增分明细:ssCode=0,2 条
 ```
 
 最近日志未发现:
@@ -269,7 +287,7 @@ XJB_PM 部门标识错误:0
 应用回滚:
 
 ```text
-恢复 /opt/data/pms/backup/20261118_starclass_remediation/classes
+恢复 /opt/data/pms/backup/20261118_starclass_testclass_keep/classes
 到 ROOT/WEB-INF/classes/biz/bj/
 然后 rollout restart deployment/tomcat-pms -n feifan-pms
 ```

+ 2 - 2
docs/24_星级班班主任移动报表/sql/2026-11-18_正式库主数据与排名快照修复.sql

@@ -31,11 +31,11 @@ begin
 end;
 /
 
--- 两个班均为正式环境测试班。A 班由 QA 清理脚本恢复到 55;
+-- A 班保留在用状态,供 bzr01 继续进入星级班做功能测试;
 -- B 班没有专业关系,必须停用,避免全校月结静默漏班。
 update BJ
    set JLZTM = 55
- where BJID in (40211004, 40211005)
+ where BJID = 40211005
    and MC like 'PMS测试%';
 
 -- 六个测试团体从未导入成员,也没有进入星级班账本。

+ 9 - 1
src/biz/bj/BjStarClassMpServ.java

@@ -50,6 +50,7 @@ public class BjStarClassMpServ extends Serv {
     private static final String SOURCE_REAL = "real";
     private static final String SOURCE_MISSING = "missing";
     private static final String ZHIXIN_STAR_MARKER_PREFIX = "ZHIXIN_STAR_";
+    private static final long TEST_TEACHER_GWID = 1015464L;
     private static final int DEFAULT_PAGE_SIZE = 20;
     private static final int DETAIL_PAGE_SIZE = 30;
 
@@ -122,6 +123,9 @@ public class BjStarClassMpServ extends Serv {
             MonthPeriod period = MonthPeriod.of(month);
 
             List<ClassInfo> classes = rdActiveClasses(db);
+            if (classes.stream().noneMatch(item ->
+                    item.bjid == selected.bjid))
+                classes.add(selected);
             ScoreBook scores = rdScoreBook(db, classes, period);
             RankBook ranks = rdRanks(classes, scores);
             ClassScore classScore = scores.classScores.get(selected.bjid);
@@ -534,7 +538,11 @@ public class BjStarClassMpServ extends Serv {
                         + " from BJ b inner join ZY z on z.ZYID=b.ZYID"
                         + " left join BM bm on bm.BMID=z.FZBMID"
                         + " where b." + ObjC.JLZT_useStr
-                        + " and b.BJZTM!=81 order by b.BJID");
+                        + " and b.BJZTM!=81"
+                        + " and not exists (select 1 from RY testRy"
+                        + " where testRy.RYID=b.BZRID"
+                        + " and testRy.GWID=" + TEST_TEACHER_GWID + ")"
+                        + " order by b.BJID");
         return rdClasses(db.doSelMapListByC(sqlc));
     }
 

+ 18 - 3
src/biz/bj/XjbMonthCloseServ.java

@@ -51,6 +51,7 @@ public class XjbMonthCloseServ extends Serv {
     private static final String FORMULA_VERSION = "SC-2024-10-V1";
     private static final String SCOPE_SCHOOL = "XX";
     private static final long SCHOOL_SCOPE_ID = 0L;
+    private static final long TEST_TEACHER_GWID = 1015464L;
     private static final int JD_DRAFT = 1;
     private static final int JD_PUBLISHED = 5;
     private static final int JD_SUPERSEDED = 6;
@@ -431,7 +432,11 @@ public class XjbMonthCloseServ extends Serv {
                         + " from BJ b"
                         + " inner join ZY z on z.ZYID=b.ZYID"
                         + " where b." + ObjC.JLZT_useStr
-                        + " and b.BJZTM!=81 order by b.MC,b.BJID");
+                        + " and b.BJZTM!=81"
+                        + " and not exists (select 1 from RY testRy"
+                        + " where testRy.RYID=b.BZRID"
+                        + " and testRy.GWID=" + TEST_TEACHER_GWID + ")"
+                        + " order by b.MC,b.BJID");
         List<ClassRow> rows = new ArrayList<>();
         for (Map<String, Object> row : db.doSelMapListByC(sqlc)) {
             rows.add(new ClassRow(
@@ -449,7 +454,10 @@ public class XjbMonthCloseServ extends Serv {
             throws Exception {
         SqlCmd countCmd = new SqlCmd(
                 "select count(*) CNT from BJ b where b."
-                        + ObjC.JLZT_useStr + " and b.BJZTM!=81");
+                        + ObjC.JLZT_useStr + " and b.BJZTM!=81"
+                        + " and not exists (select 1 from RY testRy"
+                        + " where testRy.RYID=b.BZRID"
+                        + " and testRy.GWID=" + TEST_TEACHER_GWID + ")");
         db.doSelByC(countCmd);
         int activeCount = db.rowNum == 0 ? 0 : db.rdIntCol("cnt");
         if (activeCount == joinableCount)
@@ -460,6 +468,9 @@ public class XjbMonthCloseServ extends Serv {
                         + " left join ZY z on z.ZYID=b.ZYID"
                         + " where b." + ObjC.JLZT_useStr
                         + " and b.BJZTM!=81 and z.ZYID is null"
+                        + " and not exists (select 1 from RY testRy"
+                        + " where testRy.RYID=b.BZRID"
+                        + " and testRy.GWID=" + TEST_TEACHER_GWID + ")"
                         + " order by b.BJID");
         StringBuilder message = new StringBuilder(
                 "在用班级主数据不完整:在用班 ")
@@ -621,7 +632,11 @@ public class XjbMonthCloseServ extends Serv {
                         + " from BJ b"
                         + " inner join ZY z on z.ZYID=b.ZYID"
                         + " where z.FZBMID=:bmid and b." + ObjC.JLZT_useStr
-                        + " and b.BJZTM!=81 order by b.MC,b.BJID");
+                        + " and b.BJZTM!=81"
+                        + " and not exists (select 1 from RY testRy"
+                        + " where testRy.RYID=b.BZRID"
+                        + " and testRy.GWID=" + TEST_TEACHER_GWID + ")"
+                        + " order by b.MC,b.BJID");
         sqlc.wrLongParm("bmid", bmid);
         List<ClassRow> rows = new ArrayList<>();
         for (Map<String, Object> row : db.doSelMapListByC(sqlc)) {