|
|
@ -99,7 +99,7 @@ public class LoginController { |
|
|
|
AssessUser assessUser = this.assessUserService.selectAssessUserByUserIdAndissueIdForNotEnd(userId, examId); |
|
|
|
AssessUser assessUser = this.assessUserService.selectAssessUserByUserIdAndissueIdForNotEnd(userId, examId); |
|
|
|
if (assessUser == null) { |
|
|
|
if (assessUser == null) { |
|
|
|
Date now = new Date(); |
|
|
|
Date now = new Date(); |
|
|
|
String tel=new SimpleDateFormat("yyMMddHHmm").format(now).concat(String.valueOf(userId)); |
|
|
|
String tel=new SimpleDateFormat("yyMMddHHmmss").format(now).concat(String.valueOf(userId)); |
|
|
|
|
|
|
|
|
|
|
|
//第一次进入进行注册
|
|
|
|
//第一次进入进行注册
|
|
|
|
String code=String.format("%06d",new Random().nextInt(1000000)); |
|
|
|
String code=String.format("%06d",new Random().nextInt(1000000)); |
|
|
@ -168,6 +168,14 @@ public class LoginController { |
|
|
|
if (joinStuIds == null) { |
|
|
|
if (joinStuIds == null) { |
|
|
|
joinStuIds = new ArrayList<Integer>(); |
|
|
|
joinStuIds = new ArrayList<Integer>(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, String> map = new HashMap<String, String>(); |
|
|
|
|
|
|
|
map.put("examPaperId", examDto.getExamPaperId()); |
|
|
|
|
|
|
|
map.put("examId", examDto.getExamId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
redisTemplate.opsForValue().set(caseKey, map); |
|
|
|
|
|
|
|
redisTemplate.expire(caseKey, 30, TimeUnit.DAYS); |
|
|
|
|
|
|
|
|
|
|
|
//如果等于0
|
|
|
|
//如果等于0
|
|
|
|
if (joinStuIds.stream() |
|
|
|
if (joinStuIds.stream() |
|
|
|
.filter(stuIds -> (stuIds.equals(userId))).count() == 0) { |
|
|
|
.filter(stuIds -> (stuIds.equals(userId))).count() == 0) { |
|
|
@ -192,6 +200,14 @@ public class LoginController { |
|
|
|
yyyfLoginDto.setMsg(YyyfConstant.NO_ENTRY_INTO_PRACTICE); |
|
|
|
yyyfLoginDto.setMsg(YyyfConstant.NO_ENTRY_INTO_PRACTICE); |
|
|
|
ExamDto examDto = examDtoOpsForHash.get(YyyfConstant.EXAM_KEY, examId); |
|
|
|
ExamDto examDto = examDtoOpsForHash.get(YyyfConstant.EXAM_KEY, examId); |
|
|
|
yyyfLoginDto.setRemainingTime((examDto.getEndTime().getTime() - new Date().getTime() )/ 1000); |
|
|
|
yyyfLoginDto.setRemainingTime((examDto.getEndTime().getTime() - new Date().getTime() )/ 1000); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, String> map = new HashMap<String, String>(); |
|
|
|
|
|
|
|
map.put("examPaperId", examDto.getExamPaperId()); |
|
|
|
|
|
|
|
map.put("examId", examDto.getExamId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
redisTemplate.opsForValue().set(caseKey, map); |
|
|
|
|
|
|
|
redisTemplate.expire(caseKey, 30, TimeUnit.DAYS); |
|
|
|
|
|
|
|
|
|
|
|
return handleAfterLogin(yyyfLoginDto, yyyfUserDto); |
|
|
|
return handleAfterLogin(yyyfLoginDto, yyyfUserDto); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -199,14 +215,6 @@ public class LoginController { |
|
|
|
} |
|
|
|
} |
|
|
|
//删除强制提醒的缓存
|
|
|
|
//删除强制提醒的缓存
|
|
|
|
// redisTemplate.delete(YyyfConstant.ANSER_KEY + userId);
|
|
|
|
// redisTemplate.delete(YyyfConstant.ANSER_KEY + userId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, String> map = new HashMap<String, String>(); |
|
|
|
|
|
|
|
map.put("examPaperId", examPaperId); |
|
|
|
|
|
|
|
map.put("examId", examId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
redisTemplate.opsForValue().set(caseKey, map); |
|
|
|
|
|
|
|
redisTemplate.expire(caseKey, 2, TimeUnit.HOURS); |
|
|
|
|
|
|
|
yyyfLoginDto.setStatus(1); |
|
|
|
yyyfLoginDto.setStatus(1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|