|
@@ -940,15 +940,15 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
// updateTeamTeacher(musicGroup, musicGroup);
|
|
|
//生成学员费用表
|
|
|
- List<MusicGroupStudentFee> musicGroupStudentFees = musicGroupStudentFeeDao.initMusicGroupStudentFee(musicGroupId);
|
|
|
- if (musicGroupStudentFees != null && musicGroupStudentFees.size() > 0) {
|
|
|
- if (musicGroup.getFeeType() != FeeType.OFFLINE) {
|
|
|
- for (MusicGroupStudentFee sf : musicGroupStudentFees) {
|
|
|
- sf.setRemainNetworkClassTimes(sf.getRemainNetworkClassTimes() + 1);
|
|
|
- }
|
|
|
- }
|
|
|
- musicGroupStudentFeeDao.batchInsert(musicGroupStudentFees, null, "PAID_COMPLETED");
|
|
|
- }
|
|
|
+ List<MusicGroupStudentFee> musicGroupStudentFees = musicGroupStudentFeeDao.initMusicGroupStudentFee(musicGroupId);
|
|
|
+ if (musicGroupStudentFees != null && musicGroupStudentFees.size() > 0) {
|
|
|
+ if (musicGroup.getFeeType() != FeeType.OFFLINE) {
|
|
|
+ for (MusicGroupStudentFee sf : musicGroupStudentFees) {
|
|
|
+ sf.setRemainNetworkClassTimes(sf.getRemainNetworkClassTimes() + 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ musicGroupStudentFeeDao.batchInsert(musicGroupStudentFees, null, "PAID_COMPLETED");
|
|
|
+ }
|
|
|
musicGroupStudentFeeDao.batchUpdateCalenders(musicGroupId);
|
|
|
//记录操作日志
|
|
|
musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "确认开团(筹备中 -> 进行中)", sysUser.getId(), ""));
|
|
@@ -1041,21 +1041,34 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void pushMessage(String musicGroupId,String classGroupIds) throws IOException {
|
|
|
+ public void pushMessage(String musicGroupId, String classGroupIds) throws IOException {
|
|
|
MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
|
|
|
if (musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN) {
|
|
|
- //是否有基础训练班
|
|
|
- Integer num = classGroupDao.countClassNumByType(musicGroupId);
|
|
|
- if (num != null && num > 0) {
|
|
|
- Map<Integer, String> studentMap = MapUtil.convertMybatisMap(studentRegistrationDao.findIdMapByMusicGroupId(musicGroupId, 2));
|
|
|
- if (studentMap != null && studentMap.size() > 0) {
|
|
|
- String baseURL = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
|
|
|
- String url = baseURL + "/#/smallRegister?musicGroupId=" + musicGroupId;
|
|
|
- String serverPhone = sysConfigDao.findConfigValue(SysConfigService.SERVER_PHONE);
|
|
|
- sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.SMS_BASICS_SKILL_APPLY_MESSAGE,
|
|
|
- studentMap, null, 0, "5?" + url, "STUDENT", musicGroup.getName(), HttpUtil.getSortUrl(url), serverPhone);
|
|
|
- }
|
|
|
+ List<HighClassGroupDto> highClassGroup = classGroupDao.findHighClassGroup(musicGroupId, classGroupIds);
|
|
|
+ Set<ClassGroupTypeEnum> classGroupTypeSet = highClassGroup.stream().map(HighClassGroupDto::getType).collect(Collectors.toSet());
|
|
|
+
|
|
|
+ List<StudentRegistration> students = new ArrayList<>();
|
|
|
+ if (classGroupTypeSet.contains(ClassGroupTypeEnum.HIGH)) {
|
|
|
+ List<StudentRegistration> noHighClassGroupStudents = studentRegistrationService.findMusicGroupStuNoClassType(musicGroupId, ClassGroupTypeEnum.HIGH, null);
|
|
|
+ students.addAll(noHighClassGroupStudents);
|
|
|
}
|
|
|
+ if (classGroupTypeSet.contains(ClassGroupTypeEnum.HIGH_ONLINE)) {
|
|
|
+ List<StudentRegistration> noHighOnlineClassGroupStudents = studentRegistrationService.findMusicGroupStuNoClassType(musicGroupId, ClassGroupTypeEnum.HIGH_ONLINE, null);
|
|
|
+ students.addAll(noHighOnlineClassGroupStudents);
|
|
|
+ }
|
|
|
+ if (students.size() == 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Map<Integer, String> studentMap = new HashMap<>();
|
|
|
+ for (StudentRegistration student : students) {
|
|
|
+ studentMap.put(student.getUserId(), student.getUserId().toString());
|
|
|
+ }
|
|
|
+
|
|
|
+ String baseURL = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
|
|
|
+ String url = baseURL + "/#/smallRegister?musicGroupId=" + musicGroupId;
|
|
|
+ String serverPhone = sysConfigDao.findConfigValue(SysConfigService.SERVER_PHONE);
|
|
|
+ sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.SMS_BASICS_SKILL_APPLY_MESSAGE,
|
|
|
+ studentMap, null, 0, "5?" + url, "STUDENT", musicGroup.getName(), HttpUtil.getSortUrl(url), serverPhone);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1370,9 +1383,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
//更新学员在班级的状态
|
|
|
for (Integer classGroupId : classGroupIdList) {
|
|
|
ClassGroup classGroup = classGroupService.get(classGroupId);
|
|
|
- if(classGroup.getType().equals(ClassGroupTypeEnum.MUSIC_NETWORK)){
|
|
|
+ if (classGroup.getType().equals(ClassGroupTypeEnum.MUSIC_NETWORK)) {
|
|
|
classGroupService.delSingle(classGroupId);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
classGroupStudentMapperService.delClassGroupStudent(userId, classGroupId);
|
|
|
}
|
|
|
}
|
|
@@ -1471,9 +1484,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
List<Integer> classGroupIdList = classGroupStudentMapperDao.queryClassGroupIdList(musicGroupId, userId, GroupType.MUSIC);
|
|
|
for (Integer classGroupId : classGroupIdList) {
|
|
|
ClassGroup classGroup = classGroupService.get(classGroupId);
|
|
|
- if(classGroup.getType().equals(ClassGroupTypeEnum.MUSIC_NETWORK)){
|
|
|
+ if (classGroup.getType().equals(ClassGroupTypeEnum.MUSIC_NETWORK)) {
|
|
|
classGroupService.delSingle(classGroupId);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
classGroupStudentMapperService.delClassGroupStudent(userId, classGroupId);
|
|
|
}
|
|
|
}
|