fix: 修复学生管理数据权限问题

使用带 @DataPermission 注解的查询方法
This commit is contained in:
神码-方晓辉 2026-02-03 22:11:54 +08:00
parent 730f27c55e
commit 998d9aee35
1 changed files with 6 additions and 3 deletions

View File

@ -60,7 +60,8 @@ public class PgStudentServiceImpl implements IPgStudentService {
@Override @Override
public TableDataInfo<StudentVo> selectPageList(PgStudent student, PageQuery pageQuery) { public TableDataInfo<StudentVo> selectPageList(PgStudent student, PageQuery pageQuery) {
LambdaQueryWrapper<PgStudent> lqw = buildQueryWrapper(student); LambdaQueryWrapper<PgStudent> lqw = buildQueryWrapper(student);
Page<PgStudent> page = baseMapper.selectPage(pageQuery.build(), lqw); // 使用带数据权限的查询方法
Page<PgStudent> page = baseMapper.selectPageStudentList(pageQuery.build(), lqw);
// 转换为 VO 并填充关联数据 // 转换为 VO 并填充关联数据
List<StudentVo> voList = convertToVoList(page.getRecords()); List<StudentVo> voList = convertToVoList(page.getRecords());
@ -72,7 +73,8 @@ public class PgStudentServiceImpl implements IPgStudentService {
@Override @Override
public List<PgStudent> selectList(PgStudent student) { public List<PgStudent> selectList(PgStudent student) {
return baseMapper.selectList(buildQueryWrapper(student)); // 使用带数据权限的查询方法
return baseMapper.selectStudentList(buildQueryWrapper(student));
} }
@Override @Override
@ -250,7 +252,8 @@ public class PgStudentServiceImpl implements IPgStudentService {
lqw.eq(schoolId != null, PgStudent::getSchoolId, schoolId); lqw.eq(schoolId != null, PgStudent::getSchoolId, schoolId);
lqw.orderByDesc(PgStudent::getCreateTime); lqw.orderByDesc(PgStudent::getCreateTime);
Page<PgStudent> page = baseMapper.selectPage(pageQuery.build(), lqw); // 使用带数据权限的查询方法
Page<PgStudent> page = baseMapper.selectPageStudentList(pageQuery.build(), lqw);
// 转换为 VO填充学校年级班级会员信息 // 转换为 VO填充学校年级班级会员信息
List<StudentVo> voList = convertToVoList(page.getRecords()); List<StudentVo> voList = convertToVoList(page.getRecords());