|
@@ -2,14 +2,14 @@ package com.ym.mec.collectfee.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.ym.mec.collectfee.common.sms.SmsExample;
|
|
import com.ym.mec.collectfee.common.web.BaseController;
|
|
import com.ym.mec.collectfee.common.web.BaseController;
|
|
import com.ym.mec.collectfee.entity.*;
|
|
import com.ym.mec.collectfee.entity.*;
|
|
import com.ym.mec.collectfee.service.*;
|
|
import com.ym.mec.collectfee.service.*;
|
|
|
|
+import com.ym.mec.collectfee.utils.Constants;
|
|
import com.ym.mec.collectfee.utils.GenerateNum;
|
|
import com.ym.mec.collectfee.utils.GenerateNum;
|
|
-import com.ym.mec.collectfee.utils.yqpay.Intfc;
|
|
|
|
-import com.ym.mec.collectfee.utils.yqpay.Msg;
|
|
|
|
-import com.ym.mec.collectfee.utils.yqpay.NotifyMsg;
|
|
|
|
-import com.ym.mec.collectfee.utils.yqpay.YqPayUtil;
|
|
|
|
|
|
+import com.ym.mec.collectfee.utils.ShortUrlUtil;
|
|
|
|
+import com.ym.mec.collectfee.utils.yqpay.*;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.io.IOUtils;
|
|
import org.apache.commons.io.IOUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -187,8 +187,8 @@ public class YqPayController extends BaseController {
|
|
|
|
|
|
//classType 小课1 大课2
|
|
//classType 小课1 大课2
|
|
Integer buyCount = mecCourse4json.getBuyCount();
|
|
Integer buyCount = mecCourse4json.getBuyCount();
|
|
- if (buyCount <= 0) {
|
|
|
|
- return failed("购买次数不能小于1");
|
|
|
|
|
|
+ if (buyCount <= 0 || buyCount > 20) {
|
|
|
|
+ return failed("购买课程次数不能小于1,大于20");
|
|
}
|
|
}
|
|
BigDecimal amount = new BigDecimal("0"); //课程总价
|
|
BigDecimal amount = new BigDecimal("0"); //课程总价
|
|
String remark = "";
|
|
String remark = "";
|
|
@@ -433,6 +433,9 @@ public class YqPayController extends BaseController {
|
|
public void updateOrder(Map<String, String> rpMap) {
|
|
public void updateOrder(Map<String, String> rpMap) {
|
|
int status = rpMap.get("tradeState").equals("1") ? 2 : 0;
|
|
int status = rpMap.get("tradeState").equals("1") ? 2 : 0;
|
|
Order order = orderService.getOrderByOrderNo(rpMap.get("merOrderNo"));
|
|
Order order = orderService.getOrderByOrderNo(rpMap.get("merOrderNo"));
|
|
|
|
+ if (order == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
order.setStatus(status);
|
|
order.setStatus(status);
|
|
order.setBank(rpMap.get("channelType"));
|
|
order.setBank(rpMap.get("channelType"));
|
|
|
|
|
|
@@ -443,11 +446,12 @@ public class YqPayController extends BaseController {
|
|
order.setPay(order.getAmount());
|
|
order.setPay(order.getAmount());
|
|
order.setPayTime(new Date());
|
|
order.setPayTime(new Date());
|
|
//推送mec
|
|
//推送mec
|
|
|
|
+ ApplyInfo applyInfo = applyInfoService.get(order.getUserId());
|
|
if (order.getTuiFee() != null) { //乐团报名
|
|
if (order.getTuiFee() != null) { //乐团报名
|
|
- ApplyInfo applyInfo = applyInfoService.get(order.getUserId());
|
|
|
|
applyInfo.setStatus(1);
|
|
applyInfo.setStatus(1);
|
|
applyInfoService.update(applyInfo);
|
|
applyInfoService.update(applyInfo);
|
|
applyInfoService.userRegister(applyInfo.getPatriarchPhone(), order.getId()); //推送mec
|
|
applyInfoService.userRegister(applyInfo.getPatriarchPhone(), order.getId()); //推送mec
|
|
|
|
+ schoolService.sendPayMsg(applyInfo.getPatriarchPhone(), order.getAmount().toString());
|
|
} else {
|
|
} else {
|
|
Renewals renewals = renewalsService.getRenewalsByOrderId(order.getId());
|
|
Renewals renewals = renewalsService.getRenewalsByOrderId(order.getId());
|
|
RenewBean renewBean = new RenewBean();
|
|
RenewBean renewBean = new RenewBean();
|