|
@@ -414,6 +414,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
BigDecimal instrumentFee = BigDecimal.ZERO;
|
|
|
BigDecimal accessoriesFee = BigDecimal.ZERO;
|
|
|
BigDecimal otherFee = BigDecimal.ZERO;
|
|
|
+ BigDecimal remitFee = BigDecimal.ZERO;
|
|
|
|
|
|
//乐器及打包辅件
|
|
|
List<MusicGroupSubjectGoodsGroup> goodsGroups = new ArrayList<>();
|
|
@@ -443,7 +444,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
orderAmount = orderAmount.add(orderDetail.getPrice());
|
|
|
}
|
|
|
- } else if (studentRegistration.getTemporaryCourseFee() == null && StringUtils.isNoneBlank(registerPayDto.getGoodsGroupIds())) {
|
|
|
+ } else if (StringUtils.isNoneBlank(registerPayDto.getGoodsGroupIds())) {
|
|
|
goodsGroups = musicGroupSubjectGoodsGroupService.findGoodsGroupByIds(registerPayDto.getGoodsGroupIds());
|
|
|
for (MusicGroupSubjectGoodsGroup goodsGroup : goodsGroups) {
|
|
|
if (goodsGroup.getType().equals(GoodsType.INSTRUMENT) && musicOneSubjectClassPlan.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)) {
|
|
@@ -466,6 +467,27 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
courseFee.subtract(goodsGroup.getRemissionCourseFee());
|
|
|
}
|
|
|
}
|
|
|
+ } else if (registerPayDto.getGoodsGroups() != null && registerPayDto.getGoodsGroups().size() > 0) {
|
|
|
+ String goodsGroupIds = registerPayDto.getGoodsGroups().keySet().stream().map(key -> key.toString()).collect(Collectors.joining(","));
|
|
|
+ goodsGroups = musicGroupSubjectGoodsGroupService.findGoodsGroupByIds(goodsGroupIds);
|
|
|
+ for (MusicGroupSubjectGoodsGroup goodsGroup : goodsGroups) {
|
|
|
+ JSONObject json = JSONObject.parseObject(goodsGroup.getKitGroupPurchaseTypeJson());
|
|
|
+ if (registerPayDto.getGoodsGroups().get(goodsGroup.getId()).equals("LEASE")) {
|
|
|
+ goodsGroup.setPrice(goodsGroup.getDepositFee());
|
|
|
+ goodsGroup.setKitGroupPurchaseType(KitGroupPurchaseTypeEnum.LEASE);
|
|
|
+ }
|
|
|
+ if (registerPayDto.getGoodsGroups().get(goodsGroup.getId()).equals("FREE")) {
|
|
|
+ goodsGroup.setPrice(new BigDecimal(0));
|
|
|
+ }
|
|
|
+ if(goodsGroup.getType().equals(GoodsType.INSTRUMENT)){
|
|
|
+ instrumentFee = instrumentFee.add(goodsGroup.getPrice());
|
|
|
+ }else if(goodsGroup.getType().equals(GoodsType.ACCESSORIES)) {
|
|
|
+ accessoriesFee = accessoriesFee.add(goodsGroup.getPrice());
|
|
|
+ }else {
|
|
|
+ otherFee = otherFee.add(goodsGroup.getPrice());
|
|
|
+ }
|
|
|
+ orderAmount = orderAmount.add(goodsGroup.getPrice());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//单独辅件
|
|
@@ -1441,7 +1463,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if (orderList == null || orderList.size() == 0) {
|
|
|
throw new BizException("请走报名缴费流程");
|
|
|
}*/
|
|
|
-
|
|
|
+
|
|
|
// 判断当前是否是续费状态
|
|
|
if (musicGroupStudentFee.getPaymentStatus() != PaymentStatus.NON_PAYMENT) {
|
|
|
throw new BizException("已缴费");
|
|
@@ -1761,7 +1783,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
Date date = new Date();
|
|
|
List<Integer> months = subFeeSettingDto.getMonths();
|
|
|
-
|
|
|
+
|
|
|
//判断缴费日历是否修改
|
|
|
boolean isModifiedOfCalender = false;
|
|
|
|
|
@@ -1778,12 +1800,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
if (isModifiedOfCalender) {
|
|
|
-
|
|
|
+
|
|
|
Integer num = musicGroupStudentFeeDao.countStudentNoPayNum(musicGroupId);
|
|
|
if (num > 0) {
|
|
|
throw new BizException("缴费周期更新失败,当前乐团有未缴费的学员");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 删除乐团相关付费周期
|
|
|
musicGroupPaymentCalenderDao.delByGroupId(musicGroupId);
|
|
|
musicGroupStudentFeeDao.deleteByMusicGroupId(musicGroupId);
|
|
@@ -1791,7 +1813,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
// 批量插入
|
|
|
musicGroupPaymentCalenderDao.batchAdd(months, musicGroupId);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//生成学员费用表
|
|
|
List<MusicGroupStudentFee> musicGroupStudentFees = musicGroupStudentFeeDao.initMusicGroupStudentFee(musicGroupId);
|
|
|
if(musicGroupStudentFees != null && musicGroupStudentFees.size() > 0){
|