|
@@ -88,9 +88,20 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Integer batchUpdateSubject(String userIds, Integer subId, String musicGroupId) {
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public Integer batchUpdateSubject(Integer userId, Integer subId, String musicGroupId) throws Exception {
|
|
|
+ //获取当前学员的当前声部
|
|
|
+ StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(userId, musicGroupId);
|
|
|
+ if(studentRegistration == null){
|
|
|
+ throw new Exception("学员信息不存在");
|
|
|
+ }
|
|
|
+ //当前专业报名人数减一
|
|
|
+ musicGroupSubjectPlanService.addApplyStudentNum(musicGroupId,subId,-1);
|
|
|
//批量调剂(未缴费学员)
|
|
|
- return studentRegistrationDao.batchUpdateSubject(userIds, subId, musicGroupId);
|
|
|
+ int i = studentRegistrationDao.batchUpdateSubject(userId, subId, musicGroupId);
|
|
|
+ //修改专业已报名人数
|
|
|
+ musicGroupSubjectPlanService.addApplyStudentNum(musicGroupId,subId,1);
|
|
|
+ return i;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -164,7 +175,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
studentRegistration.setUserId(sysUser.getId());
|
|
|
studentRegistrationDao.insert(studentRegistration);
|
|
|
//增加报名学生数
|
|
|
- musicGroupSubjectPlanService.addApplyStudentNum(studentRegistration.getMusicGroupId(), studentRegistration.getSubjectId());
|
|
|
+ musicGroupSubjectPlanService.addApplyStudentNum(studentRegistration.getMusicGroupId(), studentRegistration.getSubjectId(),1);
|
|
|
return studentRegistration;
|
|
|
}
|
|
|
|
|
@@ -383,7 +394,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
//学生报名表
|
|
|
studentRegistrationDao.insert(studentRegistration);
|
|
|
//增加报名学生数
|
|
|
- musicGroupSubjectPlanService.addApplyStudentNum(studentRegistration.getMusicGroupId(), studentRegistration.getSubjectId());
|
|
|
+ musicGroupSubjectPlanService.addApplyStudentNum(studentRegistration.getMusicGroupId(), studentRegistration.getSubjectId(),1);
|
|
|
if (studentRegistration.getClassGroupId() != null) {
|
|
|
ClassGroup classGroup = classGroupDao.get(studentRegistration.getClassGroupId());
|
|
|
if (classGroup != null) {
|