zouxuan 5 年之前
父節點
當前提交
81bcabfac1

+ 13 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dto/NeedCheckingDetailDto.java

@@ -2,6 +2,8 @@ package com.keao.edu.user.dto;
 
 
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 
 
+import java.util.Date;
+
 public class NeedCheckingDetailDto {
 public class NeedCheckingDetailDto {
 
 
     @ApiModelProperty(value = "报名编号")
     @ApiModelProperty(value = "报名编号")
@@ -28,6 +30,9 @@ public class NeedCheckingDetailDto {
     @ApiModelProperty(value = "是否录制")
     @ApiModelProperty(value = "是否录制")
     private Integer recordFlag;
     private Integer recordFlag;
 
 
+    @ApiModelProperty(value = "录制开始时间")
+    private Date recordStartTime;
+
     @ApiModelProperty(value = "学员是否考试")
     @ApiModelProperty(value = "学员是否考试")
     private Integer finishedExam;
     private Integer finishedExam;
 
 
@@ -52,6 +57,14 @@ public class NeedCheckingDetailDto {
     @ApiModelProperty(value = "机构")
     @ApiModelProperty(value = "机构")
     private String tenantId;
     private String tenantId;
 
 
+    public Date getRecordStartTime() {
+        return recordStartTime;
+    }
+
+    public void setRecordStartTime(Date recordStartTime) {
+        this.recordStartTime = recordStartTime;
+    }
+
     public Integer getLevel() {
     public Integer getLevel() {
         return level;
         return level;
     }
     }

+ 11 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamCertificationServiceImpl.java

@@ -4,6 +4,7 @@ package com.keao.edu.user.service.impl;
 import com.keao.edu.auth.api.client.SysUserFeignService;
 import com.keao.edu.auth.api.client.SysUserFeignService;
 import com.keao.edu.auth.api.entity.SysUser;
 import com.keao.edu.auth.api.entity.SysUser;
 import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.common.exception.BizException;
 import com.keao.edu.common.service.impl.BaseServiceImpl;
 import com.keao.edu.common.service.impl.BaseServiceImpl;
 import com.keao.edu.user.api.entity.Student;
 import com.keao.edu.user.api.entity.Student;
 import com.keao.edu.user.dao.*;
 import com.keao.edu.user.dao.*;
@@ -16,10 +17,12 @@ import com.keao.edu.user.entity.Subject;
 import com.keao.edu.user.service.ExamCertificationService;
 import com.keao.edu.user.service.ExamCertificationService;
 import com.keao.edu.user.service.StudentService;
 import com.keao.edu.user.service.StudentService;
 import com.keao.edu.user.service.SysConfigService;
 import com.keao.edu.user.service.SysConfigService;
+import com.keao.edu.util.date.DateUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 
 
+import java.util.Date;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
@@ -86,6 +89,14 @@ public class ExamCertificationServiceImpl extends BaseServiceImpl<Long, ExamCert
 		ExamRegistration examRegistration = examRegistrationDao.get(examRegistrationId);
 		ExamRegistration examRegistration = examRegistrationDao.get(examRegistrationId);
 		needCheckingDetailDto.setSubjectName(subjectDao.get(examRegistration.getSubjectId()).getName());
 		needCheckingDetailDto.setSubjectName(subjectDao.get(examRegistration.getSubjectId()).getName());
 		needCheckingDetailDto.setLevel(examRegistration.getLevel());
 		needCheckingDetailDto.setLevel(examRegistration.getLevel());
+		if(needCheckingDetailDto.getFinishedExam() == 4 && needCheckingDetailDto.getRecordStartTime() != null){
+			int recordMinutes = Integer.parseInt(sysConfigService.findConfigValue("record_minutes",needCheckingDetailDto.getTenantId()));
+			Date date = DateUtil.addMinutes(needCheckingDetailDto.getRecordStartTime(),recordMinutes);
+			int secondsBetween = DateUtil.secondsBetween(new Date(),date);
+			if(secondsBetween <= 0){
+				needCheckingDetailDto.setRecordFlag(0);
+			}
+		}
 		return needCheckingDetailDto;
 		return needCheckingDetailDto;
 	}
 	}
 
 

+ 2 - 1
edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamCertificationMapper.xml

@@ -170,11 +170,12 @@
 		<result property="finishedExam" column="is_finished_exam_"/>
 		<result property="finishedExam" column="is_finished_exam_"/>
 		<result property="recordFlag" column="record_flag_"/>
 		<result property="recordFlag" column="record_flag_"/>
 		<result property="tenantId" column="tenant_id_"/>
 		<result property="tenantId" column="tenant_id_"/>
+		<result property="recordStartTime" column="record_start_time_"/>
 	</resultMap>
 	</resultMap>
 	<select id="needCheckingDetail" resultMap="NeedCheckingDetailDtoMap">
 	<select id="needCheckingDetail" resultMap="NeedCheckingDetailDtoMap">
 		SELECT ersr.id_ exam_room_student_relation_id_,eb.name_ exam_base_name_,er.exam_start_time_,er.exam_end_time_,er.open_flag_,
 		SELECT ersr.id_ exam_room_student_relation_id_,eb.name_ exam_base_name_,er.exam_start_time_,er.exam_end_time_,er.open_flag_,
 		ser.is_finished_exam_,ersr.exam_room_id_,ersr.sign_in_time_,ersr.classroom_switch_,
 		ser.is_finished_exam_,ersr.exam_room_id_,ersr.sign_in_time_,ersr.classroom_switch_,
-		ersr.exam_registration_id_,ser.record_flag_,ser.tenant_id_
+		ersr.exam_registration_id_,ser.record_flag_,ser.tenant_id_,ser.record_start_time_
 		FROM exam_room_student_relation ersr
 		FROM exam_room_student_relation ersr
 		LEFT JOIN examination_basic eb ON eb.id_ = ersr.examination_basic_id_
 		LEFT JOIN examination_basic eb ON eb.id_ = ersr.examination_basic_id_
 		LEFT JOIN exam_room er ON er.id_ = ersr.exam_room_id_
 		LEFT JOIN exam_room er ON er.id_ = ersr.exam_room_id_