|
|
|
@ -146,17 +146,21 @@ public class UserController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String getIPAndPlace(HttpServletRequest request, String name, String userId, String studentId) {
|
|
|
|
|
String ip = request.getRemoteAddr();
|
|
|
|
|
String ipHomePlace = userService.getIpAddress(ip);
|
|
|
|
|
SysLoginLog sysLoginLog = new SysLoginLog();
|
|
|
|
|
String ip = request.getRemoteAddr();
|
|
|
|
|
if (StringUtils.isNotBlank(ip)) {
|
|
|
|
|
sysLoginLog.setLoginIp(ip);
|
|
|
|
|
String ipHomePlace = userService.getIpAddress(ip);
|
|
|
|
|
if (ipHomePlace != null) {
|
|
|
|
|
sysLoginLog.setIpAddress(ipHomePlace);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
String uuid = IdUtil.randomUUID();
|
|
|
|
|
sysLoginLog.setLogId(uuid);
|
|
|
|
|
sysLoginLog.setLoginIp(ip);
|
|
|
|
|
sysLoginLog.setUserid(userId);
|
|
|
|
|
sysLoginLog.setName(name);
|
|
|
|
|
sysLoginLog.setStudentId(studentId);
|
|
|
|
|
sysLoginLog.setLoginTime(new Date());
|
|
|
|
|
sysLoginLog.setIpAddress(ipHomePlace);
|
|
|
|
|
sysLoginLogMapper.insert(sysLoginLog);
|
|
|
|
|
return uuid;
|
|
|
|
|
}
|
|
|
|
@ -484,17 +488,17 @@ public class UserController {
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
@GetMapping("/getStudentExamPeopleCountAndStudentExamTime")
|
|
|
|
|
@ApiOperation("考试人数和考试次数")
|
|
|
|
|
public ResultEntity<Map<Long,Long>> getStudentExamCountAndStudentCount(String schoolId){
|
|
|
|
|
public ResultEntity<Map<Long, Long>> getStudentExamCountAndStudentCount(String schoolId) {
|
|
|
|
|
StuUserExample stuUserExample = new StuUserExample();
|
|
|
|
|
stuUserExample.createCriteria().andSchoolIdEqualTo(schoolId).andExamStatusEqualTo("true");
|
|
|
|
|
//考试人数
|
|
|
|
|
long examPeopleCount= stuUserMapper.countByExample(stuUserExample);
|
|
|
|
|
long examPeopleCount = stuUserMapper.countByExample(stuUserExample);
|
|
|
|
|
|
|
|
|
|
StuStudentExamExample stuStudentExamExample = new StuStudentExamExample();
|
|
|
|
|
//考试次数
|
|
|
|
|
long examTime = studentExamMapper.countByExample(stuStudentExamExample);
|
|
|
|
|
HashMap<Long, Long> countMap = new HashMap<>();
|
|
|
|
|
countMap.put(examPeopleCount,examTime);
|
|
|
|
|
countMap.put(examPeopleCount, examTime);
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "考试人数和考试次数查询成功", countMap);
|
|
|
|
|
}
|
|
|
|
|
}
|