소스 검색

新增违纪名单导出

wangliang 1 년 전
부모
커밋
d13deac624

+ 17 - 0
themis-admin/src/main/java/com/qmth/themis/admin/api/TIeReportController.java

@@ -1,5 +1,6 @@
 package com.qmth.themis.admin.api;
 
+import com.qmth.themis.business.bean.admin.ExamBreachListExportBean;
 import com.qmth.themis.business.bean.admin.ExamDeficiencyListBean;
 import com.qmth.themis.business.bean.admin.ExamViewCountListBean;
 import com.qmth.themis.business.bean.admin.InvigilateListPatrolReportBean;
@@ -196,6 +197,22 @@ public class TIeReportController {
         return ResultUtil.ok(reportService.examBreachListDetail(examStudentId, 0, pageNumber, pageSize));
     }
 
+    @ApiOperation(value = "违纪名单导出")
+    @RequestMapping(value = "/exam_breach_list/export", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
+    public void examBreachListExport(@ApiParam(value = "考试id", required = true) @RequestParam(required = true) Long examId,
+                                     @ApiParam(value = "考场场次id", required = false) @RequestParam(required = false) Long examActivityId,
+                                     @ApiParam(value = "虚拟考场代码", required = false) @RequestParam(required = false) String roomCode,
+                                     @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) throws Exception {
+        if (Objects.isNull(examId) || Objects.equals(examId, "")) {
+            throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
+        }
+        List<ExamBreachListExportBean> examDeficiencyListBeanList = reportService.examBreachListExport(examId, examActivityId, roomCode, courseCode, name, identity);
+        ExportUtils.exportEXCEL("违纪名单", ExamBreachListExportBean.class, examDeficiencyListBeanList, ServletUtil.getResponse());
+    }
+
     @ApiOperation(value = "撤销违纪名单")
     @RequestMapping(value = "/exam_revoke_breach_list", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})

+ 3 - 1
themis-business/src/main/java/com/qmth/themis/business/bean/admin/ExamBreachListBean.java

@@ -5,8 +5,10 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
+import java.io.Serializable;
+
 @ApiModel("报表-违纪名单返回对象")
