|
@@ -22,6 +22,7 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
import com.ym.mec.im.ImFeignService;
|
|
|
import com.ym.mec.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.Propagation;
|
|
@@ -116,11 +117,11 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
musicGroupDao.insert(musicGroup);
|
|
|
// 保存乐团付费主体列表
|
|
|
//批量新增
|
|
|
- musicGroupPaymentEntitiesDao.batchAdd(subFeeSettingDto.getMusicGroupPaymentEntities(), musicGroupId);
|
|
|
+ musicGroupPaymentEntitiesDao.batchAdd(subFeeSettingDto.getMusicGroupPaymentEntities(),musicGroupId);
|
|
|
// 保存学员付费周期
|
|
|
List<Integer> months = subFeeSettingDto.getMonths();
|
|
|
if (months != null && months.size() > 0) {
|
|
|
- musicGroupPaymentCalenderDao.batchAdd(months, musicGroupId);
|
|
|
+ musicGroupPaymentCalenderDao.batchAdd(months,musicGroupId);
|
|
|
}
|
|
|
// 保存乐团声部规划
|
|
|
if (musicGroupSubjectPlans == null) {
|
|
@@ -130,7 +131,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
e.setMusicGroupId(musicGroupId);
|
|
|
musicGroupSubjectPlanDao.insert(e);
|
|
|
});
|
|
|
-
|
|
|
+ //乐团科目学生
|
|
|
if (subjectRegisters != null) {
|
|
|
List<StudentRegistration> studentRegistrationList = new ArrayList<>();
|
|
|
subjectRegisters.forEach(e -> {
|
|
@@ -148,17 +149,16 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
);
|
|
|
studentRegistrationService.batchInsert(studentRegistrationList);
|
|
|
}
|
|
|
-
|
|
|
// 保存乐团声部商品规划
|
|
|
if (musicGroupSubjectGoodsGroups == null) {
|
|
|
musicGroupSubjectGoodsGroups = new ArrayList<>();
|
|
|
}
|
|
|
- musicGroupSubjectGoodsGroupDao.batchInsert(musicGroupSubjectGoodsGroups, musicGroupId);
|
|
|
+ musicGroupSubjectGoodsGroupDao.batchInsert(musicGroupSubjectGoodsGroups,musicGroupId);
|
|
|
// 新增聊天群
|
|
|
// ImGroupModel imGroupModel = new ImGroupModel(musicGroupId, musicGroup.getName());
|
|
|
// 教务老师和运营主管加入群组
|
|
|
- ImGroupMember[] imGroupMembers = {new ImGroupMember(musicGroup.getTeamTeacherId().toString()),
|
|
|
- new ImGroupMember(musicGroup.getEducationalTeacherId().toString())};
|
|
|
+ ImGroupMember[] imGroupMembers = { new ImGroupMember(musicGroup.getTeamTeacherId().toString()),
|
|
|
+ new ImGroupMember(musicGroup.getEducationalTeacherId().toString()) };
|
|
|
// 创建群组
|
|
|
imFeignService.groupCreate(new ImGroupModel(musicGroupId, imGroupMembers, musicGroup.getName()));
|
|
|
// 记录创建日志
|
|
@@ -172,7 +172,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
// 获取学员在该乐团续费状态
|
|
|
musicCardDtos.forEach(e -> {
|
|
|
MusicGroupStudentFee groupStudentFee = musicGroupStudentFeeDao.findByUser(userId, e.getMusicGroupId());
|
|
|
- if (groupStudentFee != null) {
|
|
|
+ if(groupStudentFee != null){
|
|
|
e.setPaymentStatus(musicGroupStudentFeeDao.findByUser(userId, e.getMusicGroupId()).getPaymentStatus());
|
|
|
}
|
|
|
});
|
|
@@ -474,7 +474,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
//更新下次续费时间
|
|
|
MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(userId, musicGroupId);
|
|
|
|
|
|
- if (musicGroupStudentFee == null) {
|
|
|
+ if(musicGroupStudentFee == null){
|
|
|
throw new BizException("系统数据异常,找不到学员预缴费信息");
|
|
|
}
|
|
|
|
|
@@ -570,23 +570,36 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
MusicGroup musicGroup = subFeeSettingDto.getMusicGroup();
|
|
|
String musicGroupId = musicGroup.getId();
|
|
|
MusicGroup group = musicGroupDao.get(musicGroupId);
|
|
|
- if (group != null) {
|
|
|
+ if(group != null){
|
|
|
musicGroupDao.update(musicGroup);
|
|
|
//修改课程里面的教学点
|
|
|
- if (!group.getSchoolId().equals(musicGroup.getSchoolId())) {
|
|
|
- courseScheduleDao.updateByMusicGroupId(musicGroupId, musicGroup.getSchoolId());
|
|
|
+ if(!group.getSchoolId().equals(musicGroup.getSchoolId())){
|
|
|
+ courseScheduleDao.updateByMusicGroupId(musicGroupId,musicGroup.getSchoolId());
|
|
|
}
|
|
|
// 删除乐团付费主体列表
|
|
|
musicGroupPaymentEntitiesDao.delByGroupId(musicGroupId);
|
|
|
//批量新增
|
|
|
- musicGroupPaymentEntitiesDao.batchAdd(subFeeSettingDto.getMusicGroupPaymentEntities(), musicGroupId);
|
|
|
+ musicGroupPaymentEntitiesDao.batchAdd(subFeeSettingDto.getMusicGroupPaymentEntities(),musicGroupId);
|
|
|
|
|
|
// 修改学员付费周期
|
|
|
List<Integer> calender = subFeeSettingDto.getMonths();
|
|
|
//删除乐团相关付费周期
|
|
|
musicGroupPaymentCalenderDao.delByGroupId(musicGroupId);
|
|
|
//批量插入
|
|
|
- musicGroupPaymentCalenderDao.batchAdd(calender, musicGroupId);
|
|
|
+ musicGroupPaymentCalenderDao.batchAdd(calender,musicGroupId);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public SubFeeSettingDto findMusicGroupBasicInfo(String musicGroupId) {
|
|
|
+ SubFeeSettingDto subFeeSettingDto = new SubFeeSettingDto();
|
|
|
+ //获取乐团信息
|
|
|
+ subFeeSettingDto.setMusicGroup(musicGroupDao.get(musicGroupId));
|
|
|
+ //获取付费主体
|
|
|
+ subFeeSettingDto.setMusicGroupPaymentEntities(musicGroupPaymentEntitiesDao.findByMusicGroupId(musicGroupId));
|
|
|
+ //获取缴费周期
|
|
|
+ List<Integer> paymentMonth = musicGroupPaymentCalenderDao.findByMusicGroupId(musicGroupId).stream().map(e -> e.getPaymentMonth()).collect(Collectors.toList());
|
|
|
+ subFeeSettingDto.setMonths(paymentMonth);
|
|
|
+ return subFeeSettingDto;
|
|
|
+ }
|
|
|
}
|