|
@@ -18,6 +18,7 @@ import com.qmth.themis.business.dto.cache.TEStudentCacheDto;
|
|
|
import com.qmth.themis.business.dto.response.TEExamActivityDto;
|
|
|
import com.qmth.themis.business.dto.response.TEExamDto;
|
|
|
import com.qmth.themis.business.dto.response.TEExamResultDto;
|
|
|
+import com.qmth.themis.business.entity.TBOrg;
|
|
|
import com.qmth.themis.business.entity.TBSession;
|
|
|
import com.qmth.themis.business.entity.TEConfig;
|
|
|
import com.qmth.themis.business.entity.TEStudent;
|
|
@@ -95,6 +96,9 @@ public class TEStudentController {
|
|
|
@Resource
|
|
|
TOeExamRecordService tOeExamRecordService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ TBOrgService tbOrgService;
|
|
|
+
|
|
|
@ApiOperation(value = "学生登录接口")
|
|
|
@RequestMapping(value = "/login", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "学生信息", response = TEExamResultDto.class)})
|
|
@@ -118,12 +122,24 @@ public class TEStudentController {
|
|
|
orgId = Long.parseLong(String.valueOf(mapParameter.get("orgId")));
|
|
|
}
|
|
|
Long examId = null;
|
|
|
+ TBOrg tbOrg = null;
|
|
|
if (Objects.nonNull(mapParameter.get("examId"))) {
|
|
|
examId = Long.parseLong(String.valueOf(mapParameter.get("examId")));
|
|
|
+ ExamCacheBean ec = teExamService.getExamCacheBean(examId);
|
|
|
+ tbOrg = Objects.isNull(redisUtil.getOrg(ec.getOrgId())) ? tbOrgService.getById(ec.getOrgId()) : (TBOrg) redisUtil.getOrg(ec.getOrgId());
|
|
|
}
|
|
|
if (Objects.isNull(orgId) && Objects.isNull(examId)) {
|
|
|
throw new BusinessException(ExceptionResultEnum.ORG_ID_OR_EXAM_ID_NOT_CHOOSE);
|
|
|
}
|
|
|
+ if (Objects.nonNull(orgId)) {
|
|
|
+ tbOrg = Objects.isNull(redisUtil.getOrg(orgId)) ? tbOrgService.getById(orgId) : (TBOrg) redisUtil.getOrg(orgId);
|
|
|
+ }
|
|
|
+ if (Objects.isNull(tbOrg)) {
|
|
|
+ throw new BusinessException(ExceptionResultEnum.ORG_NO);
|
|
|
+ }
|
|
|
+ if (Objects.nonNull(tbOrg.getEnable()) && tbOrg.getEnable().intValue() == 0) {
|
|
|
+ throw new BusinessException(ExceptionResultEnum.ORG_ENABLE);
|
|
|
+ }
|
|
|
String identity = String.valueOf(mapParameter.get("identity"));
|
|
|
String password = String.valueOf(mapParameter.get("password"));
|
|
|
|