| | |
| | | return value.signum() > 0 && guideUserMapper.decreaseBalance(guideId, value) == 1; |
| | | } |
| | | |
| | | /** 退款冲正只扣除当前余额,余额不足时保留为零,避免退款回调因余额竞争失败。 */ |
| | | public boolean debitForRefund(Long guideId, BigDecimal amount) { |
| | | BigDecimal value = money(amount); |
| | | return value.signum() > 0 && guideUserMapper.decreaseBalanceForRefund(guideId, value) == 1; |
| | | } |
| | | |
| | | public void credit(Long guideId, BigDecimal amount) { |
| | | BigDecimal value = money(amount); |
| | | if (value.signum() == 0) return; |
| | |
| | | && guideTeamMapper.decreaseBalance(teamId, value) == 1; |
| | | } |
| | | |
| | | public boolean debitTeamForRefund(Long teamId, BigDecimal amount) { |
| | | BigDecimal value = money(amount); |
| | | return teamId != null && value.signum() > 0 |
| | | && guideTeamMapper.decreaseBalanceForRefund(teamId, value) == 1; |
| | | } |
| | | |
| | | public void creditTeam(Long teamId, BigDecimal amount) { |
| | | BigDecimal value = money(amount); |
| | | if (value.signum() == 0) return; |