|
@@ -44,9 +44,13 @@ import cn.com.qmth.examcloud.commons.web.redis.RedisClient;
|
|
|
import cn.com.qmth.examcloud.commons.web.security.bean.User;
|
|
|
import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.OrgCloudService;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.bean.OrgBean;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.bean.StudentBean;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.request.GetOrgReq;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.request.GetStudentReq;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.response.GetOrgResp;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.response.GetStudentResp;
|
|
|
import cn.com.qmth.examcloud.core.examwork.api.controller.bean.ExamCourseGroupDomain;
|
|
|
import cn.com.qmth.examcloud.core.examwork.api.controller.bean.ExamDomain;
|
|
|
import cn.com.qmth.examcloud.core.examwork.api.controller.bean.ExamOrgSettingsDomain;
|
|
@@ -116,6 +120,9 @@ public class ExamController extends ControllerSupport {
|
|
|
@Autowired
|
|
|
ExamOrgPropertyRepo examOrgPropertyRepo;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ StudentCloudService studentCloudService;
|
|
|
+
|
|
|
/**
|
|
|
* 方法注释
|
|
|
*
|
|
@@ -367,7 +374,11 @@ public class ExamController extends ControllerSupport {
|
|
|
throw new StatusException("E-001250", "examId is wrong");
|
|
|
}
|
|
|
validateRootOrgIsolation(examEntity.getRootOrgId());
|
|
|
- return examService.getOrgProperty(examId, accessUser.getOrgId(), key);
|
|
|
+
|
|
|
+ StudentBean student = getStudent(accessUser.getUserId());
|
|
|
+ Long orgId = student.getOrgId();
|
|
|
+
|
|
|
+ return examService.getOrgProperty(examId, orgId, key);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "启用考试", notes = "启用考试")
|
|
@@ -637,8 +648,11 @@ public class ExamController extends ControllerSupport {
|
|
|
}
|
|
|
validateRootOrgIsolation(examEntity.getRootOrgId());
|
|
|
|
|
|
+ StudentBean student = getStudent(accessUser.getUserId());
|
|
|
+ Long orgId = student.getOrgId();
|
|
|
+
|
|
|
ExamOrgSettingsEntity examOrgEntity = examOrgSettingsRepo.findByExamIdAndOrgId(examId,
|
|
|
- accessUser.getOrgId());
|
|
|
+ orgId);
|
|
|
|
|
|
ExamDomain domain = new ExamDomain();
|
|
|
domain.setBeginTime(examEntity.getBeginTime());
|
|
@@ -818,7 +832,8 @@ public class ExamController extends ControllerSupport {
|
|
|
}
|
|
|
|
|
|
User accessUser = getAccessUser();
|
|
|
- Long orgId = accessUser.getOrgId();
|
|
|
+ StudentBean student = getStudent(accessUser.getUserId());
|
|
|
+ Long orgId = student.getOrgId();
|
|
|
|
|
|
if (limited) {
|
|
|
String key = "IP_" + orgId;
|
|
@@ -853,4 +868,19 @@ public class ExamController extends ControllerSupport {
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 方法注释
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param studentId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private StudentBean getStudent(Long studentId) {
|
|
|
+ GetStudentReq req = new GetStudentReq();
|
|
|
+ req.setStudentId(studentId);
|
|
|
+ GetStudentResp resp = studentCloudService.getStudent(req);
|
|
|
+ StudentBean studentInfo = resp.getStudentInfo();
|
|
|
+ return studentInfo;
|
|
|
+ }
|
|
|
+
|
|
|
}
|