Browse Source

暂时去掉mongo,es,websocket

wangliang 5 năm trước cách đây
mục cha
commit
7faf8b18d8
37 tập tin đã thay đổi với 1301 bổ sung1292 xóa
  1. 12 12
      themis-backend/pom.xml
  2. 2 2
      themis-backend/src/main/java/com/qmth/themis/backend/ThemisBackendApplication.java
  3. 317 317
      themis-backend/src/main/java/com/qmth/themis/backend/api/TBUserController.java
  4. 38 38
      themis-backend/src/main/java/com/qmth/themis/backend/config/WebSocketConfig.java
  5. 67 67
      themis-backend/src/main/java/com/qmth/themis/backend/elasticsearch/entity/ETEStudentEntity.java
  6. 31 31
      themis-backend/src/main/java/com/qmth/themis/backend/elasticsearch/repository/ETEStudentRepo.java
  7. 41 41
      themis-backend/src/main/java/com/qmth/themis/backend/elasticsearch/service/ETEStudentService.java
  8. 88 88
      themis-backend/src/main/java/com/qmth/themis/backend/elasticsearch/service/impl/ETEStudentServiceImpl.java
  9. 18 18
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEExamActivityEntity.java
  10. 26 26
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEExamCourseEntity.java
  11. 26 26
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEExamEntity.java
  12. 18 18
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEExamPaperEntity.java
  13. 61 61
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEExamStudentEntity.java
  14. 18 18
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEStudentEntity.java
  15. 18 18
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEExamActivityRepo.java
  16. 18 18
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEExamCourseRepo.java
  17. 19 19
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEExamPaperRepo.java
  18. 18 18
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEExamRepo.java
  19. 19 19
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEExamStudentRepo.java
  20. 18 18
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEStudentRepo.java
  21. 11 11
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEExamActivityService.java
  22. 11 11
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEExamCourseService.java
  23. 11 11
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEExamPaperService.java
  24. 11 11
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEExamService.java
  25. 11 11
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEExamStudentService.java
  26. 11 11
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEStudentService.java
  27. 21 21
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEExamActivityServiceImpl.java
  28. 21 21
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEExamCourseServiceImpl.java
  29. 21 21
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEExamPaperServiceImpl.java
  30. 21 21
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEExamServiceImpl.java
  31. 23 23
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEExamStudentServiceImpl.java
  32. 21 21
      themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEStudentServiceImpl.java
  33. 202 202
      themis-backend/src/main/java/com/qmth/themis/backend/websocket/WebSocketServer.java
  34. 1 0
      themis-business/src/main/java/com/qmth/themis/business/constant/SystemConstant.java
  35. 17 11
      themis-business/src/main/java/com/qmth/themis/business/dto/AuthDto.java
  36. 6 6
      themis-business/src/main/java/com/qmth/themis/business/entity/TBOrg.java
  37. 8 6
      themis-business/src/main/java/com/qmth/themis/business/service/impl/EhcacheServiceImpl.java

+ 12 - 12
themis-backend/pom.xml

@@ -22,18 +22,18 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-data-mongodb</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-websocket</artifactId>
-        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>org.springframework.boot</groupId>-->
+<!--            <artifactId>spring-boot-starter-data-mongodb</artifactId>-->
+<!--        </dependency>-->
+<!--        <dependency>-->
+<!--            <groupId>org.springframework.boot</groupId>-->
+<!--            <artifactId>spring-boot-starter-data-elasticsearch</artifactId>-->
+<!--        </dependency>-->
+<!--        <dependency>-->
+<!--            <groupId>org.springframework.boot</groupId>-->
+<!--            <artifactId>spring-boot-starter-websocket</artifactId>-->
+<!--        </dependency>-->
     </dependencies>
 
     <build>

+ 2 - 2
themis-backend/src/main/java/com/qmth/themis/backend/ThemisBackendApplication.java

@@ -14,7 +14,7 @@ import org.springframework.cache.annotation.EnableCaching;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Primary;
-import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
+//import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
 import org.springframework.data.redis.connection.RedisConnectionFactory;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
@@ -33,7 +33,7 @@ import org.springframework.web.multipart.commons.CommonsMultipartResolver;
 @EnableTransactionManagement //spring开启事务支持
 @EnableAsync //开启异步任务
 @EnableCaching//开启缓存注解
-@EnableMongoRepositories("com.qmth.themis.backend.mongodb.repository")
+//@EnableMongoRepositories("com.qmth.themis.backend.mongodb.repository")
 public class ThemisBackendApplication {
 
     public static void main(String[] args) {

+ 317 - 317
themis-backend/src/main/java/com/qmth/themis/backend/api/TBUserController.java

@@ -1,22 +1,17 @@
 package com.qmth.themis.backend.api;
 
 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.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.websocket.WebSocketServer;
 import com.qmth.themis.business.constant.SystemConstant;
 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.RoleEnum;
 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.JacksonUtil;
 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.Result;
 import com.qmth.themis.common.util.ResultUtil;
-import com.qmth.themis.mq.dto.MqDto;
 import com.qmth.themis.mq.service.MqDtoService;
 import io.swagger.annotations.*;
 import org.apache.commons.lang3.RandomStringUtils;
-import org.apache.rocketmq.spring.annotation.MessageModel;
 import org.slf4j.Logger;
 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.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -49,11 +38,13 @@ import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
-import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.security.NoSuchAlgorithmException;
 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: 用户 前端控制器
@@ -122,14 +113,14 @@ public class TBUserController {
         //添加用户缓存
         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);
-        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);
         //mq发送消息start
         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
         //测试
         String test = SignatureInfo.build(SignatureType.TOKEN, sessionId, token);
@@ -138,305 +129,314 @@ public class TBUserController {
         map.put(SystemConstant.ACCESS_TOKEN, test);
         map.put(SystemConstant.ACCOUNT, user);
         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);
     }
 
-    @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.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 = "登出接口")
     @RequestMapping(value = "/logout", method = RequestMethod.GET)
@@ -452,7 +452,7 @@ public class TBUserController {
         //循环检查该用户下其他平台是否存在session,不存在则删除用户缓存和鉴权缓存
         boolean delete = true;
         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))) {
                 delete = false;
                 break;
@@ -463,7 +463,7 @@ public class TBUserController {
             ehcacheService.removeAccountCache(tbUser.getId());
         }
         //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
         return ResultUtil.ok(JacksonUtil.parseJson(SystemConstant.SUCCESS));
     }

+ 38 - 38
themis-backend/src/main/java/com/qmth/themis/backend/config/WebSocketConfig.java

@@ -1,41 +1,41 @@
-package com.qmth.themis.backend.config;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.socket.config.annotation.EnableWebSocket;
-import org.springframework.web.socket.server.standard.ServerEndpointExporter;
-
-/**
- * @Description: 开启WebSocket支持
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/6/3
- */
-@Configuration
-@EnableWebSocket
-public class WebSocketConfig
-//        implements WebSocketConfigurer
-{
-    /**
-     * ServerEndpointExporter 作用
-     * 这个Bean会自动注册使用@ServerEndpoint注解声明的websocket endpoint
-     *
-     * @return
-     */
-    @Bean
-    public ServerEndpointExporter serverEndpointExporter() {
-        return new ServerEndpointExporter();
-    }
-
-//    @Override
-//    public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
-//        registry.addHandler(myHandler(), "/messageHandler").setAllowedOrigins("*");
-//    }
+//package com.qmth.themis.backend.config;
+//
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//import org.springframework.web.socket.config.annotation.EnableWebSocket;
+//import org.springframework.web.socket.server.standard.ServerEndpointExporter;
 //
+///**
+// * @Description: 开启WebSocket支持
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/6/3
+// */
+//@Configuration
+//@EnableWebSocket
+//public class WebSocketConfig
+////        implements WebSocketConfigurer
+//{
+//    /**
+//     * ServerEndpointExporter 作用
+//     * 这个Bean会自动注册使用@ServerEndpoint注解声明的websocket endpoint
+//     *
+//     * @return
+//     */
 //    @Bean
-//    public WebSocketHandler myHandler() {
-//        return new MessageHandler();
+//    public ServerEndpointExporter serverEndpointExporter() {
+//        return new ServerEndpointExporter();
 //    }
-}
-
+//
+////    @Override
+////    public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
+////        registry.addHandler(myHandler(), "/messageHandler").setAllowedOrigins("*");
+////    }
+////
+////    @Bean
+////    public WebSocketHandler myHandler() {
+////        return new MessageHandler();
+////    }
+//}
+//

+ 67 - 67
themis-backend/src/main/java/com/qmth/themis/backend/elasticsearch/entity/ETEStudentEntity.java

