fix(payment): 调整支付宝绑定和查询功能
parent
337a72b06c
commit
d419eb53a7
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
|
|
|
@ -34,7 +34,7 @@ server:
|
||||||
# 日志配置
|
# 日志配置
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
com.mcwl: debug
|
com.mcwl: error
|
||||||
org.springframework: warn
|
org.springframework: warn
|
||||||
|
|
||||||
# 用户配置
|
# 用户配置
|
||||||
|
|
|
@ -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, "超时");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue