Ver código fonte

Merge remote-tracking branch 'origin/dev' into dev

wangliang 4 anos atrás
pai
commit
ecbb814bf2
19 arquivos alterados com 182 adições e 71 exclusões
  1. 11 3
      themis-backend/src/main/java/com/qmth/themis/backend/api/TIeReportController.java
  2. 2 0
      themis-business/src/main/java/com/qmth/themis/business/dao/TEExamActivityMapper.java
  3. 2 4
      themis-business/src/main/java/com/qmth/themis/business/dao/TEExamBreachLogMapper.java
  4. 1 1
      themis-business/src/main/java/com/qmth/themis/business/dao/TEExamReexamMapper.java
  5. 3 3
      themis-business/src/main/java/com/qmth/themis/business/dao/TEExamStudentMapper.java
  6. 1 3
      themis-business/src/main/java/com/qmth/themis/business/dao/TIeInvigilateExceptionInfoMapper.java
  7. 1 1
      themis-business/src/main/java/com/qmth/themis/business/dao/TIeInvigilateWarnInfoMapper.java
  8. 11 11
      themis-business/src/main/java/com/qmth/themis/business/dao/TOeExamRecordMapper.java
  9. 2 0
      themis-business/src/main/java/com/qmth/themis/business/service/TEExamActivityService.java
  10. 3 3
      themis-business/src/main/java/com/qmth/themis/business/service/TIeReportService.java
  11. 5 0
      themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamActivityServiceImpl.java
  12. 58 36
      themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeReportServiceImpl.java
  13. 9 0
      themis-business/src/main/resources/mapper/TEExamActivityMapper.xml
  14. 10 4
      themis-business/src/main/resources/mapper/TEExamBreachLogMapper.xml
  15. 4 0
      themis-business/src/main/resources/mapper/TEExamReexamMapper.xml
  16. 12 2
      themis-business/src/main/resources/mapper/TEExamStudentMapper.xml
  17. 4 0
      themis-business/src/main/resources/mapper/TIeInvigilateExceptionInfoMapper.xml
  18. 5 0
      themis-business/src/main/resources/mapper/TIeInvigilateWarnInfoMapper.xml
  19. 38 0
      themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

+ 11 - 3
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeReportController.java

@@ -1,8 +1,10 @@
 package com.qmth.themis.backend.api;
 
 import com.qmth.themis.business.bean.backend.InvigilateListPatrolReportBean;
+import com.qmth.themis.business.entity.TBUser;
 import com.qmth.themis.business.service.TIeReportService;
 import com.qmth.themis.business.util.RedisUtil;
+import com.qmth.themis.business.util.ServletUtil;
 import com.qmth.themis.common.util.Result;
 import com.qmth.themis.common.util.ResultUtil;
 import io.swagger.annotations.*;
@@ -40,7 +42,9 @@ public class TIeReportController {
                            @ApiParam(value = "科目编码", required = false) @RequestParam(required = false) String courseCode,
                            @ApiParam(value = "姓名", required = false) @RequestParam(required = false) String name,
                            @ApiParam(value = "唯一码", required = false) @RequestParam(required = false) String identity) {
-        return ResultUtil.ok(reportService.examView(examId, examActivityId, roomCode, courseCode, name, identity));
+        TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        Long orgId=tbUser.getOrgId();
+        return ResultUtil.ok(reportService.examView(orgId,examId, examActivityId, roomCode, courseCode, name, identity));
     }
 
     @ApiOperation(value = "情况统计")
@@ -54,7 +58,9 @@ public class TIeReportController {
                                 @ApiParam(value = "唯一码", required = false) @RequestParam(required = false) String identity,
                                 @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
                                 @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
-        return ResultUtil.ok(reportService.examViewCount(examId, examActivityId, roomCode, courseCode, name, identity, pageNumber, pageSize));
+    	TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        Long orgId=tbUser.getOrgId();
+        return ResultUtil.ok(reportService.examViewCount(orgId,examId, examActivityId, roomCode, courseCode, name, identity, pageNumber, pageSize));
     }
 
     @ApiOperation(value = "缺考名单")
@@ -68,7 +74,9 @@ public class TIeReportController {
                                      @ApiParam(value = "唯一码", required = false) @RequestParam(required = false) String identity,
                                      @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
                                      @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
-        return ResultUtil.ok(reportService.examDeficiencyList(examId, examActivityId, roomCode, courseCode, name, identity, pageNumber, pageSize));
+    	TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        Long orgId=tbUser.getOrgId();
+        return ResultUtil.ok(reportService.examDeficiencyList(orgId,examId, examActivityId, roomCode, courseCode, name, identity, pageNumber, pageSize));
     }
 
     @ApiOperation(value = "异常处理")

+ 2 - 0
themis-business/src/main/java/com/qmth/themis/business/dao/TEExamActivityMapper.java

@@ -84,4 +84,6 @@ public interface TEExamActivityMapper extends BaseMapper<TEExamActivity> {
      * @return
      */
     public List<TEExamActivityDto> getWaitingExam(@Param("studentId") Long studentId, @Param("examActivityIds") Set<Long> examActivityIds, @Param("mode") String mode);
+
+	public List<TEExamActivity> findByExamIdAndOrgId(@Param("examId")Long examId,@Param("orgId") Long orgId);
 }

