|
@@ -695,7 +695,29 @@ public class YqPayController extends BaseController {
|
|
if (mecUser == null) {
|
|
if (mecUser == null) {
|
|
return failed("续费用户不存在");
|
|
return failed("续费用户不存在");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ int promotionCount = orderService.getPromotionCount(mecUser.getBranchId());
|
|
|
|
+ if(mecUser.getBranchId()==1012){
|
|
|
|
+ if(promotionCount >=99){
|
|
|
|
+ return failed("对不起,本次名额已满,请您下次再来!");
|
|
|
|
+ }
|
|
|
|
+ }else if(mecUser.getBranchId()==1020){
|
|
|
|
+ if(promotionCount >=176){
|
|
|
|
+ return failed("对不起,本次名额已满,请您下次再来!");
|
|
|
|
+ }
|
|
|
|
+ }else if(mecUser.getBranchId()==1025){
|
|
|
|
+ if(promotionCount >= 154){
|
|
|
|
+ return failed("对不起,本次名额已满,请您下次再来!");
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ if(promotionCount >=77){
|
|
|
|
+ return failed("对不起,本次名额已满,请您下次再来!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(orderService.getUserPromotionCount(mecUser.getUserId())>=2){
|
|
|
|
+ return failed("对不起,您本次机会已使用完,感谢您的关注!");
|
|
|
|
+ }
|
|
|
|
+
|
|
ClassPathResource classPathResource = new ClassPathResource("branchRule.json"); //规则json
|
|
ClassPathResource classPathResource = new ClassPathResource("branchRule.json"); //规则json
|
|
String branchRuleJson = IOUtils.toString(new InputStreamReader(classPathResource.getInputStream(), "UTF-8"));
|
|
String branchRuleJson = IOUtils.toString(new InputStreamReader(classPathResource.getInputStream(), "UTF-8"));
|
|
List<BranchRule> branchRules = JSONObject.parseArray(branchRuleJson, BranchRule.class);
|
|
List<BranchRule> branchRules = JSONObject.parseArray(branchRuleJson, BranchRule.class);
|
|
@@ -714,9 +736,17 @@ public class YqPayController extends BaseController {
|
|
BigDecimal courseTimes = new BigDecimal("20");
|
|
BigDecimal courseTimes = new BigDecimal("20");
|
|
|
|
|
|
if (price.compareTo(new BigDecimal("220")) >= 0) {
|
|
if (price.compareTo(new BigDecimal("220")) >= 0) {
|
|
- courseAmount = price.multiply(courseTimes).subtract(new BigDecimal("1111")).add(new BigDecimal("111"));
|
|
|
|
|
|
+ if(mecUser.getBranchId()==1012){
|
|
|
|
+ courseAmount = price.multiply(courseTimes).subtract(new BigDecimal("500")).add(new BigDecimal("11.11"));
|
|
|
|
+ }else{
|
|
|
|
+ courseAmount = price.multiply(courseTimes).subtract(new BigDecimal("1111")).add(new BigDecimal("111"));
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
- courseAmount = price.multiply(courseTimes).subtract(new BigDecimal("777")).add(new BigDecimal("11.11"));
|
|
|
|
|
|
+ if(mecUser.getBranchId()==1018 || mecUser.getBranchId()==1028 || mecUser.getBranchId() == 1024){
|
|
|
|
+ courseAmount = price.multiply(courseTimes).subtract(new BigDecimal("777")).add(new BigDecimal("111"));
|
|
|
|
+ }else{
|
|
|
|
+ courseAmount = price.multiply(courseTimes).subtract(new BigDecimal("777")).add(new BigDecimal("11.11"));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
if (!courseAmount.equals(amount)) {
|
|
if (!courseAmount.equals(amount)) {
|