|
@@ -1200,7 +1200,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
studentPaymentOrderDao.insert(studentPaymentOrder);
|
|
studentPaymentOrderDao.insert(studentPaymentOrder);
|
|
StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(studentPaymentOrder.getUserId(), calender.getMusicGroupId());
|
|
StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(studentPaymentOrder.getUserId(), calender.getMusicGroupId());
|
|
//支付成功后处理课程、云教练、活动等数据
|
|
//支付成功后处理课程、云教练、活动等数据
|
|
- List<StudentPaymentOrderDetail> orderDetails = studentRegistrationService.addOrder1(studentPaymentOrder, calender, courseSettings, calenderMembers, calenderRepair, calenderActivities);
|
|
|
|
|
|
+ List<StudentPaymentOrderDetail> orderDetails = studentRegistrationService.addOrder1(studentPaymentOrder,
|
|
|
|
+ calender,
|
|
|
|
+ courseSettings,
|
|
|
|
+ calenderMembers,
|
|
|
|
+ calenderRepair,
|
|
|
|
+ calenderActivities);
|
|
studentPaymentRouteOrderService.addRouteOrder(orderNo, calender.getOrganId(), calender.getCurrentTotalAmount());
|
|
studentPaymentRouteOrderService.addRouteOrder(orderNo, calender.getOrganId(), calender.getCurrentTotalAmount());
|
|
studentPaymentOrderDetailService.addOrderDetailTo1(studentPaymentOrder, musicGroup, studentRegistration,orderDetails);
|
|
studentPaymentOrderDetailService.addOrderDetailTo1(studentPaymentOrder, musicGroup, studentRegistration,orderDetails);
|
|
}
|
|
}
|
|
@@ -1218,11 +1223,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
}
|
|
}
|
|
|
|
|
|
boolean isGiveAccessories = musicGroup.getIsGiveAccessories();
|
|
boolean isGiveAccessories = musicGroup.getIsGiveAccessories();
|
|
|
|
+ boolean buyCloudTeacher = CollectionUtils.isNotEmpty(registerPayDto.getBuyCalenderMemberId());
|
|
|
|
|
|
- MusicGroupApplyGoodsDto goodsDto = new MusicGroupApplyGoodsDto();
|
|
|
|
|
|
+ MusicGroupApplyGoodsDto goodsDto = new MusicGroupApplyGoodsDto();
|
|
//乐器及打包辅件价格
|
|
//乐器及打包辅件价格
|
|
List<MusicGroupSubjectGoodsGroup> goodsGroups;
|
|
List<MusicGroupSubjectGoodsGroup> goodsGroups;
|
|
- if (registerPayDto.getGoodsGroups() != null && registerPayDto.getGoodsGroups().size() > 0) {
|
|
|
|
|
|
+ if (registerPayDto.getGoodsGroups() != null && registerPayDto.getGoodsGroups().size() > 0) {
|
|
String goodsGroupIds = registerPayDto.getGoodsGroups().keySet().stream().map(Object::toString).collect(Collectors.joining(","));
|
|
String goodsGroupIds = registerPayDto.getGoodsGroups().keySet().stream().map(Object::toString).collect(Collectors.joining(","));
|
|
goodsGroups = musicGroupSubjectGoodsGroupService.findGoodsGroupByIds(goodsGroupIds);
|
|
goodsGroups = musicGroupSubjectGoodsGroupService.findGoodsGroupByIds(goodsGroupIds);
|
|
goodsDto.setGoodsGroups(goodsGroups);
|
|
goodsDto.setGoodsGroups(goodsGroups);
|
|
@@ -1230,7 +1236,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
Map<String, BigDecimal> groupType = JSONObject.parseObject(goodsGroup.getKitGroupPurchaseTypeJson(), new TypeReference<Map<String, BigDecimal>>() {
|
|
Map<String, BigDecimal> groupType = JSONObject.parseObject(goodsGroup.getKitGroupPurchaseTypeJson(), new TypeReference<Map<String, BigDecimal>>() {
|
|
});
|
|
});
|
|
|
|
|
|
- if(isGiveAccessories && registerPayDto.getBuyCloudTeacher()){
|
|
|
|
|
|
+ if(isGiveAccessories && buyCloudTeacher){
|
|
if (goodsGroup.getType().equals(GoodsType.ACCESSORIES)) {
|
|
if (goodsGroup.getType().equals(GoodsType.ACCESSORIES)) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
@@ -1253,7 +1259,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
goodsGroup.setGoodsList(goodsService.findGoodsByIds(goodsGroup.getGoodsIdList()));
|
|
goodsGroup.setGoodsList(goodsService.findGoodsByIds(goodsGroup.getGoodsIdList()));
|
|
|
|
|
|
//齐齐哈尔走特殊规则
|
|
//齐齐哈尔走特殊规则
|
|
- if (calender.getOrganId() == 55 && (registerPayDto.getNewCourse() == null || registerPayDto.getNewCourse().size() == 0) && !(registerPayDto.getBuyCloudTeacher() || registerPayDto.getBuyCloudTeacherPlus())) {
|
|
|
|
|
|
+ if (calender.getOrganId() == 55 && (CollectionUtils.isEmpty(registerPayDto.getNewCourse())) && !buyCloudTeacher) {
|
|
//取商品零售价
|
|
//取商品零售价
|
|
if (StringUtils.isNotBlank(goodsGroup.getGoodsIdList())) {
|
|
if (StringUtils.isNotBlank(goodsGroup.getGoodsIdList())) {
|
|
List<Goods> goodsList = goodsDao.findGoodsByIds(goodsGroup.getGoodsIdList());
|
|
List<Goods> goodsList = goodsDao.findGoodsByIds(goodsGroup.getGoodsIdList());
|
|
@@ -1276,7 +1282,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
List<MusicGroupPaymentCalenderCourseSettings> newCourses;
|
|
List<MusicGroupPaymentCalenderCourseSettings> newCourses;
|
|
//因为前端会传newCourse过来所以这里加了合班缴费判断
|
|
//因为前端会传newCourse过来所以这里加了合班缴费判断
|
|
if (calender.getPaymentType() != PaymentType.SPAN_GROUP_CLASS_ADJUST &&
|
|
if (calender.getPaymentType() != PaymentType.SPAN_GROUP_CLASS_ADJUST &&
|
|
- calender.getPayUserType() == PayUserType.STUDENT && registerPayDto.getNewCourse() != null && registerPayDto.getNewCourse().size() > 0) {
|
|
|
|
|
|
+ calender.getPayUserType() == PayUserType.STUDENT && CollectionUtils.isNotEmpty(registerPayDto.getNewCourse())) {
|
|
newCourses = musicGroupPaymentCalenderCourseSettingsDao.getCalenderCourseSettings(registerPayDto.getNewCourse());
|
|
newCourses = musicGroupPaymentCalenderCourseSettingsDao.getCalenderCourseSettings(registerPayDto.getNewCourse());
|
|
for (MusicGroupPaymentCalenderCourseSettings calenderCourseSetting : newCourses) {
|
|
for (MusicGroupPaymentCalenderCourseSettings calenderCourseSetting : newCourses) {
|
|
if (goodsDto.isRemitCourseRFeeFlag()) {
|
|
if (goodsDto.isRemitCourseRFeeFlag()) {
|
|
@@ -1289,7 +1295,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
}
|
|
}
|
|
//活动价格
|
|
//活动价格
|
|
List<Long> buyCalenderActivityIdList = registerPayDto.getBuyCalenderActivityId();
|
|
List<Long> buyCalenderActivityIdList = registerPayDto.getBuyCalenderActivityId();
|
|
- if (buyCalenderActivityIdList != null && buyCalenderActivityIdList.size() > 0) {
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(buyCalenderActivityIdList)) {
|
|
goodsDto.setOrderAmount(goodsDto.getOrderAmount().add(musicGroupPaymentCalenderService.getActivityAmount(buyCalenderActivityIdList)));
|
|
goodsDto.setOrderAmount(goodsDto.getOrderAmount().add(musicGroupPaymentCalenderService.getActivityAmount(buyCalenderActivityIdList)));
|
|
}
|
|
}
|
|
//乐器保养价格
|
|
//乐器保养价格
|
|
@@ -1297,13 +1303,13 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
goodsDto.setOrderAmount(goodsDto.getOrderAmount().add(musicGroupPaymentCalenderService.getRepairAmount(calender.getId())));
|
|
goodsDto.setOrderAmount(goodsDto.getOrderAmount().add(musicGroupPaymentCalenderService.getRepairAmount(calender.getId())));
|
|
}
|
|
}
|
|
//云教练价格和订单
|
|
//云教练价格和订单
|
|
- if (registerPayDto.getBuyCloudTeacher()) {
|
|
|
|
- goodsDto.setOrderAmount(goodsDto.getOrderAmount().add(musicGroupPaymentCalenderService.getMemberAmount(calender.getId())));
|
|
|
|
|
|
+ if (buyCloudTeacher) {
|
|
|
|
+ goodsDto.setOrderAmount(goodsDto.getOrderAmount().add(musicGroupPaymentCalenderService.getMemberAmount(registerPayDto.getBuyCalenderMemberId())));
|
|
}
|
|
}
|
|
//合班缴费
|
|
//合班缴费
|
|
List<MusicGroupPaymentCalenderStudentDetail> studentDetails = musicGroupPaymentCalenderStudentDetailDao.findByBatchNoAndUserId(registerPayDto.getBatchNo(), registerPayDto.getUserId());
|
|
List<MusicGroupPaymentCalenderStudentDetail> studentDetails = musicGroupPaymentCalenderStudentDetailDao.findByBatchNoAndUserId(registerPayDto.getBatchNo(), registerPayDto.getUserId());
|
|
- if (studentDetails != null && studentDetails.size() > 0) {
|
|
|
|
- goodsDto.setOrderAmount(goodsDto.getOrderAmount().add(studentDetails.stream().map(e -> e.getCourseCurrentPrice()).reduce(BigDecimal.ZERO, BigDecimal::add)));
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(studentDetails)) {
|
|
|
|
+ goodsDto.setOrderAmount(goodsDto.getOrderAmount().add(studentDetails.stream().map(MusicGroupPaymentCalenderStudentDetail::getCourseCurrentPrice).reduce(BigDecimal.ZERO, BigDecimal::add)));
|
|
}
|
|
}
|
|
return goodsDto;
|
|
return goodsDto;
|
|
}
|
|
}
|