|
@@ -213,7 +213,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public StudentPaymentOrder addOrder(StudentRegistration studentRegistration, BigDecimal amount, String orderNo, String paymentChannel, BigDecimal courseFee, List<MusicGroupSubjectGoodsGroup> goodsGroups, List<Goods> goodsList, List<Goods> otherGoodsList) {
|
|
|
+ public StudentPaymentOrder addOrder(StudentRegistration studentRegistration, BigDecimal amount, String orderNo, String paymentChannel, BigDecimal courseFee, List<MusicGroupSubjectGoodsGroup> goodsGroups, List<Goods> goodsList, List<Goods> otherGoodsList) throws Exception {
|
|
|
Date date = new Date();
|
|
|
StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
|
|
|
studentPaymentOrder.setUserId(studentRegistration.getUserId());
|
|
@@ -290,6 +290,10 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getSubjectId());
|
|
|
int paidNum = musicOneSubjectClassPlan.getPaidStudentNum() == null ? 0 : musicOneSubjectClassPlan.getPaidStudentNum();
|
|
|
musicOneSubjectClassPlan.setPaidStudentNum(paidNum + 1);
|
|
|
+ if(musicOneSubjectClassPlan.getPaidStudentNum() > musicOneSubjectClassPlan.getExpectedStudentNum()){
|
|
|
+ throw new Exception("乐团人数已满");
|
|
|
+ }
|
|
|
+ musicGroupSubjectPlanService.update(musicOneSubjectClassPlan);
|
|
|
return studentPaymentOrder;
|
|
|
}
|
|
|
|
|
@@ -385,6 +389,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public Integer insertStudent(StudentRegistration studentRegistration) throws Exception {
|
|
|
StudentRegistration phoneAndMusicGroupId = studentRegistrationDao.getByPhoneAndMusicGroupId(studentRegistration.getMusicGroupId(), studentRegistration.getParentsPhone());
|
|
|
if (phoneAndMusicGroupId != null) {
|
|
@@ -417,8 +422,10 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
userId = sysUser.getId();
|
|
|
}
|
|
|
studentRegistration.setUserId(userId);
|
|
|
+ studentRegistration.setPaymentStatus(PaymentStatusEnum.YES);
|
|
|
+ studentRegistration.setMusicGroupStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
//学生报名表
|
|
|
- studentRegistrationDao.insert(studentRegistration);
|
|
|
+ studentRegistrationDao.insertBasic(studentRegistration);
|
|
|
//增加报名学生数
|
|
|
musicGroupSubjectPlanService.addApplyStudentNum(studentRegistration.getMusicGroupId(), studentRegistration.getSubjectId(),1);
|
|
|
if (studentRegistration.getClassGroupId() != null) {
|
|
@@ -478,6 +485,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public StudentPaymentOrder updateApplyOrder(StudentPaymentOrder studentPaymentOrder) {
|
|
|
//更新订单状态
|
|
|
studentPaymentOrderService.update(studentPaymentOrder);
|
|
@@ -554,11 +562,16 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
@Override
|
|
|
public List<StudentRegistration> findStudentListByUserIdList(String musicGroupId, List<Integer> userIdList) {
|
|
|
- return studentRegistrationDao.findStudentListByUserIdList(musicGroupId, userIdList);
|
|
|
+ return studentRegistrationDao.findStudentListByUserIdList(musicGroupId, StringUtils.join(userIdList,","));
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public int openPayment(String ids) {
|
|
|
return studentRegistrationDao.batchOpenPay(ids, PaymentStatusEnum.OPEN);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<StudentRegistration> queryStudentByMusicGroupId(String musicGroupId) {
|
|
|
+ return studentRegistrationDao.queryStudentByMusicGroupId(musicGroupId);
|
|
|
+ }
|
|
|
}
|