+ 2 - 4
themis-business/src/main/java/com/qmth/themis/business/dao/TEExamBreachLogMapper.java

@@ -1,7 +1,5 @@
 package com.qmth.themis.business.dao;
 
-import java.util.List;
-
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -20,13 +18,13 @@ import com.qmth.themis.business.entity.TEExamBreachLog;
  */
 @Mapper
 public interface TEExamBreachLogMapper extends BaseMapper<TEExamBreachLog> {
-	public IPage<ExamBreachListBean> getExamBreachPage(IPage<ExamBreachListBean> iPage, @Param("examId") Long examId,
+	public IPage<ExamBreachListBean> getExamBreachPage(IPage<ExamBreachListBean> iPage,@Param("orgId") Long orgId, @Param("examId") Long examId,
 			@Param("activityId") Long activityId, @Param("roomCode") String roomCode,
 			@Param("courseCode") String courseCode, @Param("name") String name, @Param("identity") String identity);
 	
 	public IPage<ExamBreachDetailListBean> getExamBreachDetailList(IPage<ExamBreachDetailListBean> iPage,@Param("examStudentId") Long examStudentId,@Param("status") Integer status);
 
-	public IPage<ExamBreachListBean> getExamRevokeBreachPage(IPage<ExamBreachListBean> iPage, @Param("examId") Long examId,
+	public IPage<ExamBreachListBean> getExamRevokeBreachPage(IPage<ExamBreachListBean> iPage, @Param("orgId") Long orgId,@Param("examId") Long examId,
 			@Param("activityId") Long activityId, @Param("roomCode") String roomCode,
 			@Param("courseCode") String courseCode, @Param("name") String name, @Param("identity") String identity);
 }

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/dao/TEExamReexamMapper.java

@@ -117,7 +117,7 @@ public interface TEExamReexamMapper extends BaseMapper<TEExamReexam> {
                                                         @Param("userId") Long userId,
                                                         @Param("orgId") Long orgId);
 
-    public IPage<ExamReexamListBean> getExamReexamPage(IPage<ExamReexamListBean> iPage, @Param("examId") Long examId,
+    public IPage<ExamReexamListBean> getExamReexamPage(IPage<ExamReexamListBean> iPage,@Param("orgId") Long orgId, @Param("examId") Long examId,
                                                        @Param("activityId") Long activityId, @Param("roomCode") String roomCode,
                                                        @Param("courseCode") String courseCode, @Param("name") String name, @Param("identity") String identity);
 }

+ 3 - 3
themis-business/src/main/java/com/qmth/themis/business/dao/TEExamStudentMapper.java

@@ -46,10 +46,10 @@ public interface TEExamStudentMapper extends BaseMapper<TEExamStudent> {
                                                     @Param("roomCode") String roomCode, @Param("courseCode") String courseCode, @Param("grade") String grade,
                                                     @Param("enable") Integer enable, @Param("classNo") String classNo, @Param("hasPhoto") Integer hasPhoto);
 
-    public List<Map<String, Object>> getTotalCount(@Param("examId") Long examId, @Param("activityId") Long activityId,
+    public List<Map<String, Object>> getTotalCount(@Param("orgId")Long orgId,@Param("examId") Long examId, @Param("activityId") Long activityId,
                                                    @Param("roomCode") String roomCode, @Param("courseCode") String courseCode);
 
-    public IPage<ExamViewCountListBean> getTotalCountInfo(IPage<Map> iPage, @Param("examId") Long examId, @Param("activityId") Long activityId,
+    public IPage<ExamViewCountListBean> getTotalCountInfo(IPage<Map> iPage,@Param("orgId")Long orgId, @Param("examId") Long examId, @Param("activityId") Long activityId,
                                                           @Param("roomCode") String roomCode, @Param("courseCode") String courseCode);
 
     public List<Map<String, Object>> getDoneCountByActivityIds(@Param("examId") Long examId, @Param("activityIds") List<Long> activityIds);
@@ -68,7 +68,7 @@ public interface TEExamStudentMapper extends BaseMapper<TEExamStudent> {
                                                                @Param("activityId") Long activityId, @Param("roomCode") String roomCode,
                                                                @Param("courseCode") String courseCode, @Param("name") String name, @Param("identity") String identity, @Param("activityIds") List<Long> activityIds);
 
-    public IPage<ExamStudentLogListBean> getPageForStudentLog(IPage<ExamStudentLogListBean> iPage, @Param("examId") Long examId,
+    public IPage<ExamStudentLogListBean> getPageForStudentLog(IPage<ExamStudentLogListBean> iPage,@Param("orgId") Long orgId,@Param("examId") Long examId,
                                                               @Param("activityId") Long activityId, @Param("roomCode") String roomCode,
                                                               @Param("courseCode") String courseCode, @Param("name") String name, @Param("identity") String identity);
 

+ 1 - 3
themis-business/src/main/java/com/qmth/themis/business/dao/TIeInvigilateExceptionInfoMapper.java

@@ -1,7 +1,5 @@
 package com.qmth.themis.business.dao;
 
-import java.util.List;
-
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -20,7 +18,7 @@ import com.qmth.themis.business.entity.TIeInvigilateExceptionInfo;
  */
 @Mapper
 public interface TIeInvigilateExceptionInfoMapper extends BaseMapper<TIeInvigilateExceptionInfo> {
-	public IPage<ExamExceptionListBean> getExamExceptionPage(IPage<ExamExceptionListBean> iPage, @Param("examId") Long examId,
+	public IPage<ExamExceptionListBean> getExamExceptionPage(IPage<ExamExceptionListBean> iPage, @Param("orgId") Long orgId,@Param("examId") Long examId,
 			@Param("activityId") Long activityId, @Param("roomCode") String roomCode,
 			@Param("courseCode") String courseCode, @Param("name") String name, @Param("identity") String identity);
 	

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/dao/TIeInvigilateWarnInfoMapper.java

@@ -45,5 +45,5 @@ public interface TIeInvigilateWarnInfoMapper extends BaseMapper<TIeInvigilateWar
      */
     public List<TIeWarningNotifyDto> warningMessage(@Param("examId") Long examId, @Param("userId") Long userId, @Param("orgId") Long orgId);
 
-    public List<WarningNotifyBean> findLastMsg(@Param("conut") Integer conut);
+    public List<WarningNotifyBean> findLastMsg(@Param("conut") Integer conut,@Param("orgId") Long orgId);
 }

+ 11 - 11
themis-business/src/main/java/com/qmth/themis/business/dao/TOeExamRecordMapper.java

@@ -305,10 +305,10 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
                                                                       @Param("userId") Long userId,
                                                                       @Param("orgId") Long orgId);
 
-    public List<Map<String, Object>> getDoneCount(@Param("examId") Long examId, @Param("activityId") Long activityId,
+    public List<Map<String, Object>> getDoneCount(@Param("orgId")Long orgId,@Param("examId") Long examId, @Param("activityId") Long activityId,
                                                   @Param("roomCode") String roomCode, @Param("courseCode") String courseCode);
 
-    public List<Map<String, Object>> getDoneCountByDay(@Param("examId") Long examId, @Param("activityId") Long activityId,
+    public List<Map<String, Object>> getDoneCountByDay(@Param("orgId")Long orgId,@Param("examId") Long examId, @Param("activityId") Long activityId,
                                                        @Param("roomCode") String roomCode, @Param("courseCode") String courseCode);
 
     public Long getCountByExamId(@Param("examId") Long examId);
@@ -326,25 +326,25 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param userId
      * @return
      */
-    public List<InvigilateListPatrolReportBean> patrolReport(@Param("examId") Long examId, @Param("userId") Long userId);
+    public List<InvigilateListPatrolReportBean> patrolReport(@Param("orgId") Long orgId,@Param("examId") Long examId, @Param("userId") Long userId);
 
     public TOeExamRecord findOneByExamId(@Param("examId") Long examId, @Param("status") String status);
 
-    public Long getExamingCount();
+    public Long getExamingCount(@Param("orgId") Long orgId);
 
-    public Long getOnlineCount();
+    public Long getOnlineCount(@Param("orgId") Long orgId);
 
-    public Long getExceptionCount();
+    public Long getExceptionCount(@Param("orgId") Long orgId);
 
-    public Long getWarnCount();
+    public Long getWarnCount(@Param("orgId") Long orgId);
 
-    public List<Map<String, Object>> getOrgExamingCount();
+    public List<Map<String, Object>> getOrgExamingCount(@Param("orgId") Long orgId);
 
-    public List<Map<String, Object>> getOrgDistribution();
+    public List<Map<String, Object>> getOrgDistribution(@Param("orgId") Long orgId);
 
-    public List<Map<String, Object>> getTypeDistribution();
+    public List<Map<String, Object>> getTypeDistribution(@Param("orgId") Long orgId);
 
-    public List<ExaminationMonitorHourWarnCountBean> getWarnTrend(@Param("startTime") Long startTime);
+    public List<ExaminationMonitorHourWarnCountBean> getWarnTrend(@Param("orgId") Long orgId,@Param("startTime") Long startTime);
 
     public void updateHasAnswerFile(@Param("recordId") Long recordId, @Param("hasAnswerFile") Integer hasAnswerFile);
 

+ 2 - 0
themis-business/src/main/java/com/qmth/themis/business/service/TEExamActivityService.java

@@ -105,4 +105,6 @@ public interface TEExamActivityService extends IService<TEExamActivity> {
      * @param examActivityId
      */
     void deleteExamActivityCacheBean(Long examActivityId);
+
+	public List<TEExamActivity> findByExamIdAndOrgId(Long examId, Long orgId);
 }

+ 3 - 3
themis-business/src/main/java/com/qmth/themis/business/service/TIeReportService.java

@@ -7,13 +7,13 @@ import java.util.List;
 import java.util.Map;
 
 public interface TIeReportService {
-    public Map<String, Object> examView(Long examId, Long examActivityId, String roomCode, String courseCode,
+    public Map<String, Object> examView(Long orgId,Long examId, Long examActivityId, String roomCode, String courseCode,
                                         String name, String identity);
 
-    public IPage examViewCount(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
+    public IPage examViewCount(Long orgId,Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                String identity, int pageNumber, int pageSize);
 
-    public IPage examDeficiencyList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
+    public IPage examDeficiencyList(Long orgId,Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                     String identity, int pageNumber, int pageSize);
 
     public IPage examExceptionList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,

+ 5 - 0
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamActivityServiceImpl.java

@@ -172,4 +172,9 @@ public class TEExamActivityServiceImpl extends ServiceImpl<TEExamActivityMapper,
         ret.setEnable(ac.getEnable());
         return ret;
     }
+
+	@Override
+	public List<TEExamActivity> findByExamIdAndOrgId(Long examId, Long orgId) {
+		return teExamActivityMapper.findByExamIdAndOrgId(examId,orgId);
+	}
 }

+ 58 - 36
themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeReportServiceImpl.java

@@ -14,7 +14,6 @@ import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.time.DateUtils;
 import org.springframework.stereotype.Service;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.OrderItem;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -43,6 +42,7 @@ import com.qmth.themis.business.dao.TEExamStudentMapper;
 import com.qmth.themis.business.dao.TIeInvigilateExceptionInfoMapper;
 import com.qmth.themis.business.dao.TIeInvigilateWarnInfoMapper;
 import com.qmth.themis.business.dao.TOeExamRecordMapper;
+import com.qmth.themis.business.entity.TBUser;
 import com.qmth.themis.business.entity.TEExamActivity;
 import com.qmth.themis.business.enums.BreachCancelTypeEnum;
 import com.qmth.themis.business.enums.BreachTypeEnum;
@@ -53,6 +53,7 @@ import com.qmth.themis.business.service.TEExamActivityService;
 import com.qmth.themis.business.service.TEExamService;
 import com.qmth.themis.business.service.TIeReportService;
 import com.qmth.themis.business.util.RedisUtil;
+import com.qmth.themis.business.util.ServletUtil;
 
 @Service
 public class TIeReportServiceImpl implements TIeReportService {
@@ -94,11 +95,11 @@ public class TIeReportServiceImpl implements TIeReportService {
     private RedisUtil redisUtil;
 
     @Override
-    public Map<String, Object> examView(Long examId, Long examActivityId, String roomCode, String courseCode,
+    public Map<String, Object> examView(Long orgId,Long examId, Long examActivityId, String roomCode, String courseCode,
                                         String name, String identity) {
         // 应考人数
         Long totalNum = 0L;
-        List<Map<String, Object>> total = examStudentMapper.getTotalCount(examId, examActivityId, roomCode, courseCode);
+        List<Map<String, Object>> total = examStudentMapper.getTotalCount(orgId,examId, examActivityId, roomCode, courseCode);
         Map<Long, Long> totalMap = new HashMap<Long, Long>();
         for (Map<String, Object> map : total) {
             Long acId = (Long) map.get("activityId");
@@ -108,7 +109,7 @@ public class TIeReportServiceImpl implements TIeReportService {
         }
         // 实考人数
         Long doneNum = 0L;
-        List<Map<String, Object>> doneCount = examRecordMapper.getDoneCount(examId, examActivityId, roomCode,
+        List<Map<String, Object>> doneCount = examRecordMapper.getDoneCount(orgId,examId, examActivityId, roomCode,
                 courseCode);
         Map<Long, Long> doneMap = new HashMap<Long, Long>();
         for (Map<String, Object> map : doneCount) {
@@ -122,7 +123,7 @@ public class TIeReportServiceImpl implements TIeReportService {
         }
         // 缺考人数
         Map<Long, Long> absentMap = new HashMap<Long, Long>();
-        Date now = new Date();
+//        Date now = new Date();
         for (Long acId : totalMap.keySet()) {
 //            ExamActivityCacheBean ac = examActivityService.getExamActivityCacheBean(acId);
 //            Long end = ac.getStartTime() + (ac.getOpeningSeconds() * 1000);
@@ -150,7 +151,7 @@ public class TIeReportServiceImpl implements TIeReportService {
             }
         }
         // 每日已考人数
-        List<Map<String, Object>> doneCountByDay = examRecordMapper.getDoneCountByDay(examId, examActivityId, roomCode,
+        List<Map<String, Object>> doneCountByDay = examRecordMapper.getDoneCountByDay(orgId,examId, examActivityId, roomCode,
                 courseCode);
 
         Map<String, Object> ret = new HashMap<String, Object>();
@@ -164,11 +165,11 @@ public class TIeReportServiceImpl implements TIeReportService {
     }
 
     @Override
-    public IPage examViewCount(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
+    public IPage<ExamViewCountListBean> examViewCount(Long orgId,Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                String identity, int pageNumber, int pageSize) {
         // 应考人数
         IPage<ExamViewCountListBean> total = examStudentMapper.getTotalCountInfo(new Page<>(pageNumber, pageSize),
-                examId, examActivityId, roomCode, courseCode);
+        		orgId,examId, examActivityId, roomCode, courseCode);
         List<ExamViewCountListBean> data = total.getRecords();
         if (data == null || data.size() == 0) {
             return total;
@@ -225,14 +226,11 @@ public class TIeReportServiceImpl implements TIeReportService {
     }
 
     @Override
-    public IPage examDeficiencyList(Long examId, Long examActivityId, String roomCode, String courseCode,
+    public IPage<ExamDeficiencyListBean> examDeficiencyList(Long orgId,Long examId, Long examActivityId, String roomCode, String courseCode,
                                     String name, String identity, int pageNumber, int pageSize) {
-        Page<ExamDeficiencyListBean> ipage = new Page<>(pageNumber, pageSize);
-        ipage.addOrder(OrderItem.asc("t.exam_activity_id"));
-        ipage.addOrder(OrderItem.asc("t.room_code"));
-        QueryWrapper<TEExamActivity> wp = new QueryWrapper<>();
-        wp.lambda().eq(TEExamActivity::getExamId, examId);
-        List<TEExamActivity> acs = examActivityService.list(wp);
+        
+        List<TEExamActivity> acs = examActivityService.findByExamIdAndOrgId(examId,orgId);
+        
         List<Long> absentActivityIds = new ArrayList<>();
         Date now = new Date();
         for (TEExamActivity ac : acs) {
@@ -244,7 +242,11 @@ public class TIeReportServiceImpl implements TIeReportService {
         if (absentActivityIds.size() == 0) {
             return new Page<>(pageNumber, pageSize);
         }
-        IPage<ExamDeficiencyListBean> total = examStudentMapper.getExamDeficiencyPage(ipage, examId, examActivityId,
+        
+        Page<ExamDeficiencyListBean> ipage = new Page<>(pageNumber, pageSize);
+        ipage.addOrder(OrderItem.asc("t.exam_activity_id"));
+        ipage.addOrder(OrderItem.asc("t.room_code"));
+        IPage<ExamDeficiencyListBean> total = examStudentMapper.getExamDeficiencyPage(ipage,examId, examActivityId,
                 roomCode, courseCode, name, identity, absentActivityIds);
         List<ExamDeficiencyListBean> data = total.getRecords();
         if (data == null || data.size() == 0) {
@@ -258,11 +260,13 @@ public class TIeReportServiceImpl implements TIeReportService {
     }
 
     @Override
-    public IPage examExceptionList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
+    public IPage<ExamExceptionListBean> examExceptionList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                    String identity, int pageNumber, int pageSize) {
+    	TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        Long orgId=tbUser.getOrgId();
         Page<ExamExceptionListBean> ipage = new Page<>(pageNumber, pageSize);
         ipage.addOrder(OrderItem.asc("f.exam_student_id"));
-        IPage<ExamExceptionListBean> total = invigilateExceptionInfoMapper.getExamExceptionPage(ipage, examId,
+        IPage<ExamExceptionListBean> total = invigilateExceptionInfoMapper.getExamExceptionPage(ipage,orgId, examId,
                 examActivityId, roomCode, courseCode, name, identity);
         List<ExamExceptionListBean> data = total.getRecords();
         if (data == null || data.size() == 0) {
@@ -289,11 +293,13 @@ public class TIeReportServiceImpl implements TIeReportService {
     }
 
     @Override
-    public IPage examReexamList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
+    public IPage<ExamReexamListBean> examReexamList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                 String identity, int pageNumber, int pageSize) {
+    	TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        Long orgId=tbUser.getOrgId();
         Page<ExamReexamListBean> ipage = new Page<>(pageNumber, pageSize);
         ipage.addOrder(OrderItem.asc("f.exam_student_id"));
-        IPage<ExamReexamListBean> total = examReexamMapper.getExamReexamPage(ipage, examId, examActivityId, roomCode,
+        IPage<ExamReexamListBean> total = examReexamMapper.getExamReexamPage(ipage,orgId, examId, examActivityId, roomCode,
                 courseCode, name, identity);
         List<ExamReexamListBean> data = total.getRecords();
         if (data == null || data.size() == 0) {
@@ -307,11 +313,13 @@ public class TIeReportServiceImpl implements TIeReportService {
     }
 
     @Override
-    public IPage examBreachList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
+    public IPage<ExamBreachListBean> examBreachList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                 String identity, int pageNumber, int pageSize) {
+    	TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        Long orgId=tbUser.getOrgId();
         Page<ExamBreachListBean> ipage = new Page<>(pageNumber, pageSize);
         ipage.addOrder(OrderItem.asc("f.exam_student_id"));
-        IPage<ExamBreachListBean> total = examBreachLogMapper.getExamBreachPage(ipage, examId, examActivityId, roomCode,
+        IPage<ExamBreachListBean> total = examBreachLogMapper.getExamBreachPage(ipage, orgId,examId, examActivityId, roomCode,
                 courseCode, name, identity);
         List<ExamBreachListBean> data = total.getRecords();
         if (data == null || data.size() == 0) {
@@ -340,11 +348,13 @@ public class TIeReportServiceImpl implements TIeReportService {
     }
 
     @Override
-    public IPage examRevokeBreachList(Long examId, Long examActivityId, String roomCode, String courseCode,
+    public IPage<ExamBreachListBean> examRevokeBreachList(Long examId, Long examActivityId, String roomCode, String courseCode,
                                       String name, String identity, int pageNumber, int pageSize) {
+    	TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        Long orgId=tbUser.getOrgId();
         Page<ExamBreachListBean> ipage = new Page<>(pageNumber, pageSize);
         ipage.addOrder(OrderItem.asc("f.exam_student_id"));
-        IPage<ExamBreachListBean> total = examBreachLogMapper.getExamRevokeBreachPage(ipage, examId, examActivityId,
+        IPage<ExamBreachListBean> total = examBreachLogMapper.getExamRevokeBreachPage(ipage,orgId, examId, examActivityId,
                 roomCode, courseCode, name, identity);
         List<ExamBreachListBean> data = total.getRecords();
         if (data == null || data.size() == 0) {
@@ -373,11 +383,13 @@ public class TIeReportServiceImpl implements TIeReportService {
     }
 
     @Override
-    public IPage examStudentLogList(Long examId, Long examActivityId, String roomCode, String courseCode,
+    public IPage<ExamStudentLogListBean> examStudentLogList(Long examId, Long examActivityId, String roomCode, String courseCode,
                                     String name, String identity, int pageNumber, int pageSize) {
+    	TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        Long orgId=tbUser.getOrgId();
         Page<ExamStudentLogListBean> ipage = new Page<>(pageNumber, pageSize);
         ipage.addOrder(OrderItem.asc("t.id"));
-        IPage<ExamStudentLogListBean> total = examStudentMapper.getPageForStudentLog(ipage, examId, examActivityId,
+        IPage<ExamStudentLogListBean> total = examStudentMapper.getPageForStudentLog(ipage,orgId, examId, examActivityId,
                 roomCode, courseCode, name, identity);
         List<ExamStudentLogListBean> data = total.getRecords();
         if (data == null || data.size() == 0) {
@@ -404,7 +416,9 @@ public class TIeReportServiceImpl implements TIeReportService {
      */
     @Override
     public List<InvigilateListPatrolReportBean> patrolReport(Long examId, Long userId) {
-        return tOeExamRecordMapper.patrolReport(examId, userId);
+    	TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        Long orgId=tbUser.getOrgId();
+        return tOeExamRecordMapper.patrolReport(orgId,examId, userId);
     }
 
     /**
@@ -412,15 +426,17 @@ public class TIeReportServiceImpl implements TIeReportService {
      */
     @Override
     public ExaminationMonitorCountBean examinationMonitorCount() {
+        TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        Long orgId=tbUser.getOrgId();
         ExaminationMonitorCountBean ret = new ExaminationMonitorCountBean();
-        Long onlineCount = tOeExamRecordMapper.getOnlineCount();
+        Long onlineCount = tOeExamRecordMapper.getOnlineCount(orgId);
         if (onlineCount == null) {
             onlineCount = 0L;
         }
         // 在线人数
         ret.setOnlineCount(onlineCount);
         // 考试人数
-        Long examingCount = tOeExamRecordMapper.getExamingCount();
+        Long examingCount = tOeExamRecordMapper.getExamingCount(orgId);
         if (examingCount == null) {
             examingCount = 0L;
         }
@@ -430,11 +446,11 @@ public class TIeReportServiceImpl implements TIeReportService {
         ret.setWaitingCount(onlineCount - examingCount);
 
         // 通讯故障人数
-        ret.setExceptionCount(tOeExamRecordMapper.getExceptionCount());
+        ret.setExceptionCount(tOeExamRecordMapper.getExceptionCount(orgId));
         // 预警人数
-        ret.setWarnCount(tOeExamRecordMapper.getWarnCount());
+        ret.setWarnCount(tOeExamRecordMapper.getWarnCount(orgId));
         // 机构在考人数
-        ret.setOrgExamingCount(tOeExamRecordMapper.getOrgExamingCount());
+        ret.setOrgExamingCount(tOeExamRecordMapper.getOrgExamingCount(orgId));
         return ret;
     }
 
@@ -443,9 +459,11 @@ public class TIeReportServiceImpl implements TIeReportService {
      */
     @Override
     public ExaminationMonitorWarnDistributionBean warnDistribution() {
+    	TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        Long orgId=tbUser.getOrgId();
         ExaminationMonitorWarnDistributionBean ret = new ExaminationMonitorWarnDistributionBean();
-        ret.setOrgDistribution(tOeExamRecordMapper.getOrgDistribution());
-        List<Map<String, Object>> typeList = tOeExamRecordMapper.getTypeDistribution();
+        ret.setOrgDistribution(tOeExamRecordMapper.getOrgDistribution(orgId));
+        List<Map<String, Object>> typeList = tOeExamRecordMapper.getTypeDistribution(orgId);
         if (typeList != null && typeList.size() > 0) {
             for (Map<String, Object> map : typeList) {
                 map.put("type", VerifyExceptionEnum.valueOf((String) map.get("type")).getCode());
@@ -460,6 +478,8 @@ public class TIeReportServiceImpl implements TIeReportService {
      */
     @Override
     public List<ExaminationMonitorHourWarnCountBean> warnTrend() {
+    	TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        Long orgId=tbUser.getOrgId();
         List<ExaminationMonitorHourWarnCountBean> ret = new ArrayList<ExaminationMonitorHourWarnCountBean>();
         SimpleDateFormat sd = new SimpleDateFormat("HH");
         Date start = null;
@@ -477,7 +497,7 @@ public class TIeReportServiceImpl implements TIeReportService {
         start = DateUtils.setMinutes(start, 0);
         start = DateUtils.setSeconds(start, 0);
         start = DateUtils.setMilliseconds(start, 0);
-        List<ExaminationMonitorHourWarnCountBean> list = tOeExamRecordMapper.getWarnTrend(start.getTime());
+        List<ExaminationMonitorHourWarnCountBean> list = tOeExamRecordMapper.getWarnTrend(orgId,start.getTime());
         if (list != null && list.size() > 0) {
             Map<String, Long> map = list.stream().collect(Collectors.toMap(ExaminationMonitorHourWarnCountBean::getHour,
                     ExaminationMonitorHourWarnCountBean::getCount, (key1, key2) -> key2));
@@ -494,8 +514,10 @@ public class TIeReportServiceImpl implements TIeReportService {
 
     @Override
     public List<ExaminationMonitorWarnMsgBean> warnMsg() {
+    	TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        Long orgId=tbUser.getOrgId();
         List<ExaminationMonitorWarnMsgBean> ret = new ArrayList<ExaminationMonitorWarnMsgBean>();
-        List<WarningNotifyBean> list = invigilateWarnInfoMapper.findLastMsg(6);
+        List<WarningNotifyBean> list = invigilateWarnInfoMapper.findLastMsg(6,orgId);
         if (list != null && list.size() > 0) {
             for (WarningNotifyBean b : list) {
                 ExaminationMonitorWarnMsgBean bean = new ExaminationMonitorWarnMsgBean();

+ 9 - 0
themis-business/src/main/resources/mapper/TEExamActivityMapper.xml

@@ -166,4 +166,13 @@
             </if>-->
         </where>
     </select>
+    
+    <select id="findByExamIdAndOrgId" resultType="com.qmth.themis.business.entity.TEExamActivity">
+    	select t.* from t_e_exam_activity t 
+    	left join t_e_exam f on t.exam_id=f.id
+    	where t.exam_id=#{examId}
+    	<if test="orgId != null">
+		 	and f.org_id=#{orgId}
+		</if>
+    </select>
 </mapper>

+ 10 - 4
themis-business/src/main/resources/mapper/TEExamBreachLogMapper.xml

@@ -20,8 +20,11 @@
 		t_e_exam_breach_log f
 		LEFT JOIN
 		t_e_exam_student t ON f.exam_student_id = t.id
-		where f.exam_id
-		=#{examId} and f.status=0
+		left join t_e_student h on t.student_id=h.id
+		where f.exam_id=#{examId} and f.status=0
+		<if test="orgId != null">
+		 	and h.org_id=#{orgId}
+		</if>
 		<if test="activityId != null and activityId != ''">
 			and f.exam_activity_id = #{activityId}
 		</if>
@@ -57,8 +60,11 @@
 		t_e_exam_breach_log f
 		LEFT JOIN
 		t_e_exam_student t ON f.exam_student_id = t.id
-		where f.exam_id
-		=#{examId} and f.status=1
+		left join t_e_student h on t.student_id=h.id
+		where f.exam_id=#{examId} and f.status=1
+		<if test="orgId != null">
+		 	and h.org_id=#{orgId}
+		</if>
 		<if test="activityId != null and activityId != ''">
 			and f.exam_activity_id = #{activityId}
 		</if>

+ 4 - 0
themis-business/src/main/resources/mapper/TEExamReexamMapper.xml

@@ -248,7 +248,11 @@
 		FROM
 		t_e_exam_reexam f
 		LEFT JOIN t_e_exam_student t ON f.exam_student_id = t.id
+		left join t_e_student h on t.student_id=h.id
 		where f.exam_id =#{examId}
+		<if test="orgId != null">
+		 	and h.org_id=#{orgId}
+		</if>
 		<if test="activityId != null and activityId != ''">
 			and f.exam_activity_id = #{activityId}
 		</if>

+ 12 - 2
themis-business/src/main/resources/mapper/TEExamStudentMapper.xml

@@ -135,8 +135,11 @@
 	
 	<select id="getTotalCount" resultType="java.util.Map">
 		select t.exam_activity_id activityId,count(1) cc from t_e_exam_student
-		t
+		t left join t_e_student f on t.student_id=f.id
 		where t.exam_id = #{examId}
+		<if test="orgId != null">
+		 	and f.org_id=#{orgId}
+		</if>
 		<if test="activityId != null and activityId != ''">
 			and t.exam_activity_id = #{activityId}
 		</if>
@@ -153,8 +156,11 @@
 		resultType="com.qmth.themis.business.bean.backend.ExamViewCountListBean">
 		select t.exam_id examId,t.exam_activity_id examActivityId,t.room_code
 		roomCode,t.room_name roomName, count(1) examTotal from
-		t_e_exam_student t
+		t_e_exam_student t left join t_e_student f on t.student_id=f.id
 		where t.exam_id = #{examId}
+		<if test="orgId != null">
+		 	and h.org_id=#{orgId}
+		</if>
 		<if test="activityId != null and activityId != ''">
 			and t.exam_activity_id = #{activityId}
 		</if>
@@ -254,7 +260,11 @@
 		courseName,t.name,t.identity
 		,t.room_name roomName from
 		t_e_exam_student t
+		left join t_e_student h on t.student_id=h.id
 		where t.exam_id = #{examId} 
+		<if test="orgId != null">
+		 	and h.org_id=#{orgId}
+		</if>
 		<if test="activityId != null and activityId != ''">
 			and t.exam_activity_id = #{activityId}
 		</if>

+ 4 - 0
themis-business/src/main/resources/mapper/TIeInvigilateExceptionInfoMapper.xml

@@ -19,7 +19,11 @@
 		FROM
 		t_ie_invigilate_exception_info f
 		LEFT JOIN t_e_exam_student t ON f.exam_student_id = t.id
+		left join t_e_student h on t.student_id=h.id
 		where f.exam_id =#{examId}
+		<if test="orgId != null">
+		 	and h.org_id=#{orgId}
+		</if>
 		<if test="activityId != null and activityId != ''">
 			and f.exam_activity_id = #{activityId}
 		</if>

+ 5 - 0
themis-business/src/main/resources/mapper/TIeInvigilateWarnInfoMapper.xml

@@ -82,6 +82,11 @@
 					t.create_time createTime
 				FROM
 					t_ie_invigilate_warn_info t
+				left join t_e_exam h on t.exam_id=h.id
+				where 1=1
+				<if test="orgId != null">
+				 	and h.org_id=#{orgId}
+				</if>
 				ORDER BY
 					t.id DESC
 				limit #{conut}

+ 38 - 0
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -644,7 +644,11 @@
 		activityId,count(distinct(f.exam_student_id)) cc from t_oe_exam_record
 		f
 		left join t_e_exam_student t on f.exam_student_id=t.id
+		left join t_e_student h on t.student_id=h.id
 		where f.exam_id = #{examId}
+		<if test="orgId != null">
+		 	and h.org_id=#{orgId}
+		</if>
 		<if test="activityId != null and activityId != ''">
 			and f.exam_activity_id = #{activityId}
 		</if>
@@ -662,7 +666,11 @@
 		FROM_UNIXTIME(f.first_prepare_time / 1000,'%Y-%m-%d') AS day,
 		count(DISTINCT(f.exam_student_id)) count from t_oe_exam_record f
 		left join t_e_exam_student t on f.exam_student_id=t.id
+		left join t_e_student h on t.student_id=h.id
 		where f.exam_id = #{examId}
+		<if test="orgId != null">
+		 	and h.org_id=#{orgId}
+		</if>
 		<if test="activityId != null and activityId != ''">
 			and f.exam_activity_id = #{activityId}
 		</if>
@@ -771,11 +779,19 @@
 
 	<select id="getOnlineCount" resultType="java.lang.Long">
 		select count(1) from t_oe_exam_record f
+		left join t_e_exam h on f.exam_id=h.id
 		where f.client_websocket_status='ON_LINE'
+		<if test="orgId != null">
+		 	and h.org_id=#{orgId}
+		</if>
 	</select>
 	<select id="getExamingCount" resultType="java.lang.Long">
 		select count(1) from t_oe_exam_record f
+		left join t_e_exam h on f.exam_id=h.id
 		where f.status != 'FINISHED' and f.status != 'PERSISTED' and f.client_websocket_status='ON_LINE'
+		<if test="orgId != null">
+		 	and h.org_id=#{orgId}
+		</if>
 	</select>
 	<select id="getExceptionCount" resultType="java.lang.Long">
 			SELECT
@@ -783,8 +799,12 @@
 		FROM
 			t_oe_exam_record f
 		LEFT JOIN t_ie_invigilate_exception_info t ON f.id = t.exam_record_id
+		left join t_e_exam h on f.exam_id=h.id
 		WHERE
 			f. STATUS != 'FINISHED'
+		<if test="orgId != null">
+		 	and h.org_id=#{orgId}
+		</if>
 		AND f. STATUS != 'PERSISTED'
 		AND t.id IS NOT NULL
 	</select>
@@ -794,8 +814,12 @@
 		FROM
 			t_oe_exam_record f
 		LEFT JOIN t_ie_invigilate_warn_info t ON f.id = t.exam_record_id
+		left join t_e_exam h on f.exam_id=h.id
 		WHERE
 			f. STATUS != 'FINISHED'
+		<if test="orgId != null">
+		 	and h.org_id=#{orgId}
+		</if>
 		AND f. STATUS != 'PERSISTED'
 		AND t.type!='NONE'
 		AND t.id IS NOT NULL
@@ -815,6 +839,9 @@
 			LEFT JOIN t_e_student h ON t.student_id = h.id
 			WHERE
 				f. STATUS != 'FINISHED'
+			<if test="orgId != null">
+			 	and h.org_id=#{orgId}
+			</if>
 			AND f. STATUS != 'PERSISTED'
 			AND f.client_websocket_status='ON_LINE'
 			GROUP BY
@@ -838,6 +865,9 @@
 				LEFT JOIN t_e_student h ON t.student_id = h.id
 				WHERE
 					f. STATUS != 'FINISHED'
+				<if test="orgId != null">
+				 	and h.org_id=#{orgId}
+				</if>
 				AND f. STATUS != 'PERSISTED'
 				AND w.id IS NOT NULL
 				AND w.type!='NONE'
@@ -853,8 +883,12 @@
 		FROM
 			t_oe_exam_record f
 		LEFT JOIN t_ie_invigilate_warn_info w ON f.id = w.exam_record_id
+		left join t_e_exam h on f.exam_id=h.id
 		WHERE
 			f. STATUS != 'FINISHED'
+		<if test="orgId != null">
+		 	and h.org_id=#{orgId}
+		</if>
 		AND f. STATUS != 'PERSISTED'
 		AND w.id IS NOT NULL
 		AND w.type!='NONE'
@@ -866,7 +900,11 @@
 			FROM_UNIXTIME(w.create_time / 1000,'%H') hour,
 			count(1) count
 		FROM  t_ie_invigilate_warn_info w 
+		left join t_e_exam h on w.exam_id=h.id
 		WHERE w.type!='NONE' and w.create_time&gt;=#{startTime}
+		<if test="orgId != null">
+		 	and h.org_id=#{orgId}
+		</if>
 		GROUP BY
 			FROM_UNIXTIME(w.create_time / 1000,'%H')
 	</select>