| | |
| | | .stream().mapToInt(Integer::intValue).sum(); |
| | | } |
| | | Integer userCount = good.getUserCount(); |
| | | if (good.getUserCount() > totalNumber) { |
| | | if (userCount > totalNumber) { |
| | | int i = userCount - totalNumber; |
| | | if (number > i) { |
| | | return R.exchangeError("兑换失败,当前兑换数量已超过最大兑换数量,剩余兑换数量为: " + |
| | | i + "!"); |
| | | } |
| | | } else { |
| | | return R.exchangeError("兑换失败,当前兑换数量已超过最大兑换数量!"); |
| | | } |
| | | } |
| | | boolean result = exchangeGood(goodExchange, recipient, number, goodId, needIntegral); |
| | |
| | | return R.exchangeError("兑换失败,当前兑换数量已超过最大兑换数量,剩余兑换数量为: " + |
| | | i + "!"); |
| | | } |
| | | } else { |
| | | return R.exchangeError("兑换失败,当前兑换数量已超过最大兑换数量!"); |
| | | } |
| | | } |
| | | boolean result = exchangeGoodParent(goodExchange, recipient, number, goodId, needIntegral); |