Переглянути джерело

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

wangliang 4 роки тому
батько
коміт
a9efe13223

+ 42 - 0
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeReportController.java

@@ -105,4 +105,46 @@ public class TIeReportController {
                              @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
         return ResultUtil.ok(reportService.examReexamList(examId, examActivityId, roomCode, courseCode, name, identity,pageNumber,pageSize));
     }
+    
+    @ApiOperation(value = "违纪名单")
+    @RequestMapping(value = "/exam_breach_list", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
+    public Result examBreachList(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
+                             @ApiParam(value = "考场场次id", required = false) @RequestParam Long examActivityId,
+                             @ApiParam(value = "虚拟考场代码", required = false) @RequestParam String roomCode,
+                             @ApiParam(value = "科目编码", required = false) @RequestParam String courseCode,
+                             @ApiParam(value = "姓名", required = false) @RequestParam String name,
+                             @ApiParam(value = "唯一码", required = false) @RequestParam String identity,
+                             @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
+                             @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+        return ResultUtil.ok(reportService.examBreachList(examId, examActivityId, roomCode, courseCode, name, identity,pageNumber,pageSize));
+    }
+    
+    @ApiOperation(value = "违纪名单明细")
+    @RequestMapping(value = "/exam_breach_list_detail", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
+    public Result examBreachListDetail(@ApiParam(value = "考生id", required = true) @RequestParam Long examStudentId) {
+        return ResultUtil.ok(reportService.examBreachListDetail(examStudentId));
+    }
+    
+    @ApiOperation(value = "撤销违纪名单")
+    @RequestMapping(value = "/exam_revoke_breach_list", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
+    public Result examRevokeBreachList(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
+                             @ApiParam(value = "考场场次id", required = false) @RequestParam Long examActivityId,
+                             @ApiParam(value = "虚拟考场代码", required = false) @RequestParam String roomCode,
+                             @ApiParam(value = "科目编码", required = false) @RequestParam String courseCode,
+                             @ApiParam(value = "姓名", required = false) @RequestParam String name,
+                             @ApiParam(value = "唯一码", required = false) @RequestParam String identity,
+                             @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
+                             @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+        return ResultUtil.ok(reportService.examRevokeBreachList(examId, examActivityId, roomCode, courseCode, name, identity,pageNumber,pageSize));
+    }
+    
+    @ApiOperation(value = "撤销违纪名单明细")
+    @RequestMapping(value = "/exam_revoke_breach_list_detail", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
+    public Result examRevokeBreachListDetail(@ApiParam(value = "考生id", required = true) @RequestParam Long examStudentId) {
+        return ResultUtil.ok(reportService.examRevokeBreachListDetail(examStudentId));
+    }
 }

+ 67 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/backend/ExamBreachDetailListBean.java

@@ -0,0 +1,67 @@
+package com.qmth.themis.business.bean.backend;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+@ApiModel("报表-违纪名单明细返回对象")
+public class ExamBreachDetailListBean {
+
+
+	@ApiModelProperty(name = "违纪撤销/处理")
+    private String status;
+	
+	@ApiModelProperty(name = "操作人")
+    private String createName;
+	
+	@ApiModelProperty(name = "结束时间")
+    private Long endTime;
+
+    @ApiModelProperty(name = "类型原因")
+    private String type;
+
+    @ApiModelProperty(name = "备注")
+    private String remark;
+
+	public String getStatus() {
+		return status;
+	}
+
+	public void setStatus(String status) {
+		this.status = status;
+	}
+
+	public String getCreateName() {
+		return createName;
+	}
+
+	public void setCreateName(String createName) {
+		this.createName = createName;
+	}
+
+	public Long getEndTime() {
+		return endTime;
+	}
+
+	public void setEndTime(Long endTime) {
+		this.endTime = endTime;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+    
+    
+}

+ 131 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/backend/ExamBreachListBean.java

@@ -0,0 +1,131 @@
+package com.qmth.themis.business.bean.backend;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+@ApiModel("报表-违纪名单返回对象")
+public class ExamBreachListBean {
+
+
+	@ApiModelProperty(name = "考生id")
+    private String examStudentId;
+	@ApiModelProperty(name = "考试名称")
+    private String examName;
+	
+	@ApiModelProperty(name = "考试id")
+    private Long examId;
+
+    @ApiModelProperty(name = "场次id")
+    private Long examActivityId;
+
+    @ApiModelProperty(name = "虚拟考场代码")
+    private String roomCode;
+
+    @ApiModelProperty(name = "虚拟考场名称")
+    private String roomName;
+
+    @ApiModelProperty(name = "唯一码")
+    private String identity;
+    
+    @ApiModelProperty(name = "姓名")
+    private String name;
+    
+    @ApiModelProperty(name = "科目名称")
+    private String courseCode;
+    
+    @ApiModelProperty(name = "科目编码")
+    private String courseName;
+    
+    @ApiModelProperty(name = "违纪状态")
+    private String breachStatus;
+
+	public String getExamStudentId() {
+		return examStudentId;
+	}
+
+	public void setExamStudentId(String examStudentId) {
+		this.examStudentId = examStudentId;
+	}
+
+	public String getExamName() {
+		return examName;
+	}
+
+	public void setExamName(String examName) {
+		this.examName = examName;
+	}
+
+	public Long getExamId() {
+		return examId;
+	}
+
+	public void setExamId(Long examId) {
+		this.examId = examId;
+	}
+
+	public Long getExamActivityId() {
+		return examActivityId;
+	}
+
+	public void setExamActivityId(Long examActivityId) {
+		this.examActivityId = examActivityId;
+	}
+
+	public String getRoomCode() {
+		return roomCode;
+	}
+
+	public void setRoomCode(String roomCode) {
+		this.roomCode = roomCode;
+	}
+
+	public String getRoomName() {
+		return roomName;
+	}
+
+	public void setRoomName(String roomName) {
+		this.roomName = roomName;
+	}
+
+	public String getIdentity() {
+		return identity;
+	}
+
+	public void setIdentity(String identity) {
+		this.identity = identity;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getCourseCode() {
+		return courseCode;
+	}
+
+	public void setCourseCode(String courseCode) {
+		this.courseCode = courseCode;
+	}
+
+	public String getCourseName() {
+		return courseName;
+	}
+
+	public void setCourseName(String courseName) {
+		this.courseName = courseName;
+	}
+
+	public String getBreachStatus() {
+		return breachStatus;
+	}
+
+	public void setBreachStatus(String breachStatus) {
+		this.breachStatus = breachStatus;
+	}
+    
+    
+}

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

@@ -1,8 +1,15 @@
 package com.qmth.themis.business.dao;
 
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.qmth.themis.business.bean.backend.ExamBreachDetailListBean;
+import com.qmth.themis.business.bean.backend.ExamBreachListBean;
 import com.qmth.themis.business.entity.TEExamBreachLog;
-import org.apache.ibatis.annotations.Mapper;
 
 /**
  * @Description: 考生违纪处理 Mapper 接口
@@ -13,5 +20,13 @@ import org.apache.ibatis.annotations.Mapper;
  */
 @Mapper
 public interface TEExamBreachLogMapper extends BaseMapper<TEExamBreachLog> {
+	public IPage<ExamBreachListBean> getExamBreachPage(IPage<ExamBreachListBean> iPage, @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 List<ExamBreachDetailListBean> getExamBreachDetailList(@Param("examStudentId") Long examStudentId);
 
+	public IPage<ExamBreachListBean> getExamRevokeBreachPage(IPage<ExamBreachListBean> iPage, @Param("examId") Long examId,
+			@Param("activityId") Long activityId, @Param("roomCode") String roomCode,
+			@Param("courseCode") String courseCode, @Param("name") String name, @Param("identity") String identity);
 }

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

@@ -4,6 +4,7 @@ import java.util.List;
 import java.util.Map;
 
 import com.qmth.themis.business.base.BasePage;
+import com.qmth.themis.business.bean.backend.ExamBreachDetailListBean;
 import com.qmth.themis.business.bean.backend.ExamExceptionDetailListBean;
 
 public interface TIeReportService {
@@ -23,4 +24,14 @@ public interface TIeReportService {
 
 	public BasePage examReexamList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
 			String identity, int pageNumber, int pageSize);
+
+	public BasePage examBreachList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
+			String identity, int pageNumber, int pageSize);
+
+	public List<ExamBreachDetailListBean> examBreachListDetail(Long examStudentId);
+
+	public BasePage examRevokeBreachList(Long examId, Long examActivityId, String roomCode, String courseCode,
+			String name, String identity, int pageNumber, int pageSize);
+
+	public List<ExamBreachDetailListBean> examRevokeBreachListDetail(Long examStudentId);
 }

+ 72 - 0
themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeReportServiceImpl.java

@@ -9,6 +9,7 @@ import java.util.stream.Collectors;
 
 import javax.annotation.Resource;
 
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -17,6 +18,8 @@ import com.baomidou.mybatisplus.core.metadata.OrderItem;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.qmth.themis.business.base.BasePage;
+import com.qmth.themis.business.bean.backend.ExamBreachDetailListBean;
+import com.qmth.themis.business.bean.backend.ExamBreachListBean;
 import com.qmth.themis.business.bean.backend.ExamDeficiencyListBean;
 import com.qmth.themis.business.bean.backend.ExamExceptionDetailListBean;
 import com.qmth.themis.business.bean.backend.ExamExceptionListBean;
@@ -24,11 +27,13 @@ import com.qmth.themis.business.bean.backend.ExamReexamListBean;
 import com.qmth.themis.business.bean.backend.ExamViewCountListBean;
 import com.qmth.themis.business.cache.bean.ExamActivityCacheBean;
 import com.qmth.themis.business.cache.bean.ExamCacheBean;
+import com.qmth.themis.business.dao.TEExamBreachLogMapper;
 import com.qmth.themis.business.dao.TEExamReexamMapper;
 import com.qmth.themis.business.dao.TEExamStudentMapper;
 import com.qmth.themis.business.dao.TIeInvigilateExceptionInfoMapper;
 import com.qmth.themis.business.dao.TOeExamRecordMapper;
 import com.qmth.themis.business.entity.TEExamActivity;
+import com.qmth.themis.business.enums.BreachTypeEnum;
 import com.qmth.themis.business.enums.ExceptionEnum;
 import com.qmth.themis.business.service.TEExamActivityService;
 import com.qmth.themis.business.service.TEExamService;
@@ -54,6 +59,9 @@ public class TIeReportServiceImpl implements TIeReportService {
     
     @Resource
     TEExamReexamMapper examReexamMapper;
+    
+    @Resource
+    TEExamBreachLogMapper examBreachLogMapper;
 
 	@Override
 	public Map<String, Object> examView(Long examId, Long examActivityId, String roomCode, String courseCode,
@@ -259,5 +267,69 @@ public class TIeReportServiceImpl implements TIeReportService {
         return basePage;
 	}
 
+	@Override
+	public BasePage examBreachList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
+			String identity, int pageNumber, int pageSize) {
+		Page<ExamBreachListBean> ipage=new Page<>(pageNumber, pageSize);
+		ipage.addOrder(OrderItem.asc("f.exam_student_id"));
+		IPage<ExamBreachListBean> total = examBreachLogMapper.getExamBreachPage(ipage,examId, examActivityId, roomCode, courseCode,name,identity);
+        List<ExamBreachListBean> data=total.getRecords();
+        if(data==null||data.size()==0) {
+        	BasePage basePage = new BasePage(total.getRecords(), total.getCurrent(), total.getSize(), total.getTotal());
+        	return basePage;
+        }
+        ExamCacheBean exam=examService.getExamCacheBean(examId);
+		for(ExamBreachListBean b:data) {
+			b.setExamName(exam.getName());
+		}
+		BasePage basePage = new BasePage(total.getRecords(), total.getCurrent(), total.getSize(), total.getTotal());
+        return basePage;
+	}
+
+	@Override
+	public List<ExamBreachDetailListBean> examBreachListDetail(Long examStudentId) {
+		List<ExamBreachDetailListBean> ret=examBreachLogMapper.getExamBreachDetailList(examStudentId);
+		if(ret!=null&&ret.size()>0) {
+			for(ExamBreachDetailListBean b:ret) {
+				if(StringUtils.isNotBlank(b.getType())){
+					b.setType(BreachTypeEnum.valueOf(b.getType()).getCode());
+				}
+			}
+		}
+		return ret;
+	}
+
+	@Override
+	public BasePage examRevokeBreachList(Long examId, Long examActivityId, String roomCode, String courseCode,
+			String name, String identity, int pageNumber, int pageSize) {
+		Page<ExamBreachListBean> ipage=new Page<>(pageNumber, pageSize);
+		ipage.addOrder(OrderItem.asc("f.exam_student_id"));
+		IPage<ExamBreachListBean> total = examBreachLogMapper.getExamRevokeBreachPage(ipage,examId, examActivityId, roomCode, courseCode,name,identity);
+        List<ExamBreachListBean> data=total.getRecords();
+        if(data==null||data.size()==0) {
+        	BasePage basePage = new BasePage(total.getRecords(), total.getCurrent(), total.getSize(), total.getTotal());
+        	return basePage;
+        }
+        ExamCacheBean exam=examService.getExamCacheBean(examId);
+		for(ExamBreachListBean b:data) {
+			b.setExamName(exam.getName());
+		}
+		BasePage basePage = new BasePage(total.getRecords(), total.getCurrent(), total.getSize(), total.getTotal());
+        return basePage;
+	}
+
+	@Override
+	public List<ExamBreachDetailListBean> examRevokeBreachListDetail(Long examStudentId) {
+		List<ExamBreachDetailListBean> ret=examBreachLogMapper.getExamBreachDetailList(examStudentId);
+		if(ret!=null&&ret.size()>0) {
+			for(ExamBreachDetailListBean b:ret) {
+				if(StringUtils.isNotBlank(b.getType())) {
+					b.setType(BreachTypeEnum.valueOf(b.getType()).getCode());
+				}
+			}
+		}
+		return ret;
+	}
+
 
 }

+ 92 - 1
themis-business/src/main/resources/mapper/TEExamBreachLogMapper.xml

@@ -1,5 +1,96 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.qmth.themis.business.dao.TEExamBreachLogMapper">
+<mapper
+	namespace="com.qmth.themis.business.dao.TEExamBreachLogMapper">
+	<select id="getExamBreachPage"
+		resultType="com.qmth.themis.business.bean.backend.ExamBreachListBean">
+		SELECT
+		f.exam_student_id examStudentId,
+		t.exam_id examId,
+		t.exam_activity_id examActivityId,
+		t.room_code roomCode,
+		t.course_code
+		courseCode,
+		t.course_name courseName,
+		t.NAME,
+		t.identity,
+		t.room_name
+		roomName,'违纪' breachStatus
+		FROM
+		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
+		<if test="activityId != null and activityId != ''">
+			and f.exam_activity_id = #{activityId}
+		</if>
+		<if test="roomCode != null and roomCode != ''">
+			and t.room_code =#{roomCode}
+		</if>
+		<if test="courseCode != null and courseCode != ''">
+			and t.course_code = #{courseCode}
+		</if>
+		<if test="identity != null and identity != ''">
+			and t.identity like concat(#{identity},'%')
+		</if>
+		<if test="name != null and name != ''">
+			and t.name like concat(#{name},'%')
+		</if>
+	</select>
+	<select id="getExamRevokeBreachPage"
+		resultType="com.qmth.themis.business.bean.backend.ExamBreachListBean">
+		SELECT
+		f.exam_student_id examStudentId,
+		t.exam_id examId,
+		t.exam_activity_id examActivityId,
+		t.room_code roomCode,
+		t.course_code
+		courseCode,
+		t.course_name courseName,
+		t.NAME,
+		t.identity,
+		t.room_name
+		roomName,'正常' breachStatus
+		FROM
+		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
+		<if test="activityId != null and activityId != ''">
+			and f.exam_activity_id = #{activityId}
+		</if>
+		<if test="roomCode != null and roomCode != ''">
+			and t.room_code =#{roomCode}
+		</if>
+		<if test="courseCode != null and courseCode != ''">
+			and t.course_code = #{courseCode}
+		</if>
+		<if test="identity != null and identity != ''">
+			and t.identity like concat(#{identity},'%')
+		</if>
+		<if test="name != null and name != ''">
+			and t.name like concat(#{name},'%')
+		</if>
+	</select>
 
+	<select id="getExamBreachDetailList"
+		resultType="com.qmth.themis.business.bean.backend.ExamBreachDetailListBean">
+		SELECT
+		(case when f.status=0 then '违纪处理' else '撤销违纪'
+		end)status,
+		t.name createName,
+		UNIX_TIMESTAMP(f.update_time) * 1000
+		endTime,
+		f.type type,
+		f.remark remark
+		FROM
+		t_e_exam_breach_log f
+		left join
+		t_b_user t on f.create_id=t.id
+		where f.exam_student_id
+		=#{examStudentId}
+		order by f.create_time
+	</select>
 </mapper>