| | |
| | | * 合约产品平仓后添加当前流水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())) { |
| | |
| | | map.put("fee", order.getFee()); |
| | | map.put("deposit", order.getDeposit()); |
| | | map.put("deposit_open", order.getDepositOpen()); |
| | | map.put("change_ratio", order.getChangeRatio()); |
| | | map.put("change_ratio", order.getChangeRatio().setScale(2, RoundingMode.HALF_UP)); |
| | | |
| | | if(order.getProfit()!=null){ |
| | | map.put("profit", order.getProfit().setScale(4, RoundingMode.HALF_UP)); |
| | | map.put("profit", order.getProfit().setScale(2, RoundingMode.HALF_UP)); |
| | | }else{ |
| | | map.put("profit", order.getProfit()); |
| | | } |