@@ -1,67 +1,67 @@
-package com.qmth.themis.backend.elasticsearch.entity;
-
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.qmth.themis.business.base.BaseEntity;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.springframework.data.annotation.Id;
-import org.springframework.data.elasticsearch.annotations.Document;
-import org.springframework.data.elasticsearch.annotations.Field;
-import org.springframework.data.elasticsearch.annotations.FieldType;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * @Description: elasticsearch 学生档案 entity
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/6
- */
-@ApiModel(value = "TEStudent", description = "学生档案")
-@Document(indexName = "student_index", shards = 1, replicas = 0)
-public class ETEStudentEntity extends BaseEntity {
-
-    @ApiModelProperty(value = "机构ID")
-    @TableField(value = "org_id")
-    private Long orgId;
-
-    @ApiModelProperty(value = "证件号")
-    @TableField(value = "identity")
-    private String identity;
-
-    @ApiModelProperty(value = "登陆密码,密文保存")
-    @TableField(value = "password")
-    private String password;
-
-    @ApiModelProperty(value = "身份证号")
-    @TableField(value = "idcard_number")
-    private String idcardNumber;
-
-    @ApiModelProperty(value = "手机号")
-    @TableField(value = "mobile_number")
-    private String mobileNumber;
-
-    @ApiModelProperty(value = "姓名")
-    @TableField(value = "name")
-    @Field(type = FieldType.Text, analyzer = "ik_max_word")
-//    @Field(type = FieldType.Keyword)
-//    @Field(type = FieldType.Auto)
-    //keyword:存储数据时候,不会分词建立索引
-    //text:存储数据时候,会自动分词,并生成索引(这是很智能的,但在有些字段里面是没用的,所以对于有些字段使用text则浪费了空间)。
-    private String name;
-
-    @ApiModelProperty(value = "性别")
-    @TableField(value = "gender")
-    private Integer gender;
-
-    @ApiModelProperty(value = "底照保存地址")
-    @TableField(value = "base_photo_path")
-    private String basePhotoPath;
-
-    @ApiModelProperty(value = "是否启用,0:停用,1:启用")
-    @TableField(value = "enable")
-    private Integer enable;
-}
+//package com.qmth.themis.backend.elasticsearch.entity;
+//
+//import com.baomidou.mybatisplus.annotation.TableField;
+//import com.baomidou.mybatisplus.annotation.TableId;
+//import com.qmth.themis.business.base.BaseEntity;
+//import io.swagger.annotations.ApiModel;
+//import io.swagger.annotations.ApiModelProperty;
+//import org.springframework.data.annotation.Id;
+//import org.springframework.data.elasticsearch.annotations.Document;
+//import org.springframework.data.elasticsearch.annotations.Field;
+//import org.springframework.data.elasticsearch.annotations.FieldType;
+//
+//import java.io.Serializable;
+//import java.util.Date;
+//
+///**
+// * @Description: elasticsearch 学生档案 entity
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/6
+// */
+//@ApiModel(value = "TEStudent", description = "学生档案")
+//@Document(indexName = "student_index", shards = 1, replicas = 0)
+//public class ETEStudentEntity extends BaseEntity {
+//
+//    @ApiModelProperty(value = "机构ID")
+//    @TableField(value = "org_id")
+//    private Long orgId;
+//
+//    @ApiModelProperty(value = "证件号")
+//    @TableField(value = "identity")
+//    private String identity;
+//
+//    @ApiModelProperty(value = "登陆密码,密文保存")
+//    @TableField(value = "password")
+//    private String password;
+//
+//    @ApiModelProperty(value = "身份证号")
+//    @TableField(value = "idcard_number")
+//    private String idcardNumber;
+//
+//    @ApiModelProperty(value = "手机号")
+//    @TableField(value = "mobile_number")
+//    private String mobileNumber;
+//
+//    @ApiModelProperty(value = "姓名")
+//    @TableField(value = "name")
+//    @Field(type = FieldType.Text, analyzer = "ik_max_word")
+////    @Field(type = FieldType.Keyword)
+////    @Field(type = FieldType.Auto)
+//    //keyword:存储数据时候,不会分词建立索引
+//    //text:存储数据时候,会自动分词,并生成索引(这是很智能的,但在有些字段里面是没用的,所以对于有些字段使用text则浪费了空间)。
+//    private String name;
+//
+//    @ApiModelProperty(value = "性别")
+//    @TableField(value = "gender")
+//    private Integer gender;
+//
+//    @ApiModelProperty(value = "底照保存地址")
+//    @TableField(value = "base_photo_path")
+//    private String basePhotoPath;
+//
+//    @ApiModelProperty(value = "是否启用,0:停用,1:启用")
+//    @TableField(value = "enable")
+//    private Integer enable;
+//}

+ 31 - 31
themis-backend/src/main/java/com/qmth/themis/backend/elasticsearch/repository/ETEStudentRepo.java

@@ -1,31 +1,31 @@
-package com.qmth.themis.backend.elasticsearch.repository;
-
-import com.qmth.themis.backend.elasticsearch.entity.ETEStudentEntity;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.Pageable;
-import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-/**
- * @Description: elasticsearch 学生档案 repo
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/7
- */
-@Repository
-public interface ETEStudentRepo extends ElasticsearchRepository<ETEStudentEntity, Long> {
-
-    //默认的注释
-    Page<ETEStudentEntity> findByName(String name, Pageable pageable);
-
-    Page<ETEStudentEntity> findByIdentity(String identity, Pageable pageable);
-
-    Page<ETEStudentEntity> findByMobileNumber(String mobileNumber, Pageable pageable);
-
-    List<ETEStudentEntity> findByNameLike(String keyword);
-
-
-}
+//package com.qmth.themis.backend.elasticsearch.repository;
+//
+//import com.qmth.themis.backend.elasticsearch.entity.ETEStudentEntity;
+//import org.springframework.data.domain.Page;
+//import org.springframework.data.domain.Pageable;
+//import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
+//import org.springframework.stereotype.Repository;
+//
+//import java.util.List;
+//
+///**
+// * @Description: elasticsearch 学生档案 repo
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/7
+// */
+//@Repository
+//public interface ETEStudentRepo extends ElasticsearchRepository<ETEStudentEntity, Long> {
+//
+//    //默认的注释
+//    Page<ETEStudentEntity> findByName(String name, Pageable pageable);
+//
+//    Page<ETEStudentEntity> findByIdentity(String identity, Pageable pageable);
+//
+//    Page<ETEStudentEntity> findByMobileNumber(String mobileNumber, Pageable pageable);
+//
+//    List<ETEStudentEntity> findByNameLike(String keyword);
+//
+//
+//}

+ 41 - 41
themis-backend/src/main/java/com/qmth/themis/backend/elasticsearch/service/ETEStudentService.java

@@ -1,41 +1,41 @@
-package com.qmth.themis.backend.elasticsearch.service;
-
-import com.qmth.themis.backend.elasticsearch.entity.ETEStudentEntity;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.Pageable;
-import org.springframework.data.elasticsearch.annotations.Query;
-
-import java.util.Iterator;
-import java.util.List;
-
-/**
-* @Description: elasticsearch 学生档案 服务类
-* @Param:  
-* @return:  
-* @Author: wangliang
-* @Date: 2020/7/6 
-*/ 
-public interface ETEStudentService {
-
-    void createIndex();
-
-    void deleteIndex(String index);
-
-    void save(ETEStudentEntity docBean);
-
-    void saveAll(List<ETEStudentEntity> list);
-
-    Iterator<ETEStudentEntity> findAll();
-
-    Page<ETEStudentEntity> findByName(String name, Pageable pageable);
-
-    Page<ETEStudentEntity> findByIdentity(String identity, Pageable pageable);
-
-    Page<ETEStudentEntity> findByMobileNumber(String mobileNumber, Pageable pageable);
-
-    Page<ETEStudentEntity> queryName(String key);
-
-    Page<ETEStudentEntity> queryMobileNumber(String key);
-
-    List<ETEStudentEntity> findByNameLike(String keyword);
-}
+//package com.qmth.themis.backend.elasticsearch.service;
+//
+//import com.qmth.themis.backend.elasticsearch.entity.ETEStudentEntity;
+//import org.springframework.data.domain.Page;
+//import org.springframework.data.domain.Pageable;
+//import org.springframework.data.elasticsearch.annotations.Query;
+//
+//import java.util.Iterator;
+//import java.util.List;
+//
+///**
+//* @Description: elasticsearch 学生档案 服务类
+//* @Param:
+//* @return:
+//* @Author: wangliang
+//* @Date: 2020/7/6
+//*/
+//public interface ETEStudentService {
+//
+//    void createIndex();
+//
+//    void deleteIndex(String index);
+//
+//    void save(ETEStudentEntity docBean);
+//
+//    void saveAll(List<ETEStudentEntity> list);
+//
+//    Iterator<ETEStudentEntity> findAll();
+//
+//    Page<ETEStudentEntity> findByName(String name, Pageable pageable);
+//
+//    Page<ETEStudentEntity> findByIdentity(String identity, Pageable pageable);
+//
+//    Page<ETEStudentEntity> findByMobileNumber(String mobileNumber, Pageable pageable);
+//
+//    Page<ETEStudentEntity> queryName(String key);
+//
+//    Page<ETEStudentEntity> queryMobileNumber(String key);
+//
+//    List<ETEStudentEntity> findByNameLike(String keyword);
+//}

+ 88 - 88
themis-backend/src/main/java/com/qmth/themis/backend/elasticsearch/service/impl/ETEStudentServiceImpl.java

