| | |
| | | |
| | | PositionVO positionVO = this.iUserPositionService.findUserPositionAllProfitAndLose(user.getId()); |
| | | userInfoVO.setAllFreezAmt(positionVO.getAllFreezAmt()); |
| | | userInfoVO.setAllFreezAmtHk(positionVO.getAllFreezAmtHk()); |
| | | BigDecimal allProfitAndLose = positionVO.getAllProfitAndLose(); |
| | | BigDecimal allProfitAndLosehk = positionVO.getAllProfitAndLoseHk(); |
| | | userInfoVO.setAllProfitAndLose(allProfitAndLose); |
| | | userInfoVO.setAllProfitAndLoseHk(allProfitAndLosehk); |
| | | |
| | | // BigDecimal userAllAmt = user.getUserAmt(); |
| | | BigDecimal userAllAmt = user.getEnableAmt(); |
| | | userAllAmt = userAllAmt.add(allProfitAndLose); |
| | | |
| | |
| | | |
| | | BigDecimal historyProfitLoss = new BigDecimal(0); |
| | | BigDecimal buyAmtAutual = new BigDecimal(0); |
| | | BigDecimal historyProfitLossHk = new BigDecimal(0); |
| | | BigDecimal buyAmtAutualHk = new BigDecimal(0); |
| | | List<UserPosition> userPositionscc = this.userPositionMapper.findMyPositionByCodeAndSpell(user.getId(), "", "", 0); |
| | | |
| | | if (userPositionscc.size() > 0) { |
| | | for (UserPosition position : userPositionscc) { |
| | | if(StockType.HK.getCode().equals(position.getStockType())){ |
| | | buyAmtAutualHk = buyAmtAutualHk.add(position.getBuyOrderPrice() |
| | | .multiply(new BigDecimal(position.getOrderNum())) |
| | | .divide(new BigDecimal(position.getOrderLever()), 2, RoundingMode.HALF_UP)); |
| | | }else { |
| | | buyAmtAutual = buyAmtAutual.add(position.getBuyOrderPrice() |
| | | .multiply(new BigDecimal(position.getOrderNum())) |
| | | .divide(new BigDecimal(position.getOrderLever()), 2, RoundingMode.HALF_UP)); |
| | | } |
| | | } |
| | | } |
| | | userInfoVO.setBuyAmtAutual(buyAmtAutual); |
| | |
| | | |
| | | if (userPositions.size() > 0) { |
| | | for (UserPosition position : userPositions) { |
| | | if(StockType.HK.getCode().equals(position.getStockType())){ |
| | | UserPositionVO userPositionVO = assembleUserPositionVO(position); |
| | | historyProfitLossHk = historyProfitLossHk.add(userPositionVO.getAllProfitAndLose()); |
| | | }else { |
| | | UserPositionVO userPositionVO = assembleUserPositionVO(position); |
| | | historyProfitLoss = historyProfitLoss.add(userPositionVO.getAllProfitAndLose()); |
| | | } |
| | | |
| | | } |
| | | } |
| | | userInfoVO.setHistoryProfitLoss(historyProfitLoss); |
| | | userInfoVO.setHistoryProfitLossHk(historyProfitLossHk); |
| | | userInfoVO.setDjzj(user.getDjzj()); |
| | | return userInfoVO; |
| | | } |