Quellcode durchsuchen

Merge branch 'master' of http://git.dayaedu.com/yonge/edu-saas

zouxuan vor 5 Jahren
Ursprung
Commit
68821d4cd9

+ 9 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamRoomStudentRelationDao.java

@@ -171,4 +171,13 @@ public interface ExamRoomStudentRelationDao extends BaseDAO<Long, ExamRoomStuden
      * @return
      */
     Integer countSignInNum(Long examRoomId);
+
+    /**
+     * @describe 统计指定教师学员数量
+     * @author Joburgess
+     * @date 2020.07.28
+     * @param examRoomId:
+     * @return int
+     */
+    int countStudentsWithRoom(Long examRoomId);
 }

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

@@ -157,7 +157,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 		if(!CollectionUtils.isEmpty(examRoomStudentRelations)){
 			examRoomStudentRelationDao.batchInsert(examRoomStudentRelations);
 			examTeacherSalaryService.teacherSalarySettlementWithExam(examRoom.getExaminationBasicId());
-			examRoom.setExamRoomStudentNum(examRoom.getExamRoomStudentNum()+examRoomStudentRelations.size());
+			examRoom.setExamRoomStudentNum(examRoomStudentRelationDao.countStudentsWithRoom(examRoom.getId()));
 			examRoomDao.update(examRoom);
 		}
 		if(!CollectionUtils.isEmpty(studentExamResults)){
@@ -219,6 +219,9 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 		}
 		studentExamResult.setExamRoomId(examRoomId);
 		studentExamResultDao.update(studentExamResult);
+
+		examRoom.setExamRoomStudentNum(examRoomStudentRelationDao.countStudentsWithRoom(examRoom.getId()));
+		examRoomDao.update(examRoom);
 	}
 
 	@Override
@@ -290,8 +293,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 		List<Long> registIds = Arrays.asList(registIdsStr.split(",")).stream().map(e -> Long.valueOf(e)).collect(Collectors.toList());
 		examRoomStudentRelationDao.deleteStudentsFromExamRoom(examRoomId, registIds);
 		studentExamResultDao.deleteWithRegists(registIds);
-		int deleteNum = examCertificationService.deleteWithRegist(registIds);
-		examRoom.setExamRoomStudentNum(examRoom.getExamRoomStudentNum()-deleteNum);
+		examRoom.setExamRoomStudentNum(examRoomStudentRelationDao.countStudentsWithRoom(examRoom.getId()));
 		examRoomDao.update(examRoom);
 		examTeacherSalaryService.teacherSalarySettlementWithExam(examRoom.getExaminationBasicId());
 	}

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

@@ -355,7 +355,7 @@
 		FROM
 			exam_registration er
 		LEFT JOIN exam_room_student_relation ersr ON ersr.exam_registration_id_ = er.id_
-		WHERE 1=1
+		WHERE 1=1 AND er.status_ IN ('AUDIT_PASS', 'AUDIT_WAIT')
 		<if test="organIds!=null">
 			AND er.organ_id_ IN
 			<foreach collection="organIds" item="organI" separator="," open="(" close=")">

+ 4 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml

@@ -293,4 +293,8 @@
 	<select id="countSignInNum" resultType="java.lang.Integer">
 		SELECT COUNT(DISTINCT id_) FROM student_exam_result WHERE is_finished_exam_ = 2 AND exam_room_id_ = #{examRoomId}
 	</select>
+
+	<select id="countStudentsWithRoom" resultType="int">
+		SELECT COUNT(DISTINCT exam_registration_id_) FROM exam_room_student_relation WHERE exam_room_id_=#{examRoomId}
+	</select>
 </mapper>

+ 2 - 6
edu-user/edu-user-server/src/main/resources/config/mybatis/ExaminationBasicMapper.xml

@@ -97,12 +97,8 @@
 			<if test="posterProfile != null">
 				poster_profile_ = #{posterProfile},
 			</if>
-			<if test="posterBackgroundImg != null">
-				poster_background_img_ = #{posterBackgroundImg},
-			</if>
-			<if test="customPoster != null">
-				custom_poster_ = #{customPoster},
-			</if>
+			poster_background_img_ = #{posterBackgroundImg},
+			custom_poster_ = #{customPoster},
 			<if test="tenantId != null">
 				tenant_id_ = #{tenantId},
 			</if>