@@ -1,88 +1,88 @@
-package com.qmth.themis.backend.elasticsearch.service.impl;
-
-import com.qmth.themis.backend.elasticsearch.entity.ETEStudentEntity;
-import com.qmth.themis.backend.elasticsearch.repository.ETEStudentRepo;
-import com.qmth.themis.backend.elasticsearch.service.ETEStudentService;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.PageRequest;
-import org.springframework.data.domain.Pageable;
-import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * @Description: elasticsearch 学生档案 服务实现类
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/6
- */
-@Service
-public class ETEStudentServiceImpl implements ETEStudentService {
-
-    @Resource
-    ETEStudentRepo eteStudentRepo;
-
-    @Resource
-    ElasticsearchRestTemplate elasticsearchRestTemplate;
-
-    Pageable pageable = PageRequest.of(0, 10);
-
-    @Override
-    public void createIndex() {
-//        elasticsearchRestTemplate.createIndex(ETEStudentEntity.class);
-    }
-
-    @Override
-    public void deleteIndex(String index) {
-//        elasticsearchRestTemplate.deleteIndex(index);
-    }
-
-    @Override
-    public void save(ETEStudentEntity docBean) {
-        eteStudentRepo.save(docBean);
-    }
-
-    @Override
-    public void saveAll(List<ETEStudentEntity> list) {
-        eteStudentRepo.saveAll(list);
-    }
-
-    @Override
-    public Iterator<ETEStudentEntity> findAll() {
-        return eteStudentRepo.findAll().iterator();
-    }
-
-    @Override
-    public Page<ETEStudentEntity> findByName(String name, Pageable pageable) {
-        return eteStudentRepo.findByName(name, pageable);
-    }
-
-    @Override
-    public Page<ETEStudentEntity> findByIdentity(String identity, Pageable pageable) {
-        return eteStudentRepo.findByIdentity(identity, pageable);
-    }
-
-    @Override
-    public Page<ETEStudentEntity> findByMobileNumber(String mobileNumber, Pageable pageable) {
-        return eteStudentRepo.findByMobileNumber(mobileNumber, pageable);
-    }
-
-    @Override
-    public Page<ETEStudentEntity> queryName(String key) {
-        return eteStudentRepo.findByName(key, pageable);
-    }
-
-    @Override
-    public Page<ETEStudentEntity> queryMobileNumber(String key) {
-        return eteStudentRepo.findByMobileNumber(key, pageable);
-    }
-
-    @Override
-    public List<ETEStudentEntity> findByNameLike(String keyword) {
-        return eteStudentRepo.findByNameLike(keyword);
-    }
-}
+//package com.qmth.themis.backend.elasticsearch.service.impl;
+//
+//import com.qmth.themis.backend.elasticsearch.entity.ETEStudentEntity;
+//import com.qmth.themis.backend.elasticsearch.repository.ETEStudentRepo;
+//import com.qmth.themis.backend.elasticsearch.service.ETEStudentService;
+//import org.springframework.data.domain.Page;
+//import org.springframework.data.domain.PageRequest;
+//import org.springframework.data.domain.Pageable;
+//import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
+//import org.springframework.stereotype.Service;
+//
+//import javax.annotation.Resource;
+//import java.util.Iterator;
+//import java.util.List;
+//
+///**
+// * @Description: elasticsearch 学生档案 服务实现类
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/6
+// */
+//@Service
+//public class ETEStudentServiceImpl implements ETEStudentService {
+//
+//    @Resource
+//    ETEStudentRepo eteStudentRepo;
+//
+//    @Resource
+//    ElasticsearchRestTemplate elasticsearchRestTemplate;
+//
+//    Pageable pageable = PageRequest.of(0, 10);
+//
+//    @Override
+//    public void createIndex() {
+////        elasticsearchRestTemplate.createIndex(ETEStudentEntity.class);
+//    }
+//
+//    @Override
+//    public void deleteIndex(String index) {
+////        elasticsearchRestTemplate.deleteIndex(index);
+//    }
+//
+//    @Override
+//    public void save(ETEStudentEntity docBean) {
+//        eteStudentRepo.save(docBean);
+//    }
+//
+//    @Override
+//    public void saveAll(List<ETEStudentEntity> list) {
+//        eteStudentRepo.saveAll(list);
+//    }
+//
+//    @Override
+//    public Iterator<ETEStudentEntity> findAll() {
+//        return eteStudentRepo.findAll().iterator();
+//    }
+//
+//    @Override
+//    public Page<ETEStudentEntity> findByName(String name, Pageable pageable) {
+//        return eteStudentRepo.findByName(name, pageable);
+//    }
+//
+//    @Override
+//    public Page<ETEStudentEntity> findByIdentity(String identity, Pageable pageable) {
+//        return eteStudentRepo.findByIdentity(identity, pageable);
+//    }
+//
+//    @Override
+//    public Page<ETEStudentEntity> findByMobileNumber(String mobileNumber, Pageable pageable) {
+//        return eteStudentRepo.findByMobileNumber(mobileNumber, pageable);
+//    }
+//
+//    @Override
+//    public Page<ETEStudentEntity> queryName(String key) {
+//        return eteStudentRepo.findByName(key, pageable);
+//    }
+//
+//    @Override
+//    public Page<ETEStudentEntity> queryMobileNumber(String key) {
+//        return eteStudentRepo.findByMobileNumber(key, pageable);
+//    }
+//
+//    @Override
+//    public List<ETEStudentEntity> findByNameLike(String keyword) {
+//        return eteStudentRepo.findByNameLike(keyword);
+//    }
+//}

+ 18 - 18
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEExamActivityEntity.java

@@ -1,18 +1,18 @@
-package com.qmth.themis.backend.mongodb.entity;
-
-import com.qmth.themis.business.entity.common.ExamActivity;
-import io.swagger.annotations.ApiModel;
-import org.springframework.data.mongodb.core.mapping.Document;
-
-/**
- * @Description: mongodb 考试场次 entity
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/6
- */
-@ApiModel(value = "TEExamActivity", description = "考试场次")
-@Document(collection = "TEExamActivity")
-public class MTEExamActivityEntity extends ExamActivity {
-
-}
+//package com.qmth.themis.backend.mongodb.entity;
+//
+//import com.qmth.themis.business.entity.common.ExamActivity;
+//import io.swagger.annotations.ApiModel;
+//import org.springframework.data.mongodb.core.mapping.Document;
+//
+///**
+// * @Description: mongodb 考试场次 entity
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/6
+// */
+//@ApiModel(value = "TEExamActivity", description = "考试场次")
+//@Document(collection = "TEExamActivity")
+//public class MTEExamActivityEntity extends ExamActivity {
+//
+//}

+ 26 - 26
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEExamCourseEntity.java

@@ -1,28 +1,28 @@
-package com.qmth.themis.backend.mongodb.entity;
-
-import com.qmth.themis.business.entity.common.ExamCourse;
-import io.swagger.annotations.ApiModel;
-import org.springframework.data.mongodb.core.mapping.Document;
-
-/**
- * @Description: mongodb 考试科目 entity
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/6
- */
-@ApiModel(value = "TEExamCourse", description = "考试科目")
-@Document(collection = "TEExamCourse")
-public class MTEExamCourseEntity extends ExamCourse {
-
-//    @DBRef
-//    private List<MTEExamPaperEntity> mteExamPaperEntityList;
+//package com.qmth.themis.backend.mongodb.entity;
 //
-//    public List<MTEExamPaperEntity> getMteExamPaperEntityList() {
-//        return mteExamPaperEntityList;
-//    }
+//import com.qmth.themis.business.entity.common.ExamCourse;
+//import io.swagger.annotations.ApiModel;
+//import org.springframework.data.mongodb.core.mapping.Document;
 //
-//    public void setMteExamPaperEntityList(List<MTEExamPaperEntity> mteExamPaperEntityList) {
-//        this.mteExamPaperEntityList = mteExamPaperEntityList;
-//    }
-}
+///**
+// * @Description: mongodb 考试科目 entity
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/6
+// */
+//@ApiModel(value = "TEExamCourse", description = "考试科目")
+//@Document(collection = "TEExamCourse")
+//public class MTEExamCourseEntity extends ExamCourse {
+//
+////    @DBRef
+////    private List<MTEExamPaperEntity> mteExamPaperEntityList;
+////
+////    public List<MTEExamPaperEntity> getMteExamPaperEntityList() {
+////        return mteExamPaperEntityList;
+////    }
+////
+////    public void setMteExamPaperEntityList(List<MTEExamPaperEntity> mteExamPaperEntityList) {
+////        this.mteExamPaperEntityList = mteExamPaperEntityList;
+////    }
+//}

+ 26 - 26
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEExamEntity.java

@@ -1,28 +1,28 @@
-package com.qmth.themis.backend.mongodb.entity;
-
-import com.qmth.themis.business.entity.common.Exam;
-import io.swagger.annotations.ApiModel;
-import org.springframework.data.mongodb.core.mapping.Document;
-
-/**
- * @Description: mongodb 考试批次 entity
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/6
- */
-@ApiModel(value = "TEExam", description = "考试批次")
-@Document(collection = "TEExam")
-public class MTEExamEntity extends Exam {
-
-//    @DBRef
-//    private List<MTEExamActivityEntity> mteExamActivityEntityList;
+//package com.qmth.themis.backend.mongodb.entity;
 //
-//    public List<MTEExamActivityEntity> getMteExamActivityEntityList() {
-//        return mteExamActivityEntityList;
-//    }
+//import com.qmth.themis.business.entity.common.Exam;
+//import io.swagger.annotations.ApiModel;
+//import org.springframework.data.mongodb.core.mapping.Document;
 //
-//    public void setMteExamActivityEntityList(List<MTEExamActivityEntity> mteExamActivityEntityList) {
-//        this.mteExamActivityEntityList = mteExamActivityEntityList;
-//    }
-}
+///**
+// * @Description: mongodb 考试批次 entity
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/6
+// */
+//@ApiModel(value = "TEExam", description = "考试批次")
+//@Document(collection = "TEExam")
+//public class MTEExamEntity extends Exam {
+//
+////    @DBRef
+////    private List<MTEExamActivityEntity> mteExamActivityEntityList;
+////
+////    public List<MTEExamActivityEntity> getMteExamActivityEntityList() {
+////        return mteExamActivityEntityList;
+////    }
+////
+////    public void setMteExamActivityEntityList(List<MTEExamActivityEntity> mteExamActivityEntityList) {
+////        this.mteExamActivityEntityList = mteExamActivityEntityList;
+////    }
+//}

