xiatian 4 роки тому
батько
коміт
e74a33ed4a

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

@@ -147,4 +147,25 @@ public class TIeReportController {
     public Result examRevokeBreachListDetail(@ApiParam(value = "考生id", required = true) @RequestParam Long examStudentId) {
         return ResultUtil.ok(reportService.examRevokeBreachListDetail(examStudentId));
     }
+    
+    @ApiOperation(value = "考生日志")
+    @RequestMapping(value = "/exam_student_log_list", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
+    public Result examStudentLogList(@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.examStudentLogList(examId, examActivityId, roomCode, courseCode, name, identity,pageNumber,pageSize));
+    }
+    
+    @ApiOperation(value = "考生日志明细")
+    @RequestMapping(value = "/exam_student_log_list_detail", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
+    public Result examStudentLogListDetail(@ApiParam(value = "考生id", required = true) @RequestParam Long examStudentId) {
+        return ResultUtil.ok(reportService.examStudentLogListDetail(examStudentId));
+    }
 }

+ 46 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/backend/ExamStudentLogDetailListBean.java

@@ -0,0 +1,46 @@
+package com.qmth.themis.business.bean.backend;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+@ApiModel("报表-考生日志明细返回对象")
+public class ExamStudentLogDetailListBean {
+
+
+	@ApiModelProperty(name = "发生时间")
+    private Long createTime;
+	
+	@ApiModelProperty(name = "事件类型")
+    private String type;
+	
+	@ApiModelProperty(name = "详情")
+    private String remark;
+
+	public Long getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Long createTime) {
+		this.createTime = createTime;
+	}
+
+	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;
+	}
+
+
+    
+    
+}

+ 118 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/backend/ExamStudentLogListBean.java

@@ -0,0 +1,118 @@
+package com.qmth.themis.business.bean.backend;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+@ApiModel("报表-考生日志返回对象")
+public class ExamStudentLogListBean {
+
+
+	@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;
+
+	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;
+	}
+}

+ 7 - 2
themis-business/src/main/java/com/qmth/themis/business/dao/TEExamStudentLogMapper.java

@@ -1,8 +1,13 @@
 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.qmth.themis.business.bean.backend.ExamStudentLogDetailListBean;
 import com.qmth.themis.business.entity.TEExamStudentLog;
-import org.apache.ibatis.annotations.Mapper;
 
 /**
  * @Description: 考生轨迹 Mapper 接口
@@ -13,5 +18,5 @@ import org.apache.ibatis.annotations.Mapper;
  */
 @Mapper
 public interface TEExamStudentLogMapper extends BaseMapper<TEExamStudentLog> {
-
+	public List<ExamStudentLogDetailListBean> getExamStudentLogList(@Param("examStudentId") Long examStudentId);
 }

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

@@ -9,6 +9,7 @@ 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.ExamDeficiencyListBean;
+import com.qmth.themis.business.bean.backend.ExamStudentLogListBean;
 import com.qmth.themis.business.bean.backend.ExamViewCountListBean;
 import com.qmth.themis.business.dto.response.RoomCodeQueryDto;
 import com.qmth.themis.business.dto.response.TEExamStudentDto;
@@ -66,4 +67,7 @@ public interface TEExamStudentMapper extends BaseMapper<TEExamStudent> {
 			@Param("activityId") Long activityId, @Param("roomCode") String roomCode,
 			@Param("courseCode") String courseCode, @Param("name") String name, @Param("identity") String identity,@Param("activityIds") List<Long> activityIds);
 
+    public IPage<ExamStudentLogListBean> getPageForStudentLog(IPage<ExamStudentLogListBean> iPage, @Param("examId") Long examId,
+			@Param("activityId") Long activityId, @Param("roomCode") String roomCode,
+			@Param("courseCode") String courseCode, @Param("name") String name, @Param("identity") String identity);
 }

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

