|
@@ -46,11 +46,10 @@ import cn.com.qmth.examcloud.core.basic.dao.UserRepo;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.entity.OrgEntity;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.entity.StudentCodeEntity;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.entity.StudentEntity;
|
|
|
+import cn.com.qmth.examcloud.core.basic.dao.entity.UserEntity;
|
|
|
import cn.com.qmth.examcloud.core.basic.service.StudentService;
|
|
|
import cn.com.qmth.examcloud.core.basic.service.bean.StudentInfo;
|
|
|
import cn.com.qmth.examcloud.core.basic.service.cache.StudentCache;
|
|
|
-import cn.com.qmth.examcloud.support.cache.CacheHelper;
|
|
|
-import cn.com.qmth.examcloud.support.cache.bean.StudentCacheBean;
|
|
|
import cn.com.qmth.examcloud.support.privilege.PrivilegeDefine.DataAccess.ExamWorkData.StudentInfoData.AllStudentData;
|
|
|
import cn.com.qmth.examcloud.support.privilege.PrivilegeDefine.DataAccess.ExamWorkData.StudentInfoData.OrgStudentData;
|
|
|
import cn.com.qmth.examcloud.support.privilege.PrivilegeManager;
|
|
@@ -163,8 +162,9 @@ public class StudentController extends ControllerSupport {
|
|
|
// 学习中心角色用户数据过滤
|
|
|
if (hasRole(RoleMeta.LC_USER)) {
|
|
|
if ((!allStudentData) && orgStudentData) {
|
|
|
- StudentCacheBean student = CacheHelper.getStudent(accessUser.getUserId());
|
|
|
- Long orgId = student.getOrgId();
|
|
|
+ UserEntity user = GlobalHelper.getEntity(userRepo, accessUser.getUserId(),
|
|
|
+ UserEntity.class);
|
|
|
+ Long orgId = user.getOrgId();
|
|
|
predicates.add(cb.equal(root.get("orgId"), orgId));
|
|
|
} else {
|
|
|
predicates.add(cb.equal(root.get("orgId"), -1));
|
|
@@ -293,13 +293,15 @@ public class StudentController extends ControllerSupport {
|
|
|
// 学习中心角色用户数据过滤
|
|
|
if (hasRole(RoleMeta.LC_USER)) {
|
|
|
if ((!allStudentData) && orgStudentData) {
|
|
|
- StudentCacheBean student = CacheHelper.getStudent(accessUser.getUserId());
|
|
|
- Long orgId = student.getOrgId();
|
|
|
+ UserEntity user = GlobalHelper.getEntity(userRepo, accessUser.getUserId(),
|
|
|
+ UserEntity.class);
|
|
|
+ Long orgId = user.getOrgId();
|
|
|
predicates.add(cb.equal(root.get("orgId"), orgId));
|
|
|
+ } else {
|
|
|
+ predicates.add(cb.equal(root.get("orgId"), -1));
|
|
|
}
|
|
|
} else if (!isSuperAdmin()) {
|
|
|
if (!allStudentData) {
|
|
|
- // 查询不到数据
|
|
|
predicates.add(cb.equal(root.get("orgId"), -1));
|
|
|
}
|
|
|
}
|