debug:用户扣减余额判断check漏了

This commit is contained in:
磷叶 2025-02-14 10:54:01 +08:00
parent 7aff2c715d
commit 8edf1c05fa

View File

@ -261,7 +261,8 @@ public class UserServiceImpl implements UserService
// 查询用户余额
BigDecimal balance = smUserMapper.selectBalanceForUpdate(userId);
ServiceUtil.assertion(balance == null || balance.compareTo(amount) < 0, "减少ID为%s的用户余额%s元失败请重试", userId, amount);
ServiceUtil.assertion(balance == null, "减少ID为%s的用户余额%s元失败请重试", userId, amount);
ServiceUtil.assertion( check && balance.compareTo(amount) < 0 , "减少ID为%s的用户余额%s元失败请重试", userId, amount);
// 更新用户余额
int update = smUserMapper.subtractBalance(userId, amount, check);