|
@@ -27,6 +27,7 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
import java.util.Set;
|
|
|
+import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
@@ -672,6 +673,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if(musicGroupRegCalender == null){
|
|
|
throw new BizException("缴费信息不存在");
|
|
|
}
|
|
|
+ MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
|
|
|
+ if(musicGroup == null){
|
|
|
+ throw new BizException("查询乐团信息失败");
|
|
|
+ }
|
|
|
Integer tenantId = TenantContextHolder.getTenantId();
|
|
|
|
|
|
Integer userId = studentRegistration.getUserId();
|
|
@@ -680,19 +685,14 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
BigDecimal orderAmount = new BigDecimal("0");
|
|
|
|
|
|
//获取课程价格
|
|
|
- MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getActualSubjectId());
|
|
|
- BigDecimal courseFee = musicOneSubjectClassPlan.getFee() == null ? BigDecimal.ZERO : musicOneSubjectClassPlan.getFee();
|
|
|
- orderAmount = orderAmount.add(courseFee);
|
|
|
+// MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getActualSubjectId());
|
|
|
+// BigDecimal courseFee = musicOneSubjectClassPlan.getFee() == null ? BigDecimal.ZERO : musicOneSubjectClassPlan.getFee();
|
|
|
+// orderAmount = orderAmount.add(courseFee);
|
|
|
|
|
|
BigDecimal remitFee = BigDecimal.ZERO; //乐器减免金额
|
|
|
BigDecimal courseRemitFee = BigDecimal.ZERO; //课程减免费用
|
|
|
boolean remitCourseRFeeFlag = false; //减免课程费用标识
|
|
|
|
|
|
- MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
|
|
|
- if(musicGroup == null){
|
|
|
- throw new BizException("查询乐团信息失败");
|
|
|
- }
|
|
|
-
|
|
|
//乐器及打包辅件
|
|
|
List<MusicGroupSubjectGoodsGroup> goodsGroups = new ArrayList<>();
|
|
|
if (registerPayDto.getGoodsGroups() != null && registerPayDto.getGoodsGroups().size() > 0) {
|
|
@@ -700,8 +700,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
goodsGroups = musicGroupSubjectGoodsGroupService.findGoodsGroupByIds(goodsGroupIds);
|
|
|
}
|
|
|
for (MusicGroupSubjectGoodsGroup goodsGroup : goodsGroups) {
|
|
|
- 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 (goodsGroup.getType().equals(GoodsType.INSTRUMENT)) {
|
|
|
String kitGroupPurchaseType = registerPayDto.getGoodsGroups().get(goodsGroup.getId());
|
|
@@ -804,7 +803,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
orderAmount,
|
|
|
orderNo,
|
|
|
channelType,
|
|
|
- courseFee,
|
|
|
goodsGroups,
|
|
|
remitFee,
|
|
|
courseRemitFee,
|
|
@@ -918,6 +916,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
return payMap;
|
|
|
}
|
|
|
|
|
|
+ private BigDecimal getCalenderAmount(Long calenderId,Function<Long,BigDecimal> func){
|
|
|
+ return func.apply(calenderId);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Map rePay(RegisterPayDto registerPayDto) throws Exception {
|
|
@@ -965,9 +969,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
BigDecimal orderAmount = new BigDecimal("0");
|
|
|
|
|
|
//获取课程价格
|
|
|
- MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getActualSubjectId());
|
|
|
- BigDecimal courseFee = musicOneSubjectClassPlan.getFee() == null ? BigDecimal.ZERO : musicOneSubjectClassPlan.getFee();
|
|
|
- orderAmount = orderAmount.add(courseFee);
|
|
|
+// MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getActualSubjectId());
|
|
|
+// BigDecimal courseFee = musicOneSubjectClassPlan.getFee() == null ? BigDecimal.ZERO : musicOneSubjectClassPlan.getFee();
|
|
|
+// orderAmount = orderAmount.add(courseFee);
|
|
|
|
|
|
BigDecimal remitFee = BigDecimal.ZERO;
|
|
|
BigDecimal courseRemitFee = BigDecimal.ZERO; //课程减免费用
|
|
@@ -1090,7 +1094,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
orderAmount,
|
|
|
orderNo,
|
|
|
channelType,
|
|
|
- courseFee,
|
|
|
goodsGroups,
|
|
|
remitFee,
|
|
|
courseRemitFee,
|