|
@@ -1,22 +1,17 @@
|
|
package com.qmth.themis.backend.api;
|
|
package com.qmth.themis.backend.api;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
-import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
-import com.google.gson.Gson;
|
|
|
|
import com.qmth.themis.backend.config.DictionaryConfig;
|
|
import com.qmth.themis.backend.config.DictionaryConfig;
|
|
-import com.qmth.themis.backend.elasticsearch.repository.ETEStudentRepo;
|
|
|
|
-import com.qmth.themis.backend.elasticsearch.service.ETEStudentService;
|
|
|
|
-import com.qmth.themis.backend.mongodb.entity.*;
|
|
|
|
import com.qmth.themis.backend.util.ServletUtil;
|
|
import com.qmth.themis.backend.util.ServletUtil;
|
|
-import com.qmth.themis.backend.websocket.WebSocketServer;
|
|
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
import com.qmth.themis.business.dto.AuthDto;
|
|
import com.qmth.themis.business.dto.AuthDto;
|
|
-import com.qmth.themis.business.entity.*;
|
|
|
|
|
|
+import com.qmth.themis.business.entity.TBSession;
|
|
|
|
+import com.qmth.themis.business.entity.TBUser;
|
|
import com.qmth.themis.business.enums.MqEnum;
|
|
import com.qmth.themis.business.enums.MqEnum;
|
|
import com.qmth.themis.business.enums.RoleEnum;
|
|
import com.qmth.themis.business.enums.RoleEnum;
|
|
import com.qmth.themis.business.enums.SystemOperationEnum;
|
|
import com.qmth.themis.business.enums.SystemOperationEnum;
|
|
-import com.qmth.themis.business.service.*;
|
|
|
|
|
|
+import com.qmth.themis.business.service.EhcacheService;
|
|
|
|
+import com.qmth.themis.business.service.TBUserService;
|
|
import com.qmth.themis.business.util.EhcacheUtil;
|
|
import com.qmth.themis.business.util.EhcacheUtil;
|
|
import com.qmth.themis.business.util.JacksonUtil;
|
|
import com.qmth.themis.business.util.JacksonUtil;
|
|
import com.qmth.themis.business.util.RedisUtil;
|
|
import com.qmth.themis.business.util.RedisUtil;
|
|
@@ -31,17 +26,11 @@ import com.qmth.themis.common.signature.SignatureType;
|
|
import com.qmth.themis.common.util.AesUtil;
|
|
import com.qmth.themis.common.util.AesUtil;
|
|
import com.qmth.themis.common.util.Result;
|
|
import com.qmth.themis.common.util.Result;
|
|
import com.qmth.themis.common.util.ResultUtil;
|
|
import com.qmth.themis.common.util.ResultUtil;
|
|
-import com.qmth.themis.mq.dto.MqDto;
|
|
|
|
import com.qmth.themis.mq.service.MqDtoService;
|
|
import com.qmth.themis.mq.service.MqDtoService;
|
|
import io.swagger.annotations.*;
|
|
import io.swagger.annotations.*;
|
|
import org.apache.commons.lang3.RandomStringUtils;
|
|
import org.apache.commons.lang3.RandomStringUtils;
|
|
-import org.apache.rocketmq.spring.annotation.MessageModel;
|
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
|
-import org.springframework.data.mongodb.core.MongoTemplate;
|
|
|
|
-import org.springframework.data.mongodb.core.query.Query;
|
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
@@ -49,11 +38,13 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
-import java.io.IOException;
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.security.NoSuchAlgorithmException;
|
|
import java.security.NoSuchAlgorithmException;
|
|
import java.security.spec.InvalidKeySpecException;
|
|
import java.security.spec.InvalidKeySpecException;
|
|
-import java.util.*;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description: 用户 前端控制器
|
|
* @Description: 用户 前端控制器
|
|
@@ -122,14 +113,14 @@ public class TBUserController {
|
|
//添加用户缓存
|
|
//添加用户缓存
|
|
redisUtil.setUser(user.getId(), user);
|
|
redisUtil.setUser(user.getId(), user);
|
|
//添加用户会话缓存
|
|
//添加用户会话缓存
|
|
- String sessionId = SessionUtil.digest(user.getId(), authDto.getRoleEnum().name(), platform.getSource());
|
|
|
|
|
|
+ String sessionId = SessionUtil.digest(user.getId(), authDto.getRoleCodes().toString(), platform.getSource());
|
|
|
|
|
|
Date expire = SystemConstant.getExpireTime(platform);
|
|
Date expire = SystemConstant.getExpireTime(platform);
|
|
- TBSession tbSession = new TBSession(sessionId, String.valueOf(user.getId()), authDto.getRoleEnum().name(), platform.getSource(), platform.name(), deviceId, request.getLocalAddr(), token, expire);
|
|
|
|
|
|
+ TBSession tbSession = new TBSession(sessionId, String.valueOf(user.getId()), authDto.getRoleCodes().toString(), platform.getSource(), platform.name(), deviceId, request.getLocalAddr(), token, expire);
|
|
redisUtil.setUserSession(sessionId, tbSession);
|
|
redisUtil.setUserSession(sessionId, tbSession);
|
|
//mq发送消息start
|
|
//mq发送消息start
|
|
mqDtoService.assembleSendOneWayMsg(dictionaryConfig.mqConfigDomain().getSessionTopic(), platform.getSource(), tbSession, MqEnum.SESSION.name(), tbSession.getId(), user.getLoginName());
|
|
mqDtoService.assembleSendOneWayMsg(dictionaryConfig.mqConfigDomain().getSessionTopic(), platform.getSource(), tbSession, MqEnum.SESSION.name(), tbSession.getId(), user.getLoginName());
|
|
- mqDtoService.assembleSendOneWayMsg(dictionaryConfig.mqConfigDomain().getUserLogTopic(), Objects.equals(authDto.getRoleEnum().name(), RoleEnum.STUDENT.name()) ? dictionaryConfig.mqConfigDomain().getUserLogTopicStudentTag() : dictionaryConfig.mqConfigDomain().getUserLogTopicUserTag(), SystemOperationEnum.LOGIN, MqEnum.USER_LOG.name(), user.getId(), user.getLoginName());
|
|
|
|
|
|
+ mqDtoService.assembleSendOneWayMsg(dictionaryConfig.mqConfigDomain().getUserLogTopic(), authDto.getRoleCodes().toString().contains(RoleEnum.STUDENT.name()) ? dictionaryConfig.mqConfigDomain().getUserLogTopicStudentTag() : dictionaryConfig.mqConfigDomain().getUserLogTopicUserTag(), SystemOperationEnum.LOGIN, MqEnum.USER_LOG.name(), user.getId(), user.getLoginName());
|
|
//mq发送消息end
|
|
//mq发送消息end
|
|
//测试
|
|
//测试
|
|
String test = SignatureInfo.build(SignatureType.TOKEN, sessionId, token);
|
|
String test = SignatureInfo.build(SignatureType.TOKEN, sessionId, token);
|
|
@@ -138,305 +129,314 @@ public class TBUserController {
|
|
map.put(SystemConstant.ACCESS_TOKEN, test);
|
|
map.put(SystemConstant.ACCESS_TOKEN, test);
|
|
map.put(SystemConstant.ACCOUNT, user);
|
|
map.put(SystemConstant.ACCOUNT, user);
|
|
map.put(SystemConstant.SESSION_ID, sessionId);
|
|
map.put(SystemConstant.SESSION_ID, sessionId);
|
|
|
|
+ Map orgMap = new HashMap();
|
|
|
|
+ orgMap.put("name", authDto.getTbOrg().getName());
|
|
|
|
+ orgMap.put("logo", authDto.getTbOrg().getLogo());
|
|
|
|
+ orgMap.put("enableVideoRecord", authDto.getTbOrg().getEnableVideoRecord());
|
|
|
|
+ map.put(SystemConstant.ORG_INFO, orgMap);
|
|
return ResultUtil.ok(map);
|
|
return ResultUtil.ok(map);
|
|
}
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "es查询接口")
|
|
|
|
- @RequestMapping(value = "/websocketPush", method = RequestMethod.POST)
|
|
|
|
- public Result websocketPush(HttpServletRequest request, @RequestBody String message) throws IOException {
|
|
|
|
- TBUser tbUser = (TBUser) ServletUtil.getRequestAccount(request);
|
|
|
|
- WebSocketServer.sendInfo(message, String.valueOf(tbUser.getId()));
|
|
|
|
- return ResultUtil.ok(SystemConstant.SUCCESS);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Resource
|
|
|
|
- TEExamActivityService teExamActivityService;
|
|
|
|
-
|
|
|
|
- @Resource
|
|
|
|
- TEExamService teExamService;
|
|
|
|
-
|
|
|
|
- @Resource
|
|
|
|
- TEStudentService teStudentService;
|
|
|
|
-
|
|
|
|
- @Resource
|
|
|
|
- TEExamStudentService teExamStudentService;
|
|
|
|
-
|
|
|
|
- @Resource
|
|
|
|
- TEExamCourseService teExamCourseService;
|
|
|
|
-
|
|
|
|
- @Resource
|
|
|
|
- TEExamPaperService teExamPaperService;
|
|
|
|
-
|
|
|
|
- @Value("${db.name}")
|
|
|
|
- String dbName;
|
|
|
|
-
|
|
|
|
- @Resource
|
|
|
|
- MongoTemplate mongoTemplate;
|
|
|
|
-
|
|
|
|
- @Resource
|
|
|
|
- ETEStudentService eteStudentService;
|
|
|
|
-
|
|
|
|
- @Resource
|
|
|
|
- ETEStudentRepo eteStudentRepo;
|
|
|
|
-
|
|
|
|
- @ApiOperation(value = "es查询接口")
|
|
|
|
- @RequestMapping(value = "/es/list", method = RequestMethod.GET)
|
|
|
|
- @Transactional
|
|
|
|
- public Result esList() {
|
|
|
|
-// eteStudentService.createIndex();
|
|
|
|
-// List<ETEStudentEntity> list = new ArrayList<>();
|
|
|
|
-// for (int i = 0; i < 10; i++) {
|
|
|
|
-// //学生档案
|
|
|
|
-// ETEStudentEntity eteStudentEntity = new ETEStudentEntity();
|
|
|
|
-// eteStudentEntity.setId(Constants.idGen.next());
|
|
|
|
-// eteStudentEntity.setOrgId(1L);
|
|
|
|
-// eteStudentEntity.setIdentity("test" + i);
|
|
|
|
-// eteStudentEntity.setPassword("123456");
|
|
|
|
-// eteStudentEntity.setIdcardNumber(RandomStringUtils.randomAlphanumeric(18));
|
|
|
|
-// eteStudentEntity.setMobileNumber(RandomStringUtils.randomNumeric(11));
|
|
|
|
-// eteStudentEntity.setName("java" + i + RandomStringUtils.randomAlphanumeric(30));
|
|
|
|
-// eteStudentEntity.setGender(1);
|
|
|
|
-// eteStudentEntity.setBasePhotoPath("http://11111");
|
|
|
|
-// eteStudentEntity.setCreateTime(new Date());
|
|
|
|
-// list.add(eteStudentEntity);
|
|
|
|
-// }
|
|
|
|
-// eteStudentService.saveAll(list);
|
|
|
|
-//// Iterator<ETEStudentEntity> iterator = eteStudentService.findAll();
|
|
|
|
-// org.springframework.data.domain.Page<ETEStudentEntity> eteStudentEntityPage1 = (org.springframework.data.domain.Page<ETEStudentEntity>) eteStudentService.queryName("2");
|
|
|
|
-//// List<ETEStudentEntity> eteStudentEntityList = eteStudentService.findByNameLike("java");
|
|
|
|
-// org.springframework.data.domain.Page<ETEStudentEntity> eteStudentEntityPage2 = (org.springframework.data.domain.Page<ETEStudentEntity>) eteStudentService.queryMobileNumber("2");
|
|
|
|
-//// Optional<ETEStudentEntity> eteStudentEntity = eteStudentRepo.findById(eteStudentEntityPage.getContent().get(0).getId());
|
|
|
|
|
|
+// @ApiOperation(value = "es查询接口")
|
|
|
|
+// @RequestMapping(value = "/websocketPush", method = RequestMethod.POST)
|
|
|
|
+// public Result websocketPush(HttpServletRequest request, @RequestBody String message) throws IOException {
|
|
|
|
+// TBUser tbUser = (TBUser) ServletUtil.getRequestAccount(request);
|
|
|
|
+// WebSocketServer.sendInfo(message, String.valueOf(tbUser.getId()));
|
|
|
|
+// return ResultUtil.ok(SystemConstant.SUCCESS);
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+// @Resource
|
|
|
|
+// TEExamActivityService teExamActivityService;
|
|
|
|
+//
|
|
|
|
+// @Resource
|
|
|
|
+// TEExamService teExamService;
|
|
|
|
+//
|
|
|
|
+// @Resource
|
|
|
|
+// TEStudentService teStudentService;
|
|
|
|
+//
|
|
|
|
+// @Resource
|
|
|
|
+// TEExamStudentService teExamStudentService;
|
|
|
|
+//
|
|
|
|
+// @Resource
|
|
|
|
+// TEExamCourseService teExamCourseService;
|
|
|
|
+//
|
|
|
|
+// @Resource
|
|
|
|
+// TEExamPaperService teExamPaperService;
|
|
|
|
+//
|
|
|
|
+// @Value("${db.name}")
|
|
|
|
+// String dbName;
|
|
|
|
+//
|
|
|
|
+// @Resource
|
|
|
|
+// MongoTemplate mongoTemplate;
|
|
|
|
+//
|
|
|
|
+// @Resource
|
|
|
|
+// ETEStudentService eteStudentService;
|
|
|
|
+//
|
|
|
|
+// @Resource
|
|
|
|
+// ETEStudentRepo eteStudentRepo;
|
|
|
|
+
|
|
|
|
+// @ApiOperation(value = "es查询接口")
|
|
|
|
+// @RequestMapping(value = "/es/list", method = RequestMethod.GET)
|
|
|
|
+// @Transactional
|
|
|
|
+// public Result esList() {
|
|
|
|
+//// eteStudentService.createIndex();
|
|
|
|
+//// List<ETEStudentEntity> list = new ArrayList<>();
|
|
|
|
+//// for (int i = 0; i < 10; i++) {
|
|
|
|
+//// //学生档案
|
|
|
|
+//// ETEStudentEntity eteStudentEntity = new ETEStudentEntity();
|
|
|
|
+//// eteStudentEntity.setId(Constants.idGen.next());
|
|
|
|
+//// eteStudentEntity.setOrgId(1L);
|
|
|
|
+//// eteStudentEntity.setIdentity("test" + i);
|
|
|
|
+//// eteStudentEntity.setPassword("123456");
|
|
|
|
+//// eteStudentEntity.setIdcardNumber(RandomStringUtils.randomAlphanumeric(18));
|
|
|
|
+//// eteStudentEntity.setMobileNumber(RandomStringUtils.randomNumeric(11));
|
|
|
|
+//// eteStudentEntity.setName("java" + i + RandomStringUtils.randomAlphanumeric(30));
|
|
|
|
+//// eteStudentEntity.setGender(1);
|
|
|
|
+//// eteStudentEntity.setBasePhotoPath("http://11111");
|
|
|
|
+//// eteStudentEntity.setCreateTime(new Date());
|
|
|
|
+//// list.add(eteStudentEntity);
|
|
|
|
+//// }
|
|
|
|
+//// eteStudentService.saveAll(list);
|
|
|
|
+////// Iterator<ETEStudentEntity> iterator = eteStudentService.findAll();
|
|
|
|
+//// org.springframework.data.domain.Page<ETEStudentEntity> eteStudentEntityPage1 = (org.springframework.data.domain.Page<ETEStudentEntity>) eteStudentService.queryName("2");
|
|
|
|
+////// List<ETEStudentEntity> eteStudentEntityList = eteStudentService.findByNameLike("java");
|
|
|
|
+//// org.springframework.data.domain.Page<ETEStudentEntity> eteStudentEntityPage2 = (org.springframework.data.domain.Page<ETEStudentEntity>) eteStudentService.queryMobileNumber("2");
|
|
|
|
+////// Optional<ETEStudentEntity> eteStudentEntity = eteStudentRepo.findById(eteStudentEntityPage.getContent().get(0).getId());
|
|
|
|
+//// Map map = new HashMap();
|
|
|
|
+//// map.put(SystemConstant.RECORDS, eteStudentEntityPage1);
|
|
|
|
+//// map.put(SystemConstant.RECORDS + 2, eteStudentEntityPage2);
|
|
|
|
+////// map.put("bean", eteStudentEntity.get());
|
|
|
|
+//// return ResultUtil.ok(map);
|
|
|
|
+//
|
|
|
|
+//// for (int i = 0; i < 5; i++) {
|
|
|
|
+//
|
|
|
|
+//// mqDtoService.assembleSendOneWayMsg("imTopic", "teacher", "老师发送的一条消息1", MqEnum.MESSAGE_LOG.name(), "1", "2");
|
|
|
|
+//// mqDtoService.assembleSendOneWayMsg("imTopic", "user", "用户发送的一条消息2", MqEnum.MESSAGE_LOG.name(), "1", "2");
|
|
|
|
+//// mqDtoService.assembleSendOneWayMsg("imTopic", "user", "学生发送的一条消息3", MqEnum.MESSAGE_LOG.name(), "1", "2");
|
|
// Map map = new HashMap();
|
|
// Map map = new HashMap();
|
|
-// map.put(SystemConstant.RECORDS, eteStudentEntityPage1);
|
|
|
|
-// map.put(SystemConstant.RECORDS + 2, eteStudentEntityPage2);
|
|
|
|
-//// map.put("bean", eteStudentEntity.get());
|
|
|
|
-// return ResultUtil.ok(map);
|
|
|
|
-
|
|
|
|
-// for (int i = 0; i < 5; i++) {
|
|
|
|
-
|
|
|
|
-// mqDtoService.assembleSendOneWayMsg("imTopic", "teacher", "老师发送的一条消息1", MqEnum.MESSAGE_LOG.name(), "1", "2");
|
|
|
|
-// mqDtoService.assembleSendOneWayMsg("imTopic", "user", "用户发送的一条消息2", MqEnum.MESSAGE_LOG.name(), "1", "2");
|
|
|
|
-// mqDtoService.assembleSendOneWayMsg("imTopic", "user", "学生发送的一条消息3", MqEnum.MESSAGE_LOG.name(), "1", "2");
|
|
|
|
- Map map = new HashMap();
|
|
|
|
- map.put("sendUserId", "10");
|
|
|
|
- map.put("toUserId", "20");
|
|
|
|
- map.put("model", MessageModel.BROADCASTING);
|
|
|
|
-// map.put("model", MessageModel.CLUSTERING);
|
|
|
|
- MqDto mqDto = new MqDto("websocketImTopic", "im", "学生发送的一条消息4", MqEnum.MESSAGE_LOG, "1", map, "2");
|
|
|
|
-// mqDtoService.assembleSendOneWayMsg("imTopic", "user", "学生发送的一条消息3", MqEnum.MESSAGE_LOG.name(), "1", "2");
|
|
|
|
- mqDtoService.assembleSendOneWayMsg(mqDto);
|
|
|
|
- // }
|
|
|
|
- return ResultUtil.ok(SystemConstant.SUCCESS);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value = "用户查询接口")
|
|
|
|
- @RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
|
|
- @Transactional
|
|
|
|
- public Result list() {
|
|
|
|
- String tableName = "t_e_exam_activity_test1";
|
|
|
|
- Integer count = teExamActivityService.existTable(tableName, dbName);
|
|
|
|
- log.info("count:{}", count);
|
|
|
|
- if (count == 0) {
|
|
|
|
- teExamActivityService.createNewTable(tableName);
|
|
|
|
- }
|
|
|
|
- //学生档案
|
|
|
|
- TEStudent teStudent = new TEStudent();
|
|
|
|
- teStudent.setId(Constants.idGen.next());
|
|
|
|
- teStudent.setOrgId(1L);
|
|
|
|
- teStudent.setIdentity(RandomStringUtils.randomAlphanumeric(30));
|
|
|
|
- teStudent.setPassword("123456");
|
|
|
|
- teStudent.setIdcardNumber(RandomStringUtils.randomAlphanumeric(18));
|
|
|
|
- teStudent.setMobileNumber(RandomStringUtils.randomNumeric(11));
|
|
|
|
- teStudent.setName("aaa");
|
|
|
|
- teStudent.setGender(1);
|
|
|
|
- teStudent.setBasePhotoPath("http://11111");
|
|
|
|
- teStudent.setEnable(1);
|
|
|
|
- teStudentService.save(teStudent);
|
|
|
|
-
|
|
|
|
- //考试批次
|
|
|
|
- TEExam teExam = new TEExam();
|
|
|
|
- teExam.setId(Constants.idGen.next());
|
|
|
|
- teExam.setOrgId(1L);
|
|
|
|
- teExam.setCode(RandomStringUtils.randomAlphanumeric(20));
|
|
|
|
- teExam.setName("123");
|
|
|
|
- teExam.setTag("test1");
|
|
|
|
- teExam.setStartTime(new Date());
|
|
|
|
- teExam.setEndTime(new Date());
|
|
|
|
- teExam.setStatus(0);
|
|
|
|
- teExam.setShortCode("123456");
|
|
|
|
- teExam.setPrepareSeconds(30);
|
|
|
|
- teExam.setMinDurationSeconds(30);
|
|
|
|
- teExam.setPreNotice("99999");
|
|
|
|
- teExam.setPreNoticeStaySeconds(30);
|
|
|
|
- teExam.setPostNotice("88888");
|
|
|
|
- teExam.setExamCount(5);
|
|
|
|
- teExam.setBreakResumeCount(3);
|
|
|
|
- teExam.setBreakExpireSeconds(30);
|
|
|
|
- teExam.setClientVideoPush(1);
|
|
|
|
- teExam.setClientVideoRecord(1);
|
|
|
|
- teExam.setWxappPhotoUpload(1);
|
|
|
|
- teExam.setWxappVideoPush(1);
|
|
|
|
- teExam.setWxappVideoRecord(1);
|
|
|
|
- teExam.setCameraPhotoUpload(1);
|
|
|
|
- teExam.setWxappPhotoUpload(1);
|
|
|
|
- teExam.setReexamAuditing(1);
|
|
|
|
- teExam.setShowObjectiveScore(1);
|
|
|
|
- teExam.setMode(0);
|
|
|
|
- teExam.setEnable(1);
|
|
|
|
- teExam.setArchived(0);
|
|
|
|
- teExam.setOpeningSeconds(30);
|
|
|
|
- teExam.setMaxDurationSeconds(30);
|
|
|
|
- teExam.setForceFinish(1);
|
|
|
|
- teExam.setEntryAuthenticationPolicy(1);
|
|
|
|
- teExam.setInProcessFaceVerify(1);
|
|
|
|
- teExam.setInProcessFaceStrangerIgnore(1);
|
|
|
|
- teExam.setInProcessLivenessVerify(1);
|
|
|
|
- teExam.setInProcessLivenessIntervalSeconds(30);
|
|
|
|
- teExam.setInProcessLivenessRetryCount(3);
|
|
|
|
- teExam.setInProcessLivenessJudgePolicy(1);
|
|
|
|
- teExam.setRecordSelectStrategy(1);
|
|
|
|
- teExam.setEnableIpLimit(1);
|
|
|
|
- teExam.setIpAllow("1");
|
|
|
|
- teExam.setScoreStatus(1);
|
|
|
|
- teExamService.save(teExam);
|
|
|
|
-
|
|
|
|
- //考试场次
|
|
|
|
- TEExamActivity teExamActivity = new TEExamActivity();
|
|
|
|
- teExamActivity.setId(Constants.idGen.next());
|
|
|
|
- teExamActivity.setExamId(teExam.getId());
|
|
|
|
- teExamActivity.setCode(RandomStringUtils.randomAlphanumeric(20));
|
|
|
|
- teExamActivity.setPrepareSeconds(30);
|
|
|
|
- teExamActivity.setMaxDurationSeconds(30);
|
|
|
|
- teExamActivity.setEnable(1);
|
|
|
|
- teExamActivity.setOpeningSeconds(30);
|
|
|
|
- teExamActivity.setStartTime(new Date());
|
|
|
|
- teExamActivity.setFinishTime(new Date());
|
|
|
|
- teExamActivity.setCreateTime(new Date());
|
|
|
|
- teExamActivityService.insertInfo(tableName, teExamActivity);
|
|
|
|
-
|
|
|
|
- //考试科目
|
|
|
|
- TEExamCourse teExamCourse = new TEExamCourse();
|
|
|
|
- teExamCourse.setId(Constants.idGen.next());
|
|
|
|
- teExamCourse.setExamId(teExam.getId());
|
|
|
|
- teExamCourse.setCourseCode(RandomStringUtils.randomAlphanumeric(5));
|
|
|
|
- teExamCourse.setCourseName("测试科目1");
|
|
|
|
- teExamCourse.setObjectiveShuffle(1);
|
|
|
|
- teExamCourse.setOptionShuffle(1);
|
|
|
|
- teExamCourse.setPaperCount(1);
|
|
|
|
- teExamCourse.setHasAnswer(1);
|
|
|
|
- teExamCourse.setAudioPlayTime(1);
|
|
|
|
- teExamCourseService.save(teExamCourse);
|
|
|
|
-
|
|
|
|
- //考试试卷
|
|
|
|
- TEExamPaper teExamPaper = new TEExamPaper();
|
|
|
|
- teExamPaper.setId(Constants.idGen.next());
|
|
|
|
- teExamPaper.setName("test1");
|
|
|
|
- teExamPaper.setTotalScore(100D);
|
|
|
|
- teExamPaper.setPaperPath("123");
|
|
|
|
- teExamPaper.setDecryptSecret("345");
|
|
|
|
- teExamPaper.setEncryptMode(1);
|
|
|
|
- teExamPaper.setNeedVoiceAnswer(1);
|
|
|
|
- teExamPaper.setExamId(teExam.getId());
|
|
|
|
- teExamPaper.setCode("test1");
|
|
|
|
- teExamPaper.setCourseCode(teExamCourse.getCourseCode());
|
|
|
|
- teExamPaper.setAnswerPath("123");
|
|
|
|
- teExamPaper.setHasAudio(1);
|
|
|
|
- teExamPaper.setWeight(1D);
|
|
|
|
- teExamPaper.setAudioPlayTime(1);
|
|
|
|
- teExamPaperService.save(teExamPaper);
|
|
|
|
-
|
|
|
|
- //考生
|
|
|
|
- TEExamStudent teExamStudent = new TEExamStudent();
|
|
|
|
- teExamStudent.setId(Constants.idGen.next());
|
|
|
|
- teExamStudent.setExamId(teExam.getId());
|
|
|
|
- teExamStudent.setExamActivityId(teExamActivity.getId());
|
|
|
|
- teExamStudent.setStudentId(teStudent.getId());
|
|
|
|
- teExamStudent.setCourseCode(teExamCourse.getCourseCode());
|
|
|
|
- teExamStudent.setRoomCode("1");
|
|
|
|
- teExamStudent.setIdentity(RandomStringUtils.randomAlphanumeric(20));
|
|
|
|
- teExamStudent.setName("132");
|
|
|
|
- Map stuMap = new HashMap();
|
|
|
|
- stuMap.put("examTest1", "aaa");
|
|
|
|
- stuMap.put("examTest2", "bbb");
|
|
|
|
- teExamStudent.setParameter(JacksonUtil.parseJson(stuMap));
|
|
|
|
- teExamStudent.setLeftExamCount(1);
|
|
|
|
- teExamStudent.setRoomName("test1");
|
|
|
|
- teExamStudent.setEnable(1);
|
|
|
|
- teExamStudentService.save(teExamStudent);
|
|
|
|
-
|
|
|
|
- Gson gson = new Gson();
|
|
|
|
- MTEStudentEntity mteStudentEntity = gson.fromJson(gson.toJson(teStudent), MTEStudentEntity.class);
|
|
|
|
- MTEExamEntity mteExamEntity = gson.fromJson(gson.toJson(teExam), MTEExamEntity.class);
|
|
|
|
- MTEExamActivityEntity mteExamActivityEntity = gson.fromJson(gson.toJson(teExamActivity), MTEExamActivityEntity.class);
|
|
|
|
- MTEExamPaperEntity mteExamPaperEntity = gson.fromJson(gson.toJson(teExamPaper), MTEExamPaperEntity.class);
|
|
|
|
- MTEExamCourseEntity mteExamCourseEntity = gson.fromJson(gson.toJson(teExamCourse), MTEExamCourseEntity.class);
|
|
|
|
- MTEExamStudentEntity mteExamStudentEntity = gson.fromJson(gson.toJson(teExamStudent), MTEExamStudentEntity.class);
|
|
|
|
-
|
|
|
|
-// List list = Arrays.asList(mteExamPaperEntity);
|
|
|
|
-// mteExamCourseEntity.setMteExamPaperEntityList(list);
|
|
|
|
-
|
|
|
|
-// list = Arrays.asList(mteExamActivityEntity);
|
|
|
|
-// mteExamEntity.setMteExamActivityEntityList(list);
|
|
|
|
-
|
|
|
|
-// list = Arrays.asList(mteExamCourseEntity);
|
|
|
|
-// mteExamStudentEntity.setMteExamEntity(mteExamEntity);
|
|
|
|
-// mteExamStudentEntity.setMteExamActivityEntity(mteExamActivityEntity);
|
|
|
|
-// mteExamStudentEntity.setMteStudentEntity(mteStudentEntity);
|
|
|
|
-// mteExamStudentEntity.setMteExamCourseEntityList(list);
|
|
|
|
-
|
|
|
|
- mongoTemplate.save(mteStudentEntity);
|
|
|
|
- mongoTemplate.save(mteExamEntity);
|
|
|
|
- mongoTemplate.save(mteExamActivityEntity);
|
|
|
|
- mongoTemplate.save(mteExamPaperEntity);
|
|
|
|
- mongoTemplate.save(mteExamCourseEntity);
|
|
|
|
- mongoTemplate.save(mteExamStudentEntity);
|
|
|
|
-
|
|
|
|
- IPage<TEExamActivity> map = teExamActivityService.selectListPage(new Page<>(0, 10), tableName);
|
|
|
|
- log.info("mysql map:{}", JacksonUtil.parseJson(map));
|
|
|
|
-
|
|
|
|
- Query query = new Query();
|
|
|
|
-// query.addCriteria(Criteria.where("questionId").in(setQuestionId).andOperator(Criteria.where("examRecordDataId").is(examSessionInfo.getExamRecordDataId())));
|
|
|
|
- query.skip((1 - 1) * 10).limit(10);//设置起始数和查询条数
|
|
|
|
- List<MTEStudentEntity> mteStudentEntityList = mongoTemplate.find(query, MTEStudentEntity.class);
|
|
|
|
- log.info("mongodb mteStudentEntityList:{}", JacksonUtil.parseJson(mteStudentEntityList));
|
|
|
|
-// List<MTEStudentEntity> mteStudentEntityList = mongoTemplate.findAll(MTEStudentEntity.class);
|
|
|
|
-// log.info("mongodb mteStudentEntityList:{}", JacksonUtil.parseJson(mteStudentEntityList));
|
|
|
|
-
|
|
|
|
- List<MTEExamEntity> mteExamEntityList = mongoTemplate.findAll(MTEExamEntity.class);
|
|
|
|
- log.info("mongodb mteExamEntityList:{}", JacksonUtil.parseJson(mteExamEntityList));
|
|
|
|
-
|
|
|
|
- List<MTEExamActivityEntity> mteExamActivityEntityList = mongoTemplate.findAll(MTEExamActivityEntity.class);
|
|
|
|
- log.info("mongodb mteExamActivityEntityList:{}", JacksonUtil.parseJson(mteExamActivityEntityList));
|
|
|
|
-// List<TEExamActivity> ps = new ArrayList<>();
|
|
|
|
-// mteExamActivityEntityList.forEach(s -> {
|
|
|
|
-// TEExamActivity t = gson.fromJson(gson.toJson(s), TEExamActivity.class);
|
|
|
|
-// ps.add(t);
|
|
|
|
-// });
|
|
|
|
-//// List<TEExamActivity> ps = gson.fromJson(JacksonUtil.parseJson(mteExamActivityEntityList), new TypeToken<List<TEExamActivity>>(){}.getType());
|
|
|
|
-// map.setRecords(ps);
|
|
|
|
-
|
|
|
|
- List<MTEExamPaperEntity> mteExamPaperEntityList = mongoTemplate.findAll(MTEExamPaperEntity.class);
|
|
|
|
- log.info("mongodb mteExamPaperEntityList:{}", JacksonUtil.parseJson(mteExamPaperEntityList));
|
|
|
|
-
|
|
|
|
- List<MTEExamCourseEntity> mteExamCourseEntityList = mongoTemplate.findAll(MTEExamCourseEntity.class);
|
|
|
|
- log.info("mongodb mteExamCourseEntityList:{}", JacksonUtil.parseJson(mteExamCourseEntityList));
|
|
|
|
-
|
|
|
|
- List<MTEExamStudentEntity> mteExamStudentEntityList = mongoTemplate.findAll(MTEExamStudentEntity.class);
|
|
|
|
- log.info("mongodb mteExamStudentEntityList:{}", JacksonUtil.parseJson(mteExamStudentEntityList));
|
|
|
|
- List<TEExamStudent> ps = new ArrayList<>();
|
|
|
|
- mteExamStudentEntityList.forEach(s -> {
|
|
|
|
- TEExamStudent t = gson.fromJson(gson.toJson(s), TEExamStudent.class);
|
|
|
|
- ps.add(t);
|
|
|
|
- });
|
|
|
|
- List<MTEExamStudentEntity> ps1 = new ArrayList<>();
|
|
|
|
- List<TEExamStudent> list1 = teExamStudentService.list();
|
|
|
|
- list1.forEach(s -> {
|
|
|
|
- MTEExamStudentEntity t = gson.fromJson(gson.toJson(s), MTEExamStudentEntity.class);
|
|
|
|
- ps1.add(t);
|
|
|
|
- });
|
|
|
|
-// teExamActivityService.dropTable(tableName);
|
|
|
|
- return ResultUtil.ok(SystemConstant.SUCCESS);
|
|
|
|
- }
|
|
|
|
|
|
+// map.put("sendUserId", "10");
|
|
|
|
+// map.put("toUserId", "20");
|
|
|
|
+// map.put("model", MessageModel.BROADCASTING);
|
|
|
|
+//// map.put("model", MessageModel.CLUSTERING);
|
|
|
|
+// MqDto mqDto = new MqDto("websocketImTopic", "im", "学生发送的一条消息4", MqEnum.MESSAGE_LOG, "1", map, "2");
|
|
|
|
+//// mqDtoService.assembleSendOneWayMsg("imTopic", "user", "学生发送的一条消息3", MqEnum.MESSAGE_LOG.name(), "1", "2");
|
|
|
|
+// mqDtoService.assembleSendOneWayMsg(mqDto);
|
|
|
|
+// // }
|
|
|
|
+// return ResultUtil.ok(SystemConstant.SUCCESS);
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+// @ApiOperation(value = "用户查询接口")
|
|
|
|
+// @RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
|
|
+// @Transactional
|
|
|
|
+// public Result list() {
|
|
|
|
+// String tableName = "t_e_exam_activity_test1";
|
|
|
|
+// Integer count = teExamActivityService.existTable(tableName, dbName);
|
|
|
|
+// log.info("count:{}", count);
|
|
|
|
+// if (count == 0) {
|
|
|
|
+// teExamActivityService.createNewTable(tableName);
|
|
|
|
+// }
|
|
|
|
+// //学生档案
|
|
|
|
+// TEStudent teStudent = new TEStudent();
|
|
|
|
+// teStudent.setId(Constants.idGen.next());
|
|
|
|
+// teStudent.setOrgId(1L);
|
|
|
|
+// teStudent.setIdentity(RandomStringUtils.randomAlphanumeric(30));
|
|
|
|
+// teStudent.setPassword("123456");
|
|
|
|
+// teStudent.setIdcardNumber(RandomStringUtils.randomAlphanumeric(18));
|
|
|
|
+// teStudent.setMobileNumber(RandomStringUtils.randomNumeric(11));
|
|
|
|
+// teStudent.setName("aaa");
|
|
|
|
+// teStudent.setGender(1);
|
|
|
|
+// teStudent.setBasePhotoPath("http://11111");
|
|
|
|
+// teStudent.setEnable(1);
|
|
|
|
+// teStudentService.save(teStudent);
|
|
|
|
+//
|
|
|
|
+// //考试批次
|
|
|
|
+// TEExam teExam = new TEExam();
|
|
|
|
+// teExam.setId(Constants.idGen.next());
|
|
|
|
+// teExam.setOrgId(1L);
|
|
|
|
+// teExam.setCode(RandomStringUtils.randomAlphanumeric(20));
|
|
|
|
+// teExam.setName("123");
|
|
|
|
+// teExam.setTag("test1");
|
|
|
|
+// teExam.setStartTime(new Date());
|
|
|
|
+// teExam.setEndTime(new Date());
|
|
|
|
+// teExam.setStatus(0);
|
|
|
|
+// teExam.setShortCode("123456");
|
|
|
|
+// teExam.setPrepareSeconds(30);
|
|
|
|
+// teExam.setMinDurationSeconds(30);
|
|
|
|
+// teExam.setPreNotice("99999");
|
|
|
|
+// teExam.setPreNoticeStaySeconds(30);
|
|
|
|
+// teExam.setPostNotice("88888");
|
|
|
|
+// teExam.setExamCount(5);
|
|
|
|
+// teExam.setBreakResumeCount(3);
|
|
|
|
+// teExam.setBreakExpireSeconds(30);
|
|
|
|
+// teExam.setClientVideoPush(1);
|
|
|
|
+// teExam.setClientVideoRecord(1);
|
|
|
|
+// teExam.setWxappPhotoUpload(1);
|
|
|
|
+// teExam.setWxappVideoPush(1);
|
|
|
|
+// teExam.setWxappVideoRecord(1);
|
|
|
|
+// teExam.setCameraPhotoUpload(1);
|
|
|
|
+// teExam.setWxappPhotoUpload(1);
|
|
|
|
+// teExam.setReexamAuditing(1);
|
|
|
|
+// teExam.setShowObjectiveScore(1);
|
|
|
|
+// teExam.setMode(0);
|
|
|
|
+// teExam.setEnable(1);
|
|
|
|
+// teExam.setArchived(0);
|
|
|
|
+// teExam.setOpeningSeconds(30);
|
|
|
|
+// teExam.setMaxDurationSeconds(30);
|
|
|
|
+// teExam.setForceFinish(1);
|
|
|
|
+// teExam.setEntryAuthenticationPolicy(1);
|
|
|
|
+// teExam.setInProcessFaceVerify(1);
|
|
|
|
+// teExam.setInProcessFaceStrangerIgnore(1);
|
|
|
|
+// teExam.setInProcessLivenessVerify(1);
|
|
|
|
+// teExam.setInProcessLivenessIntervalSeconds(30);
|
|
|
|
+// teExam.setInProcessLivenessRetryCount(3);
|
|
|
|
+// teExam.setInProcessLivenessJudgePolicy(1);
|
|
|
|
+// teExam.setRecordSelectStrategy(1);
|
|
|
|
+// teExam.setEnableIpLimit(1);
|
|
|
|
+// teExam.setIpAllow("1");
|
|
|
|
+// teExam.setScoreStatus(1);
|
|
|
|
+// teExamService.save(teExam);
|
|
|
|
+//
|
|
|
|
+// //考试场次
|
|
|
|
+// TEExamActivity teExamActivity = new TEExamActivity();
|
|
|
|
+// teExamActivity.setId(Constants.idGen.next());
|
|
|
|
+// teExamActivity.setExamId(teExam.getId());
|
|
|
|
+// teExamActivity.setCode(RandomStringUtils.randomAlphanumeric(20));
|
|
|
|
+// teExamActivity.setPrepareSeconds(30);
|
|
|
|
+// teExamActivity.setMaxDurationSeconds(30);
|
|
|
|
+// teExamActivity.setEnable(1);
|
|
|
|
+// teExamActivity.setOpeningSeconds(30);
|
|
|
|
+// teExamActivity.setStartTime(new Date());
|
|
|
|
+// teExamActivity.setFinishTime(new Date());
|
|
|
|
+// teExamActivity.setCreateTime(new Date());
|
|
|
|
+// teExamActivityService.insertInfo(tableName, teExamActivity);
|
|
|
|
+//
|
|
|
|
+// //考试科目
|
|
|
|
+// TEExamCourse teExamCourse = new TEExamCourse();
|
|
|
|
+// teExamCourse.setId(Constants.idGen.next());
|
|
|
|
+// teExamCourse.setExamId(teExam.getId());
|
|
|
|
+// teExamCourse.setCourseCode(RandomStringUtils.randomAlphanumeric(5));
|
|
|
|
+// teExamCourse.setCourseName("测试科目1");
|
|
|
|
+// teExamCourse.setObjectiveShuffle(1);
|
|
|
|
+// teExamCourse.setOptionShuffle(1);
|
|
|
|
+// teExamCourse.setPaperCount(1);
|
|
|
|
+// teExamCourse.setHasAnswer(1);
|
|
|
|
+// teExamCourse.setAudioPlayTime(1);
|
|
|
|
+// teExamCourseService.save(teExamCourse);
|
|
|
|
+//
|
|
|
|
+// //考试试卷
|
|
|
|
+// TEExamPaper teExamPaper = new TEExamPaper();
|
|
|
|
+// teExamPaper.setId(Constants.idGen.next());
|
|
|
|
+// teExamPaper.setName("test1");
|
|
|
|
+// teExamPaper.setTotalScore(100D);
|
|
|
|
+// teExamPaper.setPaperPath("123");
|
|
|
|
+// teExamPaper.setDecryptSecret("345");
|
|
|
|
+// teExamPaper.setEncryptMode(1);
|
|
|
|
+// teExamPaper.setNeedVoiceAnswer(1);
|
|
|
|
+// teExamPaper.setExamId(teExam.getId());
|
|
|
|
+// teExamPaper.setCode("test1");
|
|
|
|
+// teExamPaper.setCourseCode(teExamCourse.getCourseCode());
|
|
|
|
+// teExamPaper.setAnswerPath("123");
|
|
|
|
+// teExamPaper.setHasAudio(1);
|
|
|
|
+// teExamPaper.setWeight(1D);
|
|
|
|
+// teExamPaper.setAudioPlayTime(1);
|
|
|
|
+// teExamPaperService.save(teExamPaper);
|
|
|
|
+//
|
|
|
|
+// //考生
|
|
|
|
+// TEExamStudent teExamStudent = new TEExamStudent();
|
|
|
|
+// teExamStudent.setId(Constants.idGen.next());
|
|
|
|
+// teExamStudent.setExamId(teExam.getId());
|
|
|
|
+// teExamStudent.setExamActivityId(teExamActivity.getId());
|
|
|
|
+// teExamStudent.setStudentId(teStudent.getId());
|
|
|
|
+// teExamStudent.setCourseCode(teExamCourse.getCourseCode());
|
|
|
|
+// teExamStudent.setRoomCode("1");
|
|
|
|
+// teExamStudent.setIdentity(RandomStringUtils.randomAlphanumeric(20));
|
|
|
|
+// teExamStudent.setName("132");
|
|
|
|
+// Map stuMap = new HashMap();
|
|
|
|
+// stuMap.put("examTest1", "aaa");
|
|
|
|
+// stuMap.put("examTest2", "bbb");
|
|
|
|
+// teExamStudent.setParameter(JacksonUtil.parseJson(stuMap));
|
|
|
|
+// teExamStudent.setLeftExamCount(1);
|
|
|
|
+// teExamStudent.setRoomName("test1");
|
|
|
|
+// teExamStudent.setEnable(1);
|
|
|
|
+// teExamStudentService.save(teExamStudent);
|
|
|
|
+//
|
|
|
|
+// //todo
|
|
|
|
+//// Gson gson = new Gson();
|
|
|
|
+//// MTEStudentEntity mteStudentEntity = gson.fromJson(gson.toJson(teStudent), MTEStudentEntity.class);
|
|
|
|
+//// MTEExamEntity mteExamEntity = gson.fromJson(gson.toJson(teExam), MTEExamEntity.class);
|
|
|
|
+//// MTEExamActivityEntity mteExamActivityEntity = gson.fromJson(gson.toJson(teExamActivity), MTEExamActivityEntity.class);
|
|
|
|
+//// MTEExamPaperEntity mteExamPaperEntity = gson.fromJson(gson.toJson(teExamPaper), MTEExamPaperEntity.class);
|
|
|
|
+//// MTEExamCourseEntity mteExamCourseEntity = gson.fromJson(gson.toJson(teExamCourse), MTEExamCourseEntity.class);
|
|
|
|
+//// MTEExamStudentEntity mteExamStudentEntity = gson.fromJson(gson.toJson(teExamStudent), MTEExamStudentEntity.class);
|
|
|
|
+// //todo
|
|
|
|
+//
|
|
|
|
+//// List list = Arrays.asList(mteExamPaperEntity);
|
|
|
|
+//// mteExamCourseEntity.setMteExamPaperEntityList(list);
|
|
|
|
+//
|
|
|
|
+//// list = Arrays.asList(mteExamActivityEntity);
|
|
|
|
+//// mteExamEntity.setMteExamActivityEntityList(list);
|
|
|
|
+//
|
|
|
|
+//// list = Arrays.asList(mteExamCourseEntity);
|
|
|
|
+//// mteExamStudentEntity.setMteExamEntity(mteExamEntity);
|
|
|
|
+//// mteExamStudentEntity.setMteExamActivityEntity(mteExamActivityEntity);
|
|
|
|
+//// mteExamStudentEntity.setMteStudentEntity(mteStudentEntity);
|
|
|
|
+//// mteExamStudentEntity.setMteExamCourseEntityList(list);
|
|
|
|
+//
|
|
|
|
+// //todo
|
|
|
|
+//// mongoTemplate.save(mteStudentEntity);
|
|
|
|
+//// mongoTemplate.save(mteExamEntity);
|
|
|
|
+//// mongoTemplate.save(mteExamActivityEntity);
|
|
|
|
+//// mongoTemplate.save(mteExamPaperEntity);
|
|
|
|
+//// mongoTemplate.save(mteExamCourseEntity);
|
|
|
|
+//// mongoTemplate.save(mteExamStudentEntity);
|
|
|
|
+////
|
|
|
|
+//// IPage<TEExamActivity> map = teExamActivityService.selectListPage(new Page<>(0, 10), tableName);
|
|
|
|
+//// log.info("mysql map:{}", JacksonUtil.parseJson(map));
|
|
|
|
+////
|
|
|
|
+//// Query query = new Query();
|
|
|
|
+////// query.addCriteria(Criteria.where("questionId").in(setQuestionId).andOperator(Criteria.where("examRecordDataId").is(examSessionInfo.getExamRecordDataId())));
|
|
|
|
+//// query.skip((1 - 1) * 10).limit(10);//设置起始数和查询条数
|
|
|
|
+//// List<MTEStudentEntity> mteStudentEntityList = mongoTemplate.find(query, MTEStudentEntity.class);
|
|
|
|
+//// log.info("mongodb mteStudentEntityList:{}", JacksonUtil.parseJson(mteStudentEntityList));
|
|
|
|
+////// List<MTEStudentEntity> mteStudentEntityList = mongoTemplate.findAll(MTEStudentEntity.class);
|
|
|
|
+////// log.info("mongodb mteStudentEntityList:{}", JacksonUtil.parseJson(mteStudentEntityList));
|
|
|
|
+////
|
|
|
|
+//// List<MTEExamEntity> mteExamEntityList = mongoTemplate.findAll(MTEExamEntity.class);
|
|
|
|
+//// log.info("mongodb mteExamEntityList:{}", JacksonUtil.parseJson(mteExamEntityList));
|
|
|
|
+////
|
|
|
|
+//// List<MTEExamActivityEntity> mteExamActivityEntityList = mongoTemplate.findAll(MTEExamActivityEntity.class);
|
|
|
|
+//// log.info("mongodb mteExamActivityEntityList:{}", JacksonUtil.parseJson(mteExamActivityEntityList));
|
|
|
|
+////// List<TEExamActivity> ps = new ArrayList<>();
|
|
|
|
+////// mteExamActivityEntityList.forEach(s -> {
|
|
|
|
+////// TEExamActivity t = gson.fromJson(gson.toJson(s), TEExamActivity.class);
|
|
|
|
+////// ps.add(t);
|
|
|
|
+////// });
|
|
|
|
+//////// List<TEExamActivity> ps = gson.fromJson(JacksonUtil.parseJson(mteExamActivityEntityList), new TypeToken<List<TEExamActivity>>(){}.getType());
|
|
|
|
+////// map.setRecords(ps);
|
|
|
|
+////
|
|
|
|
+//// List<MTEExamPaperEntity> mteExamPaperEntityList = mongoTemplate.findAll(MTEExamPaperEntity.class);
|
|
|
|
+//// log.info("mongodb mteExamPaperEntityList:{}", JacksonUtil.parseJson(mteExamPaperEntityList));
|
|
|
|
+////
|
|
|
|
+//// List<MTEExamCourseEntity> mteExamCourseEntityList = mongoTemplate.findAll(MTEExamCourseEntity.class);
|
|
|
|
+//// log.info("mongodb mteExamCourseEntityList:{}", JacksonUtil.parseJson(mteExamCourseEntityList));
|
|
|
|
+////
|
|
|
|
+//// List<MTEExamStudentEntity> mteExamStudentEntityList = mongoTemplate.findAll(MTEExamStudentEntity.class);
|
|
|
|
+//// log.info("mongodb mteExamStudentEntityList:{}", JacksonUtil.parseJson(mteExamStudentEntityList));
|
|
|
|
+//// List<TEExamStudent> ps = new ArrayList<>();
|
|
|
|
+//// mteExamStudentEntityList.forEach(s -> {
|
|
|
|
+//// TEExamStudent t = gson.fromJson(gson.toJson(s), TEExamStudent.class);
|
|
|
|
+//// ps.add(t);
|
|
|
|
+//// });
|
|
|
|
+//// List<MTEExamStudentEntity> ps1 = new ArrayList<>();
|
|
|
|
+//// List<TEExamStudent> list1 = teExamStudentService.list();
|
|
|
|
+//// list1.forEach(s -> {
|
|
|
|
+//// MTEExamStudentEntity t = gson.fromJson(gson.toJson(s), MTEExamStudentEntity.class);
|
|
|
|
+//// ps1.add(t);
|
|
|
|
+//// });
|
|
|
|
+// //todo
|
|
|
|
+//// teExamActivityService.dropTable(tableName);
|
|
|
|
+// return ResultUtil.ok(SystemConstant.SUCCESS);
|
|
|
|
+// }
|
|
|
|
|
|
@ApiOperation(value = "登出接口")
|
|
@ApiOperation(value = "登出接口")
|
|
@RequestMapping(value = "/logout", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/logout", method = RequestMethod.GET)
|
|
@@ -452,7 +452,7 @@ public class TBUserController {
|
|
//循环检查该用户下其他平台是否存在session,不存在则删除用户缓存和鉴权缓存
|
|
//循环检查该用户下其他平台是否存在session,不存在则删除用户缓存和鉴权缓存
|
|
boolean delete = true;
|
|
boolean delete = true;
|
|
for (Source s : Source.values()) {
|
|
for (Source s : Source.values()) {
|
|
- String sessionId = SessionUtil.digest(tbUser.getId(), authDto.getRoleEnum().name(), s.name());
|
|
|
|
|
|
+ String sessionId = SessionUtil.digest(tbUser.getId(), authDto.getRoleCodes().toString(), s.name());
|
|
if (Objects.nonNull(redisUtil.getUserSession(sessionId))) {
|
|
if (Objects.nonNull(redisUtil.getUserSession(sessionId))) {
|
|
delete = false;
|
|
delete = false;
|
|
break;
|
|
break;
|
|
@@ -463,7 +463,7 @@ public class TBUserController {
|
|
ehcacheService.removeAccountCache(tbUser.getId());
|
|
ehcacheService.removeAccountCache(tbUser.getId());
|
|
}
|
|
}
|
|
//mq发送消息start
|
|
//mq发送消息start
|
|
- mqDtoService.assembleSendOneWayMsg(dictionaryConfig.mqConfigDomain().getUserLogTopic(), Objects.equals(authDto.getRoleEnum().name(), RoleEnum.STUDENT.name()) ? dictionaryConfig.mqConfigDomain().getUserLogTopicStudentTag() : dictionaryConfig.mqConfigDomain().getUserLogTopicUserTag(), SystemOperationEnum.LOGOUT, MqEnum.USER_LOG.name(), tbUser.getId(), tbUser.getLoginName());
|
|
|
|
|
|
+ mqDtoService.assembleSendOneWayMsg(dictionaryConfig.mqConfigDomain().getUserLogTopic(), authDto.getRoleCodes().toString().contains(RoleEnum.STUDENT.name()) ? dictionaryConfig.mqConfigDomain().getUserLogTopicStudentTag() : dictionaryConfig.mqConfigDomain().getUserLogTopicUserTag(), SystemOperationEnum.LOGOUT, MqEnum.USER_LOG.name(), tbUser.getId(), tbUser.getLoginName());
|
|
//mq发送消息end
|
|
//mq发送消息end
|
|
return ResultUtil.ok(JacksonUtil.parseJson(SystemConstant.SUCCESS));
|
|
return ResultUtil.ok(JacksonUtil.parseJson(SystemConstant.SUCCESS));
|
|
}
|
|
}
|