Files
2026-08-14 16:17:51 +08:00

21 lines
2.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 2026-08-14
## UserContext schId 超管置 0
- 需求:全局设置 `UserContext.schId`,若用户 `TYPE=1`(超级管理员)则强制赋值 0(`UserType.SUPER_ADMINISTRATOR`)。
- 改动文件:`src/main/java/com/yunhai/bschclassmanage/aspect/ControllerUserContextAspect.java`
- `populateUserContext()` 末尾在 `setType` 后增加判断:超管则 `UserContext.setSchId(0)`,覆盖 currentrole 带入的 schId。
- 新增 import `com.yunhai.bschclassmanage.enums.UserType`。
- 说明:该 Aspect(@Order(1),覆盖所有 controller)是实际填充 schId 的位置;UserContextInterceptor 的 resolveUser 仍返回 null,未设置 schId。未能本地编译(无 mvn、wrapper 缺 properties)。
## ComSchTreeService:BaseTree → BoaGroup 迁移
- 需求:将 `ComSchTreeService` 中树模型由 `com.yunhai.bschclassmanage.model.tool.BaseTree` 换成平台 `com.yunhai.platform.utils.model.BoaGroup`。
- 改动文件:`service/com/ComSchTreeService.java`、`service/IComSchTreeService.java`、`controller/api/SchTreeController.java`、`service/impl/SchTeacherService.java`(toTeacherGroupSelect + 私有 flattenTree)。
- 字段映射要点:
- BoaGroup 无 `expand`/`code`/`order`;有 `parentId`/`sort`(Integer)。
- 删除教师树节点上的 `setExpand`/`setCode`;`setOrder(String)` → `setSort(teacher.getSort())`;`sortTreeNodes` 排序改为按 `getSort()`(Integer, nullsLast)。
- `SchSystemTreeVO` 的 `setExpand`/`setSort` 保持不变(那是年级/班级树,另一套模型)。
- 接口 `getGroupTree()` 原声明为 `BoaGroup`(与实现 `List<BoaGroup>` 不匹配),改为 `List<BoaGroup>`。
- 红缓存 `SCHOOL_TREE_{schId}` 读取端由 BaseTree 改为 BoaGroup 解析;写入端未在本次仓库内找到(疑似外部/平台写入),解析向后兼容(缺字段为 null,多余字段忽略)。
- 注意:`BaseTree.java` 现已无引用,可删除(本次未删)。`expand` 字段消失会影响前端教师树自动展开,需前端确认。
- 未能本地编译(无 JDK)。