| | |
| | | // if (canAddMaxBond.compareTo(BigDecimal.ZERO) < 0) { |
| | | // canAddMaxBond = BigDecimal.ZERO; |
| | | // } |
| | | BigDecimal canReduceMaxBond = holdOrderEntity.getBondAmount().subtract(holdOrderEntity.getOpeningFeeAmount()); |
| | | BigDecimal canReduceMaxBond = holdOrderEntity.getBondAmount().subtract(holdOrderEntity.getPrePaymentAmount()); |
| | | |
| | | if (rewardRatio.compareTo(BigDecimal.ZERO) < 0) { |
| | | canReduceMaxBond = canReduceMaxBond.add(rewardRatio); |
| | |
| | | } |
| | | |
| | | result.put("hold", resultList); |
| | | result.put("totalProfitOrLoss", totalProfitOrLoss.setScale(4, BigDecimal.ROUND_DOWN).toPlainString()); |
| | | result.put("totalProfitOrLoss", totalProfitOrLoss.setScale(2, BigDecimal.ROUND_DOWN).toPlainString()); |
| | | return Result.ok(result); |
| | | } |
| | | return Result.ok("success"); |