Bladeren bron

Merge remote-tracking branch 'origin/master'

Joburgess 5 jaren geleden
bovenliggende
commit
623f5bd9db

+ 7 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamRoomStudentRelationController.java

@@ -9,6 +9,7 @@ import com.keao.edu.im.api.entity.PublishMessageDto;
 import com.keao.edu.user.api.entity.ExamRoomStudentRelation;
 import com.keao.edu.user.dto.ExamRoomStudentRelationDto;
 import com.keao.edu.user.dto.NeedCheckingDetailDto;
+import com.keao.edu.user.dto.StuRecordDetailDto;
 import com.keao.edu.user.entity.Employee;
 import com.keao.edu.user.page.ExamRoomStudentRelationQueryInfo;
 import com.keao.edu.user.service.EmployeeService;
@@ -69,6 +70,12 @@ public class ExamRoomStudentRelationController extends BaseController {
         return succeed(examRoomStudentRelationService.stuRecorded(examRegistrationId));
     }
 
+    @ApiOperation("学生端录播详情页面")
+    @GetMapping(value = "/stuRecordDetail")
+    public HttpResponseResult<StuRecordDetailDto> stuRecordDetail(Long examRegistrationId) {
+        return succeed(examRoomStudentRelationService.stuRecordDetail(examRegistrationId));
+    }
+
     @ApiOperation("学生选择重新排队")
     @PostMapping(value = "/againQueue")
     public HttpResponseResult<NeedCheckingDetailDto> againQueue(Long examRegistrationId) {

+ 7 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamRegistrationDao.java

@@ -161,4 +161,11 @@ public interface ExamRegistrationDao extends BaseDAO<Long, ExamRegistration> {
      * @return
      */
     List<StudentBaseExamsDto> queryStudentBaseExams(Map<String, Object> params);
+
+    /**
+     * 学生端录播详情页面
+     * @param examRegistrationId
+     * @return
+     */
+    StuRecordDetailDto getStuRecordDetail(Long examRegistrationId);
 }

+ 74 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/StuRecordDetailDto.java

@@ -0,0 +1,74 @@
+package com.keao.edu.user.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+
+public class StuRecordDetailDto {
+
+    @ApiModelProperty(value = "剩余时长(秒)")
+    private Integer subTime;
+
+    @ApiModelProperty(value = "录制最大时长(分)")
+    private Integer recordTime;
+
+    @ApiModelProperty(value = "单首曲目录制时长(分)")
+    private Integer singleSongRecordMinutes;
+
+    @ApiModelProperty(value = "实际考试结束时间")
+    private String actualExamEndTime;
+
+    @ApiModelProperty(value = "考试内容")
+    private String songJson;
+
+    @ApiModelProperty(value = "开始录制时间")
+    private Date recordStartTime;
+
+    public Integer getRecordTime() {
+        return recordTime;
+    }
+
+    public void setRecordTime(Integer recordTime) {
+        this.recordTime = recordTime;
+    }
+
+    public Integer getSingleSongRecordMinutes() {
+        return singleSongRecordMinutes;
+    }
+
+    public void setSingleSongRecordMinutes(Integer singleSongRecordMinutes) {
+        this.singleSongRecordMinutes = singleSongRecordMinutes;
+    }
+
+    public Date getRecordStartTime() {
+        return recordStartTime;
+    }
+
+    public void setRecordStartTime(Date recordStartTime) {
+        this.recordStartTime = recordStartTime;
+    }
+
+    public Integer getSubTime() {
+        return subTime;
+    }
+
+    public void setSubTime(Integer subTime) {
+        this.subTime = subTime;
+    }
+
+    public String getActualExamEndTime() {
+        return actualExamEndTime;
+    }
+
+    public void setActualExamEndTime(String actualExamEndTime) {
+        this.actualExamEndTime = actualExamEndTime;
+    }
+
+    public String getSongJson() {
+        return songJson;
+    }
+
+    public void setSongJson(String songJson) {
+        this.songJson = songJson;
+    }
+}

+ 5 - 3
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/StudentExamResult.java

@@ -4,6 +4,8 @@ import com.keao.edu.user.api.enums.ExamEvaluationResultEnum;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
+import java.util.Date;
+
 /**
  * 对应数据库表(student_exam_result):
  */
@@ -53,15 +55,15 @@ public class StudentExamResult {
 
 	private String tenantId;
 
-	private String recordStartTime;
+	private Date recordStartTime;
 
 	private Integer recordFlag;
 
-	public String getRecordStartTime() {
+	public Date getRecordStartTime() {
 		return recordStartTime;
 	}
 
-	public void setRecordStartTime(String recordStartTime) {
+	public void setRecordStartTime(Date recordStartTime) {
 		this.recordStartTime = recordStartTime;
 	}
 

+ 8 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamRoomStudentRelationService.java

@@ -7,6 +7,7 @@ import com.keao.edu.user.dto.ExamRoomStudentRelationDto;
 import com.keao.edu.user.api.entity.ExamRoomStudentRelation;
 import com.keao.edu.user.dto.NeedCheckingDetailDto;
 import com.keao.edu.user.dto.RoomStudentListDto;
+import com.keao.edu.user.dto.StuRecordDetailDto;
 import com.keao.edu.user.page.ExamRoomStudentRelationQueryInfo;
 
 import java.util.List;
@@ -132,4 +133,11 @@ public interface ExamRoomStudentRelationService extends BaseService<Long, ExamRo
      * @return
      */
     List<Map<Integer, String>> getStuRegistrationMap(Long examRoomId);
+
+    /**
+     * 学生端录播详情页面
+     * @param examRegistrationId
+     * @return
+     */
+    StuRecordDetailDto stuRecordDetail(Long examRegistrationId);
 }

+ 31 - 5
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java

@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject;
 import com.keao.edu.auth.api.client.SysUserFeignService;
 import com.keao.edu.auth.api.entity.SysUser;
 import com.keao.edu.common.dal.BaseDAO;
-import com.keao.edu.common.enums.YesOrNoEnum;
 import com.keao.edu.common.exception.BizException;
 import com.keao.edu.common.page.PageInfo;
 import com.keao.edu.common.service.IdGeneratorService;
@@ -21,13 +20,12 @@ import com.keao.edu.user.dao.*;
 import com.keao.edu.user.dto.ExamRoomStudentRelationDto;
 import com.keao.edu.user.dto.NeedCheckingDetailDto;
 import com.keao.edu.user.dto.RoomStudentListDto;
+import com.keao.edu.user.dto.StuRecordDetailDto;
 import com.keao.edu.user.entity.*;
 import com.keao.edu.user.page.ExamRoomStudentRelationQueryInfo;
-import com.keao.edu.user.service.ExamCertificationService;
-import com.keao.edu.user.service.ExamRoomStudentRelationService;
-import com.keao.edu.user.service.ExamTeacherSalaryService;
-import com.keao.edu.user.service.OrganizationService;
+import com.keao.edu.user.service.*;
 import com.keao.edu.util.collection.MapUtil;
+import com.keao.edu.util.date.DateUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -63,6 +61,8 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 	private ImFeignService imFeignService;
 	@Autowired
 	private SysUserFeignService sysUserFeignService;
+	@Autowired
+	private SysConfigService sysConfigService;
 
 	@Override
 	public BaseDAO<Long, ExamRoomStudentRelation> getDAO() {
@@ -289,6 +289,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 		//修改考试状态为录播
 		StudentExamResult studentExamResult = studentExamResultDao.findByRegistrationId(examRegistrationId);
 		studentExamResult.setRecordFlag(1);
+		studentExamResult.setRecordStartTime(new Date());
 		studentExamResultDao.update(studentExamResult);
 		//返回详情数据
 		return examCertificationService.needCheckingDetail(examRegistrationId);
@@ -324,6 +325,31 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 	}
 
 	@Override
+	public StuRecordDetailDto stuRecordDetail(Long examRegistrationId) {
+		StudentExamResult studentExamResult = studentExamResultDao.findByRegistrationId(examRegistrationId);
+		//当前学员是否完成考试
+		if(studentExamResult.getIsFinishedExam() == 1){
+			throw new BizException("操作失败:您已完成考试");
+		}
+		//是否允许录播
+		if(studentExamResult.getRecordFlag() == 0){
+			throw new BizException("操作失败:请走直播通道");
+		}
+		StuRecordDetailDto stuRecordDetailDto = examRegistrationDao.getStuRecordDetail(examRegistrationId);
+		int recordMinutes = Integer.parseInt(sysConfigService.findByParamName("record_minutes").getParanValue());
+		Date date = new Date();
+		date = DateUtil.addMinutes(date,recordMinutes);
+		int secondsBetween = DateUtil.secondsBetween(stuRecordDetailDto.getRecordStartTime(), date);
+		if(secondsBetween <= 0){
+			throw new BizException("操作失败:录制超时");
+		}
+		stuRecordDetailDto.setSubTime(secondsBetween);
+		stuRecordDetailDto.setRecordTime(recordMinutes);
+		stuRecordDetailDto.setSingleSongRecordMinutes(Integer.parseInt(sysConfigService.findByParamName("single_song_record_minutes").getParanValue()));
+		return stuRecordDetailDto;
+	}
+
+	@Override
 	public void nextBit(Long nextExamRoomStudentRelationId, Long currentExamRoomStudentRelationId, Integer examStatus,Long examRoomId) {
 		Boolean isPush = true;
 		if(currentExamRoomStudentRelationId != null){

+ 1 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/OrganizationServiceImpl.java

@@ -144,6 +144,7 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 				employee.setTenantId(organ.getTenantId());
 				employee.setEmployeeType("ORGAN");
 				employeeDao.update(employee);
+				organ.setParentOrganIdTag(currentOrganization.getParentOrganIdTag() + "," + organ.getId());
 				organ.setDelFlag(YesOrNoEnum.NO);
 				organ.setId(organization.getId());
 				organDao.update(organ);

+ 12 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRegistrationMapper.xml

@@ -591,4 +591,16 @@
 		ORDER BY er.update_time_ DESC
 		<include refid="global.limit"/>
 	</select>
+	<resultMap id="StuRecordDetailDtoMap" type="com.keao.edu.user.dto.StuRecordDetailDto">
+		<result property="actualExamEndTime" column="expect_exam_end_time_"/>
+		<result property="songJson" column="song_json_"/>
+		<result property="recordStartTime" column="record_start_time_"/>
+	</resultMap>
+    <select id="getStuRecordDetail" resultMap="StuRecordDetailDtoMap">
+		SELECT eb.expect_exam_end_time_,er.song_json_,ser.record_start_time_
+		FROM exam_registration er
+		LEFT JOIN examination_basic eb ON er.examination_basic_id_ = eb.id_
+		LEFT JOIN student_exam_result ser ON ser.exam_registration_id_ = er.id_
+		WHERE er.id_ = #{examRegistrationId} LIMIT 1
+	</select>
 </mapper>