|
@@ -1,11 +1,13 @@
|
|
|
package com.qmth.themis.exam.api;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.google.gson.Gson;
|
|
|
import com.qmth.themis.business.annotation.ApiJsonObject;
|
|
|
import com.qmth.themis.business.annotation.ApiJsonProperty;
|
|
|
import com.qmth.themis.business.cache.ExamRecordCacheUtil;
|
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
|
import com.qmth.themis.business.dto.AuthDto;
|
|
|
+import com.qmth.themis.business.dto.cache.TEStudentCacheDto;
|
|
|
import com.qmth.themis.business.dto.response.TEExamDto;
|
|
|
import com.qmth.themis.business.dto.response.TEExamResultDto;
|
|
|
import com.qmth.themis.business.dto.response.TEExamUnFinishDto;
|
|
@@ -83,7 +85,7 @@ public class TEStudentController {
|
|
|
public Result login(@ApiJsonObject(name = "loginAccount", value = {
|
|
|
@ApiJsonProperty(key = "identity", description = "证件号"),
|
|
|
@ApiJsonProperty(key = "password", description = "密码"),
|
|
|
- @ApiJsonProperty(key = "orgId",type = "long",example = "1",description = "机构id")
|
|
|
+ @ApiJsonProperty(key = "orgId", type = "long", example = "1", description = "机构id")
|
|
|
}) @ApiParam(value = "学生信息", required = true) @RequestBody Map<String, Object> mapParameter) throws NoSuchAlgorithmException {
|
|
|
if (Objects.isNull(mapParameter)) {
|
|
|
throw new BusinessException(ExceptionResultEnum.STUDENT_IS_NULL);
|
|
@@ -144,8 +146,13 @@ public class TEStudentController {
|
|
|
AuthDto authDto = cacheService.addStudentCache(teStudent.getId());
|
|
|
//生成token
|
|
|
String token = RandomStringUtils.randomAlphanumeric(32);
|
|
|
+ TEStudentCacheDto teStudentCacheDto = (TEStudentCacheDto) redisUtil.getStudent(teStudent.getId());
|
|
|
+ if (Objects.isNull(teStudentCacheDto)) {
|
|
|
+ Gson gson = new Gson();
|
|
|
+ teStudentCacheDto = gson.fromJson(gson.toJson(teStudent), TEStudentCacheDto.class);
|
|
|
+ }
|
|
|
//添加用户缓存
|
|
|
- redisUtil.setStudent(teStudent.getId(), teStudent);
|
|
|
+ redisUtil.setStudent(teStudent.getId(), teStudentCacheDto, null, null);
|
|
|
String source = null;
|
|
|
if (Objects.equals(platform.name(), Platform.win.name()) || Objects.equals(platform.name(), Platform.mac.name())) {
|
|
|
source = platform.getSource().split(",")[1];
|