Browse Source

考情监考-大屏报表修改

wangliang 2 years ago
parent
commit
34d0690538

+ 16 - 2
themis-admin/src/main/java/com/qmth/themis/admin/api/TIeReportController.java

@@ -224,14 +224,14 @@ public class TIeReportController {
         return ResultUtil.ok(reportService.examinationMonitorCount());
     }
 
-    @ApiOperation(value = "考情监控-预警分布")
+    @ApiOperation(value = "考情监控-预警类型排行")
     @RequestMapping(value = "/examination_monitor/warn_distribution", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
     public Result warnDistribution() {
         return ResultUtil.ok(reportService.warnDistribution());
     }
 
-    @ApiOperation(value = "考情监控-预警时间趋势")
+    @ApiOperation(value = "考情监控-在线人数/预警时间趋势")
     @RequestMapping(value = "/examination_monitor/warn_trend", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
     public Result warnTrend() {
@@ -244,4 +244,18 @@ public class TIeReportController {
     public Result warnMsg() {
         return ResultUtil.ok(reportService.warnMsg());
     }
+
+    @ApiOperation(value = "考情监控-预警地区排行")
+    @RequestMapping(value = "/examination_monitor/warn_region_distribution", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
+    public Result warnRegionDistribution() {
+        return ResultUtil.ok(reportService.warnRegionDistribution());
+    }
+
+    @ApiOperation(value = "考情监控-地图数据")
+    @RequestMapping(value = "/examination_monitor/map", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
+    public Result map() {
+        return ResultUtil.ok(reportService.map());
+    }
 }

+ 135 - 65
themis-business/src/main/java/com/qmth/themis/business/bean/admin/ExaminationMonitorCountBean.java

@@ -1,71 +1,141 @@
 package com.qmth.themis.business.bean.admin;
 
-import java.util.List;
-import java.util.Map;
-
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.themis.business.entity.TBOrg;
 import io.swagger.annotations.ApiModelProperty;
 
-public class ExaminationMonitorCountBean {
-	@ApiModelProperty(name = "在线人数")
-	private Long onlineCount = 0L;
-	@ApiModelProperty(name = "待考人数")
-	private Long waitingCount = 0L;
-	@ApiModelProperty(name = "考试中人数")
-	private Long examingCount = 0L;
-	@ApiModelProperty(name = "通讯故障人数")
-	private Long exceptionCount;
-	@ApiModelProperty(name = "预警人数")
-	private Long warnCount;
-
-	@ApiModelProperty(name = "机构在线考试人数")
-	private List<Map<String, Object>> orgExamingCount;
-
-	public Long getOnlineCount() {
-		return onlineCount;
-	}
-
-	public void setOnlineCount(Long onlineCount) {
-		this.onlineCount = onlineCount;
-	}
-
-	public Long getWaitingCount() {
-		return waitingCount;
-	}
-
-	public void setWaitingCount(Long waitingCount) {
-		this.waitingCount = waitingCount;
-	}
-
-	public Long getExamingCount() {
-		return examingCount;
-	}
-
-	public void setExamingCount(Long examingCount) {
-		this.examingCount = examingCount;
-	}
-
-	public Long getExceptionCount() {
-		return exceptionCount;
-	}
-
-	public void setExceptionCount(Long exceptionCount) {
-		this.exceptionCount = exceptionCount;
-	}
-
-	public Long getWarnCount() {
-		return warnCount;
-	}
-
-	public void setWarnCount(Long warnCount) {
-		this.warnCount = warnCount;
-	}
-
-	public List<Map<String, Object>> getOrgExamingCount() {
-		return orgExamingCount;
-	}
-
-	public void setOrgExamingCount(List<Map<String, Object>> orgExamingCount) {
-		this.orgExamingCount = orgExamingCount;
-	}
+import java.io.Serializable;
+
+/**
+ * @Description: 考情监控-人数
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2022/8/19
+ */
+public class ExaminationMonitorCountBean implements Serializable {
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @ApiModelProperty(value = "机构代码,通常用学校简称表示,全局唯一")
+    private String code;
+
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    @ApiModelProperty(name = "在线人数")
+    private Long onlineCount = 0L;
+
+    @ApiModelProperty(name = "待考人数")
+    private Long waitingCount = 0L;
+
+    @ApiModelProperty(name = "考试中人数")
+    private Long examingCount = 0L;
+
+//	@ApiModelProperty(name = "通讯故障人数")
+//	private Long exceptionCount;
+
+    @ApiModelProperty(name = "预警人数")
+    private Long warnCount = 0L;
+
+    @ApiModelProperty(name = "违纪人数")
+    private Long breachCount = 0L;
+
+//	@ApiModelProperty(name = "机构在线考试人数")
+//	private List<Map<String, Object>> orgExamingCount;
+
+    public ExaminationMonitorCountBean() {
+
+    }
+
+    public ExaminationMonitorCountBean(Long id, String name, String code) {
+        this.id = id;
+        this.name = name;
+        this.code = code;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Long getBreachCount() {
+        return breachCount;
+    }
+
+    public void setBreachCount(Long breachCount) {
+        this.breachCount = breachCount;
+    }
+
+    public Long getOnlineCount() {
+        return onlineCount;
+    }
+
+    public void setOnlineCount(Long onlineCount) {
+        this.onlineCount = onlineCount;
+    }
+
+    public Long getWaitingCount() {
+        return waitingCount;
+    }
+
+    public void setWaitingCount(Long waitingCount) {
+        this.waitingCount = waitingCount;
+    }
+
+    public Long getExamingCount() {
+        return examingCount;
+    }
+
+    public void setExamingCount(Long examingCount) {
+        this.examingCount = examingCount;
+    }
+
+//	public Long getExceptionCount() {
+//		return exceptionCount;
+//	}
+
+//	public void setExceptionCount(Long exceptionCount) {
+//		this.exceptionCount = exceptionCount;
+//	}
+
+    public Long getWarnCount() {
+        return warnCount;
+    }
+
+    public void setWarnCount(Long warnCount) {
+        this.warnCount = warnCount;
+    }
+
+//	public List<Map<String, Object>> getOrgExamingCount() {
+//		return orgExamingCount;
+//	}
 
+//	public void setOrgExamingCount(List<Map<String, Object>> orgExamingCount) {
+//		this.orgExamingCount = orgExamingCount;
+//	}
 }

+ 59 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/admin/ExaminationMonitorMapBean.java

@@ -0,0 +1,59 @@
+package com.qmth.themis.business.bean.admin;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 地图数据
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2022/8/19
+ */
+public class ExaminationMonitorMapBean implements Serializable {
+
+    @ApiModelProperty(name = "国家")
+    private String country;
+
+    @ApiModelProperty(name = "省份")
+    private String province;
+
+    @ApiModelProperty(name = "在线人数")
+    private Integer onlineCount = 0;
+
+    @ApiModelProperty(name = "预警条数")
+    private Integer warnCount = 0;
+
+    public Integer getOnlineCount() {
+        return onlineCount;
+    }
+
+    public void setOnlineCount(Integer onlineCount) {
+        this.onlineCount = onlineCount;
+    }
+
+    public String getCountry() {
+        return country;
+    }
+
+    public void setCountry(String country) {
+        this.country = country;
+    }
+
+    public String getProvince() {
+        return province;
+    }
+
+    public void setProvince(String province) {
+        this.province = province;
+    }
+
+    public Integer getWarnCount() {
+        return warnCount;
+    }
+
+    public void setWarnCount(Integer warnCount) {
+        this.warnCount = warnCount;
+    }
+}

+ 49 - 23
themis-business/src/main/java/com/qmth/themis/business/bean/admin/ExaminationMonitorWarnDistributionBean.java

@@ -1,28 +1,54 @@
 package com.qmth.themis.business.bean.admin;
 
-import java.util.List;
-import java.util.Map;
-
 import io.swagger.annotations.ApiModelProperty;
 
-public class ExaminationMonitorWarnDistributionBean {
-
-	@ApiModelProperty(name = "机构预警分布")
-	private List<Map<String, Object>> orgDistribution;
-	@ApiModelProperty(name = "预警类型分布")
-	private List<Map<String, Object>> typeDistribution;
-	public List<Map<String, Object>> getOrgDistribution() {
-		return orgDistribution;
-	}
-	public void setOrgDistribution(List<Map<String, Object>> orgDistribution) {
-		this.orgDistribution = orgDistribution;
-	}
-	public List<Map<String, Object>> getTypeDistribution() {
-		return typeDistribution;
-	}
-	public void setTypeDistribution(List<Map<String, Object>> typeDistribution) {
-		this.typeDistribution = typeDistribution;
-	}
-
-	
+import java.io.Serializable;
+
+/**
+ * @Description: 预警类型排行
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2022/8/19
+ */
+public class ExaminationMonitorWarnDistributionBean implements Serializable {
+
+//	@ApiModelProperty(name = "机构预警分布")
+//	private List<Map<String, Object>> orgDistribution;
+//	@ApiModelProperty(name = "预警类型分布")
+//	private List<Map<String, Object>> typeDistribution;
+//	public List<Map<String, Object>> getOrgDistribution() {
+//		return orgDistribution;
+//	}
+//	public void setOrgDistribution(List<Map<String, Object>> orgDistribution) {
+//		this.orgDistribution = orgDistribution;
+//	}
+//	public List<Map<String, Object>> getTypeDistribution() {
+//		return typeDistribution;
+//	}
+//	public void setTypeDistribution(List<Map<String, Object>> typeDistribution) {
+//		this.typeDistribution = typeDistribution;
+//	}
+
+    @ApiModelProperty(name = "预警类型")
+    private String type;
+
+    @ApiModelProperty(name = "预警条数")
+    private Integer warnCount = 0;
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public Integer getWarnCount() {
+        return warnCount;
+    }
+
+    public void setWarnCount(Integer warnCount) {
+        this.warnCount = warnCount;
+    }
 }

+ 48 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/admin/ExaminationMonitorWarnRegionDistributionBean.java

@@ -0,0 +1,48 @@
+package com.qmth.themis.business.bean.admin;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 预警地区排行
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2022/8/19
+ */
+public class ExaminationMonitorWarnRegionDistributionBean implements Serializable {
+
+    @ApiModelProperty(name = "国家")
+    private String country;
+
+    @ApiModelProperty(name = "省份")
+    private String province;
+
+    @ApiModelProperty(name = "预警条数")
+    private Integer warnCount = 0;
+
+    public String getCountry() {
+        return country;
+    }
+
+    public void setCountry(String country) {
+        this.country = country;
+    }
+
+    public String getProvince() {
+        return province;
+    }
+
+    public void setProvince(String province) {
+        this.province = province;
+    }
+
+    public Integer getWarnCount() {
+        return warnCount;
+    }
+
+    public void setWarnCount(Integer warnCount) {
+        this.warnCount = warnCount;
+    }
+}

+ 12 - 1
themis-business/src/main/java/com/qmth/themis/business/bean/admin/WarningNotifyBean.java

@@ -20,7 +20,7 @@ public class WarningNotifyBean  {
     private String name;//考生姓名
     
     @ApiModelProperty(name = "考生证件号")
-    private String identity;//考生姓名
+    private String identity;//考生证件号
 
     @ApiModelProperty(name = "预警内容")
     private String info;//预警内容
@@ -45,6 +45,17 @@ public class WarningNotifyBean  {
     @ApiModelProperty(name = "时间")
     private Long createTime;
 
+    @ApiModelProperty(name = "未处理/已处理")
+    private String approveStatus;
+
+    public String getApproveStatus() {
+        return approveStatus;
+    }
+
+    public void setApproveStatus(String approveStatus) {
+        this.approveStatus = approveStatus;
+    }
+
     public Long getExamRecordId() {
         return examRecordId;
     }

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

@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.qmth.themis.business.bean.admin.*;
 import com.qmth.themis.business.cache.bean.ExamRecordDetailBean;
-import com.qmth.themis.business.dto.response.TEExamUnFinishDto;
 import com.qmth.themis.business.entity.TOeExamRecord;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -334,14 +333,62 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
 
     public TOeExamRecord findOneByExamId(@Param("examId") Long examId, @Param("status") String status);
 
-    public Long getExamingCount(@Param("orgId") Long orgId);
-
+    /**
+     * 在线人数
+     *
+     * @param orgId
+     * @return
+     */
     public Long getOnlineCount(@Param("orgId") Long orgId);
 
+    /**
+     * 异常总数
+     *
+     * @param orgId
+     * @return
+     */
     public Long getExceptionCount(@Param("orgId") Long orgId);
 
+    /**
+     * 预警总数
+     *
+     * @param orgId
+     * @return
+     */
     public Long getWarnCount(@Param("orgId") Long orgId);
 
+    /**
+     * 违纪总数
+     *
+     * @param orgId
+     * @return
+     */
+    public Long getBreachCount(@Param("orgId") Long orgId);
+
+    /**
+     * 预警类型排行
+     *
+     * @param orgId
+     * @return
+     */
+    public List<ExaminationMonitorWarnDistributionBean> getWarnDistribution(@Param("orgId") Long orgId);
+
+    /**
+     * 预警地区排行
+     *
+     * @param orgId
+     * @return
+     */
+    public List<ExaminationMonitorWarnRegionDistributionBean> getWarnRegionDistribution(@Param("orgId") Long orgId);
+
+    /**
+     * 地图数据
+     *
+     * @param orgId
+     * @return
+     */
+    public List<ExaminationMonitorMapBean> getMap(@Param("orgId") Long orgId);
+
     public List<Map<String, Object>> getOrgExamingCount(@Param("orgId") Long orgId);
 
     public List<Map<String, Object>> getOrgDistribution(@Param("orgId") Long orgId);

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

@@ -6,37 +6,184 @@ import com.qmth.themis.business.bean.admin.*;
 import java.util.List;
 import java.util.Map;
 
+/**
+ * @Description: 报表数据
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2022/8/19
+ */
 public interface TIeReportService {
-    public Map<String, Object> examView(Long orgId,Long examId, Long examActivityId, String roomCode, String courseCode,
+
+    /**
+     * 考试概览
+     *
+     * @param orgId
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param courseCode
+     * @param name
+     * @param identity
+     * @return
+     */
+    public Map<String, Object> examView(Long orgId, Long examId, Long examActivityId, String roomCode, String courseCode,
                                         String name, String identity);
 
-    public IPage examViewCount(Long orgId,Long examId, Long examActivityId, String roomCode, String courseCode, String name,
+    /**
+     * 情况统计
+     *
+     * @param orgId
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param courseCode
+     * @param name
+     * @param identity
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
+    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 orgId,Long examId, Long examActivityId, String roomCode, String courseCode, String name,
+    /**
+     * 缺考名单
+     *
+     * @param orgId
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param courseCode
+     * @param name
+     * @param identity
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
+    public IPage examDeficiencyList(Long orgId, Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                     String identity, int pageNumber, int pageSize);
 
+    /**
+     * 异常处理
+     *
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param courseCode
+     * @param name
+     * @param identity
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
     public IPage examExceptionList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                    String identity, int pageNumber, int pageSize);
 
+    /**
+     * 异常处理明细
+     *
+     * @param examStudentId
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
     public IPage<ExamExceptionDetailListBean> examExceptionDetailList(Long examStudentId, int pageNumber, int pageSize);
 
+    /**
+     * 重考处理
+     *
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param courseCode
+     * @param name
+     * @param identity
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
     public IPage examReexamList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                 String identity, int pageNumber, int pageSize);
 
+    /**
+     * 违纪名单
+     *
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param courseCode
+     * @param name
+     * @param identity
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
     public IPage examBreachList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                 String identity, int pageNumber, int pageSize);
 
+    /**
+     * 违纪名单明细
+     *
+     * @param examStudentId
+     * @param status
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
     public IPage<ExamBreachDetailListBean> examBreachListDetail(Long examStudentId, Integer status, int pageNumber, int pageSize);
 
+    /**
+     * 撤销违纪名单
+     *
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param courseCode
+     * @param name
+     * @param identity
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
     public IPage examRevokeBreachList(Long examId, Long examActivityId, String roomCode, String courseCode,
                                       String name, String identity, int pageNumber, int pageSize);
 
+    /**
+     * 撤销违纪名单明细
+     *
+     * @param examStudentId
+     * @param status
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
     public IPage<ExamBreachDetailListBean> examRevokeBreachListDetail(Long examStudentId, Integer status, int pageNumber, int pageSize);
 
+    /**
+     * 考生日志
+     *
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param courseCode
+     * @param name
+     * @param identity
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
     public IPage examStudentLogList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                     String identity, int pageNumber, int pageSize);
 
+    /**
+     * 考生日志明细
+     *
+     * @param examStudentId
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
     public IPage<ExamStudentLogDetailListBean> examStudentLogListDetail(Long examStudentId, int pageNumber, int pageSize);
 
     /**
@@ -55,9 +202,38 @@ public interface TIeReportService {
      */
     public ExaminationMonitorCountBean examinationMonitorCount();
 
-    public ExaminationMonitorWarnDistributionBean warnDistribution();
+    /**
+     * 考情监控-预警类型排行
+     *
+     * @return
+     */
+    public List<ExaminationMonitorWarnDistributionBean> warnDistribution();
 
+    /**
+     * 考情监控-预警时间趋势
+     *
+     * @return
+     */
     public List<ExaminationMonitorHourWarnCountBean> warnTrend();
 
-    public List<ExaminationMonitorWarnMsgBean> warnMsg();
+    /**
+     * 考情监控-预警消息
+     *
+     * @return
+     */
+    public List<WarningNotifyBean> warnMsg();
+
+    /**
+     * 考情监控-预警地区排行
+     *
+     * @return
+     */
+    public List<ExaminationMonitorWarnRegionDistributionBean> warnRegionDistribution();
+
+    /**
+     * 考情监控-地图数据
+     *
+     * @return
+     */
+    public List<ExaminationMonitorMapBean> map();
 }

+ 222 - 51
themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeReportServiceImpl.java

@@ -4,17 +4,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.themis.business.bean.admin.*;
 import com.qmth.themis.business.cache.bean.ExamCacheBean;
-import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dao.*;
+import com.qmth.themis.business.entity.TBOrg;
 import com.qmth.themis.business.entity.TBUser;
 import com.qmth.themis.business.entity.TEExamActivity;
 import com.qmth.themis.business.enums.InvigilateMonitorStatusEnum;
-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.service.TOeExamRecordService;
+import com.qmth.themis.business.service.*;
 import com.qmth.themis.business.util.ServletUtil;
-import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.time.DateUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -25,6 +21,13 @@ import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
 
+/**
+ * @Description: 报表数据
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2022/8/19
+ */
 @Service
 public class TIeReportServiceImpl implements TIeReportService {
     private final static Logger log = LoggerFactory.getLogger(TIeReportServiceImpl.class);
@@ -41,9 +44,6 @@ public class TIeReportServiceImpl implements TIeReportService {
     @Resource
     TIeInvigilateExceptionInfoMapper invigilateExceptionInfoMapper;
 
-    @Resource
-    TBExamInvigilateUserMapper examInvigilateUserMapper;
-
     @Resource
     TIeInvigilateWarnInfoMapper invigilateWarnInfoMapper;
 
@@ -62,6 +62,21 @@ public class TIeReportServiceImpl implements TIeReportService {
     @Resource
     TOeExamRecordService tOeExamRecordService;
 
+    @Resource
+    CacheService cacheService;
+
+    /**
+     * 考试概览
+     *
+     * @param orgId
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param courseCode
+     * @param name
+     * @param identity
+     * @return
+     */
     @Override
     public Map<String, Object> examView(Long orgId, Long examId, Long examActivityId, String roomCode, String courseCode,
                                         String name, String identity) {
@@ -92,6 +107,20 @@ public class TIeReportServiceImpl implements TIeReportService {
         return ret;
     }
 
+    /**
+     * 情况统计
+     *
+     * @param orgId
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param courseCode
+     * @param name
+     * @param identity
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
     @Override
     public IPage<ExamViewCountListBean> examViewCount(Long orgId, Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                                       String identity, int pageNumber, int pageSize) {
@@ -99,6 +128,20 @@ public class TIeReportServiceImpl implements TIeReportService {
                 orgId, examId, examActivityId, roomCode, courseCode);
     }
 
+    /**
+     * 缺考名单
+     *
+     * @param orgId
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param courseCode
+     * @param name
+     * @param identity
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
     @Override
     public IPage<ExamDeficiencyListBean> examDeficiencyList(Long orgId, Long examId, Long examActivityId, String roomCode, String courseCode,
                                                             String name, String identity, int pageNumber, int pageSize) {
@@ -117,6 +160,19 @@ public class TIeReportServiceImpl implements TIeReportService {
                 roomCode, courseCode, name, identity, absentActivityIds);
     }
 
+    /**
+     * 异常处理
+     *
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param courseCode
+     * @param name
+     * @param identity
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
     @Override
     public IPage<ExamExceptionListBean> examExceptionList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                                           String identity, int pageNumber, int pageSize) {
@@ -125,11 +181,32 @@ public class TIeReportServiceImpl implements TIeReportService {
                 examActivityId, roomCode, courseCode, name, identity);
     }
 
+    /**
+     * 异常处理明细
+     *
+     * @param examStudentId
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
     @Override
     public IPage<ExamExceptionDetailListBean> examExceptionDetailList(Long examStudentId, int pageNumber, int pageSize) {
         return invigilateExceptionInfoMapper.getExamExceptionDetailList(new Page<>(pageNumber, pageSize), examStudentId);
     }
 
+    /**
+     * 重考处理
+     *
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param courseCode
+     * @param name
+     * @param identity
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
     @Override
     public IPage<ExamReexamListBean> examReexamList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                                     String identity, int pageNumber, int pageSize) {
@@ -138,6 +215,19 @@ public class TIeReportServiceImpl implements TIeReportService {
                 courseCode, name, identity);
     }
 
+    /**
+     * 违纪名单
+     *
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param courseCode
+     * @param name
+     * @param identity
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
     @Override
     public IPage<ExamBreachListBean> examBreachList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
                                                     String identity, int pageNumber, int pageSize) {
@@ -146,11 +236,33 @@ public class TIeReportServiceImpl implements TIeReportService {
                 courseCode, name, identity);
     }
 
+    /**
+     * 违纪名单明细
+     *
+     * @param examStudentId
+     * @param status
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
     @Override
     public IPage<ExamBreachDetailListBean> examBreachListDetail(Long examStudentId, Integer status, int pageNumber, int pageSize) {
         return examBreachLogMapper.getExamBreachDetailList(new Page<>(pageNumber, pageSize), examStudentId, status);
     }
 
+    /**
+     * 撤销违纪名单
+     *
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param courseCode
+     * @param name
+     * @param identity
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
     @Override
     public IPage<ExamBreachListBean> examRevokeBreachList(Long examId, Long examActivityId, String roomCode, String courseCode,
                                                           String name, String identity, int pageNumber, int pageSize) {
@@ -159,11 +271,33 @@ public class TIeReportServiceImpl implements TIeReportService {
                 roomCode, courseCode, name, identity);
     }
 
+    /**
+     * 撤销违纪名单明细
+     *
+     * @param examStudentId
+     * @param status
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
     @Override
     public IPage<ExamBreachDetailListBean> examRevokeBreachListDetail(Long examStudentId, Integer status, int pageNumber, int pageSize) {
         return examBreachLogMapper.getExamBreachDetailList(new Page<>(pageNumber, pageSize), examStudentId, status);
     }
 
+    /**
+     * 考生日志
+     *
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param courseCode
+     * @param name
+     * @param identity
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
     @Override
     public IPage<ExamStudentLogListBean> examStudentLogList(Long examId, Long examActivityId, String roomCode, String courseCode,
                                                             String name, String identity, int pageNumber, int pageSize) {
@@ -172,6 +306,14 @@ public class TIeReportServiceImpl implements TIeReportService {
                 roomCode, courseCode, name, identity);
     }
 
+    /**
+     * 考生日志明细
+     *
+     * @param examStudentId
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
     @Override
     public IPage<ExamStudentLogDetailListBean> examStudentLogListDetail(Long examStudentId, int pageNumber, int pageSize) {
         return examStudentLogMapper.getExamStudentLogList(new Page<>(pageNumber, pageSize), examStudentId);
@@ -196,9 +338,12 @@ public class TIeReportServiceImpl implements TIeReportService {
     @Override
     public ExaminationMonitorCountBean examinationMonitorCount() {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
-        ExaminationMonitorCountBean ret = new ExaminationMonitorCountBean();
+        ExaminationMonitorCountBean ret = null;
         if (Objects.isNull(tbUser.getOrgId())) {
             return ret;
+        } else {
+            TBOrg tbOrg = cacheService.addOrgCache(tbUser.getOrgId());
+            ret = new ExaminationMonitorCountBean(tbOrg.getId(), tbOrg.getName(), tbOrg.getCode());
         }
         List<Long> countList = tOeExamRecordService.findByOrgId(tbUser.getOrgId());
         if (Objects.nonNull(countList) && countList.size() > 0) {
@@ -209,26 +354,29 @@ public class TIeReportServiceImpl implements TIeReportService {
             // 考试人数
             ret.setExamingCount(countList.get(2));
         }
-        // 通讯故障人数
-        ret.setExceptionCount(tOeExamRecordMapper.getExceptionCount(tbUser.getOrgId()));
+//         通讯故障人数
+//        ret.setExceptionCount(tOeExamRecordMapper.getExceptionCount(tbUser.getOrgId()));
         // 预警人数
         ret.setWarnCount(tOeExamRecordMapper.getWarnCount(tbUser.getOrgId()));
-        // 机构在考人数
-        ret.setOrgExamingCount(tOeExamRecordMapper.getOrgExamingCount(tbUser.getOrgId()));
+//         机构在考人数
+//        ret.setOrgExamingCount(tOeExamRecordMapper.getOrgExamingCount(tbUser.getOrgId()));
+        //违纪人数
+        ret.setBreachCount(tOeExamRecordMapper.getBreachCount(tbUser.getOrgId()));
         return ret;
     }
 
     /**
-     * 考情监控-预警分布
+     * 考情监控-预警类型排行
      */
     @Override
-    public ExaminationMonitorWarnDistributionBean warnDistribution() {
+    public List<ExaminationMonitorWarnDistributionBean> warnDistribution() {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
-        ExaminationMonitorWarnDistributionBean ret = new ExaminationMonitorWarnDistributionBean();
-        ret.setOrgDistribution(tOeExamRecordMapper.getOrgDistribution(tbUser.getOrgId()));
-        List<Map<String, Object>> typeList = tOeExamRecordMapper.getTypeDistribution(tbUser.getOrgId());
-        ret.setTypeDistribution(typeList);
-        return ret;
+//        ExaminationMonitorWarnDistributionBean ret = new ExaminationMonitorWarnDistributionBean();
+//        ret.setOrgDistribution(tOeExamRecordMapper.getOrgDistribution(tbUser.getOrgId()));
+//        List<Map<String, Object>> typeList = tOeExamRecordMapper.getTypeDistribution(tbUser.getOrgId());
+//        ret.setTypeDistribution(typeList);
+//        return ret;
+        return tOeExamRecordMapper.getWarnDistribution(tbUser.getOrgId());
     }
 
     /**
@@ -270,36 +418,59 @@ public class TIeReportServiceImpl implements TIeReportService {
     }
 
     @Override
-    public List<ExaminationMonitorWarnMsgBean> warnMsg() {
+    public List<WarningNotifyBean> warnMsg() {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
-        List<ExaminationMonitorWarnMsgBean> ret = new ArrayList<ExaminationMonitorWarnMsgBean>();
-        List<WarningNotifyBean> list = invigilateWarnInfoMapper.findLastMsg(6, tbUser.getOrgId());
-        if (list != null && list.size() > 0) {
-            for (WarningNotifyBean b : list) {
-                ExaminationMonitorWarnMsgBean bean = new ExaminationMonitorWarnMsgBean();
-                bean.setTime(b.getCreateTime());
-                StringBuilder sb = new StringBuilder();
-                sb.append(b.getName()).append(" (证件号:").append(b.getIdentity()).append(") ").append(b.getInfo());
-                List<Map<String, String>> users = examInvigilateUserMapper.getInvigilateUsers(b.getExamId(), b.getRoomCode());
-                if (users != null && users.size() > 0) {
-                    StringBuilder usersb = new StringBuilder();
-                    for (Map<String, String> map : users) {
-                        if (map != null) {
-                            String lname = map.get("loginName");
-                            String name = map.get(SystemConstant.NAME);
-                            if (StringUtils.isNotBlank(lname) && StringUtils.isNotBlank(name)) {
-                                usersb.append(lname).append("(账号:").append(name).append(") ");
-                            }
-                        }
-                    }
-                    if (usersb.length() > 0) {
-                        sb.append(",系统已提示").append(usersb).append("进行人工干预");
-                    }
-                }
-                bean.setContent(sb.toString());
-                ret.add(bean);
-            }
-        }
-        return ret;
+        return invigilateWarnInfoMapper.findLastMsg(6, tbUser.getOrgId());
+//        List<ExaminationMonitorWarnMsgBean> ret = new ArrayList<ExaminationMonitorWarnMsgBean>();
+//        List<WarningNotifyBean> list = invigilateWarnInfoMapper.findLastMsg(6, tbUser.getOrgId());
+//        if (list != null && list.size() > 0) {
+//            for (WarningNotifyBean b : list) {
+//                ExaminationMonitorWarnMsgBean bean = new ExaminationMonitorWarnMsgBean();
+//                bean.setTime(b.getCreateTime());
+//                StringBuilder sb = new StringBuilder();
+//                sb.append(b.getName()).append(" (证件号:").append(b.getIdentity()).append(") ").append(b.getInfo());
+//                List<Map<String, String>> users = examInvigilateUserMapper.getInvigilateUsers(b.getExamId(), b.getRoomCode());
+//                if (users != null && users.size() > 0) {
+//                    StringBuilder usersb = new StringBuilder();
+//                    for (Map<String, String> map : users) {
+//                        if (map != null) {
+//                            String lname = map.get("loginName");
+//                            String name = map.get(SystemConstant.NAME);
+//                            if (StringUtils.isNotBlank(lname) && StringUtils.isNotBlank(name)) {
+//                                usersb.append(lname).append("(账号:").append(name).append(") ");
+//                            }
+//                        }
+//                    }
+//                    if (usersb.length() > 0) {
+//                        sb.append(",系统已提示").append(usersb).append("进行人工干预");
+//                    }
+//                }
+//                bean.setContent(sb.toString());
+//                ret.add(bean);
+//            }
+//        }
+//        return ret;
+    }
+
+    /**
+     * 考情监控-预警地区排行
+     *
+     * @return
+     */
+    @Override
+    public List<ExaminationMonitorWarnRegionDistributionBean> warnRegionDistribution() {
+        TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        return tOeExamRecordMapper.getWarnRegionDistribution(tbUser.getOrgId());
+    }
+
+    /**
+     * 考情监控-地图数据
+     *
+     * @return
+     */
+    @Override
+    public List<ExaminationMonitorMapBean> map() {
+        TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        return tOeExamRecordMapper.getMap(tbUser.getOrgId());
     }
 }

+ 1 - 0
themis-business/src/main/java/com/qmth/themis/business/service/impl/TOeExamRecordServiceImpl.java

@@ -619,6 +619,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
                 String ip = IpUtil.getRemoteIp(ServletUtil.getRequest());
                 if (Objects.nonNull(ip)) {
                     ExamRecordCacheUtil.setClientCurrentIp(recordId, ip);
+//                    ExamRecordCacheUtil.setClientCurrentIp(recordId, "171.43.210.22");
                 }
             }
         } catch (Exception e) {

+ 3 - 4
themis-business/src/main/resources/mapper/TIeInvigilateWarnInfoMapper.xml

@@ -78,7 +78,8 @@
         t.remark,
         t.exam_id AS examId,
         t.exam_record_id AS examRecordId,
-        t.create_time createTime
+        t.create_time createTime,
+        IF(t.approve_status = 0,'未处理','已处理') as approveStatus
         FROM
         t_ie_invigilate_warn_info t
         left join t_e_exam h on t.exam_id=h.id
@@ -86,11 +87,9 @@
         <if test="orgId != null">
             and h.org_id=#{orgId}
         </if>
-        ORDER BY
-        t.id DESC
         limit #{conut}
         ) tem
-        LEFT JOIN t_e_exam_student f ON tem.examStudentId = f.id
+        LEFT JOIN t_e_exam_student f ON tem.examStudentId = f.id order by tem.createTime desc
     </select>
 
     <select id="findWarnAndExceptionInfo" resultType="java.lang.Integer">

+ 208 - 76
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -187,7 +187,7 @@
             and (toer.STATUS = 'FINISHED' or toer.STATUS = 'PERSISTED')
             and toer.first_start_time is not null
         </if>-->
-                    )
+        )
         <if test="examId != null and examId != ''">
             and s.exam_id = #{examId}
         </if>
@@ -215,7 +215,7 @@
         ) temp
         left join t_oe_exam_record toer on
         toer.exam_student_id = temp.examStudentId
-        <where> 1 = 1
+        <where>1 = 1
             <if test="status != null and status != '' and status != 'UN_FINISH'">
                 <choose>
                     <when test="status == 'EXAMING'">
@@ -242,7 +242,8 @@
                 and toer.paper_download = #{paperDownload}
             </if>
             <if test="status == null or status == ''">
-                and (toer.status = 'FIRST_PREPARE' or toer.status = 'ANSWERING' or toer.status = 'BREAK_OFF' or toer.status = 'RESUME_PREPARE')
+                and (toer.status = 'FIRST_PREPARE' or toer.status = 'ANSWERING' or toer.status = 'BREAK_OFF' or
+                toer.status = 'RESUME_PREPARE')
             </if>
             <if test="cameraMonitorStatus != null and cameraMonitorStatus != ''">
                 and toer.camera_monitor_status = upper(#{cameraMonitorStatus})
@@ -256,7 +257,8 @@
             <if test="mobileSecondMonitorStatus != null and mobileSecondMonitorStatus != ''">
                 and toer.mobile_second_monitor_status = upper(#{mobileSecondMonitorStatus})
             </if>
-        </where>) t,
+        </where>
+        ) t,
         (SELECT @i := 0) as i
         order by t.identity desc
     </select>
@@ -296,7 +298,8 @@
         toer.monitor_video_source as monitorVideoSource,
         toer.monitor_record as monitorRecord,
         toer.finish_type as finishType
-        ,(select count(1) from t_ie_invigilate_exception_info tiiei where tiiei.exam_record_id = toer.id) as exceptionCount
+        ,(select count(1) from t_ie_invigilate_exception_info tiiei where tiiei.exam_record_id = toer.id) as
+        exceptionCount
         ,(select count(1) from t_ie_invigilate_warn_info tiiwi where tiiwi.exam_record_id = toer.id and tiiwi.`type` =
         'FACE_COUNT_ERROR' and tiiwi.`level` = 'D8') as multipleFaceCount
         from
@@ -341,7 +344,7 @@
             and (toer.STATUS = 'FINISHED' or toer.STATUS = 'PERSISTED')
             and toer.first_start_time is not null
         </if>-->
-                    )
+        )
         <if test="examId != null and examId != ''">
             and s.exam_id = #{examId}
         </if>
@@ -369,7 +372,7 @@
         ) temp
         left join t_oe_exam_record toer on
         toer.exam_student_id = temp.examStudentId
-        <where> 1 = 1
+        <where>1 = 1
             <if test="status != null and status != '' and status != 'UN_FINISH'">
                 <choose>
                     <when test="status == 'EXAMING'">
@@ -393,11 +396,13 @@
                 and toer.client_websocket_status = #{clientWebsocketStatus}
             </if>
             <if test="status == null or status == ''">
-                and (toer.status = 'FIRST_PREPARE' or toer.status = 'ANSWERING' or toer.status = 'BREAK_OFF' or toer.status = 'RESUME_PREPARE')
+                and (toer.status = 'FIRST_PREPARE' or toer.status = 'ANSWERING' or toer.status = 'BREAK_OFF' or
+                toer.status = 'RESUME_PREPARE')
             </if>
-        </where>) t,
+        </where>
+        ) t,
         (SELECT @i := 0) as i
-        <where> 1 = 1
+        <where>1 = 1
             <if test="minMultipleFaceCount != null and minMultipleFaceCount != '' or minMultipleFaceCount == 0">
                 and t.multipleFaceCount &gt;= #{minMultipleFaceCount}
             </if>
@@ -479,7 +484,7 @@
             </if>
         </where>
         ) t,(SELECT @i := 0) as i
-        <where> 1 = 1
+        <where>1 = 1
             <if test="minMultipleFaceCount != null and minMultipleFaceCount != '' or minMultipleFaceCount == 0">
                 and t.multipleFaceCount &gt;= #{minMultipleFaceCount}
             </if>
@@ -617,7 +622,8 @@
                 and tees.identity like CONCAT('%', #{identity},'%')
             </if>
             and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
-        </where> ) t
+        </where>
+        ) t
         <where>
             <if test="status != null and status != '' or status == 0">
                 <choose>
@@ -654,7 +660,8 @@
         if(tee.exam_count - tees.already_exam_count <![CDATA[ < ]]> 0,0,tee.exam_count - tees.already_exam_count) as
         leftExamCount,
         (select count(1) from t_oe_exam_record toer where toer.exam_student_id =
-        tees.id and (toer.status = 'FINISHED' or toer.status = 'PERSISTED') and toer.first_start_time is not null) as statusTemp,
+        tees.id and (toer.status = 'FINISHED' or toer.status = 'PERSISTED') and toer.first_start_time is not null) as
+        statusTemp,
         tes.mobile_number as mobileNumber
         from
         t_e_exam_student tees
@@ -693,7 +700,8 @@
             and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
         </where>
         group by
-        tee.id,tees.room_code,tee.name,teea.id,teea.code,tees.`identity`,tees.name,leftExamCount,statusTemp,tes.mobile_number) t
+        tee.id,tees.room_code,tee.name,teea.id,teea.code,tees.`identity`,tees.name,leftExamCount,statusTemp,tes.mobile_number)
+        t
         <where>
             <if test="status != null and status != '' or status == 0">
                 <choose>
@@ -710,7 +718,7 @@
     </select>
 
     <select id="invigilatePageListHistory" resultType="com.qmth.themis.business.bean.admin.InvigilateListHistoryBean">
-        <include refid="invigilatePageListHistorySql" />
+        <include refid="invigilatePageListHistorySql"/>
     </select>
 
     <sql id="invigilatePageListHistorySql">
@@ -731,7 +739,8 @@
         toer.finish_type as finishType
         ,(select count(1) from t_ie_invigilate_warn_info tiiwi where tiiwi.exam_record_id = toer.id and tiiwi.`type` =
         'FACE_COUNT_ERROR' and tiiwi.`level` = 'D8') as multipleFaceCount
-        ,(select count(1) from t_ie_invigilate_exception_info tiiei where tiiei.exam_record_id = toer.id) as exceptionCount
+        ,(select count(1) from t_ie_invigilate_exception_info tiiei where tiiei.exam_record_id = toer.id) as
+        exceptionCount
         from
         (
         select
@@ -774,7 +783,7 @@
             and (toer.STATUS = 'FINISHED' or toer.STATUS = 'PERSISTED')
             and toer.first_start_time is not null
         </if>-->
-                    )
+        )
         <if test="examId != null and examId != ''">
             and s.exam_id = #{examId}
         </if>
