zouxuan 4 年之前
父節點
當前提交
eedc459355

+ 12 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/StudentAttendanceDao.java

@@ -2,6 +2,7 @@ package com.keao.edu.user.dao;
 
 import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.user.api.entity.StudentAttendance;
+import org.apache.ibatis.annotations.Param;
 
 public interface StudentAttendanceDao extends BaseDAO<Long, StudentAttendance> {
 
@@ -12,4 +13,15 @@ public interface StudentAttendanceDao extends BaseDAO<Long, StudentAttendance> {
      * @return
      */
     StudentAttendance findByRegistrationId(Long examRegistrationId);
+
+    /**
+     * @describe 根据注册id删除
+     * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+     * @author zouxuan
+     * @date 2020/9/10
+     * @time 21:45
+     * @param examRegistrationId:
+     * @return void
+     */
+    void delByRegistrationId(@Param("examRegistrationId") Long examRegistrationId);
 }

+ 3 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java

@@ -57,6 +57,8 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 	@Autowired
 	private ExamReviewDao examReviewDao;
 	@Autowired
+	private StudentAttendanceDao studentAttendanceDao;
+	@Autowired
 	private ExamCertificationService examCertificationService;
 	@Autowired
 	private ExamLocationDao examLocationDao;
@@ -698,6 +700,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 			studentExamResultDao.updateFinishedExam(examRoomStudentRelation.getExamRegistrationId(),3);
 			studentExamResultDao.updateVideoExam(examRoomStudentRelation.getExamRegistrationId());
 			examReviewDao.delByRegistration(examRoomStudentRelation.getExamRegistrationId());
+			studentAttendanceDao.delByRegistrationId(examRoomStudentRelation.getExamRegistrationId());
 			publishMessage(examRoomStudentRelation,MemberChangedMessage.Not_Finish,true,operator);
 			HashMap<Integer, String> map = new HashMap<>(1);
 			map.put(examRoomStudentRelation.getStudentId(),examRoomStudentRelation.getStudentId().toString());

+ 4 - 1
edu-user/edu-user-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml

@@ -57,7 +57,10 @@
 	<delete id="delete" >
 		DELETE FROM student_attendance WHERE id_ = #{id} 
 	</delete>
-	
+	<delete id="delByRegistrationId">
+		DELETE FROM student_attendance WHERE exam_registration_id_ = #{examRegistrationId}
+	</delete>
+
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="StudentAttendance" parameterType="map">
 		SELECT * FROM student_attendance ORDER BY id_ <include refid="global.limit"/>