@@ -6,6 +6,7 @@ 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;
+import com.qmth.themis.business.bean.backend.ExamStudentLogDetailListBean;
 
 public interface TIeReportService {
 	public Map<String, Object> examView(Long examId, Long examActivityId, String roomCode, String courseCode,
@@ -34,4 +35,9 @@ public interface TIeReportService {
 			String name, String identity, int pageNumber, int pageSize);
 
 	public List<ExamBreachDetailListBean> examRevokeBreachListDetail(Long examStudentId);
+
+	public BasePage examStudentLogList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
+			String identity, int pageNumber, int pageSize);
+
+	public List<ExamStudentLogDetailListBean> examStudentLogListDetail(Long examStudentId);
 }

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

@@ -24,11 +24,14 @@ import com.qmth.themis.business.bean.backend.ExamDeficiencyListBean;
 import com.qmth.themis.business.bean.backend.ExamExceptionDetailListBean;
 import com.qmth.themis.business.bean.backend.ExamExceptionListBean;
 import com.qmth.themis.business.bean.backend.ExamReexamListBean;
+import com.qmth.themis.business.bean.backend.ExamStudentLogDetailListBean;
+import com.qmth.themis.business.bean.backend.ExamStudentLogListBean;
 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.TEExamStudentLogMapper;
 import com.qmth.themis.business.dao.TEExamStudentMapper;
 import com.qmth.themis.business.dao.TIeInvigilateExceptionInfoMapper;
 import com.qmth.themis.business.dao.TOeExamRecordMapper;
@@ -62,6 +65,9 @@ public class TIeReportServiceImpl implements TIeReportService {
     
     @Resource
     TEExamBreachLogMapper examBreachLogMapper;
+    
+    @Resource
+    TEExamStudentLogMapper examStudentLogMapper;
 
 	@Override
 	public Map<String, Object> examView(Long examId, Long examActivityId, String roomCode, String courseCode,
@@ -331,5 +337,30 @@ public class TIeReportServiceImpl implements TIeReportService {
 		return ret;
 	}
 
+	@Override
+	public BasePage examStudentLogList(Long examId, Long examActivityId, String roomCode, String courseCode,
+			String name, String identity, int pageNumber, int pageSize) {
+		Page<ExamStudentLogListBean> ipage=new Page<>(pageNumber, pageSize);
+		ipage.addOrder(OrderItem.asc("t.id"));
+		IPage<ExamStudentLogListBean> total = examStudentMapper.getPageForStudentLog(ipage,examId, examActivityId, roomCode, courseCode,name,identity);
+        List<ExamStudentLogListBean> 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(ExamStudentLogListBean b:data) {
+			b.setExamName(exam.getName());
+		}
+		BasePage basePage = new BasePage(total.getRecords(), total.getCurrent(), total.getSize(), total.getTotal());
+        return basePage;
+	}
+
+	@Override
+	public List<ExamStudentLogDetailListBean> examStudentLogListDetail(Long examStudentId) {
+		List<ExamStudentLogDetailListBean> ret=examStudentLogMapper.getExamStudentLogList(examStudentId);
+		return ret;
+	}
+
 
 }

+ 13 - 0
themis-business/src/main/resources/mapper/TEExamStudentLogMapper.xml

@@ -2,4 +2,17 @@
 <!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.TEExamStudentLogMapper">
 
+	<select id="getExamStudentLogList"
+		resultType="com.qmth.themis.business.bean.backend.ExamStudentLogDetailListBean">
+		SELECT
+		UNIX_TIMESTAMP(f.create_time) * 1000
+		createTime,
+		f.type type,
+		f.info remark
+		FROM
+		t_e_exam_student_log f
+		where f.exam_student_id
+		=#{examStudentId}
+		order by f.create_time
+	</select>
 </mapper>

+ 26 - 0
themis-business/src/main/resources/mapper/TEExamStudentMapper.xml

@@ -170,4 +170,30 @@
 		</if>
 	</select>
 	
+	<select id="getPageForStudentLog"
+		resultType="com.qmth.themis.business.bean.backend.ExamStudentLogListBean">
+		select t.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 from
+		t_e_exam_student t
+		where t.exam_id = #{examId} 
+		<if test="activityId != null and activityId != ''">
+			and t.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>
+	
 </mapper>