@@ -804,7 +813,7 @@
         ) temp
         left join t_oe_exam_record toer on
         toer.exam_student_id = temp.examStudentId
-        <where> 1 = 1
+        <where>1 = 1
             <if test="status != null and status != '' and status != 'UN_FINISH'">
                 <choose>
                     <when test="status == 'EXAMING'">
@@ -835,16 +844,18 @@
             <if test="finishType != null and finishType != ''">
                 <choose>
                     <when test="finishType == 'ALL'">
-                        and (toer.finish_type = 'MANUAL' or toer.finish_type = 'AUTO' or toer.finish_type = 'BREACH' or toer.finish_type = 'INTERRUPT')
+                        and (toer.finish_type = 'MANUAL' or toer.finish_type = 'AUTO' or toer.finish_type = 'BREACH' or
+                        toer.finish_type = 'INTERRUPT')
                     </when>
                     <otherwise>
                         and toer.finish_type = #{finishType}
                     </otherwise>
                 </choose>
             </if>
-        </where>) t,
+        </where>
+        ) t,
         (SELECT @i := 0) as i
-        <where> 1 = 1
+        <where>1 = 1
             <if test="minMultipleFaceCount != null and minMultipleFaceCount != '' or minMultipleFaceCount == 0">
                 and t.multipleFaceCount &gt;= #{minMultipleFaceCount}
             </if>
