| 
														
															@@ -177,7 +177,7 @@ public class MemberRankSettingServiceImpl extends BaseServiceImpl<Integer, Membe 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     public HttpResponseResult buy2Qqhe(MemberPayParamDto dto) throws Exception { 
														 | 
														
														 | 
														
															     public HttpResponseResult buy2Qqhe(MemberPayParamDto dto) throws Exception { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         //获取学员信息 
														 | 
														
														 | 
														
															         //获取学员信息 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         SysUser sysUser = getSysUser(); 
														 | 
														
														 | 
														
															         SysUser sysUser = getSysUser(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        if(!dto.getRepeatPay()){ 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if (!dto.getRepeatPay()) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             //查询是否有待支付订单 
														 | 
														
														 | 
														
															             //查询是否有待支付订单 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             List<StudentPaymentOrder> studentPaymentOrders = studentPaymentOrderService.queryByCondition(GroupType.MEMBER, 
														 | 
														
														 | 
														
															             List<StudentPaymentOrder> studentPaymentOrders = studentPaymentOrderService.queryByCondition(GroupType.MEMBER, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     null, sysUser.getId(), DealStatusEnum.ING, OrderTypeEnum.MEMBER); 
														 | 
														
														 | 
														
															                     null, sysUser.getId(), DealStatusEnum.ING, OrderTypeEnum.MEMBER); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -199,7 +199,7 @@ public class MemberRankSettingServiceImpl extends BaseServiceImpl<Integer, Membe 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             studentPaymentOrderService.update(studentPaymentOrder); 
														 | 
														
														 | 
														
															             studentPaymentOrderService.update(studentPaymentOrder); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             //从缓存取出上次传入参数 
														 | 
														
														 | 
														
															             //从缓存取出上次传入参数 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             RBucket<Object> cache = redissonClient.getBucket(BUY_2_QQHE_LOCK + studentPaymentOrder.getOrderNo()); 
														 | 
														
														 | 
														
															             RBucket<Object> cache = redissonClient.getBucket(BUY_2_QQHE_LOCK + studentPaymentOrder.getOrderNo()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            if(!cache.isExists()){ 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            if (!cache.isExists()) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 return BaseController.failed("订单超时,请重新购买!"); 
														 | 
														
														 | 
														
															                 return BaseController.failed("订单超时,请重新购买!"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             Map<String, Object> cacheMap = (Map<String, Object>) cache.get(); 
														 | 
														
														 | 
														
															             Map<String, Object> cacheMap = (Map<String, Object>) cache.get(); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -207,27 +207,22 @@ public class MemberRankSettingServiceImpl extends BaseServiceImpl<Integer, Membe 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         int val = dto.getVal(); 
														 | 
														
														 | 
														
															         int val = dto.getVal(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        if (val < 0) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            throw new BizException("最少购买1个月!"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        if (val > 12) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            throw new BizException("最多购买12个月!"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         //获取赠送的月份 
														 | 
														
														 | 
														
															         //获取赠送的月份 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         BigDecimal giveMonth = getGiveMonth(val); 
														 | 
														
														 | 
														
															         BigDecimal giveMonth = getGiveMonth(val); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         //转换格式 
														 | 
														
														 | 
														
															         //转换格式 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         BigDecimal valDecimal = new BigDecimal(val); 
														 | 
														
														 | 
														
															         BigDecimal valDecimal = new BigDecimal(val); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         //获取单价 
														 | 
														
														 | 
														
															         //获取单价 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        String activityAmount = sysConfigDao.findConfigValue("qqhe_2022_buy_member_activity_amount"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        BigDecimal price = new BigDecimal(activityAmount); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        BigDecimal price = Optional.of("qqhe_2022_buy_member_activity_amount") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .map(sysConfigDao::findConfigValue) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .filter(StringUtils::isNotBlank) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .map(BigDecimal::new) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .orElseThrow(() -> new BizException("未配置活动单价,请联系教务老师。")); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         //计算出购买的价格 单价 X 购买的月份 
														 | 
														
														 | 
														
															         //计算出购买的价格 单价 X 购买的月份 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         BigDecimal amount = price.multiply(valDecimal); 
														 | 
														
														 | 
														
															         BigDecimal amount = price.multiply(valDecimal); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         //获取会员总激活时间 
														 | 
														
														 | 
														
															         //获取会员总激活时间 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         BigDecimal totalMonth = valDecimal.add(giveMonth); 
														 | 
														
														 | 
														
															         BigDecimal totalMonth = valDecimal.add(giveMonth); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        //优惠券使用范围 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        String[] checkCoupon = CouponDetailTypeEnum.getAllowType(MEMBER); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        //使用优惠券 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        StudentPaymentOrder studentPaymentOrder = sysCouponCodeService.use(dto.getCouponIdList(), amount, true, checkCoupon); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        //使用优惠券 设置优惠券使用范围 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        StudentPaymentOrder studentPaymentOrder = sysCouponCodeService.use(dto.getCouponIdList(), amount, true, CouponDetailTypeEnum.getAllowType(MEMBER)); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         //写入redis证明是活动购买 
														 | 
														
														 | 
														
															         //写入redis证明是活动购买 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         String orderNo = idGeneratorService.generatorId("payment") + ""; 
														 | 
														
														 | 
														
															         String orderNo = idGeneratorService.generatorId("payment") + ""; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         studentPaymentOrder.setOrderNo(orderNo); 
														 | 
														
														 | 
														
															         studentPaymentOrder.setOrderNo(orderNo); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -294,6 +289,12 @@ public class MemberRankSettingServiceImpl extends BaseServiceImpl<Integer, Membe 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     private BigDecimal getGiveMonth(int val) { 
														 | 
														
														 | 
														
															     private BigDecimal getGiveMonth(int val) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if (val < 0) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            throw new BizException("最少购买1个月!"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if (val > 12) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            throw new BizException("最多购买12个月!"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         BigDecimal giveMonth; 
														 | 
														
														 | 
														
															         BigDecimal giveMonth; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         //最小数o  最大数s 
														 | 
														
														 | 
														
															         //最小数o  最大数s 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         BiPredicate<Integer, Integer> predicate = (o, s) -> val >= o && val < s; 
														 | 
														
														 | 
														
															         BiPredicate<Integer, Integer> predicate = (o, s) -> val >= o && val < s; 
														 |