| | |
| | | // BigDecimal userAllAmt = user.getUserAmt(); |
| | | BigDecimal userAllAmt = user.getEnableAmt(); |
| | | userAllAmt = userAllAmt.add(allProfitAndLose); |
| | | userInfoVO.setUserAmt(userAllAmt); |
| | | |
| | | |
| | | userInfoVO.setEnableIndexAmt(user.getEnableIndexAmt()); |
| | | userInfoVO.setEnaleWithdrawAmt(user.getEnaleWithdrawAmt()); |
| | | userInfoVO.setHkAmt(user.getHkAmt()); |
| | | |
| | | BigDecimal historyProfitLoss = new BigDecimal(0); |
| | | BigDecimal buyAmtAutual = new BigDecimal(0); |
| | | List<UserPosition> userPositionscc = this.userPositionMapper.findMyPositionByCodeAndSpell(user.getId(), "", "", 0); |
| | | |
| | | if (userPositionscc.size() > 0) { |
| | | for (UserPosition position : userPositionscc) { |
| | | buyAmtAutual = buyAmtAutual.add(position.getBuyOrderPrice() |
| | | .multiply(new BigDecimal(position.getOrderNum())) |
| | | .divide(new BigDecimal(position.getOrderLever()), 2, RoundingMode.HALF_UP)); |
| | | } |
| | | } |
| | | userInfoVO.setBuyAmtAutual(buyAmtAutual); |
| | | userAllAmt = userAllAmt.add(buyAmtAutual); |
| | | userInfoVO.setUserAmt(userAllAmt); |
| | | |
| | | List<UserPosition> userPositions = this.userPositionMapper.findMyPositionByCodeAndSpell(user.getId(), "", "", 1); |
| | | |
| | | if (userPositions.size() > 0) { |
| | |
| | | if (position.getSellOrderId() != null) { |
| | | |
| | | BigDecimal subPrice = position.getSellOrderPrice().subtract(position.getBuyOrderPrice()); |
| | | profitAndLose = subPrice.multiply(new BigDecimal(position.getOrderNum().intValue())).multiply(new BigDecimal(position.getOrderLever())).setScale(2,4); |
| | | // profitAndLose = subPrice.multiply(new BigDecimal(position.getOrderNum().intValue())).multiply(new BigDecimal(position.getOrderLever())).setScale(2,4); |
| | | profitAndLose = subPrice.multiply(new BigDecimal(position.getOrderNum().intValue())).setScale(2,4); |
| | | if ("买跌".equals(position.getOrderDirection())) { |
| | | profitAndLose = profitAndLose.negate(); |
| | | } |
| | |
| | | } |
| | | |
| | | BigDecimal subPrice = (new BigDecimal(nowPrice)).subtract(position.getBuyOrderPrice()); |
| | | profitAndLose = subPrice.multiply(new BigDecimal(position.getOrderNum().intValue())).multiply(new BigDecimal(position.getOrderLever())).setScale(2,4); |
| | | // profitAndLose = subPrice.multiply(new BigDecimal(position.getOrderNum().intValue())).multiply(new BigDecimal(position.getOrderLever())).setScale(2,4); |
| | | profitAndLose = subPrice.multiply(new BigDecimal(position.getOrderNum().intValue())).setScale(2,4); |
| | | if ("买跌".equals(position.getOrderDirection())) { |
| | | profitAndLose = profitAndLose.negate(); |
| | | } |