fix(payment): 调整支付宝绑定和查询功能

master
yang 2025-03-08 10:22:34 +08:00
parent 337a72b06c
commit d419eb53a7
6 changed files with 16 additions and 8 deletions

View File

@ -38,9 +38,9 @@ public class PlaFormController extends BaseController {
*/ */
@ApiOperation(value = "模型列表") @ApiOperation(value = "模型列表")
@GetMapping("/list") @GetMapping("/list")
public List<PlatForm> list() { public R<List<PlatForm>> list() {
return platFormService.list(); return R.ok(platFormService.list());
} }
/*** /***

View File

@ -34,7 +34,7 @@ server:
# 日志配置 # 日志配置
logging: logging:
level: level:
com.mcwl: debug com.mcwl: error
org.springframework: warn org.springframework: warn
# 用户配置 # 用户配置

View File

@ -47,13 +47,13 @@ public class GlobalExceptionHandler {
} }
/** /**
* redis * redis
*/ */
@ExceptionHandler(QueryTimeoutException.class) @ExceptionHandler(QueryTimeoutException.class)
public AjaxResult commandTimeoutException(QueryTimeoutException e, HttpServletRequest request) { public AjaxResult commandTimeoutException(QueryTimeoutException e, HttpServletRequest request) {
String requestURI = request.getRequestURI(); String requestURI = request.getRequestURI();
log.error("redis异常{},{}", requestURI, e.getMessage()); log.error("redis异常{},{}", requestURI, e.getMessage());
return AjaxResult.error(HttpStatus.ERROR, "超时"); return AjaxResult.error(HttpStatus.WARN, "超时");
} }

View File

@ -82,9 +82,6 @@ public class TokenService
} }
catch (Exception e) catch (Exception e)
{ {
if (e.getCause() instanceof io.lettuce.core.RedisCommandTimeoutException) {
throw new RedisCommandTimeoutException("连接超时");
}
log.error("获取用户信息异常'{}'", e.getMessage()); log.error("获取用户信息异常'{}'", e.getMessage());
} }
} }

View File

@ -307,6 +307,8 @@ public class AliPayServiceImpl implements AliPayService {
SysUserPayAccount sysUserPayAccount = sysUserPayAccountService.lambdaQuery() SysUserPayAccount sysUserPayAccount = sysUserPayAccountService.lambdaQuery()
.eq(SysUserPayAccount::getUserId, SecurityUtils.getUserId()) .eq(SysUserPayAccount::getUserId, SecurityUtils.getUserId())
.eq(SysUserPayAccount::getAppId, aliConfig.getAppId())
.eq(SysUserPayAccount::getType, 0)
.one(); .one();
if (Objects.isNull(sysUserPayAccount)) { if (Objects.isNull(sysUserPayAccount)) {
@ -476,6 +478,7 @@ public class AliPayServiceImpl implements AliPayService {
// 判断是否已经绑定过 // 判断是否已经绑定过
SysUserPayAccount sysUserPayAccount = sysUserPayAccountService.lambdaQuery() SysUserPayAccount sysUserPayAccount = sysUserPayAccountService.lambdaQuery()
.eq(SysUserPayAccount::getUserId, userId) .eq(SysUserPayAccount::getUserId, userId)
.eq(SysUserPayAccount::getAppId, aliConfig.getAppId())
.eq(SysUserPayAccount::getType, 0) .eq(SysUserPayAccount::getType, 0)
.one(); .one();
if (Objects.nonNull(sysUserPayAccount)) { if (Objects.nonNull(sysUserPayAccount)) {
@ -486,6 +489,7 @@ public class AliPayServiceImpl implements AliPayService {
// 将openId与当前商城用户绑定保存到数据库 // 将openId与当前商城用户绑定保存到数据库
SysUserPayAccount userPayAccount = new SysUserPayAccount(); SysUserPayAccount userPayAccount = new SysUserPayAccount();
userPayAccount.setUserId(userId); userPayAccount.setUserId(userId);
userPayAccount.setAppId(aliConfig.getAppId());
userPayAccount.setOpenId(openId); userPayAccount.setOpenId(openId);
userPayAccount.setType(0); userPayAccount.setType(0);
sysUserPayAccountService.save(userPayAccount); sysUserPayAccountService.save(userPayAccount);

View File

@ -21,10 +21,17 @@ public class SysUserPayAccount extends BaseEntity {
* id * id
*/ */
private Long userId; private Long userId;
/**
* id
*/
private String appId;
/** /**
* *
*/ */
private String openId; private String openId;
/** /**
* 0 1 2 QQ * 0 1 2 QQ
*/ */