debug,支付渠道未登录情况下获取

This commit is contained in:
磷叶 2025-06-05 10:03:21 +08:00
parent c8ef146127
commit 52751f506e
4 changed files with 21 additions and 4 deletions

View File

@ -230,7 +230,7 @@ public class ChannelServiceImpl implements ChannelService
return ChannelApiType.CREDIT.getType().equals(item.getApiType());
});
if (hasCredit) {
if (hasCredit && query.getUserId() != null) {
// 查询挂账选项
CreditUserQuery creditQuery = new CreditUserQuery();
creditQuery.setId(query.getSubId());
@ -254,6 +254,11 @@ public class ChannelServiceImpl implements ChannelService
return channelPaySubVO;
}).collect(Collectors.toList()));
});
} else {
// 移除挂账渠道
result = result.stream()
.filter(item -> !ChannelApiType.CREDIT.getType().equals(item.getApiType()))
.collect(Collectors.toList());
}
return result;

View File

@ -20,6 +20,7 @@ import com.ruoyi.bst.creditUser.domain.CreditUserVO;
import com.ruoyi.bst.creditUser.service.CreditUserService;
import com.ruoyi.bst.pay.domain.PayVO;
import com.ruoyi.bst.pay.service.PayService;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.pay.PayApi;
import com.ruoyi.common.pay.Payable;
import com.ruoyi.common.pay.Refundable;
@ -199,7 +200,8 @@ public class CreditPayServiceImpl implements CreditPayService, PayApi
// 关闭支付单
@Override
public void closeByOutTradeNo(String outTradeNo, Object config) {
// 什么都不做当前支付单无法关闭
// 支付单无法关闭
throw new ServiceException("挂账支付无法关闭:" + outTradeNo);
}
// 查询支付单

View File

@ -447,7 +447,9 @@ public class PayServiceImpl implements PayService {
ServiceUtil.assertion(app == null, "ID为%s的APP信息不存在", pay.getAppId());
// 获取支付结果若成功则处理支付成功
Object result = this.queryPayInfo(payApi, pay, channel, app);
if (payApi.isPaySuccess(result)) {
boolean isPaySuccess = payApi.isPaySuccess(result);
log.info("刷新支付结果:{}, {}, {}", pay.getNo(), isPaySuccess, result);
if (isPaySuccess) {
this.handleSuccess(pay, payApi.getPayTime(result));
}
}

View File

@ -6,6 +6,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.bst.channel.service.ChannelService;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
@ -20,8 +21,15 @@ public class AppChannelController extends BaseController {
@ApiOperation("获取可用支付渠道列表")
@GetMapping("/list")
@Anonymous
public AjaxResult list(Long areaId, Long appId, String bstType) {
return success(channelService.selectPayChannelList(getUserId(), areaId, appId, bstType));
Long userId = null;
try {
userId = getUserId();
} catch (Exception e) {
userId = null;
}
return success(channelService.selectPayChannelList(userId, areaId, appId, bstType));
}
@ApiOperation("获取骑行费可用的支付渠道")