修改退款逻辑

This commit is contained in:
韩鹏辉
2023-08-30 14:09:59 +08:00
parent fc770b633e
commit ff8e7c5770
3 changed files with 29 additions and 17 deletions

View File

@@ -25,3 +25,5 @@ server:
servlet:
context-path: /api
port: 7004
environment: test

View File

@@ -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<MerchantOrderMapper, M
private UserMakerQuotaService userMakerQuotaService;
@Value("${environment}")
private String environment;
@Override
public Map<String, Object> billCollect(MerchantOrder merchantOrder) {
UserApp tokenUserApp = userAppService.queryUserAppByToken();
@@ -1690,24 +1695,30 @@ public class MerchantOrderServiceImpl extends ServiceImpl<MerchantOrderMapper, M
Map<String, Object> 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());

View File

@@ -43,7 +43,6 @@ public class ApiPayController {
@Autowired
private MerchantOrderService merchantOrderService;
@Autowired
private NotifyMessageService notifyMessageService;