| | |
| | | String type = eUserAssets.getDesc(); |
| | | String before = userAssets.getAvailableBalance().toString(); |
| | | String accectType = userAssets.getAccectType(); |
| | | BigDecimal amountLog = amount; |
| | | if(Objects.equals(eUserAssets.getCode(), EUserAssets.BUY.getCode())){ |
| | | userAssets.setAvailableBalance(userAssets.getAvailableBalance().add(amount)); |
| | | userAssets.setFreezeMoney(userAssets.getFreezeMoney().add(amount.negate())); |
| | |
| | | }else if(Objects.equals(eUserAssets.getCode(), EUserAssets.HANDLING_CHARGE.getCode())){ |
| | | if(userAssets.getAvailableBalance().compareTo(amount.abs()) >= 0){ |
| | | userAssets.setAvailableBalance(userAssets.getAvailableBalance().add(amount.negate())); |
| | | amountLog = amount.negate(); |
| | | }else { |
| | | userAssets.setHandlingChargeWritten(userAssets.getHandlingChargeWritten().add(amount.abs())); |
| | | } |
| | |
| | | moneyLog.setDescs(eUserAssets.getDesc()); |
| | | moneyLog.setBeFore(before); |
| | | moneyLog.setAfter(after); |
| | | moneyLog.setAmount(amount.toString()); |
| | | moneyLog.setAmount(amountLog.toString()); |
| | | moneyLog.setAccectType(accectType); |
| | | moneyLog.setType(eUserAssets.getCode()); |
| | | moneyLog.setUserId(userId+""); |