|
@@ -7,9 +7,11 @@ import com.keao.edu.common.controller.BaseController;
|
|
import com.keao.edu.common.entity.HttpResponseResult;
|
|
import com.keao.edu.common.entity.HttpResponseResult;
|
|
import com.keao.edu.thirdparty.adapay.ConfigInit;
|
|
import com.keao.edu.thirdparty.adapay.ConfigInit;
|
|
import com.keao.edu.thirdparty.adapay.Payment;
|
|
import com.keao.edu.thirdparty.adapay.Payment;
|
|
|
|
+import com.keao.edu.thirdparty.yqpay.Msg;
|
|
import com.keao.edu.user.dto.StudentExamPaymentDto;
|
|
import com.keao.edu.user.dto.StudentExamPaymentDto;
|
|
import com.keao.edu.user.entity.ExamRegistrationPayment;
|
|
import com.keao.edu.user.entity.ExamRegistrationPayment;
|
|
import com.keao.edu.user.entity.ExamSong;
|
|
import com.keao.edu.user.entity.ExamSong;
|
|
|
|
+import com.keao.edu.user.enums.TransStatusEnum;
|
|
import com.keao.edu.user.service.ExamRegistrationPaymentService;
|
|
import com.keao.edu.user.service.ExamRegistrationPaymentService;
|
|
import com.keao.edu.user.service.ExamRegistrationService;
|
|
import com.keao.edu.user.service.ExamRegistrationService;
|
|
import com.keao.edu.util.date.DateUtil;
|
|
import com.keao.edu.util.date.DateUtil;
|
|
@@ -131,4 +133,41 @@ public class ExamOrderController extends BaseController {
|
|
return succeed(examRegistrationPaymentService.getExamOrderInfo(orderNo));
|
|
return succeed(examRegistrationPaymentService.getExamOrderInfo(orderNo));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @PostMapping("/notify")
|
|
|
|
+ public Msg notify(@ModelAttribute Msg msg) throws Exception {
|
|
|
|
+ Map<String, Object> rqMap = new LinkedHashMap<String, Object>();
|
|
|
|
+ rqMap.put("code", msg.getCode());
|
|
|
|
+ rqMap.put("msg", msg.getMsg());
|
|
|
|
+ rqMap.put("responseType", msg.getResponseType());
|
|
|
|
+ rqMap.put("responseParameters", msg.getResponseParameters());
|
|
|
|
+ rqMap.put("sign", msg.getSign());
|
|
|
|
+ //boolean rs = YqPayUtil.verify(rqMap);
|
|
|
|
+ msg.setMsg("fail");
|
|
|
|
+ Map<String, String> notifyMap = new HashMap<>();
|
|
|
|
+ //if (rs) {
|
|
|
|
+ notifyMap = JSON.parseObject(msg.getResponseParameters(), Map.class);
|
|
|
|
+ //}
|
|
|
|
+ //支付中订单存在,更新状态
|
|
|
|
+ if (msg.getResponseType().equals("1") && notifyMap.size() > 0) {
|
|
|
|
+ TransStatusEnum status = msg.getCode().equals("88") ? TransStatusEnum.SUCCESS : TransStatusEnum.FAILED;
|
|
|
|
+ String channelType = notifyMap.get("channelType").equals("1") ? "WXPay" : (notifyMap.get("channelType").equals("2") ? "Alipay" : "quickPay");
|
|
|
|
+
|
|
|
|
+ String memo = notifyMap.get("remarks");
|
|
|
|
+ String orderNo = notifyMap.get("merMerOrderNo");
|
|
|
|
+ String transNo = notifyMap.get("orderNo");
|
|
|
|
+
|
|
|
|
+ notifyMap.put("channelType", channelType);
|
|
|
|
+ notifyMap.put("memo", memo);
|
|
|
|
+ notifyMap.put("transStatus", status.getCode());
|
|
|
|
+ notifyMap.put("orderNo", orderNo);
|
|
|
|
+ notifyMap.put("transNo", transNo);
|
|
|
|
+
|
|
|
|
+ examRegistrationPaymentService.updateOrder(notifyMap);
|
|
|
|
+ msg.setCode("000000");
|
|
|
|
+ msg.setMsg("success");
|
|
|
|
+ }
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|