bug
This commit is contained in:
@ -469,15 +469,15 @@ public class DeductionServiceImpl implements DeductionService {
|
||||
synchronized (getUserLock(userId)) {
|
||||
MemberUserDO user = userService.getUser(userId);
|
||||
MoneyDO moneyDO = moneyService.getMoney(userId, storeId);
|
||||
|
||||
|
||||
if (user.getMoney().compareTo(money) < 0) {
|
||||
BigDecimal total = moneyDO.getCashAmount().add(user.getWxAmount()).add(user.getGiftAmount());
|
||||
if (total.compareTo(money) < 0) {
|
||||
if (CHECK_LIST.contains(type)) {
|
||||
throw exception(CASH_AMOUNT_NOT_ENOUGH);
|
||||
}
|
||||
user.setWxAmount(BigDecimal.ZERO);
|
||||
moneyDO.setCashAmount(BigDecimal.ZERO);
|
||||
user.setGiftAmount(BigDecimal.ZERO);
|
||||
moneyDO.setDebtAmount(total.subtract(money));
|
||||
} else {
|
||||
BigDecimal wxAmount = user.getWxAmount();
|
||||
BigDecimal giftAmount = user.getGiftAmount();
|
||||
|
Reference in New Issue
Block a user