|
@@ -1597,4 +1597,18 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
public List<StudentMusicGroupDto> queryStudentMusicGroupInfo(Integer userId) {
|
|
|
return studentRegistrationDao.queryStudentMusicGroupInfo(userId);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public Boolean delReg(Long id) {
|
|
|
+ StudentRegistration studentRegistration = studentRegistrationDao.get(id);
|
|
|
+ MusicGroupSubjectPlan subjectPlan = musicGroupSubjectPlanDao.findSubjectPlan(studentRegistration.getMusicGroupId(), studentRegistration.getSubjectId());
|
|
|
+ int delNum = studentRegistrationDao.delete(id);
|
|
|
+ subjectPlan.setApplyStudentNum(subjectPlan.getApplyStudentNum() - 1);
|
|
|
+ int updateNum = musicGroupSubjectPlanDao.update(subjectPlan);
|
|
|
+ if (delNum <= 0 || updateNum <= 0) {
|
|
|
+ throw new BizException("删除失败,请重试");
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|