提现审核修改
This commit is contained in:
@@ -562,18 +562,23 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
||||
entity.setState(2);
|
||||
entity.setRefund(cashOut.getRefund());
|
||||
}
|
||||
UserEntity userEntity = userService.selectUserById(entity.getUserId());
|
||||
if (userEntity == null) {
|
||||
throw new SqxException("提现用户信息不存在!");
|
||||
|
||||
boolean isSysUser = entity.getSysUserId() != null;
|
||||
|
||||
if (isSysUser) {
|
||||
SysUserEntity sysUserEntity = sysUserService.getById(entity.getSysUserId());
|
||||
if (sysUserEntity == null) {
|
||||
throw new SqxException("提现代理信息不存在!");
|
||||
}
|
||||
} else {
|
||||
UserEntity userEntity = userService.selectUserById(entity.getUserId());
|
||||
if (userEntity == null) {
|
||||
throw new SqxException("提现用户信息不存在!");
|
||||
}
|
||||
}
|
||||
|
||||
if (isAgree == 0) {
|
||||
baseMapper.updateById(entity);
|
||||
UserMoneyDetails userMoneyDetails = new UserMoneyDetails(
|
||||
entity.getUserId(), null, null, "[提现退款]", 4, 1, 2,
|
||||
new BigDecimal(entity.getMoney()), "提现失败,自动退款" + entity.getMoney() + "元", 1);
|
||||
userMoneyDetailsService.save(userMoneyDetails);
|
||||
//归还余额 钱
|
||||
userMoneyService.updateAmount(1, entity.getUserId(), Convert.toDouble(entity.getMoney()));
|
||||
backCashAmount(entity);
|
||||
return;
|
||||
}
|
||||
entity.setState(4);
|
||||
@@ -593,13 +598,25 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
||||
} else {
|
||||
entity.setRefund(baseResp.getErrorMsg());
|
||||
}
|
||||
backCashAmount(entity);
|
||||
} else if (StringUtils.isNotBlank(baseResp.getMsg())) {
|
||||
entity.setState(2);
|
||||
entity.setRefund("提现失败,请检查支付宝账号与收款人姓名后,重试。");
|
||||
backCashAmount(entity);
|
||||
}
|
||||
baseMapper.updateById(entity);
|
||||
}
|
||||
|
||||
private void backCashAmount(CashOut entity) {
|
||||
baseMapper.updateById(entity);
|
||||
UserMoneyDetails userMoneyDetails = new UserMoneyDetails(
|
||||
entity.getUserId(), entity.getSysUserId(), null, "[提现退款]", 4, 1, 2,
|
||||
new BigDecimal(entity.getMoney()), "提现失败,自动退款" + entity.getMoney() + "元", 1);
|
||||
userMoneyDetailsService.save(userMoneyDetails);
|
||||
//归还余额 钱
|
||||
userMoneyService.updateAmount(1, entity.getUserId(), Convert.toDouble(entity.getMoney()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量审核
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user