|
@@ -173,10 +173,6 @@ public class ChildrenDayReserveServiceImpl extends BaseServiceImpl<Integer, Chil
|
|
|
public Map pay(DegreePayDto degreePayDto) throws Exception {
|
|
|
studentDao.lockUser(degreePayDto.getUserId());
|
|
|
|
|
|
- if (degreePayDto.getTheoryLevel() != null && !degreePayDto.getTheoryCourse()) {
|
|
|
- throw new BizException("参加乐理考试,请选乐理考级专项训练课");
|
|
|
- }
|
|
|
-
|
|
|
//检查进行中的订单
|
|
|
List<ChildrenDayDegreeDetail> details = childrenDayDegreeDetailService.getByUserIdAndStatus(degreePayDto.getUserId(), 1);
|
|
|
|
|
@@ -194,6 +190,11 @@ public class ChildrenDayReserveServiceImpl extends BaseServiceImpl<Integer, Chil
|
|
|
//检查已经购买的课程(不能重复)
|
|
|
details = childrenDayDegreeDetailService.getByUserIdAndStatus(degreePayDto.getUserId(), 2);
|
|
|
Set<Integer> detailTypes = details.stream().map(ChildrenDayDegreeDetail::getType).collect(Collectors.toSet());
|
|
|
+
|
|
|
+ if (degreePayDto.getTheoryLevel() != null && degreePayDto.getTheoryLevel() > 0 && !degreePayDto.getTheoryCourse() && !detailTypes.contains(5)) {
|
|
|
+ throw new BizException("参加乐理考试,请选乐理考级专项训练课");
|
|
|
+ }
|
|
|
+
|
|
|
if (degreePayDto.getVip1v1() && detailTypes.contains(3)) {
|
|
|
throw new BizException("您已购买过VIP 1V1课程,请勿重复选择");
|
|
|
}
|
|
@@ -215,6 +216,10 @@ public class ChildrenDayReserveServiceImpl extends BaseServiceImpl<Integer, Chil
|
|
|
if (hasList.size() > 0) {
|
|
|
throw new BizException("您已报考同声部同等级,请勿重复报考");
|
|
|
}
|
|
|
+
|
|
|
+ if (degreePayDto.getNeedVipCourse() && !detailTypes.contains(3) && !detailTypes.contains(4)) {
|
|
|
+ throw new BizException("请选择VIP课程");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//检查乐理考级等级是否重复
|
|
@@ -237,7 +242,7 @@ public class ChildrenDayReserveServiceImpl extends BaseServiceImpl<Integer, Chil
|
|
|
OrganizationDegreeCourseFee courseFee = organizationDegreeCourseFeeDao.getByOrganId(degreePayDto.getOrganId());
|
|
|
|
|
|
if (courseFee == null) {
|
|
|
- throw new BizException("刚前分部不参与,谢谢关注");
|
|
|
+ throw new BizException("当前分部不参与,谢谢关注");
|
|
|
}
|
|
|
|
|
|
List<DegreeLevelFee> degreeLevelFees = degreeLevelFeeDao.getAll();
|