diff --git a/pluss-api-page/src/main/resources/application.yml b/pluss-api-page/src/main/resources/application.yml index 549411a..3108808 100644 --- a/pluss-api-page/src/main/resources/application.yml +++ b/pluss-api-page/src/main/resources/application.yml @@ -25,3 +25,5 @@ server: servlet: context-path: /api port: 7004 + +environment: test diff --git a/pluss-service-bundle/src/main/java/cn/pluss/platform/merchantOrder/impl/MerchantOrderServiceImpl.java b/pluss-service-bundle/src/main/java/cn/pluss/platform/merchantOrder/impl/MerchantOrderServiceImpl.java index f9a61d2..89e0362 100644 --- a/pluss-service-bundle/src/main/java/cn/pluss/platform/merchantOrder/impl/MerchantOrderServiceImpl.java +++ b/pluss-service-bundle/src/main/java/cn/pluss/platform/merchantOrder/impl/MerchantOrderServiceImpl.java @@ -81,6 +81,7 @@ import org.junit.Test; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; @@ -230,6 +231,10 @@ public class MerchantOrderServiceImpl extends ServiceImpl billCollect(MerchantOrder merchantOrder) { UserApp tokenUserApp = userAppService.queryUserAppByToken(); @@ -1690,24 +1695,30 @@ public class MerchantOrderServiceImpl extends ServiceImpl resultMap = new HashMap<>(); MerchantRefundOrder refundOrder = new MerchantRefundOrder(); - if (channel.getChannel() == 1) { - resultMap = sxfPayService.refundPay(order, channel.getMerchantId()); - } else if (channel.getChannel() == 2) { - MsgException.throwException("通道已关闭!"); - } else if (channel.getChannel() == 3) { - resultMap = ryxPayService.refundPay(order, channel.getMerchantId()); - } else if (channel.getChannel() == 4) { - resultMap = ysPayOldService.refundPay(order, channel.getMerchantId()); - }else if(channel.getChannel()==5){ - resultMap = lkLPayServiceImpl.refundPay(order,channel.getMerchantCode()); + if(!"test".equals(environment)){ + if (channel.getChannel() == 1) { + resultMap = sxfPayService.refundPay(order, channel.getMerchantId()); + } else if (channel.getChannel() == 2) { + MsgException.throwException("通道已关闭!"); + } else if (channel.getChannel() == 3) { + resultMap = ryxPayService.refundPay(order, channel.getMerchantId()); + } else if (channel.getChannel() == 4) { + resultMap = ysPayOldService.refundPay(order, channel.getMerchantId()); + }else if(channel.getChannel()==5){ + resultMap = lkLPayServiceImpl.refundPay(order,channel.getMerchantCode()); + } + else { + MsgException.throwException("未知通道!"); + } + if (ResultCode.SUCCESS.code() != (Integer) resultMap.get("code")) { + throw new MsgException(resultMap.get("msg") + ""); + } } - else { - MsgException.throwException("未知通道!"); - } - if (ResultCode.SUCCESS.code() != (Integer) resultMap.get("code")) { - throw new MsgException(resultMap.get("msg") + ""); - } + + + + MerchantOrder update = new MerchantOrder(); if(StringUtil.isNotEmpty(order.getMarketAmt()) && order.getMarketAmt().doubleValue() > 0){ update.setId(order.getId()); diff --git a/pluss-wap-page/src/main/java/cn/pluss/platform/controller/home/ApiPayController.java b/pluss-wap-page/src/main/java/cn/pluss/platform/controller/home/ApiPayController.java index 097c8b3..6501db9 100644 --- a/pluss-wap-page/src/main/java/cn/pluss/platform/controller/home/ApiPayController.java +++ b/pluss-wap-page/src/main/java/cn/pluss/platform/controller/home/ApiPayController.java @@ -43,7 +43,6 @@ public class ApiPayController { @Autowired private MerchantOrderService merchantOrderService; - @Autowired private NotifyMessageService notifyMessageService;