| | |
| | | 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; |