|
@@ -156,19 +156,22 @@ public class StudentController extends ControllerSupport {
|
|
|
predicates.add(cb.exists(subquery));
|
|
|
}
|
|
|
|
|
|
+ Boolean orgStudentData = PrivilegeManager.judge(finalRootOrgId,
|
|
|
+ accessUser.getRoleList(), OrgStudentData.CODE);
|
|
|
+ Boolean allStudentData = PrivilegeManager.judge(finalRootOrgId,
|
|
|
+ accessUser.getRoleList(), AllStudentData.CODE);
|
|
|
// 学习中心角色用户数据过滤
|
|
|
if (hasRole(RoleMeta.LC_USER)) {
|
|
|
- // 数据权限判断
|
|
|
- Boolean orgStudentData = PrivilegeManager.judge(finalRootOrgId,
|
|
|
- accessUser.getRoleList(), OrgStudentData.CODE);
|
|
|
- Boolean allStudentData = PrivilegeManager.judge(finalRootOrgId,
|
|
|
- accessUser.getRoleList(), AllStudentData.CODE);
|
|
|
- // 学习中心角色用户只能访问学习中心的学生数据
|
|
|
if ((!allStudentData) && orgStudentData) {
|
|
|
StudentCacheBean student = CacheHelper.getStudent(accessUser.getUserId());
|
|
|
Long orgId = student.getOrgId();
|
|
|
predicates.add(cb.equal(root.get("orgId"), orgId));
|
|
|
}
|
|
|
+ } else {
|
|
|
+ if (!allStudentData) {
|
|
|
+ // 查询不到数据
|
|
|
+ predicates.add(cb.equal(root.get("orgId"), -1));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return cb.and(predicates.toArray(new Predicate[predicates.size()]));
|
|
@@ -281,19 +284,22 @@ public class StudentController extends ControllerSupport {
|
|
|
predicates.add(cb.exists(subquery));
|
|
|
}
|
|
|
|
|
|
+ Boolean orgStudentData = PrivilegeManager.judge(finalRootOrgId,
|
|
|
+ accessUser.getRoleList(), OrgStudentData.CODE);
|
|
|
+ Boolean allStudentData = PrivilegeManager.judge(finalRootOrgId,
|
|
|
+ accessUser.getRoleList(), AllStudentData.CODE);
|
|
|
// 学习中心角色用户数据过滤
|
|
|
if (hasRole(RoleMeta.LC_USER)) {
|
|
|
- // 数据权限判断
|
|
|
- Boolean orgStudentData = PrivilegeManager.judge(finalRootOrgId,
|
|
|
- accessUser.getRoleList(), OrgStudentData.CODE);
|
|
|
- Boolean allStudentData = PrivilegeManager.judge(finalRootOrgId,
|
|
|
- accessUser.getRoleList(), AllStudentData.CODE);
|
|
|
- // 学习中心角色用户只能访问学习中心的学生数据
|
|
|
if ((!allStudentData) && orgStudentData) {
|
|
|
StudentCacheBean student = CacheHelper.getStudent(accessUser.getUserId());
|
|
|
Long orgId = student.getOrgId();
|
|
|
predicates.add(cb.equal(root.get("orgId"), orgId));
|
|
|
}
|
|
|
+ } else {
|
|
|
+ if (!allStudentData) {
|
|
|
+ // 查询不到数据
|
|
|
+ predicates.add(cb.equal(root.get("orgId"), -1));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return cb.and(predicates.toArray(new Predicate[predicates.size()]));
|