-public class ExamBreachListBean {
+public class ExamBreachListBean  implements Serializable {
 
 	@ApiModelProperty(name = "考生id")
     private String examStudentId;

+ 190 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/admin/ExamBreachListExportBean.java

@@ -0,0 +1,190 @@
+package com.qmth.themis.business.bean.admin;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.themis.business.excel.ExcelProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+@ApiModel("报表-违纪名单导出返回对象")
+public class ExamBreachListExportBean implements Serializable {
+
+    @ApiModelProperty(name = "考生id")
+    private String examStudentId;
+
+    @ApiModelProperty(name = "考试名称")
+    @ExcelProperty(name = "批次名称(ID)", width = 30, index = 1)
+    private String examName;
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(name = "考试id")
+    private Long examId;
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(name = "场次id")
+    private Long examActivityId;
+
+    @ApiModelProperty(name = "场次代码")
+    @ExcelProperty(name = "场次代码", width = 30, index = 2)
+    private String examActivityCode;
+
+    @ApiModelProperty(name = "虚拟考场代码")
+    private String roomCode;
+
+    @ApiModelProperty(name = "虚拟考场名称")
+    private String roomName;
+
+    @ApiModelProperty(name = "考场名称(代码)")
+    @ExcelProperty(name = "考场名称(代码)", width = 30, index = 3)
+    private String roomNameCode;
+
+    @ApiModelProperty(name = "唯一码")
+    @ExcelProperty(name = "证件号", width = 30, index = 4)
+    private String identity;
+
+    @ApiModelProperty(name = "姓名")
+    @ExcelProperty(name = "姓名", width = 30, index = 5)
+    private String name;
+
+    @ApiModelProperty(name = "科目名称")
+    private String courseCode;
+
+    @ApiModelProperty(name = "科目编码")
+    private String courseName;
+
+    @ApiModelProperty(name = "科目名称(代码)")
+    @ExcelProperty(name = "科目名称(代码)", width = 30, index = 6)
+    private String courseNameCode;
+
+    @ApiModelProperty(name = "违纪状态")
+    @ExcelProperty(name = "违纪/正常", width = 30, index = 7)
+    private String breachStatus;
+
+    @ApiModelProperty(name = "违纪明细")
+    @ExcelProperty(name = "违纪明细", width = 150, index = 8)
+    private String breachDetail;
+
+    public String getBreachDetail() {
+        return breachDetail;
+    }
+
+    public void setBreachDetail(String breachDetail) {
+        this.breachDetail = breachDetail;
+    }
+
+    public String getRoomNameCode() {
+        return roomNameCode;
+    }
+
+    public void setRoomNameCode(String roomNameCode) {
+        this.roomNameCode = roomNameCode;
+    }
+
+    public String getCourseNameCode() {
+        return courseNameCode;
+    }
+
+    public void setCourseNameCode(String courseNameCode) {
+        this.courseNameCode = courseNameCode;
+    }
+
+    public String getExamActivityCode() {
+        return examActivityCode;
+    }
+
+    public void setExamActivityCode(String examActivityCode) {
+        this.examActivityCode = examActivityCode;
+    }
+
+    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;
+    }
+
+
+}

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

@@ -1,13 +1,15 @@
 package com.qmth.themis.business.dao;
 
-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.admin.ExamBreachDetailListBean;
 import com.qmth.themis.business.bean.admin.ExamBreachListBean;
+import com.qmth.themis.business.bean.admin.ExamBreachListExportBean;
 import com.qmth.themis.business.entity.TEExamBreachLog;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * @Description: 考生违纪处理 Mapper 接口
@@ -18,13 +20,28 @@ import com.qmth.themis.business.entity.TEExamBreachLog;
  */
 @Mapper
 public interface TEExamBreachLogMapper extends BaseMapper<TEExamBreachLog> {
-	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> 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);
+
+    /**
+     * 违纪名单导出
+     * @param orgId
+     * @param examId
+     * @param activityId
+     * @param roomCode
+     * @param courseCode
+     * @param name
+     * @param identity
+     * @return
+     */
+    public List<ExamBreachListExportBean> getExamBreachPageExport(@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("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<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);
 }

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

@@ -147,8 +147,22 @@ public interface TIeReportService {
      * @param pageSize
      * @return
      */
-    public IPage examBreachList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
-                                String identity, int pageNumber, int pageSize);
+    public IPage<ExamBreachListBean> examBreachList(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
+     * @return
+     */
+    public List<ExamBreachListExportBean> examBreachListExport(Long examId, Long examActivityId, String roomCode, String courseCode, String name, String identity);
+
 
     /**
      * 违纪名单明细

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

@@ -286,6 +286,23 @@ public class TIeReportServiceImpl implements TIeReportService {
                 courseCode, name, identity);
     }
 
+    /**
+     * 违纪名单导出
+     *
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param courseCode
+     * @param name
+     * @param identity
+     * @return
+     */
+    @Override
+    public List<ExamBreachListExportBean> examBreachListExport(Long examId, Long examActivityId, String roomCode, String courseCode, String name, String identity) {
+        TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        return examBreachLogMapper.getExamBreachPageExport(tbUser.getOrgId(), examId, examActivityId, roomCode, courseCode, name, identity);
+    }
+
     /**
      * 违纪名单明细
      *

+ 6 - 0
themis-business/src/main/resources/db/log/1.2.8.log

@@ -11,6 +11,9 @@ VALUES(206, '报表-情况统计导出', '/api/admin/report/exam_view_count/expo
 INSERT INTO t_b_privilege
 (id, name, url, `type`, parent_id, `sequence`, remark, create_time)
 VALUES(207, '报表-缺考名单导出', '/api/admin/report/exam_deficiency_list/export', 'LINK', 24, 4, NULL, 1600932652000);
+INSERT INTO t_b_privilege
+(id, name, url, `type`, parent_id, `sequence`, remark, create_time)
+VALUES(208, '报表-违纪名单导出', '/api/admin/report/exam_breach_list/export', 'LINK', 24, 9, NULL, 1600932652000);
 
 INSERT INTO t_b_role_privilege
 (id, role_code, privilege_id)
@@ -18,6 +21,9 @@ VALUES(256, 'ADMIN', 206);
 INSERT INTO t_b_role_privilege
 (id, role_code, privilege_id)
 VALUES(257, 'ADMIN', 207);
+INSERT INTO t_b_role_privilege
+(id, role_code, privilege_id)
+VALUES(258, 'ADMIN', 208);
 
 /*删除进度查询菜单*/
 INSERT INTO t_b_role_privilege

+ 69 - 7
themis-business/src/main/resources/mapper/TEExamBreachLogMapper.xml

@@ -2,10 +2,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">
 
-	<select id="getExamBreachPage"
-		resultType="com.qmth.themis.business.bean.admin.ExamBreachListBean">
-		SELECT
-        distinct tee.name as examName,
+	<select id="getExamBreachPage" resultType="com.qmth.themis.business.bean.admin.ExamBreachListBean">
+		SELECT distinct tee.name as examName,
 		f.exam_student_id examStudentId,
 		t.exam_id examId,
 		t.exam_activity_id examActivityId,
@@ -25,15 +23,15 @@
 		left join t_e_student h on t.student_id=h.id
 		left join t_e_exam_activity teea on teea.id = t.exam_activity_id
 		join t_e_exam tee on tee.id = f.exam_id
-		where f.exam_id=#{examId} and f.status=0
+		where f.exam_id = #{examId} and f.status = 0
 		<if test="orgId != null">
-		 	and h.org_id=#{orgId}
+		 	and h.org_id = #{orgId}
 		</if>
 		<if test="activityId != null and activityId != ''">
 			and f.exam_activity_id = #{activityId}
 		</if>
 		<if test="roomCode != null and roomCode != ''">
-			and t.room_code =#{roomCode}
+			and t.room_code = #{roomCode}
 		</if>
 		<if test="courseCode != null and courseCode != ''">
 			and t.course_code = #{courseCode}
@@ -47,6 +45,70 @@
         order by CAST(teea.code AS UNSIGNED),CAST(t.room_code AS UNSIGNED)
 	</select>
 
+    <select id="getExamBreachPageExport" resultType="com.qmth.themis.business.bean.admin.ExamBreachListExportBean">
+        SELECT tee.name as examName,
+        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,
+        teea.code as examActivityCode,
+        CONCAT(t.room_name,'(',t.room_code,')') as roomNameCode,
+        CONCAT(t.course_name,'(',t.course_code,')') as courseNameCode,
+        group_concat(CONCAT('时间:' , DATE_FORMAT(FROM_UNIXTIME(f.update_time / 1000), '%Y-%m-%d %H:%i:%s'), ",违纪类型:" , case when f.type = 'PLAGIARIZE' then '夹带抄袭'
+        when f.type = 'LOOK_AROUND' then '左顾右盼'
+        when f.type = 'ILLEGAL_ITEMS' then '考中携带违规物品'
+        when f.type = 'TAKER' then '他人替考'
+        when f.type = 'ASSISTANCE' then '他人协助作答'
+        when f.type = 'BLACK_LIST_SOFTWARE' then '考中使用违规(远程协助、直播等)软件'
+        else '其它' end, ",违纪说明:" ,f.description) separator ';') as breachDetail
+        FROM
+        t_e_exam_breach_log 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
+        left join t_e_exam_activity teea on teea.id = t.exam_activity_id
+        join t_e_exam tee on tee.id = f.exam_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>
+        <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>
+        group by
+        tee.name,
+        f.exam_student_id,
+        t.exam_id,
+        t.exam_activity_id,
+        t.room_code,
+        t.course_code,
+        t.course_name,
+        t.NAME,
+        t.identity,
+        t.room_name,
+        teea.code
+        order by CAST(teea.code AS UNSIGNED),CAST(t.room_code AS UNSIGNED)
+    </select>
+
 	<select id="getExamRevokeBreachPage"
 		resultType="com.qmth.themis.business.bean.admin.ExamBreachListBean">
 		SELECT