Browse Source

临时拆合班增加课程类型

周箭河 5 năm trước cách đây
mục cha
commit
c77cf9060b

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java

@@ -92,7 +92,7 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
 	 * @return
 	 */
 	StudentPaymentOrder addOrder(StudentRegistration studentRegistration, BigDecimal amount, String orderNo, String paymentChannel, BigDecimal courseFee,
-			List<MusicGroupSubjectGoodsGroup> goodsGroups, List<Goods> goodsList, List<Goods> otherGoodsList);
+			List<MusicGroupSubjectGoodsGroup> goodsGroups, List<Goods> goodsList, List<Goods> otherGoodsList) throws Exception;
 
 	/**
 	 * 学生注册缴费重新下订单

+ 5 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -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;
     }