zouxuan 5 năm trước cách đây
mục cha
commit
a44b05363d

+ 4 - 1
edu-auth/edu-auth-server/src/main/java/com/keao/edu/auth/core/provider/PhoneAuthenticationProvider.java

@@ -51,7 +51,10 @@ public class PhoneAuthenticationProvider extends AbstractAuthenticationProvider
 		}
 
 		SysUserInfo userInfo = sysUserService.queryUserInfoByPhone(loginEntity.getPhone(),loginEntity.getClientId());
-		if (userInfo == null && StringUtils.isNotEmpty(loginEntity.getRegisterFlag())) {
+		if (StringUtils.isNotEmpty(loginEntity.getRegisterFlag())) {
+			if(userInfo != null){
+				throw new InternalAuthenticationServiceException("账户已存在");
+			}
 			userInfo = sysUserService.initUser(loginEntity);
 		}
 		if (userInfo == null) {

+ 9 - 14
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamRoomServiceImpl.java

@@ -79,8 +79,6 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 	@Autowired
 	private ExamRoomStudentRelationDao examRoomStudentRelationDao;
 	@Autowired
-	private SysConfigService sysConfigService;
-	@Autowired
 	private ExamCertificationDao examCertificationDao;
 	@Autowired
 	private ExamLocationDao examLocationDao;
@@ -790,18 +788,15 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 			stringBuffer.append(examRoom.getMainTeacherUserId());
 			if(StringUtils.isNotEmpty(studentIds)){
 				stringBuffer.append(",").append(studentIds);
-				//推送消息
-				/*String[] split = studentIds.split(",");
-				Map<Integer, String> userPhoneMap = new HashMap<>(split.length);
-//				Map<Integer, String> map = MapUtil.convertMybatisMap(examRoomStudentRelationService.getStuRegistrationMap(examRoomId), Integer.class, String.class);
-
-				for (String s : split) {
-					userPhoneMap.put(Integer.parseInt(s),s);
-				}
-//				String notifyUrl = "?examRegistrationId=" + studentExtraExercise.getId() + "&studentCourseHomeworkId=" + studentExtraExercise.getId() + "&extra=1";
-//				String extra = "dayaedu" + notifyUrl + "&userId=" + studentId;
-				sysMessageService.batchSendMessage(MessageTypeEnum.ACTION_EXAM_SIGN_PUSH,
-						userPhoneMap, null, 0, null, JiguangPushPlugin.PLUGIN_NAME);*/
+				List<ExamRoomStudentRelation> studentRelations = examRoomStudentRelationDao.findStudentsWithExamRoom(examRoomId);
+				ExaminationBasic examinationBasic = examinationBasicDao.get(examRoom.getExaminationBasicId());
+				studentRelations.forEach(e->{
+					Map<Integer, String> userPhoneMap = new HashMap<>(1);
+					userPhoneMap.put(e.getStudentId(),e.getStudentId().toString());
+					String notifyUrl = "3?examRegistrationId=" + e.getExamRegistrationId();
+					sysMessageService.batchSendMessage(MessageTypeEnum.ACTION_EXAM_SIGN_PUSH,
+							userPhoneMap, null, 0, notifyUrl, JiguangPushPlugin.PLUGIN_NAME,examinationBasic.getName());
+				});
 			}
 			if(StringUtils.isNotEmpty(examRoom.getAssistantTeacherUserIdList())){
 				stringBuffer.append(",").append(examRoom.getAssistantTeacherUserIdList());

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

@@ -22,6 +22,7 @@ import com.keao.edu.util.collection.MapUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.ArrayList;
@@ -54,7 +55,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
     }
 
     @Override
-    @Transactional(rollbackFor = Exception.class)
+    @Transactional(rollbackFor = Exception.class,isolation = Isolation.SERIALIZABLE)
     public void addStudent(Student student) {
         SysUser sysUser = student.getSysUser();
         if (sysUser == null || StringUtils.isEmpty(sysUser.getPhone())) {

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

@@ -122,7 +122,8 @@
 	</select>
 
 	<select id="getExamCertificationDto" resultMap="ExamCertificationDtoMap">
-		SELECT ec.exam_registration_id_,ec.exam_start_time_,ec.subject_id_,ec.level_,ec.exam_address_,er.song_json_,ec.card_no_,er.student_id_
+		SELECT ec.exam_registration_id_,ec.exam_start_time_,ec.subject_id_,ec.level_,
+		ec.exam_address_,er.song_json_,ec.card_no_,er.student_id_
 		FROM exam_registration er
 		LEFT JOIN exam_certification ec ON er.id_ = ec.exam_registration_id_
 		WHERE er.id_ = #{examRegistrationId} LIMIT 1