|
@@ -388,7 +388,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public StudentPaymentOrder addOrder(StudentRegistration studentRegistration, BigDecimal amount, String orderNo, String paymentChannel,
|
|
|
- BigDecimal courseFee, List<MusicGroupSubjectGoodsGroup> goodsGroups, BigDecimal remitFee, BigDecimal courseRemitFee, List<MusicGroupPaymentCalenderCourseSettings> newCourses,Boolean buyMaintenance) throws Exception {
|
|
|
+ BigDecimal courseFee, List<MusicGroupSubjectGoodsGroup> goodsGroups, BigDecimal remitFee, BigDecimal courseRemitFee, List<MusicGroupPaymentCalenderCourseSettings> newCourses, Boolean buyMaintenance) throws Exception {
|
|
|
Date date = new Date();
|
|
|
StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
|
|
|
studentPaymentOrder.setUserId(studentRegistration.getUserId());
|
|
@@ -412,6 +412,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
studentPaymentOrderDetail.setPaymentOrderId(studentPaymentOrder.getId());
|
|
|
studentPaymentOrderDetailList.add(studentPaymentOrderDetail);
|
|
|
//乐器及打包辅件
|
|
|
+ String maintenanceGoodsId = "";
|
|
|
if (goodsGroups != null && goodsGroups.size() > 0) {
|
|
|
for (MusicGroupSubjectGoodsGroup goodsGroup : goodsGroups) {
|
|
|
StudentPaymentOrderDetail studentPaymentOrderDetail4goodsGroup = new StudentPaymentOrderDetail();
|
|
@@ -434,6 +435,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
studentPaymentOrderDetail4goodsGroup.setPaymentOrderId(studentPaymentOrder.getId());
|
|
|
studentPaymentOrderDetail4goodsGroup.setKitGroupPurchaseType(goodsGroup.getKitGroupPurchaseType());
|
|
|
studentPaymentOrderDetailList.add(studentPaymentOrderDetail4goodsGroup);
|
|
|
+ if (OrderDetailTypeEnum.MUSICAL.equals(type) && KitGroupPurchaseTypeEnum.GROUP.equals(goodsGroup.getKitGroupPurchaseType())) {
|
|
|
+ maintenanceGoodsId = goodsGroup.getGoodsIdList();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -442,7 +446,6 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
for (MusicGroupPaymentCalenderCourseSettings newCourse : newCourses) {
|
|
|
StudentPaymentOrderDetail studentPaymentOrderDetailCourse = new StudentPaymentOrderDetail();
|
|
|
studentPaymentOrderDetailCourse.setType(OrderDetailTypeEnum.valueOf(newCourse.getCourseType().getCode()));
|
|
|
- studentPaymentOrderDetailCourse.setPrice(newCourse.getCourseCurrentPrice());
|
|
|
if (courseRemitFee.compareTo(BigDecimal.ZERO) > 0 && !newCourse.getIsStudentOptional()) {
|
|
|
studentPaymentOrderDetailCourse.setPrice(BigDecimal.ZERO);
|
|
|
studentPaymentOrderDetailCourse.setRemitFee(newCourse.getCourseCurrentPrice());
|
|
@@ -456,7 +459,10 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
studentPaymentOrderDetailList.add(studentPaymentOrderDetailCourse);
|
|
|
}
|
|
|
}
|
|
|
- if(buyMaintenance){
|
|
|
+ if (buyMaintenance) {
|
|
|
+ if ("".equals(maintenanceGoodsId)) {
|
|
|
+ throw new BizException("团购乐器才能购买乐保,请核查");
|
|
|
+ }
|
|
|
StudentPaymentOrderDetail maintenanceOrderDetail = new StudentPaymentOrderDetail();
|
|
|
maintenanceOrderDetail.setType(OrderDetailTypeEnum.MAINTENANCE);
|
|
|
maintenanceOrderDetail.setPrice(new BigDecimal(400));
|
|
@@ -530,6 +536,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
studentPaymentOrderDetail.setPaymentOrderId(studentPaymentOrder.getId());
|
|
|
studentPaymentOrderDetailList.add(studentPaymentOrderDetail);
|
|
|
//乐器及打包辅件
|
|
|
+ String maintenanceGoodsId = "";
|
|
|
if (goodsGroups != null && goodsGroups.size() > 0) {
|
|
|
for (MusicGroupSubjectGoodsGroup goodsGroup : goodsGroups) {
|
|
|
StudentPaymentOrderDetail studentPaymentOrderDetail4goodsGroup = new StudentPaymentOrderDetail();
|
|
@@ -552,6 +559,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
studentPaymentOrderDetail4goodsGroup.setPaymentOrderId(studentPaymentOrder.getId());
|
|
|
studentPaymentOrderDetail4goodsGroup.setKitGroupPurchaseType(goodsGroup.getKitGroupPurchaseType());
|
|
|
studentPaymentOrderDetailList.add(studentPaymentOrderDetail4goodsGroup);
|
|
|
+ if (OrderDetailTypeEnum.MUSICAL.equals(type) && KitGroupPurchaseTypeEnum.GROUP.equals(goodsGroup.getKitGroupPurchaseType())) {
|
|
|
+ maintenanceGoodsId = goodsGroup.getGoodsIdList();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -573,7 +583,10 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
studentPaymentOrderDetailList.add(studentPaymentOrderDetailCourse);
|
|
|
}
|
|
|
}
|
|
|
- if(buyMaintenance){
|
|
|
+ if (buyMaintenance) {
|
|
|
+ if ("".equals(maintenanceGoodsId)) {
|
|
|
+ throw new BizException("团购乐器才能购买乐保,请核查");
|
|
|
+ }
|
|
|
StudentPaymentOrderDetail maintenanceOrderDetail = new StudentPaymentOrderDetail();
|
|
|
maintenanceOrderDetail.setType(OrderDetailTypeEnum.MAINTENANCE);
|
|
|
maintenanceOrderDetail.setPrice(new BigDecimal(400));
|