学制角色类型

This commit is contained in:
2026-08-17 09:45:16 +08:00
parent ae554d7aa2
commit 823330cdfb
2 changed files with 1 additions and 9 deletions
@@ -80,7 +80,7 @@ public class SchsystemController {
UserContext.UserInfo user= UserContext.getCurrentUser(); UserContext.UserInfo user= UserContext.getCurrentUser();
// 2. 角色权限校验 // 2. 角色权限校验
int roleId = user.getRoleId(); Integer roleId = user.getRoleId();
boolean isSuperAdmin = UserType.SUPER_ADMINISTRATOR.getId().equals(UserContext.getType()); boolean isSuperAdmin = UserType.SUPER_ADMINISTRATOR.getId().equals(UserContext.getType());
boolean isAreaAdmin = UserRole.AREAADMIN.getValue().equals(roleId); boolean isAreaAdmin = UserRole.AREAADMIN.getValue().equals(roleId);
@@ -27,8 +27,6 @@ public class BaseSchsystemService implements IBaseSchsystemService {
public List<BaseSchsystem> getSchsystemList() { public List<BaseSchsystem> getSchsystemList() {
String cacheKey = RedisConstants.SYSTEM_SCHSYSTEM; String cacheKey = RedisConstants.SYSTEM_SCHSYSTEM;
// 1. 先读缓存;空结果(null 或 空列表)视为未命中,强制回源 DB,
// 避免“冷启动时把 [] 写进缓存后长期毒化”的问题
List<BaseSchsystem> cached = redisUtil.getList(cacheKey, BaseSchsystem.class); List<BaseSchsystem> cached = redisUtil.getList(cacheKey, BaseSchsystem.class);
if (cached != null && !cached.isEmpty()) { if (cached != null && !cached.isEmpty()) {
return cached; return cached;
@@ -52,11 +50,5 @@ public class BaseSchsystemService implements IBaseSchsystemService {
} }
} }
/**
* 学制数据变更后调用:清除学制列表缓存(base_sch_system 写入/更新/删除时触发)
*/
public void clearSchsystemCache() {
redisUtil.del(RedisConstants.SYSTEM_SCHSYSTEM);
}
} }