Browse Source

Merge remote-tracking branch 'origin/master'

Joburgess 5 years ago
parent
commit
f4511b50aa

+ 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());
 		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);
 			userInfo = sysUserService.initUser(loginEntity);
 		}
 		}
 		if (userInfo == null) {
 		if (userInfo == null) {

+ 1 - 1
edu-im/edu-im-api/src/main/java/com/keao/edu/im/api/entity/PublishMessageDto.java

@@ -5,7 +5,7 @@ public class PublishMessageDto{
 
 
     private String roomId;
     private String roomId;
 
 
-    private Integer includeSender;
+    private Integer includeSender = 1;
 
 
     private MemberChangedMessage memberChangedMessage;
     private MemberChangedMessage memberChangedMessage;
 
 

+ 4 - 1
edu-im/edu-im-server/src/main/java/com/keao/edu/im/service/Impl/RoomServiceImpl.java

@@ -652,7 +652,10 @@ public class RoomServiceImpl implements RoomService {
 
 
     @Override
     @Override
     public void joinGroup(String userIds, String groupId, String groupName) throws Exception {
     public void joinGroup(String userIds, String groupId, String groupName) throws Exception {
-        imHelper.joinGroup(userIds.split(","),groupId,groupName);
+        IMApiResultInfo imApiResultInfo = imHelper.joinGroup(userIds.split(","), groupId, groupName);
+        if(imApiResultInfo.getCode() != 200){
+            throw new BizException("加入群组失败");
+        }
     }
     }
 
 
     @Override
     @Override

+ 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
 	@Autowired
 	private ExamRoomStudentRelationDao examRoomStudentRelationDao;
 	private ExamRoomStudentRelationDao examRoomStudentRelationDao;
 	@Autowired
 	@Autowired
-	private SysConfigService sysConfigService;
-	@Autowired
 	private ExamCertificationDao examCertificationDao;
 	private ExamCertificationDao examCertificationDao;
 	@Autowired
 	@Autowired
 	private ExamLocationDao examLocationDao;
 	private ExamLocationDao examLocationDao;
@@ -790,18 +788,15 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 			stringBuffer.append(examRoom.getMainTeacherUserId());
 			stringBuffer.append(examRoom.getMainTeacherUserId());
 			if(StringUtils.isNotEmpty(studentIds)){
 			if(StringUtils.isNotEmpty(studentIds)){
 				stringBuffer.append(",").append(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())){
 			if(StringUtils.isNotEmpty(examRoom.getAssistantTeacherUserIdList())){
 				stringBuffer.append(",").append(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.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 
 
 import java.util.ArrayList;
 import java.util.ArrayList;
@@ -54,7 +55,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
     }
     }
 
 
     @Override
     @Override
-    @Transactional(rollbackFor = Exception.class)
+    @Transactional(rollbackFor = Exception.class,isolation = Isolation.SERIALIZABLE)
     public void addStudent(Student student) {
     public void addStudent(Student student) {
         SysUser sysUser = student.getSysUser();
         SysUser sysUser = student.getSysUser();
         if (sysUser == null || StringUtils.isEmpty(sysUser.getPhone())) {
         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>
 
 
 	<select id="getExamCertificationDto" resultMap="ExamCertificationDtoMap">
 	<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
 		FROM exam_registration er
 		LEFT JOIN exam_certification ec ON er.id_ = ec.exam_registration_id_
 		LEFT JOIN exam_certification ec ON er.id_ = ec.exam_registration_id_
 		WHERE er.id_ = #{examRegistrationId} LIMIT 1
 		WHERE er.id_ = #{examRegistrationId} LIMIT 1

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

@@ -317,7 +317,7 @@
 	</resultMap>
 	</resultMap>
 	<sql id="queryExamRoomPageListSql">
 	<sql id="queryExamRoomPageListSql">
 		<where>
 		<where>
-			(er.main_teacher_user_id_ = #{teacherId} OR FIND_IN_SET(#{teacherId},er.assistant_teacher_user_id_list_))
+			er.exam_plan_push_flag_ = 1 AND (er.main_teacher_user_id_ = #{teacherId} OR FIND_IN_SET(#{teacherId},er.assistant_teacher_user_id_list_))
 			<if test="startTime != null and startTime != ''">
 			<if test="startTime != null and startTime != ''">
 				AND DATE_FORMAT(er.exam_end_time_,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime}
 				AND DATE_FORMAT(er.exam_end_time_,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime}
 			</if>
 			</if>