+ 18 - 18
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEExamPaperEntity.java

@@ -1,18 +1,18 @@
-package com.qmth.themis.backend.mongodb.entity;
-
-import com.qmth.themis.business.entity.common.ExamPaper;
-import io.swagger.annotations.ApiModel;
-import org.springframework.data.mongodb.core.mapping.Document;
-
-/**
- * @Description: mongodb 考试试卷 entity
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/6
- */
-@ApiModel(value = "TEExamPaper", description = "考试试卷")
-@Document(collection = "TEExamPaper")
-public class MTEExamPaperEntity extends ExamPaper {
-
-}
+//package com.qmth.themis.backend.mongodb.entity;
+//
+//import com.qmth.themis.business.entity.common.ExamPaper;
+//import io.swagger.annotations.ApiModel;
+//import org.springframework.data.mongodb.core.mapping.Document;
+//
+///**
+// * @Description: mongodb 考试试卷 entity
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/6
+// */
+//@ApiModel(value = "TEExamPaper", description = "考试试卷")
+//@Document(collection = "TEExamPaper")
+//public class MTEExamPaperEntity extends ExamPaper {
+//
+//}

+ 61 - 61
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEExamStudentEntity.java

@@ -1,61 +1,61 @@
-package com.qmth.themis.backend.mongodb.entity;
-
-import com.qmth.themis.business.entity.common.ExamStudent;
-import io.swagger.annotations.ApiModel;
-import org.springframework.data.mongodb.core.mapping.Document;
-
-/**
- * @Description: mongodb 考生 entity
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/6
- */
-@ApiModel(value = "TEExamStudent", description = "考生库")
-@Document(collection = "TEExamStudent")
-public class MTEExamStudentEntity extends ExamStudent {
-
-//    @DBRef
-//    private MTEStudentEntity mteStudentEntity;
-//
-//    @DBRef
-//    private MTEExamEntity mteExamEntity;
-//
-//    @DBRef
-//    private MTEExamActivityEntity mteExamActivityEntity;
-//
-//    @DBRef
-//    private List<MTEExamCourseEntity> mteExamCourseEntityList;
-
-//    public MTEExamEntity getMteExamEntity() {
-//        return mteExamEntity;
-//    }
-//
-//    public void setMteExamEntity(MTEExamEntity mteExamEntity) {
-//        this.mteExamEntity = mteExamEntity;
-//    }
-//
-//    public MTEExamActivityEntity getMteExamActivityEntity() {
-//        return mteExamActivityEntity;
-//    }
-//
-//    public void setMteExamActivityEntity(MTEExamActivityEntity mteExamActivityEntity) {
-//        this.mteExamActivityEntity = mteExamActivityEntity;
-//    }
-//
-//    public List<MTEExamCourseEntity> getMteExamCourseEntityList() {
-//        return mteExamCourseEntityList;
-//    }
-//
-//    public void setMteExamCourseEntityList(List<MTEExamCourseEntity> mteExamCourseEntityList) {
-//        this.mteExamCourseEntityList = mteExamCourseEntityList;
-//    }
-//
-//    public MTEStudentEntity getMteStudentEntity() {
-//        return mteStudentEntity;
-//    }
-//
-//    public void setMteStudentEntity(MTEStudentEntity mteStudentEntity) {
-//        this.mteStudentEntity = mteStudentEntity;
-//    }
-}
+//package com.qmth.themis.backend.mongodb.entity;
+//
+//import com.qmth.themis.business.entity.common.ExamStudent;
+//import io.swagger.annotations.ApiModel;
+//import org.springframework.data.mongodb.core.mapping.Document;
+//
+///**
+// * @Description: mongodb 考生 entity
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/6
+// */
+//@ApiModel(value = "TEExamStudent", description = "考生库")
+//@Document(collection = "TEExamStudent")
+//public class MTEExamStudentEntity extends ExamStudent {
+//
+////    @DBRef
+////    private MTEStudentEntity mteStudentEntity;
+////
+////    @DBRef
+////    private MTEExamEntity mteExamEntity;
+////
+////    @DBRef
+////    private MTEExamActivityEntity mteExamActivityEntity;
+////
+////    @DBRef
+////    private List<MTEExamCourseEntity> mteExamCourseEntityList;
+//
+////    public MTEExamEntity getMteExamEntity() {
+////        return mteExamEntity;
+////    }
+////
+////    public void setMteExamEntity(MTEExamEntity mteExamEntity) {
+////        this.mteExamEntity = mteExamEntity;
+////    }
+////
+////    public MTEExamActivityEntity getMteExamActivityEntity() {
+////        return mteExamActivityEntity;
+////    }
+////
+////    public void setMteExamActivityEntity(MTEExamActivityEntity mteExamActivityEntity) {
+////        this.mteExamActivityEntity = mteExamActivityEntity;
+////    }
+////
+////    public List<MTEExamCourseEntity> getMteExamCourseEntityList() {
+////        return mteExamCourseEntityList;
+////    }
+////
+////    public void setMteExamCourseEntityList(List<MTEExamCourseEntity> mteExamCourseEntityList) {
+////        this.mteExamCourseEntityList = mteExamCourseEntityList;
+////    }
+////
+////    public MTEStudentEntity getMteStudentEntity() {
+////        return mteStudentEntity;
+////    }
+////
+////    public void setMteStudentEntity(MTEStudentEntity mteStudentEntity) {
+////        this.mteStudentEntity = mteStudentEntity;
+////    }
+//}

+ 18 - 18
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/entity/MTEStudentEntity.java

@@ -1,18 +1,18 @@
-package com.qmth.themis.backend.mongodb.entity;
-
-import com.qmth.themis.business.entity.common.Student;
-import io.swagger.annotations.ApiModel;
-import org.springframework.data.mongodb.core.mapping.Document;
-
-/**
- * @Description: mongodb 学生档案 entity
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/6
- */
-@ApiModel(value = "TEStudent", description = "学生档案")
-@Document(collection = "TEStudent")
-public class MTEStudentEntity extends Student {
-
-}
+//package com.qmth.themis.backend.mongodb.entity;
+//
+//import com.qmth.themis.business.entity.common.Student;
+//import io.swagger.annotations.ApiModel;
+//import org.springframework.data.mongodb.core.mapping.Document;
+//
+///**
+// * @Description: mongodb 学生档案 entity
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/6
+// */
+//@ApiModel(value = "TEStudent", description = "学生档案")
+//@Document(collection = "TEStudent")
+//public class MTEStudentEntity extends Student {
+//
+//}

+ 18 - 18
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEExamActivityRepo.java

@@ -1,18 +1,18 @@
-package com.qmth.themis.backend.mongodb.repository;
-
-import com.qmth.themis.backend.mongodb.entity.MTEExamActivityEntity;
-import org.springframework.data.mongodb.repository.MongoRepository;
-import org.springframework.data.repository.query.QueryByExampleExecutor;
-import org.springframework.stereotype.Repository;
-
-/**
- * @Description: mongodb 考试场次 repo
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/6
- */
-@Repository
-public interface MTEExamActivityRepo extends MongoRepository<MTEExamActivityEntity, String>, QueryByExampleExecutor<MTEExamActivityEntity> {
-
-}
+//package com.qmth.themis.backend.mongodb.repository;
+//
+//import com.qmth.themis.backend.mongodb.entity.MTEExamActivityEntity;
+//import org.springframework.data.mongodb.repository.MongoRepository;
+//import org.springframework.data.repository.query.QueryByExampleExecutor;
+//import org.springframework.stereotype.Repository;
+//
+///**
+// * @Description: mongodb 考试场次 repo
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/6
+// */
+//@Repository
+//public interface MTEExamActivityRepo extends MongoRepository<MTEExamActivityEntity, String>, QueryByExampleExecutor<MTEExamActivityEntity> {
+//
+//}

+ 18 - 18
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEExamCourseRepo.java

@@ -1,18 +1,18 @@
-package com.qmth.themis.backend.mongodb.repository;
-
-import com.qmth.themis.backend.mongodb.entity.MTEExamCourseEntity;
-import org.springframework.data.mongodb.repository.MongoRepository;
-import org.springframework.data.repository.query.QueryByExampleExecutor;
-import org.springframework.stereotype.Repository;
-
-/**
- * @Description: mongodb 考试科目 repo
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/6
- */
-@Repository
-public interface MTEExamCourseRepo extends MongoRepository<MTEExamCourseEntity, String>, QueryByExampleExecutor<MTEExamCourseEntity> {
-
-}
+//package com.qmth.themis.backend.mongodb.repository;
+//
+//import com.qmth.themis.backend.mongodb.entity.MTEExamCourseEntity;
+//import org.springframework.data.mongodb.repository.MongoRepository;
+//import org.springframework.data.repository.query.QueryByExampleExecutor;
+//import org.springframework.stereotype.Repository;
+//
+///**
+// * @Description: mongodb 考试科目 repo
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/6
+// */
+//@Repository
+//public interface MTEExamCourseRepo extends MongoRepository<MTEExamCourseEntity, String>, QueryByExampleExecutor<MTEExamCourseEntity> {
+//
+//}

+ 19 - 19
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEExamPaperRepo.java

