| | |
| | | userInfoVO.setAllFreezAmt(positionVO.getAllFreezAmt()); |
| | | BigDecimal allProfitAndLose = positionVO.getAllProfitAndLose(); |
| | | BigDecimal profitAndLose = this.userPositionMapper.CountPositionAllProfitAndLoseByUserId(user.getId()); |
| | | userInfoVO.setAllProfitAndLose(allProfitAndLose.add(profitAndLose)); |
| | | |
| | | // BigDecimal userAllAmt = user.getUserAmt(); |
| | | BigDecimal userAllAmt = user.getEnableAmt(); |
| | | |
| | | |
| | | // 初始化总盈亏为0 |
| | | BigDecimal totalProfitAndLose = BigDecimal.ZERO; |
| | | |
| | | // 累加各个盈亏(安全处理null值) |
| | | if (allProfitAndLose != null) { |
| | | totalProfitAndLose = totalProfitAndLose.add(allProfitAndLose); |
| | | } |
| | | if (profitAndLose != null) { |
| | | totalProfitAndLose = totalProfitAndLose.add(profitAndLose); |
| | | } |
| | | userInfoVO.setAllProfitAndLose(totalProfitAndLose); |
| | | if(null != allProfitAndLose){ |
| | | userInfoVO.setAllProfitAndLose(allProfitAndLose); |
| | | userAllAmt = userAllAmt.add(allProfitAndLose); |
| | | } |
| | | |
| | | |
| | | |
| | | userInfoVO.setEnableIndexAmt(user.getEnableIndexAmt()); |