|
@@ -49,7 +49,7 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public ClassGroupStudentMapper findClassStudentMapperByUserIdAndClassGroupId(Integer userId, Integer classGroupId) {
|
|
public ClassGroupStudentMapper findClassStudentMapperByUserIdAndClassGroupId(Integer userId, Integer classGroupId) {
|
|
- return classGroupStudentMapperDao.findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupId,"NORMAL");
|
|
|
|
|
|
+ return classGroupStudentMapperDao.findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupId, "NORMAL");
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -153,26 +153,22 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
|
|
|
|
|
|
Iterator<String> iterator = userIdStrSet.iterator();
|
|
Iterator<String> iterator = userIdStrSet.iterator();
|
|
while (iterator.hasNext()) {
|
|
while (iterator.hasNext()) {
|
|
- Integer userId = Integer.parseInt(iterator.next());
|
|
|
|
|
|
+ Integer userId = Integer.parseInt(iterator.next());
|
|
List<ClassGroupStudentMapper> highClassGroupHasUser = classGroupStudentMapperDao.findHighClassGroupHasUser(classGroup.getMusicGroupId(), userId, classGroup.getType());
|
|
List<ClassGroupStudentMapper> highClassGroupHasUser = classGroupStudentMapperDao.findHighClassGroupHasUser(classGroup.getMusicGroupId(), userId, classGroup.getType());
|
|
if (!classGroup.getType().equals(ClassGroupTypeEnum.SNAP) && highClassGroupHasUser != null && highClassGroupHasUser.size() > 0) {
|
|
if (!classGroup.getType().equals(ClassGroupTypeEnum.SNAP) && highClassGroupHasUser != null && highClassGroupHasUser.size() > 0) {
|
|
- iterator.remove();
|
|
|
|
|
|
+ iterator.remove();
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- //校验是否存在历史记录
|
|
|
|
- ClassGroupStudentMapper classGroupStudentMapper = classGroupStudentMapperDao.findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupId, null);
|
|
|
|
- if(classGroupStudentMapper != null){
|
|
|
|
- classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
|
- }else {
|
|
|
|
- classGroupStudentMapper = new ClassGroupStudentMapper();
|
|
|
|
- classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
|
|
|
|
- classGroupStudentMapper.setClassGroupId(classGroupId);
|
|
|
|
- classGroupStudentMapper.setUserId(userId);
|
|
|
|
- classGroupStudentMapper.setCreateTime(nowDate);
|
|
|
|
- classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
|
- classGroupStudentMapper.setGroupType(GroupType.MUSIC);
|
|
|
|
- classGroupStudentMappers.add(classGroupStudentMapper);
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
|
|
|
|
+ classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
|
|
|
|
+ classGroupStudentMapper.setClassGroupId(classGroupId);
|
|
|
|
+ classGroupStudentMapper.setUserId(userId);
|
|
|
|
+ classGroupStudentMapper.setCreateTime(nowDate);
|
|
|
|
+ classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
|
+ classGroupStudentMapper.setGroupType(GroupType.MUSIC);
|
|
|
|
+ classGroupStudentMappers.add(classGroupStudentMapper);
|
|
|
|
+
|
|
if (classGroup.getType().equals(ClassGroupTypeEnum.NORMAL)) {
|
|
if (classGroup.getType().equals(ClassGroupTypeEnum.NORMAL)) {
|
|
StudentRegistration studentRegistration = studentRegistrationService.queryByUserIdAndMusicGroupId(userId, classGroup.getMusicGroupId());
|
|
StudentRegistration studentRegistration = studentRegistrationService.queryByUserIdAndMusicGroupId(userId, classGroup.getMusicGroupId());
|
|
studentRegistration.setClassGroupId(classGroupId);
|
|
studentRegistration.setClassGroupId(classGroupId);
|
|
@@ -180,9 +176,9 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
|
|
}
|
|
}
|
|
imGroupMemberList.add(new ImGroupMember(userId.toString()));
|
|
imGroupMemberList.add(new ImGroupMember(userId.toString()));
|
|
}
|
|
}
|
|
- if (classGroupStudentMappers.size() > 0) {
|
|
|
|
- classGroupStudentMapperDao.classGroupStudentsInsert(classGroupStudentMappers);
|
|
|
|
- }
|
|
|
|
|
|
+ if (classGroupStudentMappers.size() > 0) {
|
|
|
|
+ classGroupStudentMapperDao.classGroupStudentsInsert(classGroupStudentMappers);
|
|
|
|
+ }
|
|
|
|
|
|
//添加进IM群组
|
|
//添加进IM群组
|
|
ImGroupMember[] imGroupMembers = imGroupMemberList.toArray(new ImGroupMember[imGroupMemberList.size()]);
|
|
ImGroupMember[] imGroupMembers = imGroupMemberList.toArray(new ImGroupMember[imGroupMemberList.size()]);
|
|
@@ -214,8 +210,8 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
|
|
courseScheduleStudentPaymentService.batchInsert(courseScheduleStudentPayments);
|
|
courseScheduleStudentPaymentService.batchInsert(courseScheduleStudentPayments);
|
|
}
|
|
}
|
|
//乐团在合奏班
|
|
//乐团在合奏班
|
|
- if(classGroupRelation != null){
|
|
|
|
- addStudents(classGroupRelation.getClassGroupId(),userIdsStr,GroupType.MUSIC);
|
|
|
|
|
|
+ if (classGroupRelation != null) {
|
|
|
|
+ addStudents(classGroupRelation.getClassGroupId(), userIdsStr, GroupType.MUSIC);
|
|
}
|
|
}
|
|
|
|
|
|
return true;
|
|
return true;
|
|
@@ -223,12 +219,12 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Object queryHoliday(String year) throws IOException {
|
|
public Object queryHoliday(String year) throws IOException {
|
|
- return HttpUtil.get(holidayUrl + year,null);
|
|
|
|
|
|
+ return HttpUtil.get(holidayUrl + year, null);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<ClassGroupStudentMapper> findMusicGroupClassGroupByType(String musicGroupId, ClassGroupTypeEnum type) {
|
|
public List<ClassGroupStudentMapper> findMusicGroupClassGroupByType(String musicGroupId, ClassGroupTypeEnum type) {
|
|
- return classGroupStudentMapperDao.findMusicGroupClassGroupByType(musicGroupId,type);
|
|
|
|
|
|
+ return classGroupStudentMapperDao.findMusicGroupClassGroupByType(musicGroupId, type);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|