|
@@ -31,6 +31,7 @@ import com.ym.mec.biz.dal.enums.DealStatusEnum;
|
|
|
import com.ym.mec.biz.dal.enums.GroupType;
|
|
|
import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.OrderTypeEnum;
|
|
|
+import com.ym.mec.biz.dal.enums.PayStatus;
|
|
|
import com.ym.mec.biz.dal.enums.PlatformCashAccountDetailTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
|
|
|
import com.ym.mec.biz.dal.page.SporadicOrderQueryInfo;
|
|
@@ -645,4 +646,49 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
public int batchUpdate(List<StudentPaymentOrder> studentPaymentOrderList) {
|
|
|
return studentPaymentOrderDao.batchUpdate(studentPaymentOrderList);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PayStatus queryPayStatus(String paymentChannel, String orderNo, String transNo) throws Exception {
|
|
|
+ if (StringUtils.isBlank(transNo)) {
|
|
|
+ return PayStatus.FAILED;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.equals(paymentChannel, "ADAPAY")) {
|
|
|
+ Map<String, Object> payment = Payment.queryPayment(transNo);
|
|
|
+ String status = (String) payment.get("status");
|
|
|
+ if (status.equals("succeeded")) {
|
|
|
+ return PayStatus.SUCCESSED;
|
|
|
+ } else if (status.equals("failed")) {
|
|
|
+ return PayStatus.FAILED;
|
|
|
+ } else {
|
|
|
+ return PayStatus.PAYING;
|
|
|
+ }
|
|
|
+ } else if (StringUtils.equals(paymentChannel, "YQPAY")) {
|
|
|
+ String notifyUrl = ""; // 回调地址
|
|
|
+ Map<String, Object> resultMap = new LinkedHashMap<>();
|
|
|
+ resultMap.put("merOrderNoList", orderNo);
|
|
|
+ Map<String, Object> requestMap = YqPayUtil.getRequestMap(notifyUrl, resultMap);
|
|
|
+
|
|
|
+ RsqMsg rsqMsg = new RsqMsg(requestMap);
|
|
|
+
|
|
|
+ Msg queryRs = yqPayFeignService.orderQuery(rsqMsg);
|
|
|
+
|
|
|
+ if (queryRs.getCode().equals("88")) {
|
|
|
+ // 更新订单状态
|
|
|
+ String responseParameters = queryRs.getResponseParameters();
|
|
|
+ List<Map<String, String>> responseList = JSON.parseObject(responseParameters, List.class);
|
|
|
+ for (Map<String, String> response : responseList) {
|
|
|
+
|
|
|
+ if (StringUtils.equals(response.get("tradeState"), "1")) {
|
|
|
+ return PayStatus.SUCCESSED;
|
|
|
+ } else if (StringUtils.equals(response.get("tradeState"), "0") || StringUtils.equals(response.get("tradeState"), "7")) {
|
|
|
+ return PayStatus.FAILED;
|
|
|
+ } else {
|
|
|
+ return PayStatus.PAYING;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ throw new BizException("支付渠道错误");
|
|
|
+ }
|
|
|
}
|