| | |
| | | * 合约产品平仓后添加当前流水setWithdraw_limit_now_amount |
| | | */ |
| | | User party = userService.getById(order.getPartyId()); |
| | | if (party.getWithdrawLimitNowAmount() == null) { |
| | | party.setWithdrawLimitNowAmount(BigDecimal.ZERO); |
| | | } |
| | | party.setWithdrawLimitNowAmount(party.getWithdrawLimitNowAmount().add(order.getDepositOpen())); |
| | | userService.updateById(party); |
| | | if (ObjectUtils.isEmpty(order.getCloseAvgPrice())) { |
| | |
| | | BigDecimal close = realtime.getClose(); |
| | | BigDecimal point = close.subtract(order.getTradeAvgPrice()); |
| | | BigDecimal profit = point.multiply(new BigDecimal("0.01")).multiply(order.getVolumeOpen()).setScale(4, BigDecimal.ROUND_DOWN);; |
| | | if(null != order.getProfitLossRatio() || order.getProfitLossRatio() > 0){ |
| | | if(null != order.getProfitLossRatio() && order.getProfitLossRatio() > 0){ |
| | | profit = order.getDepositOpen().multiply(new BigDecimal((order.getProfitLossRatio()/100))).setScale(2, RoundingMode.DOWN); |
| | | } |
| | | BigDecimal rentalProfit = order.getDeposit().add(profit).add(order.getAddDepositOpen()); |