Bläddra i källkod

Merge remote-tracking branch 'origin/master'

Joburgess 5 år sedan
förälder
incheckning
e7f3a2c29c

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

@@ -63,4 +63,16 @@ public interface ExamCertificationDao extends BaseDAO<Long, ExamCertification> {
      * @return java.util.List<com.keao.edu.user.dto.BasicNeedCheckingDetailDto>
      */
     List<BasicNeedCheckingDetailDto> basicNeedCheckingDetail(Long examRoomId);
+
+    /**
+     * @describe 根据合作单位获取学员准考证数量
+     * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+     * @author zouxuan
+     * @date 2020/8/26
+     * @time 15:10
+     * @param studentIds:
+     * @param childOrganIds:
+     * @return java.util.List<java.util.Map<java.lang.Integer,java.lang.Integer>>
+     */
+    List<Map<Integer, Integer>> countExamNum(@Param("studentIds") List<Integer> studentIds, @Param("childOrganIds") List<Integer> childOrganIds);
 }

+ 4 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/StudentExamResultServiceImpl.java

@@ -289,6 +289,10 @@ public class StudentExamResultServiceImpl extends BaseServiceImpl<Long, StudentE
 					redisTemplate.delete(recordNotify.getRecordId());
 					Long registrationId = Long.parseLong(recordId);
 					StudentExamResult studentExamResult = studentExamResultDao.findByRegistrationId(registrationId);
+					Integer isFinishedExam = studentExamResult.getIsFinishedExam();
+					if(isFinishedExam != 5 && isFinishedExam != 0){
+						return;
+					}
 					String videoUrl = studentExamResult.getVideoUrl();
 					if(StringUtils.isNotEmpty(videoUrl)){
 						videoUrl += "," + jsonObject.get("fileUrl");

+ 5 - 2
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/StudentServiceImpl.java

@@ -43,6 +43,8 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
     @Autowired
     private StudentExamResultDao studentExamResultDao;
     @Autowired
+    private ExamCertificationDao examCertificationDao;
+    @Autowired
     private ImFeignService imFeignService;
     @Autowired
     private OrganizationService organizationService;
@@ -169,8 +171,9 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
         Map<String, Object> params = new HashMap<>();
         MapUtil.populateMap(params, queryInfo);
         Integer organId = queryInfo.getOrganId();
+        List<Integer> childOrganIds = null;
         if(organId != null){
-            List<Integer> childOrganIds = organizationService.getChildOrganIds(organId,true);
+            childOrganIds = organizationService.getChildOrganIds(organId,true);
             if(childOrganIds == null || childOrganIds.size() == 0){
                 return pageInfo;
             }
@@ -184,7 +187,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
             dataList = studentDao.queryRegistrationList(params);
             List<Integer> studentIds = dataList.stream().map(e -> e.getUserId()).collect(Collectors.toList());
             //获取考试次数
-            Map<Integer, Integer> examNumMap = MapUtil.convertMybatisMap(studentExamResultDao.countExamNum(studentIds, queryInfo.getTenantId()),Integer.class,Integer.class);
+            Map<Integer, Integer> examNumMap = MapUtil.convertMybatisMap(examCertificationDao.countExamNum(studentIds,childOrganIds),Integer.class,Integer.class);
 
             List<Integer> studentId = studentExamResultDao.queryStudentByOrganId(organId);
 

+ 15 - 0
edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamCertificationMapper.xml

@@ -201,4 +201,19 @@
 		WHERE ersr.exam_room_id_ = #{examRoomId} AND ser.is_finished_exam_ != 5
 		ORDER BY ser.is_finished_exam_ ASC,ersr.sign_in_time_ ASC,ersr.id_ ASC
 	</select>
+    <select id="countExamNum" resultType="java.util.Map">
+		SELECT ec.student_id_ 'key',COUNT(ec.id_) 'value' FROM exam_certification ec
+		LEFT JOIN exam_registration er ON ec.exam_registration_id_ = er.id_
+		WHERE ec.student_id_ IN
+		<foreach collection="studentIds" item="item" open="(" close=")" separator=",">
+			#{item}
+		</foreach>
+		<if test="childOrganIds != null">
+			AND er.organ_id_ IN
+			<foreach collection="childOrganIds" item="item" open="(" close=")" separator=",">
+				#{item}
+			</foreach>
+		</if>
+		GROUP BY ec.student_id_
+	</select>
 </mapper>

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

@@ -268,7 +268,7 @@
 	</select>
 	<select id="countExamNum" resultType="java.util.HashMap">
 		SELECT ser.student_id_ 'key',COUNT(ser.id_) 'value' FROM student_exam_result ser
-		WHERE ser.tenant_id_ = #{tenantId} AND ser.is_finished_exam_ != 5 AND ser.student_id_ IN
+		WHERE ser.tenant_id_ = #{tenantId} AND ser.student_id_ IN
 		<foreach collection="studentIds" item="item" open="(" close=")" separator=",">
 			#{item}
 		</foreach>

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

@@ -117,7 +117,7 @@
 		</if>
 	</select>
 	<select id="queryRegistrationList" resultMap="Student">
-		SELECT su.phone_,su.real_name_,su.id_ user_id_ FROM exam_registration er
+		SELECT su.phone_,su.real_name_,su.id_ user_id_,su.id_ FROM exam_registration er
 		LEFT JOIN sys_user su ON er.student_id_ = su.id_
 		WHERE su.del_flag_ = 0 AND su.lock_flag_ = 0
 		<if test="search != null and search != ''">