This commit is contained in:
77
2024-08-03 19:30:35 +08:00
parent 90620baea4
commit 4fc5fdc77f
4 changed files with 16 additions and 5 deletions

View File

@@ -11,4 +11,5 @@ import com.ruoyi.cai.domain.AccountBlack;
*/
public interface AccountBlackService extends IService<AccountBlack> {
boolean existsByNameAndAccount(String cardName, String cardAccount);
}

View File

@@ -1,5 +1,6 @@
package com.ruoyi.cai.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.cai.domain.AccountBlack;
import com.ruoyi.cai.mapper.AccountBlackMapper;
@@ -14,4 +15,10 @@ import org.springframework.stereotype.Service;
*/
@Service
public class AccountBlackServiceImpl extends ServiceImpl<AccountBlackMapper,AccountBlack> implements AccountBlackService {
@Override
public boolean existsByNameAndAccount(String cardName, String cardAccount) {
return this.exists(Wrappers.lambdaQuery(AccountBlack.class).eq(AccountBlack::getCardName, cardName)
.eq(AccountBlack::getCardAccount, cardAccount)
.eq(AccountBlack::getEnableStatus, 1));
}
}

View File

@@ -23,10 +23,7 @@ import com.ruoyi.cai.pay.OrderNoUtil;
import com.ruoyi.cai.pay.OrderTypeEnum;
import com.ruoyi.cai.rank.RankAdminManager;
import com.ruoyi.cai.rank.bean.RankAdminBean;
import com.ruoyi.cai.service.AccountBankcardService;
import com.ruoyi.cai.service.AccountCashService;
import com.ruoyi.cai.service.AccountService;
import com.ruoyi.cai.service.WithdrawExchangeService;
import com.ruoyi.cai.service.*;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.ServletUtils;
@@ -52,6 +49,8 @@ public class AccountCashServiceImpl extends ServiceImpl<AccountCashMapper, Accou
private WithdrawTotalCache withdrawTotalCache;
@Autowired
private RankAdminManager rankAdminManager;
@Autowired
private AccountBlackService accountBlackService;
@Override
public void withdraw(WithdrawReq res) {
AccountBankcard one = accountBankcardService.getOne(Wrappers.lambdaQuery(AccountBankcard.class)
@@ -63,6 +62,10 @@ public class AccountCashServiceImpl extends ServiceImpl<AccountCashMapper, Accou
if(withdrawExchange == null){
throw new ServiceException("参数不正确");
}
boolean check = accountBlackService.existsByNameAndAccount(one.getCardName(),one.getCardAccount());
if(check){
throw new ServiceException("提现失败,错误码: 800900");
}
Long traceId = IdManager.nextId();
Long coinNum = withdrawExchange.getCoinNum();
accountService.withdraw(res.getUserId(), coinNum,traceId);