@@ -1,19 +1,19 @@
-package com.qmth.themis.backend.mongodb.repository;
-
-import com.qmth.themis.backend.mongodb.entity.MTEExamEntity;
-import com.qmth.themis.backend.mongodb.entity.MTEExamPaperEntity;
-import org.springframework.data.mongodb.repository.MongoRepository;
-import org.springframework.data.repository.query.QueryByExampleExecutor;
-import org.springframework.stereotype.Repository;
-
-/**
- * @Description: mongodb 考试试卷 repo
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/6
- */
-@Repository
-public interface MTEExamPaperRepo extends MongoRepository<MTEExamPaperEntity, String>, QueryByExampleExecutor<MTEExamPaperEntity> {
-
-}
+//package com.qmth.themis.backend.mongodb.repository;
+//
+//import com.qmth.themis.backend.mongodb.entity.MTEExamEntity;
+//import com.qmth.themis.backend.mongodb.entity.MTEExamPaperEntity;
+//import org.springframework.data.mongodb.repository.MongoRepository;
+//import org.springframework.data.repository.query.QueryByExampleExecutor;
+//import org.springframework.stereotype.Repository;
+//
+///**
+// * @Description: mongodb 考试试卷 repo
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/6
+// */
+//@Repository
+//public interface MTEExamPaperRepo extends MongoRepository<MTEExamPaperEntity, String>, QueryByExampleExecutor<MTEExamPaperEntity> {
+//
+//}

+ 18 - 18
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEExamRepo.java

@@ -1,18 +1,18 @@
-package com.qmth.themis.backend.mongodb.repository;
-
-import com.qmth.themis.backend.mongodb.entity.MTEExamEntity;
-import org.springframework.data.mongodb.repository.MongoRepository;
-import org.springframework.data.repository.query.QueryByExampleExecutor;
-import org.springframework.stereotype.Repository;
-
-/**
- * @Description: mongodb 考试批次 repo
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/6
- */
-@Repository
-public interface MTEExamRepo extends MongoRepository<MTEExamEntity, String>, QueryByExampleExecutor<MTEExamEntity> {
-
-}
+//package com.qmth.themis.backend.mongodb.repository;
+//
+//import com.qmth.themis.backend.mongodb.entity.MTEExamEntity;
+//import org.springframework.data.mongodb.repository.MongoRepository;
+//import org.springframework.data.repository.query.QueryByExampleExecutor;
+//import org.springframework.stereotype.Repository;
+//
+///**
+// * @Description: mongodb 考试批次 repo
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/6
+// */
+//@Repository
+//public interface MTEExamRepo extends MongoRepository<MTEExamEntity, String>, QueryByExampleExecutor<MTEExamEntity> {
+//
+//}

+ 19 - 19
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEExamStudentRepo.java

@@ -1,19 +1,19 @@
-package com.qmth.themis.backend.mongodb.repository;
-
-import com.qmth.themis.backend.mongodb.entity.MTEExamEntity;
-import com.qmth.themis.backend.mongodb.entity.MTEExamStudentEntity;
-import org.springframework.data.mongodb.repository.MongoRepository;
-import org.springframework.data.repository.query.QueryByExampleExecutor;
-import org.springframework.stereotype.Repository;
-
-/**
- * @Description: mongodb 考生 repo
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/6
- */
-@Repository
-public interface MTEExamStudentRepo extends MongoRepository<MTEExamStudentEntity, String>, QueryByExampleExecutor<MTEExamStudentEntity> {
-
-}
+//package com.qmth.themis.backend.mongodb.repository;
+//
+//import com.qmth.themis.backend.mongodb.entity.MTEExamEntity;
+//import com.qmth.themis.backend.mongodb.entity.MTEExamStudentEntity;
+//import org.springframework.data.mongodb.repository.MongoRepository;
+//import org.springframework.data.repository.query.QueryByExampleExecutor;
+//import org.springframework.stereotype.Repository;
+//
+///**
+// * @Description: mongodb 考生 repo
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/6
+// */
+//@Repository
+//public interface MTEExamStudentRepo extends MongoRepository<MTEExamStudentEntity, String>, QueryByExampleExecutor<MTEExamStudentEntity> {
+//
+//}

+ 18 - 18
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/repository/MTEStudentRepo.java

@@ -1,18 +1,18 @@
-package com.qmth.themis.backend.mongodb.repository;
-
-import com.qmth.themis.backend.mongodb.entity.MTEStudentEntity;
-import org.springframework.data.mongodb.repository.MongoRepository;
-import org.springframework.data.repository.query.QueryByExampleExecutor;
-import org.springframework.stereotype.Repository;
-
-/**
- * @Description: mongodb 学生档案 repo
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/6
- */
-@Repository
-public interface MTEStudentRepo extends MongoRepository<MTEStudentEntity, String>, QueryByExampleExecutor<MTEStudentEntity> {
-
-}
+//package com.qmth.themis.backend.mongodb.repository;
+//
+//import com.qmth.themis.backend.mongodb.entity.MTEStudentEntity;
+//import org.springframework.data.mongodb.repository.MongoRepository;
+//import org.springframework.data.repository.query.QueryByExampleExecutor;
+//import org.springframework.stereotype.Repository;
+//
+///**
+// * @Description: mongodb 学生档案 repo
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/6
+// */
+//@Repository
+//public interface MTEStudentRepo extends MongoRepository<MTEStudentEntity, String>, QueryByExampleExecutor<MTEStudentEntity> {
+//
+//}

+ 11 - 11
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEExamActivityService.java

@@ -1,11 +1,11 @@
-package com.qmth.themis.backend.mongodb.service;
-
-/**
- * @Description: mongodb 考试场次 服务类
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/6
- */
-public interface MTEExamActivityService {
-}
+//package com.qmth.themis.backend.mongodb.service;
+//
+///**
+// * @Description: mongodb 考试场次 服务类
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/6
+// */
+//public interface MTEExamActivityService {
+//}

+ 11 - 11
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEExamCourseService.java

@@ -1,11 +1,11 @@
-package com.qmth.themis.backend.mongodb.service;
-
-/** 
-* @Description: mongodb 考试科目 服务类
-* @Param:  
-* @return:  
-* @Author: wangliang
-* @Date: 2020/7/6 
-*/ 
-public interface MTEExamCourseService {
-}
+//package com.qmth.themis.backend.mongodb.service;
+//
+///**
+//* @Description: mongodb 考试科目 服务类
+//* @Param:
+//* @return:
+//* @Author: wangliang
+//* @Date: 2020/7/6
+//*/
+//public interface MTEExamCourseService {
+//}

+ 11 - 11
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEExamPaperService.java

@@ -1,11 +1,11 @@
-package com.qmth.themis.backend.mongodb.service;
-
-/** 
-* @Description: mongodb 考试试卷 服务类
-* @Param:  
-* @return:  
-* @Author: wangliang
-* @Date: 2020/7/6 
-*/ 
-public interface MTEExamPaperService {
-}
+//package com.qmth.themis.backend.mongodb.service;
+//
+///**
+//* @Description: mongodb 考试试卷 服务类
+//* @Param:
+//* @return:
+//* @Author: wangliang
+//* @Date: 2020/7/6
+//*/
+//public interface MTEExamPaperService {
+//}

+ 11 - 11
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEExamService.java

@@ -1,11 +1,11 @@
-package com.qmth.themis.backend.mongodb.service;
-
-/** 
-* @Description: mongodb 考试批次 服务类
-* @Param:  
-* @return:  
-* @Author: wangliang
-* @Date: 2020/7/6 
-*/ 
-public interface MTEExamService {
-}
+//package com.qmth.themis.backend.mongodb.service;
+//
+///**
+//* @Description: mongodb 考试批次 服务类
+//* @Param:
+//* @return:
+//* @Author: wangliang
+//* @Date: 2020/7/6
+//*/
+//public interface MTEExamService {
+//}

+ 11 - 11
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEExamStudentService.java

@@ -1,11 +1,11 @@
-package com.qmth.themis.backend.mongodb.service;
-
-/** 
-* @Description: mongodb 考生 服务类
-* @Param:  
-* @return:  
-* @Author: wangliang
-* @Date: 2020/7/6 
-*/ 
-public interface MTEExamStudentService {
-}
+//package com.qmth.themis.backend.mongodb.service;
+//
+///**
+//* @Description: mongodb 考生 服务类
+//* @Param:
+//* @return:
+//* @Author: wangliang
+//* @Date: 2020/7/6
+//*/
+//public interface MTEExamStudentService {
+//}

+ 11 - 11
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/MTEStudentService.java

@@ -1,11 +1,11 @@
-package com.qmth.themis.backend.mongodb.service;
-
-/** 
-* @Description: mongodb 学生档案 服务类
-* @Param:  
-* @return:  
-* @Author: wangliang
-* @Date: 2020/7/6 
-*/ 
-public interface MTEStudentService {
-}
+//package com.qmth.themis.backend.mongodb.service;
+//
+///**
+//* @Description: mongodb 学生档案 服务类
+//* @Param:
+//* @return:
+//* @Author: wangliang
+//* @Date: 2020/7/6
+//*/
+//public interface MTEStudentService {
+//}

+ 21 - 21
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEExamActivityServiceImpl.java

@@ -1,21 +1,21 @@
-package com.qmth.themis.backend.mongodb.service.impl;
-
-import com.qmth.themis.backend.mongodb.repository.MTEExamActivityRepo;
-import com.qmth.themis.backend.mongodb.service.MTEExamActivityService;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-
-/**
- * @Description: mongodb 考试场次 服务实现类
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/6
- */
-@Service
-public class MTEExamActivityServiceImpl implements MTEExamActivityService {
-
-    @Resource
-    MTEExamActivityRepo mteExamActivityRepo;
-}
+//package com.qmth.themis.backend.mongodb.service.impl;
+//
+//import com.qmth.themis.backend.mongodb.repository.MTEExamActivityRepo;
+//import com.qmth.themis.backend.mongodb.service.MTEExamActivityService;
+//import org.springframework.stereotype.Service;
+//
+//import javax.annotation.Resource;
+//
+///**
+// * @Description: mongodb 考试场次 服务实现类
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/6
+// */
+//@Service
+//public class MTEExamActivityServiceImpl implements MTEExamActivityService {
+//
+//    @Resource
+//    MTEExamActivityRepo mteExamActivityRepo;
+//}

