fix: 退款修改退款订单状态
This commit is contained in:
@@ -422,6 +422,10 @@ public class TbPayServiceImpl implements TbPayService {
|
|||||||
throw new BadRequestException("用户不存在");
|
throw new BadRequestException("用户不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (user.getAmount().compareTo(BigDecimal.ZERO) <= 0) {
|
||||||
|
throw new BadRequestException("余额不足");
|
||||||
|
}
|
||||||
|
|
||||||
shopUserMapper.update(null, new LambdaUpdateWrapper<TbShopUser>()
|
shopUserMapper.update(null, new LambdaUpdateWrapper<TbShopUser>()
|
||||||
.eq(TbShopUser::getId, user.getId())
|
.eq(TbShopUser::getId, user.getId())
|
||||||
.apply(StrUtil.format("amount-{}>=0", payMount.doubleValue()))
|
.apply(StrUtil.format("amount-{}>=0", payMount.doubleValue()))
|
||||||
|
|||||||
@@ -652,9 +652,15 @@ public class TbOrderInfoServiceImpl implements TbOrderInfoService {
|
|||||||
log.warn("订单信息不存在: {}", payOrderId);
|
log.warn("订单信息不存在: {}", payOrderId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
orderInfo.setStatus("refund");
|
TbOrderInfo returnOrder = orderInfoMapper.selectOne(new LambdaQueryWrapper<TbOrderInfo>()
|
||||||
orderInfo.setPaidTime(cn.hutool.core.date.DateUtil.current());
|
.eq(TbOrderInfo::getSource, orderInfo.getId()));
|
||||||
orderInfoMapper.updateById(orderInfo);
|
if (returnOrder == null) {
|
||||||
|
log.warn("订单信息不存在: {}", payOrderId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
returnOrder.setStatus("refund");
|
||||||
|
returnOrder.setPaidTime(cn.hutool.core.date.DateUtil.current());
|
||||||
|
orderInfoMapper.updateById(returnOrder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user