Compare commits
7 Commits
fca80acccb
...
447cd262ad
Author | SHA1 | Date |
---|---|---|
|
447cd262ad | |
|
0f7743abb1 | |
|
ccd4372a68 | |
|
7150bcf495 | |
|
196ba38b15 | |
|
0d29d79af6 | |
|
43f11e5db2 |
|
@ -93,16 +93,7 @@ public class AliPayController extends BaseController {
|
|||
String state = ShareCodeUtils.idToCode(SecurityUtils.getUserId()); // 防止CSRF攻击
|
||||
|
||||
String encodedRedirectUri = URLEncoder.encode(bindUrl, "UTF-8");
|
||||
// 线上
|
||||
// String authUrl = String.format(
|
||||
// "https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?app_id=%s&scope=%s&redirect_uri=%s&state=%s",
|
||||
// appId, scope, encodedRedirectUri, state
|
||||
// );
|
||||
// 沙箱
|
||||
String authUrl = String.format(
|
||||
"https://openauth-sandbox.dl.alipaydev.com/oauth2/publicAppAuthorize.htm?app_id=%s&scope=%s&redirect_uri=%s&state=%s",
|
||||
appId, scope, encodedRedirectUri, state
|
||||
);
|
||||
String authUrl = String.format(aliConfig.getOauthUrl(),appId, scope, encodedRedirectUri, state);
|
||||
|
||||
// QrCodeUtil.generate(authUrl, 300, 300, "png", response.getOutputStream());
|
||||
return R.ok(authUrl, "成功");
|
||||
|
@ -168,7 +159,7 @@ public class AliPayController extends BaseController {
|
|||
|
||||
if ("member".equalsIgnoreCase(type)) {
|
||||
if (!Optional.ofNullable(orderTradeDto.getProductId()).isPresent()) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"商品id不能为空");
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG, "商品id不能为空");
|
||||
}
|
||||
payVo = aliPayService.memberPay(orderTradeDto);
|
||||
// QrCodeUtil.generate(payVo.getUrl(), 300, 300, "png", response.getOutputStream());
|
||||
|
@ -178,12 +169,12 @@ public class AliPayController extends BaseController {
|
|||
} else if ("wallet".equalsIgnoreCase(type)) {
|
||||
// 充值金额只能是整数
|
||||
if (orderTradeDto.getAmount() % 1 != 0) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"充值金额只能是整数");
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG, "充值金额只能是整数");
|
||||
}
|
||||
payVo = aliPayService.walletPay(orderTradeDto.getAmount());
|
||||
// QrCodeUtil.generate(payVo.getUrl(), 300, 300, "png", response.getOutputStream());
|
||||
} else {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"订单类型错误");
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG, "订单类型错误");
|
||||
}
|
||||
|
||||
return R.ok(payVo);
|
||||
|
@ -207,15 +198,15 @@ public class AliPayController extends BaseController {
|
|||
.one();
|
||||
|
||||
if (Objects.isNull(sysUserPayAccount)) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"请先绑定支付宝");
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG, "请先绑定支付宝");
|
||||
}
|
||||
|
||||
|
||||
if (Double.parseDouble(amount) < 0.1) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"提现金额最小为0.1");
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG, "提现金额最小为0.1");
|
||||
}
|
||||
|
||||
return aliPayService.fetch(amount.toString());
|
||||
return aliPayService.fetch(amount);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -161,6 +161,10 @@ mall:
|
|||
gatewayUrl: https://openapi-sandbox.dl.alipaydev.com/gateway.do
|
||||
# 绑定回调
|
||||
bindUrl: http://113.45.190.154:8080/ali/pay/callback
|
||||
# 参与方的标识类型,目前支持如下类型: 1、ALIPAY_USER_ID 支付宝的会员ID 2、ALIPAY_LOGON_ID:支付宝登录号,支持邮箱和手机号格式 3、ALIPAY_OPEN_ID:支付宝openid
|
||||
identityType: ALIPAY_USER_ID
|
||||
# 授权url
|
||||
oauthUrl: https://openauth-sandbox.dl.alipaydev.com/oauth2/publicAppAuthorize.htm?app_id=%s&scope=%s&redirect_uri=%s&state=%s
|
||||
|
||||
huawei:
|
||||
obs:
|
||||
|
|
|
@ -148,6 +148,10 @@ mall:
|
|||
gatewayUrl: https://openapi.alipay.com/gateway.do
|
||||
# 绑定回调
|
||||
bindUrl: https://36072a51.r27.cpolar.top/ali/pay/callback
|
||||
# 参与方的标识类型,目前支持如下类型: 1、ALIPAY_USER_ID 支付宝的会员ID 2、ALIPAY_LOGON_ID:支付宝登录号,支持邮箱和手机号格式 3、ALIPAY_OPEN_ID:支付宝openid
|
||||
identityType: ALIPAY_OPEN_ID
|
||||
# 授权url
|
||||
oauthUrl: https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?app_id=%s&scope=%s&redirect_uri=%s&state=%s
|
||||
|
||||
huawei:
|
||||
obs:
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
package com.mcwl.common.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author:ChenYan
|
||||
* @Project:McWl
|
||||
* @Package:com.mcwl.pay.domain
|
||||
* @Filename:PaymentStatus
|
||||
* @Description TODO
|
||||
* @Date:2025/1/3 17:24
|
||||
*/
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public enum CommissionRationEnum {
|
||||
|
||||
/**
|
||||
* 佣金配给邀请者用户
|
||||
*/
|
||||
COMMISSION_RATION_INVITER_USER("CommissionRationInviterUser"),
|
||||
/**
|
||||
* 佣金配给商家用户
|
||||
*/
|
||||
COMMISSION_RATION_MERCHANT("CommissionRationMerchant");
|
||||
|
||||
private String name;
|
||||
}
|
|
@ -2,11 +2,13 @@ package com.mcwl.myInvitation.service.impl;
|
|||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mcwl.common.core.redis.RedisCache;
|
||||
import com.mcwl.myInvitation.domain.CommissionRatio;
|
||||
import com.mcwl.myInvitation.domain.vo.CommissionRatioVo;
|
||||
import com.mcwl.myInvitation.mapper.CommissionRatioMapper;
|
||||
import com.mcwl.myInvitation.service.CommissionRatioService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -20,6 +22,8 @@ import java.util.Objects;
|
|||
public class CommissionRatioServiceImpl extends ServiceImpl<CommissionRatioMapper, CommissionRatio> implements CommissionRatioService {
|
||||
|
||||
|
||||
private final RedisCache redisCache;
|
||||
|
||||
@Override
|
||||
public List<CommissionRatioVo> ratioList() {
|
||||
List<CommissionRatio> list = baseMapper.selectList(null);
|
||||
|
@ -41,7 +45,10 @@ public class CommissionRatioServiceImpl extends ServiceImpl<CommissionRatioMappe
|
|||
return null;
|
||||
}
|
||||
commissionRatio.setRatio(ratio);
|
||||
baseMapper.insert(commissionRatio);
|
||||
baseMapper.updateById(commissionRatio);
|
||||
|
||||
redisCache.deleteObject("CommissionRationInviterUser");
|
||||
redisCache.deleteObject("CommissionRationMerchant");
|
||||
|
||||
return this.getCommissionRatioVo(commissionRatio);
|
||||
}
|
||||
|
|
|
@ -30,4 +30,8 @@ public class AliConfig {
|
|||
private String gatewayUrl;
|
||||
@Value("${mall.mgt.aliPayConfig.notifyUrl}")
|
||||
private String notifyUrl;
|
||||
@Value("${mall.mgt.aliPayConfig.identityType}")
|
||||
private String identityType;
|
||||
@Value("${mall.mgt.aliPayConfig.oauthUrl}")
|
||||
private String oauthUrl;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.mcwl.pay.service.impl;
|
|||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.UUID;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.mail.MailUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
@ -47,6 +48,7 @@ import com.mcwl.system.service.ISysUserPayAccountService;
|
|||
import com.mcwl.system.service.ISysUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
@ -127,13 +129,13 @@ public class AliPayServiceImpl implements AliPayService {
|
|||
Long productId = orderTradeDto.getProductId();
|
||||
|
||||
if (!Optional.ofNullable(productId).isPresent()) {
|
||||
throw new ServiceException("memberLevelId不能为空");
|
||||
throw new ServiceException("memberLevelId不能为空", HttpStatus.SHOW_ERROR_MSG);
|
||||
}
|
||||
|
||||
MemberLevel memberLevel = memberLevelService.getById(productId);
|
||||
|
||||
if (!Optional.ofNullable(memberLevel).isPresent()) {
|
||||
throw new ServiceException("memberLevel不存在");
|
||||
throw new ServiceException("memberLevel不存在", HttpStatus.SHOW_ERROR_MSG);
|
||||
}
|
||||
|
||||
// 设置orderTrade信息
|
||||
|
@ -284,75 +286,87 @@ public class AliPayServiceImpl implements AliPayService {
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<String> fetch(String amount) throws AlipayApiException, FileNotFoundException {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
SysUser sysUser = sysUserService.selectUserById(userId);
|
||||
if (sysUser.getWallet() < Double.parseDouble(amount)) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"钱包余额不足");
|
||||
String lock = redisCache.getCacheObject("alipay:fetch:user:" + SecurityUtils.getUserId());
|
||||
if (!StrUtil.isEmpty(lock)) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG, "请勿频繁点击");
|
||||
}
|
||||
try {
|
||||
redisCache.setCacheObject("alipay:fetch:user:" + SecurityUtils.getUserId(), "1");
|
||||
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
|
||||
|
||||
SysUser sysUser = sysUserService.selectUserById(userId);
|
||||
if (sysUser.getWallet() < Double.parseDouble(amount)) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG, "钱包余额不足");
|
||||
}
|
||||
|
||||
// 初始化SDK
|
||||
AlipayClient alipayClient = new DefaultAlipayClient(getAlipayConfig());
|
||||
|
||||
// 构造请求参数以调用接口
|
||||
AlipayFundTransUniTransferRequest request = new AlipayFundTransUniTransferRequest();
|
||||
AlipayFundTransUniTransferModel model = new AlipayFundTransUniTransferModel();
|
||||
// 设置商家侧唯一订单号
|
||||
model.setOutBizNo(UUID.fastUUID().toString(true));
|
||||
|
||||
// 设置订单总金额
|
||||
model.setTransAmount(amount);
|
||||
|
||||
// 设置描述特定的业务场景
|
||||
model.setBizScene("DIRECT_TRANSFER");
|
||||
|
||||
// 设置业务产品码
|
||||
model.setProductCode("TRANS_ACCOUNT_NO_PWD");
|
||||
|
||||
// 设置转账业务的标题
|
||||
model.setOrderTitle("提现");
|
||||
|
||||
// 查询用户支付宝账户
|
||||
SysUserPayAccount sysUserPayAccount = sysUserPayAccountService
|
||||
.lambdaQuery()
|
||||
.eq(SysUserPayAccount::getUserId, userId)
|
||||
.eq(SysUserPayAccount::getType, 0)
|
||||
.one();
|
||||
if (Objects.isNull(sysUserPayAccount)) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG, "请先绑定支付宝账号");
|
||||
}
|
||||
|
||||
// 收款方信息
|
||||
Participant payeeInfo = new Participant();
|
||||
|
||||
payeeInfo.setIdentity(sysUserPayAccount.getOpenId());
|
||||
payeeInfo.setIdentityType(aliConfig.getIdentityType());
|
||||
model.setPayeeInfo(payeeInfo);
|
||||
|
||||
request.setBizModel(model);
|
||||
|
||||
// 添加提现记录和修改用户钱包
|
||||
this.addLogAndUpdateUserWallet(sysUser, amount);
|
||||
|
||||
// 证书用:certificateExecute(request),密钥用:execute(request)
|
||||
AlipayFundTransUniTransferResponse response = alipayClient.certificateExecute(request);
|
||||
System.out.println(response.getBody());
|
||||
|
||||
if (response.isSuccess()) {
|
||||
|
||||
return R.ok("提现成功");
|
||||
}
|
||||
|
||||
if (response.getSubCode().equals("PAYER_BALANCE_NOT_ENOUGH")) {
|
||||
// 账户余额不足,发送邮件通知
|
||||
ArrayList<String> tos = CollUtil.newArrayList("2119157836@qq.com");
|
||||
|
||||
String content = String.format("账户余额不足:用户%s提现%s", sysUser.getNickName(), amount);
|
||||
MailUtil.send(tos, "魔创未来", content, false);
|
||||
throw new ServiceException("网络连接出错,请稍后再试", HttpStatus.SHOW_ERROR_MSG);
|
||||
}
|
||||
System.out.println("用户" + SecurityUtils.getLoginUser().getUser().getNickName() + "提现失败:" + response.getSubMsg());
|
||||
throw new ServiceException("提现失败", HttpStatus.SHOW_ERROR_MSG);
|
||||
} finally {
|
||||
redisCache.deleteObject("alipay:fetch:user:" + SecurityUtils.getUserId());
|
||||
}
|
||||
|
||||
// 初始化SDK
|
||||
AlipayClient alipayClient = new DefaultAlipayClient(getAlipayConfig());
|
||||
|
||||
// 构造请求参数以调用接口
|
||||
AlipayFundTransUniTransferRequest request = new AlipayFundTransUniTransferRequest();
|
||||
AlipayFundTransUniTransferModel model = new AlipayFundTransUniTransferModel();
|
||||
// 设置商家侧唯一订单号
|
||||
model.setOutBizNo(UUID.fastUUID().toString(true));
|
||||
|
||||
// 设置订单总金额
|
||||
model.setTransAmount(amount);
|
||||
|
||||
// 设置描述特定的业务场景
|
||||
model.setBizScene("DIRECT_TRANSFER");
|
||||
|
||||
// 设置业务产品码
|
||||
model.setProductCode("TRANS_ACCOUNT_NO_PWD");
|
||||
|
||||
// 设置转账业务的标题
|
||||
model.setOrderTitle("提现");
|
||||
|
||||
// 查询用户支付宝账户
|
||||
SysUserPayAccount sysUserPayAccount = sysUserPayAccountService
|
||||
.lambdaQuery()
|
||||
.eq(SysUserPayAccount::getUserId, userId)
|
||||
.eq(SysUserPayAccount::getType, 0)
|
||||
.one();
|
||||
if (Objects.isNull(sysUserPayAccount)) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"请先绑定支付宝账号");
|
||||
}
|
||||
|
||||
// 收款方信息
|
||||
Participant payeeInfo = new Participant();
|
||||
|
||||
// 线上环境
|
||||
payeeInfo.setIdentity(sysUserPayAccount.getOpenId());
|
||||
payeeInfo.setIdentityType("ALIPAY_OPEN_ID");
|
||||
model.setPayeeInfo(payeeInfo);
|
||||
|
||||
request.setBizModel(model);
|
||||
|
||||
// 添加提现记录和修改用户钱包
|
||||
this.addLogAndUpdateUserWallet(sysUser, amount);
|
||||
|
||||
// 证书用:certificateExecute(request),密钥用:execute(request)
|
||||
AlipayFundTransUniTransferResponse response = alipayClient.certificateExecute(request);
|
||||
System.out.println(response.getBody());
|
||||
|
||||
if (response.isSuccess()) {
|
||||
|
||||
return R.ok("提现成功");
|
||||
}
|
||||
|
||||
if (response.getSubCode().equals("PAYER_BALANCE_NOT_ENOUGH")) {
|
||||
// 账户余额不足,发送邮件通知
|
||||
ArrayList<String> tos = CollUtil.newArrayList("2119157836@qq.com");
|
||||
|
||||
String content = String.format("账户余额不足:用户%s提现%s", sysUser.getNickName(), amount);
|
||||
MailUtil.send(tos, "魔创未来", content, false);
|
||||
throw new ServiceException("网络连接出错,请稍后再试");
|
||||
}
|
||||
System.out.println("用户" + SecurityUtils.getLoginUser().getUser().getNickName() + "提现失败:" + response.getSubMsg());
|
||||
throw new ServiceException("提现失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -376,7 +390,7 @@ public class AliPayServiceImpl implements AliPayService {
|
|||
|
||||
// 如果数据库中不存在该订单, 则返回订单不存在
|
||||
if (Objects.isNull(orderTrade)) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"订单不存在");
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG, "订单不存在");
|
||||
}
|
||||
|
||||
|
||||
|
@ -403,7 +417,7 @@ public class AliPayServiceImpl implements AliPayService {
|
|||
Map<String, String> params = new HashMap<>();
|
||||
params.put("buyer_pay_amount", tradStatus.getBuyerPayAmount());
|
||||
params.put("out_trade_no", tradStatus.getOutTradeNo());
|
||||
params.put("gmt_payment",DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, tradStatus.getSendPayDate()));
|
||||
params.put("gmt_payment", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, tradStatus.getSendPayDate()));
|
||||
params.put("total_amount", tradStatus.getTotalAmount());
|
||||
params.put("trade_no", tradStatus.getTradeNo());
|
||||
String code = orderTrade.getCode();
|
||||
|
@ -440,6 +454,7 @@ public class AliPayServiceImpl implements AliPayService {
|
|||
if (response.isSuccess()) {
|
||||
// 支付宝用户唯一ID
|
||||
String openId = response.getOpenId();
|
||||
String uid = response.getUserId();
|
||||
// 判断是否已经绑定过
|
||||
SysUserPayAccount sysUserPayAccount = sysUserPayAccountService.lambdaQuery()
|
||||
.eq(SysUserPayAccount::getUserId, userId)
|
||||
|
@ -450,12 +465,12 @@ public class AliPayServiceImpl implements AliPayService {
|
|||
// 已经绑定过,直接返回
|
||||
return "success";
|
||||
}
|
||||
System.out.println("绑定成功!openId:" + openId);
|
||||
System.out.println("绑定成功!openId/uid:" + openId);
|
||||
// 将openId与当前商城用户绑定(保存到数据库)
|
||||
SysUserPayAccount userPayAccount = new SysUserPayAccount();
|
||||
userPayAccount.setUserId(userId);
|
||||
userPayAccount.setAppId(aliConfig.getAppId());
|
||||
userPayAccount.setOpenId(openId);
|
||||
userPayAccount.setOpenId(StrUtil.isEmpty(openId) ? uid : openId);
|
||||
userPayAccount.setType(0);
|
||||
sysUserPayAccountService.save(userPayAccount);
|
||||
redisCache.setCacheObject("alipay:bind:user:status:" + userId, "1", 4, TimeUnit.SECONDS);
|
||||
|
@ -527,6 +542,7 @@ public class AliPayServiceImpl implements AliPayService {
|
|||
sysUserPayAccountLog.setUserId(sysUser.getUserId());
|
||||
sysUserPayAccountLog.setAmount(Double.valueOf(amount));
|
||||
sysUserPayAccountLog.setAccount("支付宝");
|
||||
sysUserPayAccountLog.setWallet(sysUser.getWallet());
|
||||
sysUserPayAccountLogService.save(sysUserPayAccountLog);
|
||||
}
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDate;
|
||||
|
@ -114,6 +115,19 @@ public class OrderTradeServiceImpl extends ServiceImpl<OrderTradeMapper, OrderTr
|
|||
.expireAfterAccess(3, TimeUnit.MINUTES)
|
||||
.build();
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
CommissionRatio commissionRatio1 = commissionRatioService.lambdaQuery()
|
||||
.eq(CommissionRatio::getType, 0)
|
||||
.one();
|
||||
CommissionRatio commissionRatio2 = commissionRatioService.lambdaQuery()
|
||||
.eq(CommissionRatio::getType, 1)
|
||||
.one();
|
||||
redisCache.setCacheObject(CommissionRationEnum.COMMISSION_RATION_INVITER_USER.getName(), commissionRatio1.getRatio().toString());
|
||||
redisCache.setCacheObject(CommissionRationEnum.COMMISSION_RATION_MERCHANT.getName(), commissionRatio2.getRatio().toString());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void productHandler(ProductRes productRes) {
|
||||
|
@ -676,6 +690,7 @@ public class OrderTradeServiceImpl extends ServiceImpl<OrderTradeMapper, OrderTr
|
|||
.eq(CommissionRatio::getType, 1)
|
||||
.one();
|
||||
CommissionRationMerchant = commissionRatio.getRatio().toString();
|
||||
redisCache.setCacheObject(CommissionRationEnum.COMMISSION_RATION_MERCHANT.getName(), CommissionRationMerchant);
|
||||
}
|
||||
|
||||
// 佣金配给邀请者用户比例
|
||||
|
@ -685,6 +700,7 @@ public class OrderTradeServiceImpl extends ServiceImpl<OrderTradeMapper, OrderTr
|
|||
.eq(CommissionRatio::getType, 0)
|
||||
.one();
|
||||
commissionRationInviterUser = commissionRatio.getRatio().toString();
|
||||
redisCache.setCacheObject(CommissionRationEnum.COMMISSION_RATION_INVITER_USER.getName(), commissionRationInviterUser);
|
||||
}
|
||||
|
||||
Double rationMerchant = redisCache.getCacheObject(CommissionRationMerchant);
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
sys_user u ON mil.user_id = u.user_id
|
||||
WHERE
|
||||
mil.user_id = #{userId}
|
||||
and mil.del_flag = '0' and mi.del_flag = '0' and u.del_flag = '0'
|
||||
ORDER BY
|
||||
<choose>
|
||||
<when test="orderByColumn == 'create_time'">
|
||||
|
|
|
@ -132,6 +132,7 @@
|
|||
ON ml.user_id = u.user_id
|
||||
WHERE
|
||||
ml.user_id = #{userId}
|
||||
and ml.del_flag = '0' and m.del_flag = '0' and u.del_flag = '0'
|
||||
ORDER BY
|
||||
<choose>
|
||||
<when test="orderByColumn == 'create_time'">
|
||||
|
|
|
@ -88,6 +88,7 @@
|
|||
ON wfl.user_id = u.user_id
|
||||
WHERE
|
||||
wfl.user_id = #{userId}
|
||||
and wfl.del_flag = '0' and wf.del_flag = '0' and u.del_flag = '0'
|
||||
ORDER BY
|
||||
<choose>
|
||||
<when test="orderByColumn == 'create_time'">
|
||||
|
|
|
@ -28,5 +28,9 @@ public class SysUserPayAccountLog extends BaseEntity {
|
|||
* 提现账户
|
||||
*/
|
||||
private String account;
|
||||
/**
|
||||
* 剩余金币
|
||||
*/
|
||||
private Double wallet;
|
||||
|
||||
}
|
||||
|
|
|
@ -41,7 +41,8 @@ public class SysUserPayAccountLogServiceImpl extends ServiceImpl<SysUserPayAccou
|
|||
|
||||
baseMapper.selectPage(page, new LambdaQueryWrapper<SysUserPayAccountLog>()
|
||||
.select(SysUserPayAccountLog::getAmount, SysUserPayAccountLog::getAccount, SysUserPayAccountLog::getCreateTime)
|
||||
.eq(SysUserPayAccountLog::getUserId, userId));
|
||||
.eq(SysUserPayAccountLog::getUserId, userId)
|
||||
.orderByDesc(SysUserPayAccountLog::getCreateTime));
|
||||
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
|
|
Loading…
Reference in New Issue