+ 21 - 21
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEExamCourseServiceImpl.java

@@ -1,21 +1,21 @@
-package com.qmth.themis.backend.mongodb.service.impl;
-
-import com.qmth.themis.backend.mongodb.repository.MTEExamCourseRepo;
-import com.qmth.themis.backend.mongodb.service.MTEExamCourseService;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-
-/**
- * @Description: mongodb 考试科目 服务实现类
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/6
- */
-@Service
-public class MTEExamCourseServiceImpl implements MTEExamCourseService {
-
-    @Resource
-    MTEExamCourseRepo mteExamCourseRepo;
-}
+//package com.qmth.themis.backend.mongodb.service.impl;
+//
+//import com.qmth.themis.backend.mongodb.repository.MTEExamCourseRepo;
+//import com.qmth.themis.backend.mongodb.service.MTEExamCourseService;
+//import org.springframework.stereotype.Service;
+//
+//import javax.annotation.Resource;
+//
+///**
+// * @Description: mongodb 考试科目 服务实现类
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/6
+// */
+//@Service
+//public class MTEExamCourseServiceImpl implements MTEExamCourseService {
+//
+//    @Resource
+//    MTEExamCourseRepo mteExamCourseRepo;
+//}

+ 21 - 21
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEExamPaperServiceImpl.java

@@ -1,21 +1,21 @@
-package com.qmth.themis.backend.mongodb.service.impl;
-
-import com.qmth.themis.backend.mongodb.repository.MTEExamPaperRepo;
-import com.qmth.themis.backend.mongodb.service.MTEExamPaperService;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-
-/**
- * @Description: mongodb 考试试卷 服务实现类
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/6
- */
-@Service
-public class MTEExamPaperServiceImpl implements MTEExamPaperService {
-
-    @Resource
-    MTEExamPaperRepo mteExamPaperRepo;
-}
+//package com.qmth.themis.backend.mongodb.service.impl;
+//
+//import com.qmth.themis.backend.mongodb.repository.MTEExamPaperRepo;
+//import com.qmth.themis.backend.mongodb.service.MTEExamPaperService;
+//import org.springframework.stereotype.Service;
+//
+//import javax.annotation.Resource;
+//
+///**
+// * @Description: mongodb 考试试卷 服务实现类
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/6
+// */
+//@Service
+//public class MTEExamPaperServiceImpl implements MTEExamPaperService {
+//
+//    @Resource
+//    MTEExamPaperRepo mteExamPaperRepo;
+//}

+ 21 - 21
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEExamServiceImpl.java

@@ -1,21 +1,21 @@
-package com.qmth.themis.backend.mongodb.service.impl;
-
-import com.qmth.themis.backend.mongodb.repository.MTEExamRepo;
-import com.qmth.themis.backend.mongodb.service.MTEExamService;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-
-/**
- * @Description: mongodb 考试批次 服务实现类
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/6
- */
-@Service
-public class MTEExamServiceImpl implements MTEExamService {
-
-    @Resource
-    MTEExamRepo mteExamRepo;
-}
+//package com.qmth.themis.backend.mongodb.service.impl;
+//
+//import com.qmth.themis.backend.mongodb.repository.MTEExamRepo;
+//import com.qmth.themis.backend.mongodb.service.MTEExamService;
+//import org.springframework.stereotype.Service;
+//
+//import javax.annotation.Resource;
+//
+///**
+// * @Description: mongodb 考试批次 服务实现类
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/6
+// */
+//@Service
+//public class MTEExamServiceImpl implements MTEExamService {
+//
+//    @Resource
+//    MTEExamRepo mteExamRepo;
+//}

+ 23 - 23
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEExamStudentServiceImpl.java

@@ -1,23 +1,23 @@
-package com.qmth.themis.backend.mongodb.service.impl;
-
-import com.qmth.themis.backend.mongodb.repository.MTEExamRepo;
-import com.qmth.themis.backend.mongodb.repository.MTEExamStudentRepo;
-import com.qmth.themis.backend.mongodb.service.MTEExamService;
-import com.qmth.themis.backend.mongodb.service.MTEExamStudentService;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-
-/**
- * @Description: mongodb 考生 服务实现类
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/6
- */
-@Service
-public class MTEExamStudentServiceImpl implements MTEExamStudentService {
-
-    @Resource
-    MTEExamStudentRepo mteExamStudentRepo;
-}
+//package com.qmth.themis.backend.mongodb.service.impl;
+//
+//import com.qmth.themis.backend.mongodb.repository.MTEExamRepo;
+//import com.qmth.themis.backend.mongodb.repository.MTEExamStudentRepo;
+//import com.qmth.themis.backend.mongodb.service.MTEExamService;
+//import com.qmth.themis.backend.mongodb.service.MTEExamStudentService;
+//import org.springframework.stereotype.Service;
+//
+//import javax.annotation.Resource;
+//
+///**
+// * @Description: mongodb 考生 服务实现类
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/6
+// */
+//@Service
+//public class MTEExamStudentServiceImpl implements MTEExamStudentService {
+//
+//    @Resource
+//    MTEExamStudentRepo mteExamStudentRepo;
+//}

+ 21 - 21
themis-backend/src/main/java/com/qmth/themis/backend/mongodb/service/impl/MTEStudentServiceImpl.java

@@ -1,21 +1,21 @@
-package com.qmth.themis.backend.mongodb.service.impl;
-
-import com.qmth.themis.backend.mongodb.repository.MTEStudentRepo;
-import com.qmth.themis.backend.mongodb.service.MTEStudentService;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-
-/**
- * @Description: mongodb 学生档案 服务实现类
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/6
- */
-@Service
-public class MTEStudentServiceImpl implements MTEStudentService {
-
-    @Resource
-    MTEStudentRepo mteStudentRepo;
-}
+//package com.qmth.themis.backend.mongodb.service.impl;
+//
+//import com.qmth.themis.backend.mongodb.repository.MTEStudentRepo;
+//import com.qmth.themis.backend.mongodb.service.MTEStudentService;
+//import org.springframework.stereotype.Service;
+//
+//import javax.annotation.Resource;
+//
+///**
+// * @Description: mongodb 学生档案 服务实现类
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/6
+// */
+//@Service
+//public class MTEStudentServiceImpl implements MTEStudentService {
+//
+//    @Resource
+//    MTEStudentRepo mteStudentRepo;
+//}

+ 202 - 202
themis-backend/src/main/java/com/qmth/themis/backend/websocket/WebSocketServer.java

@@ -1,213 +1,213 @@
-package com.qmth.themis.backend.websocket;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-import javax.websocket.*;
-import javax.websocket.server.PathParam;
-import javax.websocket.server.ServerEndpoint;
-import java.io.IOException;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * @Description: websocker服务端
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/10
- */
-@ServerEndpoint("/imserver/{userId}")
-@Component
-public class WebSocketServer
-//        implements MessageListenerConcurrently
-{
-    private final static Logger log = LoggerFactory.getLogger(WebSocketServer.class);
-    /**
-     * 静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。
-     */
-    private static int onlineCount = 0;
-    /**
-     * concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。
-     */
-    private static ConcurrentHashMap<String, WebSocketServer> webSocketMap = new ConcurrentHashMap<>();
-    /**
-     * 与某个客户端的连接会话,需要通过它来给客户端发送数据
-     */
-    private Session session;
-    /**
-     * 接收userId
-     */
-    private String userId = null;
-
-    /**
-     * 连接建立成功调用的方法
-     */
-    @OnOpen
-    public void onOpen(Session session, @PathParam("userId") String userId) {
-        this.session = session;
-        this.userId = userId;
-        if (webSocketMap.containsKey(userId)) {
-            webSocketMap.remove(userId);
-            webSocketMap.put(userId, this);
-            //加入set中
-        } else {
-            webSocketMap.put(userId, this);
-            //加入set中
-            addOnlineCount();
-            //在线数加1
-        }
-        log.info("用户连接:" + userId + ",当前在线人数为:" + getOnlineCount());
-        try {
-            sendMessage("连接成功");
-        } catch (IOException e) {
-            log.error("用户:" + userId + ",网络异常!!!!!!");
-        }
-    }
-
-    /**
-     * 连接关闭调用的方法
-     */
-    @OnClose
-    public void onClose() {
-        if (webSocketMap.containsKey(userId)) {
-            webSocketMap.remove(userId);
-            //从set中删除
-            subOnlineCount();
-        }
-        log.info("用户退出:" + userId + ",当前在线人数为:" + getOnlineCount());
-    }
-
-    /**
-     * 收到客户端消息后调用的方法
-     *
-     * @param message 客户端发送过来的消息
-     */
-    @OnMessage
-    public void onMessage(String message, Session session) {
-        log.info("用户消息:" + userId + ",报文:" + message);
-        //可以群发消息
-        //消息保存到数据库、redis
-        if (StringUtils.isNotBlank(message)) {
-            try {
-                //解析发送的报文
-                JSONObject jsonObject = JSON.parseObject(message);
-                //追加发送人(防止串改)
-                jsonObject.put("fromUserId", this.userId);
-                String toUserId = jsonObject.getString("toUserId");
-                //传送给对应toUserId用户的websocket
-                if (StringUtils.isNotBlank(toUserId) && webSocketMap.containsKey(toUserId)) {
-                    webSocketMap.get(toUserId).sendMessage(jsonObject.toJSONString());
-                } else {
-                    log.error("请求的userId:" + toUserId + "不在该服务器上");
-                    //否则不在这个服务器上,发送到mysql或者redis
-                }
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-    }
-
-    /**
-     * @param session
-     * @param error
-     */
-    @OnError
-    public void onError(Session session, Throwable error) {
-        log.error("用户错误:" + this.userId + ",原因:" + error.getMessage());
-        error.printStackTrace();
-    }
-
-    /**
-     * 实现服务器主动推送
-     */
-    public void sendMessage(String message) throws IOException {
-        this.session.getBasicRemote().sendText(message);
-    }
-
-
-    /**
-     * 发送自定义消息
-     */
-    public static void sendInfo(String message, @PathParam("userId") String userId) throws IOException {
-        log.info("发送消息到:" + userId + ",报文:" + message);
-        if (StringUtils.isNotBlank(userId) && webSocketMap.containsKey(userId)) {
-            webSocketMap.get(userId).sendMessage(message);
-        } else {
-            log.error("用户" + userId + ",不在线!");
-        }
-    }
-
-    public void wxappPhotoReady(){
-        log.info("wxappPhotoReady is come in");
-    }
-
-    public static synchronized int getOnlineCount() {
-        return onlineCount;
-    }
-
-    public static synchronized void addOnlineCount() {
-        WebSocketServer.onlineCount++;
-    }
-
-    public static synchronized void subOnlineCount() {
-        WebSocketServer.onlineCount--;
-    }
-
-//    @Override
-//    public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> msgs, ConsumeConcurrentlyContext consumeConcurrentlyContext) {
+//package com.qmth.themis.backend.websocket;
+//
+//import com.alibaba.fastjson.JSON;
+//import com.alibaba.fastjson.JSONObject;
+//import org.apache.commons.lang3.StringUtils;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//import org.springframework.stereotype.Component;
+//
+//import javax.websocket.*;
+//import javax.websocket.server.PathParam;
+//import javax.websocket.server.ServerEndpoint;
+//import java.io.IOException;
+//import java.util.concurrent.ConcurrentHashMap;
+//
+///**
+// * @Description: websocker服务端
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2020/7/10
+// */
+//@ServerEndpoint("/imserver/{userId}")
+//@Component
+//public class WebSocketServer
+////        implements MessageListenerConcurrently
+//{
+//    private final static Logger log = LoggerFactory.getLogger(WebSocketServer.class);
+//    /**
+//     * 静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。
+//     */
+//    private static int onlineCount = 0;
+//    /**
+//     * concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。
+//     */
+//    private static ConcurrentHashMap<String, WebSocketServer> webSocketMap = new ConcurrentHashMap<>();
+//    /**
+//     * 与某个客户端的连接会话,需要通过它来给客户端发送数据
+//     */
+//    private Session session;
+//    /**
+//     * 接收userId
+//     */
+//    private String userId = null;
+//
+//    /**
+//     * 连接建立成功调用的方法
+//     */
+//    @OnOpen
+//    public void onOpen(Session session, @PathParam("userId") String userId) {
+//        this.session = session;
+//        this.userId = userId;
+//        if (webSocketMap.containsKey(userId)) {
+//            webSocketMap.remove(userId);
+//            webSocketMap.put(userId, this);
+//            //加入set中
+//        } else {
+//            webSocketMap.put(userId, this);
+//            //加入set中
+//            addOnlineCount();
+//            //在线数加1
+//        }
+//        log.info("用户连接:" + userId + ",当前在线人数为:" + getOnlineCount());
 //        try {
-//            long threadId = Thread.currentThread().getId();
-//            String threadName = Thread.currentThread().getName();
-//            for (MessageExt messageExt : msgs) {
-//                log.info(":{}-:{} websocketConsumer 重试次数:{}", threadId, threadName, messageExt.getReconsumeTimes());
-//                MqDto mqDto = JacksonUtil.readJson(new String(messageExt.getBody(), Constants.CHARSET), MqDto.class);
-//                log.info(":{}-:{} websocketConsumer 接收到的消息:{}", threadId, threadName, JacksonUtil.parseJson(mqDto));
-//                log.info(":{}-:{} websocketConsumer mqDto sequence:{},tag:{}", threadId, threadName, mqDto.getSequence(), mqDto.getTag());
-//                Map map = mqDto.getProperties();
-//                String body = JacksonUtil.parseJson(mqDto.getBody());
-//                log.info("map:{},body:{}", JacksonUtil.parseJson(map), body);
-//                String model = String.valueOf(map.get("model"));
-//                MessageModel messageModel = MessageModel.valueOf(model);
-//                if (messageModel.ordinal() == MessageModel.CLUSTERING.ordinal()) {
-//                    webSocketMap.get(map.get("toUserId")).sendMessage(body);
+//            sendMessage("连接成功");
+//        } catch (IOException e) {
+//            log.error("用户:" + userId + ",网络异常!!!!!!");
+//        }
+//    }
+//
+//    /**
+//     * 连接关闭调用的方法
+//     */
+//    @OnClose
+//    public void onClose() {
+//        if (webSocketMap.containsKey(userId)) {
+//            webSocketMap.remove(userId);
+//            //从set中删除
+//            subOnlineCount();
+//        }
+//        log.info("用户退出:" + userId + ",当前在线人数为:" + getOnlineCount());
+//    }
+//
+//    /**
+//     * 收到客户端消息后调用的方法
+//     *
+//     * @param message 客户端发送过来的消息
+//     */
+//    @OnMessage
+//    public void onMessage(String message, Session session) {
+//        log.info("用户消息:" + userId + ",报文:" + message);
+//        //可以群发消息
+//        //消息保存到数据库、redis
+//        if (StringUtils.isNotBlank(message)) {
+//            try {
+//                //解析发送的报文
+//                JSONObject jsonObject = JSON.parseObject(message);
+//                //追加发送人(防止串改)
+//                jsonObject.put("fromUserId", this.userId);
+//                String toUserId = jsonObject.getString("toUserId");
+//                //传送给对应toUserId用户的websocket
+//                if (StringUtils.isNotBlank(toUserId) && webSocketMap.containsKey(toUserId)) {
+//                    webSocketMap.get(toUserId).sendMessage(jsonObject.toJSONString());
 //                } else {
-//                    webSocketMap.forEach((k, v) -> {
-//                        try {
-//                            v.sendMessage(body);
-//                        } catch (IOException e) {
-//                            e.printStackTrace();
-//                        }
-//                    });
+//                    log.error("请求的userId:" + toUserId + "不在该服务器上");
+//                    //否则不在这个服务器上,发送到mysql或者redis
 //                }
+//            } catch (Exception e) {
+//                e.printStackTrace();
 //            }
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//            return ConsumeConcurrentlyStatus.RECONSUME_LATER;//重试
 //        }
-//        return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;//成功
 //    }
 //
-//    @Service
-//    @RocketMQMessageListener(consumerGroup = "websocketConsumerImGroup", topic = "websocketImTopic", selectorType = SelectorType.TAG, selectorExpression = "*")
-//    public class sessionConsumerWeb implements RocketMQListener<Message>, RocketMQPushConsumerLifecycleListener {
+//    /**
+//     * @param session
+//     * @param error
+//     */
+//    @OnError
+//    public void onError(Session session, Throwable error) {
+//        log.error("用户错误:" + this.userId + ",原因:" + error.getMessage());
+//        error.printStackTrace();
+//    }
+//
+//    /**
+//     * 实现服务器主动推送
+//     */
+//    public void sendMessage(String message) throws IOException {
+//        this.session.getBasicRemote().sendText(message);
+//    }
 //
-//        @Override
-//        public void onMessage(Message message) {
-//            //实现RocketMQPushConsumerLifecycleListener监听器之后,此方法不调用
-//        }
 //
-//        @Override
-//        public void prepareStart(DefaultMQPushConsumer defaultMQPushConsumer) {
-//            defaultMQPushConsumer.setConsumeMessageBatchMaxSize(SystemConstant.CONSUME_MESSAGE_BATCH_MAX_SIZE);//每次拉取10条
-//            defaultMQPushConsumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_FIRST_OFFSET);
-//            defaultMQPushConsumer.setMaxReconsumeTimes(SystemConstant.MAXRECONSUMETIMES);//最大重试次数
-////            defaultMQPushConsumer.setMessageModel(MessageModel.BROADCASTING);
-//            defaultMQPushConsumer.registerMessageListener(WebSocketServer.this::consumeMessage);
+//    /**
+//     * 发送自定义消息
+//     */
+//    public static void sendInfo(String message, @PathParam("userId") String userId) throws IOException {
+//        log.info("发送消息到:" + userId + ",报文:" + message);
+//        if (StringUtils.isNotBlank(userId) && webSocketMap.containsKey(userId)) {
+//            webSocketMap.get(userId).sendMessage(message);
+//        } else {
+//            log.error("用户" + userId + ",不在线!");
 //        }
 //    }
-}
-
+//
+//    public void wxappPhotoReady(){
+//        log.info("wxappPhotoReady is come in");
+//    }
+//
+//    public static synchronized int getOnlineCount() {
+//        return onlineCount;
+//    }
+//
+//    public static synchronized void addOnlineCount() {
+//        WebSocketServer.onlineCount++;
+//    }
+//
+//    public static synchronized void subOnlineCount() {
+//        WebSocketServer.onlineCount--;
+//    }
+//
+////    @Override
+////    public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> msgs, ConsumeConcurrentlyContext consumeConcurrentlyContext) {
+////        try {
+////            long threadId = Thread.currentThread().getId();
+////            String threadName = Thread.currentThread().getName();
+////            for (MessageExt messageExt : msgs) {
+////                log.info(":{}-:{} websocketConsumer 重试次数:{}", threadId, threadName, messageExt.getReconsumeTimes());
+////                MqDto mqDto = JacksonUtil.readJson(new String(messageExt.getBody(), Constants.CHARSET), MqDto.class);
+////                log.info(":{}-:{} websocketConsumer 接收到的消息:{}", threadId, threadName, JacksonUtil.parseJson(mqDto));
+////                log.info(":{}-:{} websocketConsumer mqDto sequence:{},tag:{}", threadId, threadName, mqDto.getSequence(), mqDto.getTag());
+////                Map map = mqDto.getProperties();
+////                String body = JacksonUtil.parseJson(mqDto.getBody());
+////                log.info("map:{},body:{}", JacksonUtil.parseJson(map), body);
+////                String model = String.valueOf(map.get("model"));
+////                MessageModel messageModel = MessageModel.valueOf(model);
+////                if (messageModel.ordinal() == MessageModel.CLUSTERING.ordinal()) {
+////                    webSocketMap.get(map.get("toUserId")).sendMessage(body);
+////                } else {
+////                    webSocketMap.forEach((k, v) -> {
+////                        try {
+////                            v.sendMessage(body);
+////                        } catch (IOException e) {
+////                            e.printStackTrace();
+////                        }
+////                    });
+////                }
+////            }
+////        } catch (Exception e) {
+////            e.printStackTrace();
+////            return ConsumeConcurrentlyStatus.RECONSUME_LATER;//重试
+////        }
+////        return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;//成功
+////    }
+////
+////    @Service
+////    @RocketMQMessageListener(consumerGroup = "websocketConsumerImGroup", topic = "websocketImTopic", selectorType = SelectorType.TAG, selectorExpression = "*")
+////    public class sessionConsumerWeb implements RocketMQListener<Message>, RocketMQPushConsumerLifecycleListener {
+////
+////        @Override
+////        public void onMessage(Message message) {
+////            //实现RocketMQPushConsumerLifecycleListener监听器之后,此方法不调用
+////        }
+////
+////        @Override
+////        public void prepareStart(DefaultMQPushConsumer defaultMQPushConsumer) {
+////            defaultMQPushConsumer.setConsumeMessageBatchMaxSize(SystemConstant.CONSUME_MESSAGE_BATCH_MAX_SIZE);//每次拉取10条
+////            defaultMQPushConsumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_FIRST_OFFSET);
+////            defaultMQPushConsumer.setMaxReconsumeTimes(SystemConstant.MAXRECONSUMETIMES);//最大重试次数
+//////            defaultMQPushConsumer.setMessageModel(MessageModel.BROADCASTING);
+////            defaultMQPushConsumer.registerMessageListener(WebSocketServer.this::consumeMessage);
+////        }
+////    }
+//}
+//

+ 1 - 0
themis-business/src/main/java/com/qmth/themis/business/constant/SystemConstant.java

@@ -21,6 +21,7 @@ public class SystemConstant {
      */
     public static final String ACCESS_TOKEN = "accessToken";
     public static final String SESSION_ID = "sessionId";
+    public static final String ORG_INFO = "orgInfo";
     /**
      * 阿里云oss
      */

+ 17 - 11
themis-business/src/main/java/com/qmth/themis/business/dto/AuthDto.java

@@ -1,5 +1,6 @@
 package com.qmth.themis.business.dto;
 
+import com.qmth.themis.business.entity.TBOrg;
 import com.qmth.themis.business.enums.RoleEnum;
 
 import java.io.Serializable;
@@ -15,30 +16,35 @@ import java.util.Set;
 public class AuthDto implements Serializable {
     private static final long serialVersionUID = 1L;
 
-    private RoleEnum roleEnum;
     private Set<String> roleCodes;
     private Set<String> urls;
+    private TBOrg tbOrg;
+
+    public TBOrg getTbOrg() {
+        return tbOrg;
+    }
+
+    public void setTbOrg(TBOrg tbOrg) {
+        this.tbOrg = tbOrg;
+    }
 
     public AuthDto() {
 
     }
 
-    public AuthDto(RoleEnum roleEnum, Set<String> roleCodes, Set<String> urls) {
-        this.roleEnum = roleEnum;
+    public AuthDto(Set<String> roleCodes, Set<String> urls) {
         this.roleCodes = roleCodes;
         this.urls = urls;
     }
 
-    public static long getSerialVersionUID() {
-        return serialVersionUID;
-    }
-
-    public RoleEnum getRoleEnum() {
-        return roleEnum;
+    public AuthDto(Set<String> roleCodes, Set<String> urls, TBOrg tbOrg) {
+        this.roleCodes = roleCodes;
+        this.urls = urls;
+        this.tbOrg = tbOrg;
     }
 
-    public void setRoleEnum(RoleEnum roleEnum) {
-        this.roleEnum = roleEnum;
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
     }
 
     public Set<String> getRoleCodes() {

+ 6 - 6
themis-business/src/main/java/com/qmth/themis/business/entity/TBOrg.java

@@ -16,8 +16,8 @@ import io.swagger.annotations.ApiModelProperty;
 public class TBOrg extends BaseEntity {
 
     @ApiModelProperty(value = "机构代码,通常用学校简称表示,全局唯一")
-    @TableField(value = "org_code")
-    private String orgCode;
+    @TableField(value = "code")
+    private String code;
 
     @ApiModelProperty(value = "名称")
     @TableField(value = "name")
@@ -95,12 +95,12 @@ public class TBOrg extends BaseEntity {
         this.enableVideoRecord = enableVideoRecord;
     }
 
-    public String getOrgCode() {
-        return orgCode;
+    public String getCode() {
+        return code;
     }
 
-    public void setOrgCode(String orgCode) {
-        this.orgCode = orgCode;
+    public void setCode(String code) {
+        this.code = code;
     }
 
     public String getName() {

+ 8 - 6
themis-business/src/main/java/com/qmth/themis/business/service/impl/EhcacheServiceImpl.java

@@ -3,10 +3,7 @@ package com.qmth.themis.business.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.AuthDto;
-import com.qmth.themis.business.entity.TBPrivilege;
-import com.qmth.themis.business.entity.TBRolePrivilege;
-import com.qmth.themis.business.entity.TBUser;
-import com.qmth.themis.business.entity.TBUserRole;
+import com.qmth.themis.business.entity.*;
 import com.qmth.themis.business.enums.RoleEnum;
 import com.qmth.themis.business.service.*;
 import com.qmth.themis.business.util.EhcacheUtil;
@@ -18,6 +15,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.util.List;
+import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
 import java.util.stream.Collectors;
@@ -45,6 +43,9 @@ public class EhcacheServiceImpl implements EhcacheService {
     @Resource
     TBUserService tbUserService;
 
+    @Resource
+    TBOrgService tbOrgService;
+
     /**
      * 添加用户缓存
      *
@@ -76,9 +77,10 @@ public class EhcacheServiceImpl implements EhcacheService {
                     QueryWrapper<TBPrivilege> pWrapper = new QueryWrapper<>();
                     pWrapper.lambda().eq(TBPrivilege::getType, SystemConstant.LINK);
                     List<TBPrivilege> tbPrivilegeList = tbPrivilegeService.list(pWrapper);
-                    authDto = new AuthDto(RoleEnum.SUPER_ADMIN, tbUserRoleList.stream().map(s -> s.getRoleCode()).collect(Collectors.toSet()), tbPrivilegeList.stream().map(s -> s.getUrl()).collect(Collectors.toSet()));
+                    authDto = new AuthDto(tbUserRoleList.stream().map(s -> s.getRoleCode()).collect(Collectors.toSet()), tbPrivilegeList.stream().map(s -> s.getUrl()).collect(Collectors.toSet()));
                     EhcacheUtil.put(SystemConstant.AUTH_CACHE, user.getId(), authDto);
                 } else {
+                    TBOrg tbOrg = tbOrgService.getById(user.getOrgId());
                     //根据角色名查权限
                     Set<String> roleCodes = tbUserRoleList.stream().map(s -> s.getRoleCode()).collect(Collectors.toSet());
                     QueryWrapper<TBRolePrivilege> rpWrapper = new QueryWrapper<>();
@@ -88,7 +90,7 @@ public class EhcacheServiceImpl implements EhcacheService {
                     QueryWrapper<TBPrivilege> pWrapper = new QueryWrapper<>();
                     pWrapper.lambda().in(TBPrivilege::getId, privilegeIds).eq(TBPrivilege::getType, SystemConstant.LINK);
                     List<TBPrivilege> tbPrivilegeList = tbPrivilegeService.list(pWrapper);
-                    authDto = new AuthDto(RoleEnum.valueOf(tbRolePrivilegeList.get(0).getRoleCode()), tbUserRoleList.stream().map(s -> s.getRoleCode()).collect(Collectors.toSet()), tbPrivilegeList.stream().map(s -> s.getUrl()).collect(Collectors.toSet()));
+                    authDto = new AuthDto(roleCodes, tbPrivilegeList.stream().map(s -> s.getUrl()).collect(Collectors.toSet()), tbOrg);
                     EhcacheUtil.put(SystemConstant.AUTH_CACHE, user.getId(), authDto);
                 }
             }