Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
package com.czg.service.order.service;
|
||||
|
||||
import com.czg.entity.resp.CzgBaseResp;
|
||||
import com.czg.enums.CzgPayEnum;
|
||||
import com.czg.order.dto.LtPayOtherDTO;
|
||||
import com.czg.order.entity.OrderPayment;
|
||||
import com.czg.pay.CzgPayBaseReq;
|
||||
import com.czg.pay.CzgRefundReq;
|
||||
import com.czg.pay.QueryOrderRespDTO;
|
||||
import com.czg.pay.RefundRespDTO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import lombok.NonNull;
|
||||
@@ -67,7 +67,7 @@ public interface PayService {
|
||||
* @param payOrderId 平台订单号
|
||||
* @param mchOrderNo 商户订单号
|
||||
*/
|
||||
CzgResult<CzgBaseResp> queryPayOrder(Long shopId, String payOrderId, String mchOrderNo);
|
||||
CzgResult<QueryOrderRespDTO> queryPayOrder(Long shopId, String payOrderId, String mchOrderNo, String platform);
|
||||
|
||||
/**
|
||||
* 退款查询
|
||||
|
||||
@@ -1030,12 +1030,12 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void payCallBackOrder(@NotBlank String orderNo, @NotNull PayNotifyRespDTO notifyRespDTO, int retryCount) {
|
||||
public void payCallBackOrder(@NotBlank String orderNo, @NotNull PayNotifyRespDTO notifyRespDTO, String channel, int retryCount) {
|
||||
OrderPayment payment = paymentService.getOne(new QueryWrapper().eq(OrderPayment::getOrderNo, orderNo));
|
||||
if (payment == null) {
|
||||
if (retryCount < MAX_RETRIES) {
|
||||
log.info("支付记录不存在,第 {} 次重试,将在 {} 秒后进行", retryCount + 1, DELAY);
|
||||
executorService.schedule(() -> payCallBackOrder(orderNo, notifyRespDTO, retryCount + 1), DELAY, TimeUnit.SECONDS);
|
||||
executorService.schedule(() -> payCallBackOrder(orderNo, notifyRespDTO, channel, retryCount + 1), DELAY, TimeUnit.SECONDS);
|
||||
} else {
|
||||
log.error("订单支付回调失败, 达到最大重试次数, 支付记录不存在, orderNo: {}", orderNo);
|
||||
}
|
||||
@@ -1049,6 +1049,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
||||
payment.setRespJson(notifyRespDTO.getOriginalData());
|
||||
payment.setPayStatus(PayTypeConstants.PayStatus.FAIL);
|
||||
payment.setPlatformType(notifyRespDTO.getPlatform());
|
||||
payment.setChannel(channel);
|
||||
if ("TRADE_SUCCESS".equals(notifyRespDTO.getStatus())) {
|
||||
payment.setPayStatus(PayTypeConstants.PayStatus.SUCCESS);
|
||||
if (PayTypeConstants.SourceType.ORDER.equals(payment.getSourceType())) {
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.czg.constant.PayChannelCst;
|
||||
import com.czg.constants.ParamCodeCst;
|
||||
import com.czg.constants.PayTypeConstants;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.entity.resp.CzgBaseResp;
|
||||
import com.czg.enums.CzgPayEnum;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.order.dto.LtPayOtherDTO;
|
||||
@@ -20,6 +19,7 @@ import com.czg.order.service.OrderPaymentService;
|
||||
import com.czg.order.service.ShopMerchantService;
|
||||
import com.czg.pay.CzgPayBaseReq;
|
||||
import com.czg.pay.CzgRefundReq;
|
||||
import com.czg.pay.QueryOrderRespDTO;
|
||||
import com.czg.pay.RefundRespDTO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.service.order.mapper.OrderPaymentMapper;
|
||||
@@ -146,7 +146,7 @@ public class PayServiceImpl implements PayService {
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public CzgResult<CzgBaseResp> queryPayOrder(@NonNull Long shopId, String payOrderId, String mchOrderNo) {
|
||||
public CzgResult<QueryOrderRespDTO> queryPayOrder(@NonNull Long shopId, String payOrderId, String mchOrderNo, String platform) {
|
||||
ShopMerchant shopMerchant = getMerchant(shopId);
|
||||
PayAdapter adapter = PayAdapterFactory.getAdapter(shopMerchant.getChannel());
|
||||
String payData = null;
|
||||
@@ -155,7 +155,7 @@ public class PayServiceImpl implements PayService {
|
||||
} else if (shopMerchant.getChannel().equals(PayChannelCst.POLY)) {
|
||||
payData = shopMerchant.getPolyPayJson();
|
||||
}
|
||||
return adapter.queryPayOrder(getDomain(), payData, payOrderId, mchOrderNo);
|
||||
return adapter.queryPayOrder(getDomain(), payData, payOrderId, mchOrderNo, platform);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user