@@ -861,8 +872,9 @@
         order by t.roomCode
     </sql>
 
-    <select id="invigilatePageListHistoryExport" resultType="com.qmth.themis.business.bean.admin.InvigilateListHistoryBean">
-        <include refid="invigilatePageListHistorySql" />
+    <select id="invigilatePageListHistoryExport"
+            resultType="com.qmth.themis.business.bean.admin.InvigilateListHistoryBean">
+        <include refid="invigilatePageListHistorySql"/>
     </select>
 
     <select id="getDoneCount" resultType="java.util.Map">
@@ -872,7 +884,7 @@
         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">
+        <if test="orgId != null and orgId != ''">
             and h.org_id=#{orgId}
         </if>
         <if test="activityId != null and activityId != ''">
@@ -894,7 +906,7 @@
         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">
+        <if test="orgId != null and orgId != ''">
             and h.org_id=#{orgId}
         </if>
         <if test="activityId != null and activityId != ''">
@@ -994,18 +1006,11 @@
         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">
+        <if test="orgId != null and orgId != ''">
             and h.org_id=#{orgId}
         </if>
     </select>
+
     <select id="getExceptionCount" resultType="java.lang.Long">
         SELECT
         count(DISTINCT(f.id))
@@ -1014,22 +1019,23 @@
         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 1 = 1
