|
@@ -2,6 +2,7 @@ package com.ym.mec.student.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.microsvc.toolkit.middleware.payment.common.api.BasePaymentService;
|
|
|
import com.microsvc.toolkit.middleware.payment.common.api.PaymentServiceContext;
|
|
|
import com.microsvc.toolkit.middleware.payment.common.api.entity.PaymentResp;
|
|
@@ -145,17 +146,25 @@ public class StudentOrderController extends BaseController {
|
|
|
}
|
|
|
StudentPaymentOrder studentPaymentOrder = studentPaymentOrderService.findOrderByOrderNo(paymentResp.getMerOrderNo());
|
|
|
if(studentPaymentOrder == null) {
|
|
|
- return "订单号错误";
|
|
|
- }
|
|
|
- try {
|
|
|
- Map<String, String> notifyMap = new HashMap<>(4);
|
|
|
- notifyMap.put("channelType", paymentResp.getPaymentChannel());
|
|
|
- notifyMap.put("tradeState", paymentResp.getPaymentStatus() == PaymentStatus.SUCCESSED?"1":"0");
|
|
|
- notifyMap.put("totalMoney", paymentResp.getPaymentAmount().toString());
|
|
|
- notifyMap.put("merOrderNo", paymentResp.getMerOrderNo());
|
|
|
- studentPaymentOrderService.updateOrder(notifyMap);
|
|
|
- } catch (Exception e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
+ //获取机构订单
|
|
|
+ TenantOrderRecord record = tenantOrderRecordService.getOne(Wrappers.<TenantOrderRecord> lambdaQuery()
|
|
|
+ .eq(TenantOrderRecord::getOrderNo, paymentResp.getMerOrderNo()));
|
|
|
+ if (Objects.isNull(record)) {
|
|
|
+ throw new BizException("订单号不存在:{}", paymentResp.getMerOrderNo());
|
|
|
+ }else {
|
|
|
+ tenantOrderRecordService.callback(record, request);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ try {
|
|
|
+ Map<String, String> notifyMap = new HashMap<>(4);
|
|
|
+ notifyMap.put("channelType", paymentResp.getPaymentChannel());
|
|
|
+ notifyMap.put("tradeState", paymentResp.getPaymentStatus() == PaymentStatus.SUCCESSED?"1":"0");
|
|
|
+ notifyMap.put("totalMoney", paymentResp.getPaymentAmount().toString());
|
|
|
+ notifyMap.put("merOrderNo", paymentResp.getMerOrderNo());
|
|
|
+ studentPaymentOrderService.updateOrder(notifyMap);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
}
|
|
|
return paymentService.returnNotifyResult(request);
|
|
|
/*
|