zouxuan 3 years ago
parent
commit
a16974bb61

+ 4 - 2
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/core/filter/PhoneLoginAuthenticationFilter.java

@@ -52,7 +52,7 @@ public class PhoneLoginAuthenticationFilter extends AbstractAuthenticationProces
 		// 是否是租户
 		String isLessee = obtainParameter(request, IS_LESSEE);
 		
-//		String tenantId = obtainParameter(request, TENANT_ID);
+		String tenantId = obtainParameter(request, TENANT_ID);
 		
 		String organId = obtainParameter(request, ORGAN_ID);
 
@@ -75,7 +75,9 @@ public class PhoneLoginAuthenticationFilter extends AbstractAuthenticationProces
 		loginEntity.setIsRegister(isRegister);
 		loginEntity.setDeviceNum(deviceNum);
 		loginEntity.setOrganId(organId);
-//		loginEntity.setTenantId(Integer.parseInt(tenantId));
+		if(StringUtils.isNotEmpty(tenantId)){
+			loginEntity.setTenantId(Integer.parseInt(tenantId));
+		}
 
 		authRequest = new PhoneAuthenticationToken(SecurityConstants.PHONE_PRINCIPAL_PREFIX + principal, loginEntity);
 

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderService.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service;
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;

+ 0 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java

@@ -121,7 +121,6 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
                                  BigDecimal amount,
                                  String orderNo,
                                  String paymentChannel,
-                                 BigDecimal courseFee,
                                  List<MusicGroupSubjectGoodsGroup> goodsGroups,
                                  BigDecimal remitFee,
                                  BigDecimal courseRemitFee,

+ 18 - 15
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -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,

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -581,7 +581,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<MusicGroupSubjectGoodsGroup> goodsGroups, BigDecimal remitFee, BigDecimal courseRemitFee,
                                         List<MusicGroupPaymentCalenderCourseSettings> newCourses, Boolean buyMaintenance, Boolean buyCloudTeacher, Boolean buyCloudTeacherPlus,List<Integer> couponIdList) throws Exception {
         Date date = new Date();
         StudentPaymentOrder studentPaymentOrder = sysCouponCodeService.use(couponIdList,amount,true);