-        <if test="orgId != null">
+        <if test="orgId != null and orgId != ''">
             and h.org_id=#{orgId}
         </if>
         and (f.STATUS = 'FIRST_PREPARE' or f.STATUS = 'ANSWERING'
         or f.STATUS = 'BREAK_OFF' or f.STATUS = 'RESUME_PREPARE')
         AND t.id IS NOT NULL
     </select>
+
     <select id="getWarnCount" resultType="java.lang.Long">
         SELECT
-        count(DISTINCT(f.id))
+        count(f.id)
         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 1 = 1
-        <if test="orgId != null">
+        <if test="orgId != null and orgId != ''">
             and h.org_id=#{orgId}
         </if>
         and (f.STATUS = 'FIRST_PREPARE' or f.STATUS = 'ANSWERING'
@@ -1037,6 +1043,126 @@
         AND t.type!='NONE'
         AND t.id IS NOT NULL
     </select>
+
+    <select id="getBreachCount" resultType="java.lang.Long">
+        SELECT
+        count(f.id)
+        FROM
+        t_oe_exam_record f
+        LEFT JOIN t_e_exam_breach_log t ON f.id = t.exam_record_id
+        left join t_e_exam h on f.exam_id=h.id
+        WHERE 1 = 1
+        <if test="orgId != null and orgId != ''">
+            and h.org_id=#{orgId}
+        </if>
+        and (f.STATUS = 'FIRST_PREPARE' or f.STATUS = 'ANSWERING'
+        or f.STATUS = 'BREAK_OFF' or f.STATUS = 'RESUME_PREPARE')
+        AND t.status = 0
+        AND t.id IS NOT NULL
+    </select>
+
+    <select id="getWarnDistribution" resultType="com.qmth.themis.business.bean.admin.ExaminationMonitorWarnDistributionBean">
+        select
+            tiiwi.info as type,
+            count(tiiwi.exam_record_id) as warnCount
+        from
+            t_ie_invigilate_warn_info tiiwi
+            join t_oe_exam_record toer on tiiwi.exam_record_id = toer.id
+            join t_e_exam tee on toer.exam_id = tee.id
+        WHERE 1 = 1
+            <if test="orgId != null and orgId != ''">
+                and tee.org_id = #{orgId}
+            </if>
+            and (toer.STATUS = 'FIRST_PREPARE' or toer.STATUS = 'ANSWERING'
+            or toer.STATUS = 'BREAK_OFF' or toer.STATUS = 'RESUME_PREPARE')
+        group by
+            tiiwi.`info`
+    </select>
+
+    <select id="getWarnRegionDistribution" resultType="com.qmth.themis.business.bean.admin.ExaminationMonitorWarnRegionDistributionBean">
+        select
+            tir.country,
+            tir.province,
+            count(tiiwi.exam_record_id) as warnCount
+        from
+            t_ip_region tir
+                join t_oe_exam_record toer on
+                tir.exam_record_id = toer.id
+                left join t_ie_invigilate_warn_info tiiwi on
+                tiiwi.exam_record_id = toer.id
+                join t_e_exam tee on toer.exam_id = tee.id
+        WHERE 1 = 1
+            <if test="orgId != null and orgId != ''">
+                and tee.org_id = #{orgId}
+            </if>
+            and (toer.STATUS = 'FIRST_PREPARE' or toer.STATUS = 'ANSWERING'
+            or toer.STATUS = 'BREAK_OFF' or toer.STATUS = 'RESUME_PREPARE')
+        group by
+            tir.country,
+            tir.province;
+    </select>
+
+    <select id="getMap" resultType="com.qmth.themis.business.bean.admin.ExaminationMonitorMapBean">
+        select
+            t.country,
+            t.province,
+            sum(t.onlineCount) as onlineCount,
+            sum(t.warnCount) as warnCount
+        from
+            (
+                select
+                    tir.country,
+                    tir.province,
+                    count(toer.id) as onlineCount,
+                    0 as warnCount
+                from
+                    t_ip_region tir
+                        join t_oe_exam_record toer on
+                        tir.exam_record_id = toer.id
+                        join t_e_exam tee on
+                        toer.exam_id = tee.id
+                WHERE 1 = 1
+                    <if test="orgId != null and orgId != ''">
+                        and tee.org_id = #{orgId}
+                    </if>
+                  and toer.client_websocket_status = 'ON_LINE'
+                  and (toer.STATUS = 'FIRST_PREPARE'
+                    or toer.STATUS = 'ANSWERING'
+                    or toer.STATUS = 'BREAK_OFF'
+                    or toer.STATUS = 'RESUME_PREPARE')
+                group by
+                    tir.country,
+                    tir.province
+                union all
+                select
+                    tir.country,
+                    tir.province,
+                    0 as onlineCount,
+                    count(tiiwi.exam_record_id) as warnCount
+                from
+                    t_ip_region tir
+                        join t_oe_exam_record toer on
+                        tir.exam_record_id = toer.id
+                        left join t_ie_invigilate_warn_info tiiwi on
+                        tiiwi.exam_record_id = tir.exam_record_id
+                        join t_e_exam tee on
+                        toer.exam_id = tee.id
+                WHERE 1 = 1
+                <if test="orgId != null and orgId != ''">
+                    and tee.org_id = #{orgId}
+                </if>
+                  and (toer.STATUS = 'FIRST_PREPARE'
+                    or toer.STATUS = 'ANSWERING'
+                    or toer.STATUS = 'BREAK_OFF'
+                    or toer.STATUS = 'RESUME_PREPARE')
+                group by
+                    tir.country,
+                    tir.province) t
+        group by
+            t.country,
+            t.province
+    </select>
+
     <select id="getOrgExamingCount" resultType="java.util.Map">
         SELECT
         o. NAME orgName,
@@ -1051,7 +1177,7 @@
         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 1 = 1
-        <if test="orgId != null">
+        <if test="orgId != null and orgId != ''">
             and h.org_id=#{orgId}
         </if>
         and (f.STATUS = 'FIRST_PREPARE' or f.STATUS = 'ANSWERING'
@@ -1062,6 +1188,7 @@
         ) tem
         LEFT JOIN t_b_org o ON o.id = tem.orgId
     </select>
+
     <select id="getOrgDistribution" resultType="java.util.Map">
         SELECT
         o. NAME orgName,
@@ -1077,7 +1204,7 @@
         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 1 = 1
-        <if test="orgId != null">
+        <if test="orgId != null and orgId != ''">
             and h.org_id=#{orgId}
         </if>
         and (f.STATUS = 'FIRST_PREPARE' or f.STATUS = 'ANSWERING'
@@ -1089,6 +1216,7 @@
         ) tem
         LEFT JOIN t_b_org o ON o.id = tem.orgId
     </select>
+
     <select id="getTypeDistribution" resultType="java.util.Map">
         SELECT
         substring(w.info,instr(w.info,"【") + 1,instr(w.info,"】") - 2) as type,
@@ -1098,7 +1226,7 @@
         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 1 = 1
-        <if test="orgId != null">
+        <if test="orgId != null and orgId != ''">
             and h.org_id=#{orgId}
         </if>
         and (f.STATUS = 'FIRST_PREPARE' or f.STATUS = 'ANSWERING'
@@ -1108,6 +1236,7 @@
         GROUP BY
         w.info
     </select>
+
     <select id="getWarnTrend" resultType="com.qmth.themis.business.bean.admin.ExaminationMonitorHourWarnCountBean">
         SELECT
         FROM_UNIXTIME(w.create_time / 1000,'%H') hour,
@@ -1115,7 +1244,7 @@
         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">
+        <if test="orgId != null and orgId != ''">
             and h.org_id=#{orgId}
         </if>
         GROUP BY
@@ -1282,8 +1411,8 @@
             #{roomCode}
         </foreach>
         and ((t.STATUS = 'ANSWERING' and t.client_websocket_status = 'ON_LINE')
-           or t.STATUS = 'RESUME_PREPARE'
-           or t.STATUS = 'BREAK_OFF')
+        or t.STATUS = 'RESUME_PREPARE'
+        or t.STATUS = 'BREAK_OFF')
         union all
         select
         count(distinct t.exam_student_id) as c
@@ -1325,37 +1454,37 @@
 
     <select id="findByViewAdmin" resultType="java.lang.Integer">
         select
-            count(1) as c
+        count(1) as c
         from
-            t_e_exam_student tees
-                join t_e_student tes on
-                tees.student_id = tes.id
+        t_e_exam_student tees
+        join t_e_student tes on
+        tees.student_id = tes.id
         where
-            exists(
-                    select
-                        tee.id
-                    from
-                        t_e_exam tee
-                    <where> 1 = 1
-                        <if test="orgId != null and orgId != ''">
-                            and tee.org_id = #{orgId}
-                        </if>
-                        <if test="examId != null and examId != ''">
-                            and tee.id = #{examId}
-                        </if>
-                        <if test="examActivityId != null and examActivityId != ''">
-                            and tees.exam_activity_id = #{examActivityId}
-                        </if>
-                        <if test="roomCode != null and roomCode != ''">
-                            and tees.room_code = #{roomCode}
-                        </if>
-                        <if test="courseCode != null and courseCode != ''">
-                            and tees.course_code = #{courseCode}
-                        </if>
-                        and tees.exam_id = tee.id
-                        and tes.org_id = tee.org_id
-                    </where>
-                )
+        exists(
+        select
+        tee.id
+        from
+        t_e_exam tee
+        <where>1 = 1
+            <if test="orgId != null and orgId != ''">
+                and tee.org_id = #{orgId}
+            </if>
+            <if test="examId != null and examId != ''">
+                and tee.id = #{examId}
+            </if>
+            <if test="examActivityId != null and examActivityId != ''">
+                and tees.exam_activity_id = #{examActivityId}
+            </if>
+            <if test="roomCode != null and roomCode != ''">
+                and tees.room_code = #{roomCode}
+            </if>
+            <if test="courseCode != null and courseCode != ''">
+                and tees.course_code = #{courseCode}
+            </if>
+            and tees.exam_id = tee.id
+            and tes.org_id = tee.org_id
+        </where>
+        )
         union all
         select
         count(distinct toer.exam_student_id) as c
@@ -1379,7 +1508,7 @@
         tee.id
         from
         t_e_exam tee
-        <where> 1 = 1
+        <where>1 = 1
             <if test="orgId != null and orgId != ''">
                 and tee.org_id = #{orgId}
             </if>
@@ -1454,7 +1583,8 @@
         from t_oe_exam_record toer
         join t_e_exam tee on tee.id = toer.exam_id
         join t_e_exam_activity teea on teea.exam_id = toer.exam_id and teea.id = toer.exam_activity_id
-        join t_e_exam_student tees on tees.exam_id = toer.exam_id and tees.exam_activity_id = toer.exam_activity_id and tees.id = toer.exam_student_id
+        join t_e_exam_student tees on tees.exam_id = toer.exam_id and tees.exam_activity_id = toer.exam_activity_id and
+        tees.id = toer.exam_student_id
         <where>
             toer.first_start_time is not null
             <if test="examId != null and examId != ''">
@@ -1472,7 +1602,8 @@
             <if test="finishType != null and finishType != ''">
                 <choose>
                     <when test="finishType == 'ALL'">
-                        and (toer.finish_type = 'MANUAL' or toer.finish_type = 'AUTO' or toer.finish_type = 'BREACH' or toer.finish_type = 'INTERRUPT')
+                        and (toer.finish_type = 'MANUAL' or toer.finish_type = 'AUTO' or toer.finish_type = 'BREACH' or
+                        toer.finish_type = 'INTERRUPT')
                     </when>
                     <otherwise>
                         and toer.finish_type = #{finishType}
@@ -1495,7 +1626,8 @@
         from t_oe_exam_record toer
         join t_e_exam tee on tee.id = toer.exam_id
         join t_e_exam_activity teea on teea.exam_id = toer.exam_id and teea.id = toer.exam_activity_id
-        join t_e_exam_student tees on tees.exam_id = toer.exam_id and tees.exam_activity_id = toer.exam_activity_id and tees.id = toer.exam_student_id
+        join t_e_exam_student tees on tees.exam_id = toer.exam_id and tees.exam_activity_id = toer.exam_activity_id and
+        tees.id = toer.exam_student_id
         <where>
             toer.first_start_time is not null
             <if test="examId != null and examId != ''">