Quellcode durchsuchen

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

zouxuan vor 5 Jahren
Ursprung
Commit
a0ba236b1b

+ 3 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamCertificationDao.java

@@ -21,6 +21,9 @@ public interface ExamCertificationDao extends BaseDAO<Long, ExamCertification> {
      */
     ExamCertification findByStuAndBasicId(@Param("studentId") Integer studentId, @Param("examRegistrationId") Long examRegistrationId);
 
+    int updateExamAddress(@Param("address") String address,
+                          @Param("registIds") List<Long> registIds);
+
     int deleteWithRegist(@Param("registIds") List<Long> registIds);
 
     /**

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

@@ -325,9 +325,9 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 
 		List<ExamOrganizationRelation> needUpdate=new ArrayList<>();
 		for (ExamOrganizationRelation examOrgan : examOrgans) {
-//			if(YesOrNoEnum.YES.getCode().equals(examOrgan.getSendUrlFlag())){
-//				continue;
-//			}
+			if(YesOrNoEnum.YES.getCode().equals(examOrgan.getSendUrlFlag())){
+				continue;
+			}
 
 			String registrationUrl = baseUrl + "examId=" + examinationBasic.getId() + "&organId=" + examOrgan.getOrganId();
 			String registShortUrl = shortUrlService.createShortUrl(registrationUrl);

+ 15 - 4
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomServiceImpl.java

@@ -25,10 +25,7 @@ import com.keao.edu.user.dto.ExamRoomDto;
 import com.keao.edu.user.dto.ExamRoomExamTimeDto;
 import com.keao.edu.user.dto.ExamRoomListDto;
 import com.keao.edu.user.dto.ExamRoomStatisticsDto;
-import com.keao.edu.user.entity.ExamLifecycleLog;
-import com.keao.edu.user.entity.ExamOrganizationRelation;
-import com.keao.edu.user.entity.ExamRegistration;
-import com.keao.edu.user.entity.ExaminationBasic;
+import com.keao.edu.user.entity.*;
 import com.keao.edu.user.page.ExamRoomListQueryInfo;
 import com.keao.edu.user.page.ExamRoomQueryInfo;
 import com.keao.edu.user.service.*;
@@ -82,6 +79,10 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 	private ExamRoomStudentRelationDao examRoomStudentRelationDao;
 	@Autowired
 	private SysConfigService sysConfigService;
+	@Autowired
+	private ExamCertificationDao examCertificationDao;
+	@Autowired
+	private ExamLocationDao examLocationDao;
 
 	@Override
 	public BaseDAO<Long, ExamRoom> getDAO() {
@@ -338,6 +339,16 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 		}
 		examinationBasicDao.update(examinationBasic);
 
+		if(ExamModeEnum.OFFLINE.equals(examRoom.getExamMode())){
+			ExamLocation examLocation = examLocationDao.get(examRoom.getExamLocationId());
+			if(Objects.isNull(examLocation)){
+				throw new BizException("考试地址不存在");
+			}
+			List<ExamRoomStudentRelation> examRoomStudents = examRoomStudentRelationDao.findStudentsWithExamRoom(examRoom.getId());
+			List<Long> registIds = examRoomStudents.stream().map(ExamRoomStudentRelation::getExamRegistrationId).collect(Collectors.toList());
+			examCertificationDao.updateExamAddress(examLocation.getAddress(), registIds);
+		}
+
 		examTeacherSalaryService.teacherSalarySettlementWithExam(examRoom.getExaminationBasicId());
 		return examRoom;
 	}

+ 9 - 2
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamCertificationMapper.xml

@@ -87,8 +87,15 @@
 			update_time_ = NOW()
 		</set> WHERE id_ = #{id}
 	</update>
-	
-	<!-- 根据主键删除一条记录 -->
+
+    <update id="updateExamAddress">
+		UPDATE exam_certification SET exam_address_=#{address} WHERE exam_registration_id_ IN
+		<foreach collection="registIds" item="registId" separator="," open="(" close=")">
+			#{registId}
+		</foreach>
+    </update>
+
+    <!-- 根据主键删除一条记录 -->
 	<delete id="delete" >
 		DELETE FROM exam_certification WHERE id_ = #{id} 
 	</delete>