1.体现报错修复
This commit is contained in:
@@ -623,12 +623,8 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
|||||||
queryWrapper.le(CashOut::getCreateAt, cashOut.getEndTime());
|
queryWrapper.le(CashOut::getCreateAt, cashOut.getEndTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
List<CashOut> page;
|
queryWrapper.orderByDesc(CashOut::getId);
|
||||||
if (queryWrapper.isEmptyOfWhere()) {
|
List<CashOut> page = list(queryWrapper);
|
||||||
page = list();
|
|
||||||
}else {
|
|
||||||
page = list(queryWrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!page.isEmpty()) {
|
if (!page.isEmpty()) {
|
||||||
Set<Long> userIdList = page.stream().map(CashOut::getUserId).collect(Collectors.toSet());
|
Set<Long> userIdList = page.stream().map(CashOut::getUserId).collect(Collectors.toSet());
|
||||||
@@ -651,7 +647,6 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void audit(CashOut cashOut) {
|
public void audit(CashOut cashOut) {
|
||||||
long id = cashOut.getId();
|
|
||||||
Integer isAgree = cashOut.getIsAgree();
|
Integer isAgree = cashOut.getIsAgree();
|
||||||
if (isAgree == null) {
|
if (isAgree == null) {
|
||||||
throw new SqxException("请选择同意或者拒绝!");
|
throw new SqxException("请选择同意或者拒绝!");
|
||||||
@@ -659,7 +654,7 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
|||||||
if (isAgree == 0 && StrUtil.isBlank(cashOut.getRefund())) {
|
if (isAgree == 0 && StrUtil.isBlank(cashOut.getRefund())) {
|
||||||
throw new SqxException("请输入拒绝原因!");
|
throw new SqxException("请输入拒绝原因!");
|
||||||
}
|
}
|
||||||
CashOut entity = baseMapper.selectById(id);
|
CashOut entity = baseMapper.selectOne(new LambdaQueryWrapper<CashOut>().eq(CashOut::getUserId, cashOut.getUserId()).eq(CashOut::getId, cashOut.getId()));
|
||||||
if (entity == null) {
|
if (entity == null) {
|
||||||
throw new SqxException("提现申请不存在!");
|
throw new SqxException("提现申请不存在!");
|
||||||
}
|
}
|
||||||
@@ -692,7 +687,7 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
entity.setState(4);
|
entity.setState(4);
|
||||||
baseMapper.updateById(entity);
|
baseMapper.update(entity, new LambdaQueryWrapper<CashOut>().eq(CashOut::getUserId, entity.getUserId()).eq(CashOut::getId, entity.getId()));
|
||||||
if (StrUtil.isBlank(entity.getOrderNumber())) {
|
if (StrUtil.isBlank(entity.getOrderNumber())) {
|
||||||
String outOrderNo = AliPayOrderUtil.createOrderId();
|
String outOrderNo = AliPayOrderUtil.createOrderId();
|
||||||
entity.setOrderNumber(outOrderNo);
|
entity.setOrderNumber(outOrderNo);
|
||||||
@@ -714,11 +709,18 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
|||||||
entity.setRefund("提现失败,请检查支付宝账号与收款人姓名后,重试。");
|
entity.setRefund("提现失败,请检查支付宝账号与收款人姓名后,重试。");
|
||||||
backCashAmount(entity);
|
backCashAmount(entity);
|
||||||
}
|
}
|
||||||
baseMapper.updateById(entity);
|
updateByUserId(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateByUserId(CashOut entity) {
|
||||||
|
if (entity.getUserId() == null) {
|
||||||
|
throw new SqxException("cashOut修改失败: userId必须传递");
|
||||||
|
}
|
||||||
|
baseMapper.update(entity, new LambdaQueryWrapper<CashOut>().eq(CashOut::getUserId, entity.getUserId()).eq(CashOut::getId, entity.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void backCashAmount(CashOut entity) {
|
private void backCashAmount(CashOut entity) {
|
||||||
baseMapper.updateById(entity);
|
updateByUserId(entity);
|
||||||
UserMoneyDetails userMoneyDetails = new UserMoneyDetails(
|
UserMoneyDetails userMoneyDetails = new UserMoneyDetails(
|
||||||
entity.getUserId(), entity.getSysUserId(), null, "[提现退款]", 4, 1, 2,
|
entity.getUserId(), entity.getSysUserId(), null, "[提现退款]", 4, 1, 2,
|
||||||
new BigDecimal(entity.getMoney()), "提现失败,自动退款" + entity.getMoney() + "元", 1, entity.getId());
|
new BigDecimal(entity.getMoney()), "提现失败,自动退款" + entity.getMoney() + "元", 1, entity.getId());
|
||||||
|
|||||||
Reference in New Issue
Block a user