提现 增加验证码校验
This commit is contained in:
parent
297c028985
commit
38decaa8f1
|
|
@ -32,6 +32,8 @@ import com.sqx.modules.utils.AmountCalUtils;
|
|||
import com.sqx.modules.utils.excel.ExcelData;
|
||||
import com.sqx.modules.utils.excel.ExportExcelUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import lombok.val;
|
||||
|
|
@ -484,8 +486,16 @@ public class CashController {
|
|||
@Login
|
||||
@GetMapping(value = "/withdraw")
|
||||
@ApiOperation("发起提现 余额 金钱")
|
||||
public Result withdraw(Long userId, Double money) {
|
||||
return cashOutService.withdraw(userId, money, true);
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userId", value = "提现人员Id", dataTypeClass = String.class, paramType = "param"),
|
||||
@ApiImplicitParam(name = "money", value = "提现金额", dataTypeClass = Double.class, paramType = "param"),
|
||||
@ApiImplicitParam(name = "msg", value = "验证码", dataTypeClass = String.class, paramType = "param"),
|
||||
})
|
||||
public Result withdraw(Long userId, Double money, String msg) {
|
||||
if (StringUtils.isBlank(msg)) {
|
||||
return Result.error("请输入验证码");
|
||||
}
|
||||
return cashOutService.withdraw(userId, money, msg, true);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public class AppCashController {
|
|||
@Debounce(interval = 3000, value = "#userId")
|
||||
@ApiOperation("发起提现 余额 金钱")
|
||||
public Result withdraw(@RequestAttribute("userId") Long userId, Double amount) {
|
||||
return cashOutService.withdraw(userId, amount, false);
|
||||
return cashOutService.withdraw(userId, amount, null, false);
|
||||
}
|
||||
|
||||
@Login
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import java.util.List;
|
|||
|
||||
public interface CashOutService {
|
||||
|
||||
PageUtils selectCashOutList(Integer page,Integer limit,CashOut cashOut);
|
||||
PageUtils selectCashOutList(Integer page, Integer limit, CashOut cashOut);
|
||||
|
||||
ExcelData excelPayDetails(CashOut cashOut);
|
||||
|
||||
|
|
@ -43,11 +43,10 @@ public interface CashOutService {
|
|||
Result sysCashMoney(Long userId, Double money);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param userId 用户Id tb_user的id
|
||||
* @param money 提现金额
|
||||
* @param isSys 是否是系统用户提现
|
||||
* @param isSys 是否是系统用户提现
|
||||
*/
|
||||
Result withdraw(Long userId, Double money, boolean isSys);
|
||||
Result withdraw(Long userId, Double money, String msg, boolean isSys);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.app.dao.MsgDao;
|
||||
import com.sqx.modules.app.entity.Msg;
|
||||
import com.sqx.modules.app.entity.UserEntity;
|
||||
import com.sqx.modules.app.entity.UserMoney;
|
||||
import com.sqx.modules.app.entity.UserMoneyDetails;
|
||||
|
|
@ -76,6 +78,8 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
|||
private InviteMoneyService inviteMoneyService;
|
||||
@Autowired
|
||||
private SysUserService sysUserService;
|
||||
@Autowired
|
||||
private MsgDao msgDao;
|
||||
|
||||
@Override
|
||||
public PageUtils selectCashOutList(Integer page, Integer limit, CashOut cashOut) {
|
||||
|
|
@ -402,7 +406,7 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
|||
|
||||
@Override
|
||||
@Transactional
|
||||
public Result withdraw(Long userId, Double money, boolean isSys) {
|
||||
public Result withdraw(Long userId, Double money, String msg, boolean isSys) {
|
||||
if (money == null || money <= 0.00) {
|
||||
return Result.error("请不要输入小于0的数字,请输入正确的提现金额!");
|
||||
}
|
||||
|
|
@ -412,6 +416,10 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
|||
|
||||
if (isSys) {
|
||||
SysUserEntity sysUserEntity = sysUserService.getById(userId);
|
||||
Msg msg1 = msgDao.findByPhoneAndCode(sysUserEntity.getMobile(), msg);
|
||||
if (msg1 == null) {
|
||||
return Result.error("验证码不正确!");
|
||||
}
|
||||
if (StringUtils.isBlank(sysUserEntity.getZhiFuBao()) || StringUtils.isBlank(sysUserEntity.getZhiFuBaoName())) {
|
||||
return Result.error(9999, "请先绑定支付宝账号!");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue