|
@@ -2833,7 +2833,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public List<StudentRegistration> addMusicGroupRegs(String musicGroupId, List<Long> registerIds) {
|
|
|
+ public List<StudentRegistration> addMusicGroupRegs(String musicGroupId, List<Long> registerIds) throws Exception {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
if (sysUser == null || sysUser.getId() == null) {
|
|
|
throw new BizException("获取用户信息失败");
|
|
@@ -2882,10 +2882,11 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
for (StudentRegistration studentRegistration : regs) {
|
|
|
studentRegistration.setId(null);
|
|
|
studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.APPLY);
|
|
|
- studentRegistration.setPaymentStatus(PaymentStatusEnum.NO);
|
|
|
+ studentRegistration.setPaymentStatus(PaymentStatusEnum.OPEN); //开启缴费
|
|
|
studentRegistration.setMusicGroupId(musicGroupId);
|
|
|
studentRegistration.setSubjectId(subjectId);
|
|
|
studentRegistration.setActualSubjectId(subjectId);
|
|
|
+ studentRegistration.setIsMerge(1);
|
|
|
studentRegistration.setTemporaryCourseFee(null);
|
|
|
}
|
|
|
studentRegistrationList.addAll(regs);
|
|
@@ -2895,6 +2896,21 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if (studentRegistrationList.size() > 0) {
|
|
|
studentRegistrationDao.batchInsert(studentRegistrationList);
|
|
|
}
|
|
|
+ //0元的和学校缴费的默认缴费
|
|
|
+ MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderService.findByMusicGroupRegCalender(musicGroupId);
|
|
|
+ if (regCalender == null || regCalender.getPayUserType().equals(MusicGroupPaymentCalender.PayUserType.SCHOOL) ||
|
|
|
+ regCalender.getPaymentAmount().compareTo(BigDecimal.ZERO) == 0) {
|
|
|
+ List<MusicGroupPaymentCalenderCourseSettings> musicGroupRegCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.getMusicGroupRegCalenderCourseSettings(musicGroupId);
|
|
|
+ List<Integer> courseSettings = musicGroupRegCalenderCourseSettings.stream().filter(e -> !e.getIsStudentOptional()).map(MusicGroupPaymentCalenderCourseSettings::getId).collect(Collectors.toList());
|
|
|
+ RegisterPayDto registerPayDto = new RegisterPayDto();
|
|
|
+ registerPayDto.setAmount(BigDecimal.ZERO);
|
|
|
+ registerPayDto.setNewCourse(courseSettings);
|
|
|
+ for (StudentRegistration studentRegistration : studentRegistrationList) {
|
|
|
+ registerPayDto.setRegisterId(studentRegistration.getId().intValue());
|
|
|
+ Map payMap = this.pay(registerPayDto);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
//修改乐团信息
|
|
|
MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
|