| | |
| | | BigDecimal sh_amt = user.getEnableAmt(); |
| | | |
| | | BigDecimal sh_amt_back = new BigDecimal("0"); |
| | | BigDecimal enaleWithdrawAmt = user.getEnaleWithdrawAmt(); |
| | | //0 加钱 1 减钱 2虚拟加钱 |
| | | if (direction.intValue() == 0||direction.intValue()==2) { |
| | | sh_amt_back = sh_amt.add(new BigDecimal(amt)); |
| | | enaleWithdrawAmt = enaleWithdrawAmt.add(new BigDecimal(amt)); |
| | | } else if (direction.intValue() == 1) { |
| | | |
| | | if (sh_amt.compareTo(new BigDecimal(amt)) == -1) { |
| | |
| | | return ServerResponse.createByErrorMsg("不存在此操作"); |
| | | } |
| | | user.setEnableAmt(sh_amt_back); |
| | | user.setEnaleWithdrawAmt(enaleWithdrawAmt); |
| | | |
| | | // BigDecimal hk_amt = user.getHkAmt(); |
| | | // |
| | |
| | | PositionVO positionVO = this.iUserPositionService.findUserPositionAllProfitAndLose(user.getId()); |
| | | userInfoVO.setAllFreezAmt(positionVO.getAllFreezAmt()); |
| | | BigDecimal allProfitAndLose = positionVO.getAllProfitAndLose(); |
| | | userInfoVO.setAllProfitAndLose(allProfitAndLose); |
| | | BigDecimal profitAndLose = this.userPositionMapper.CountPositionAllProfitAndLoseByUserId(user.getId()); |
| | | userInfoVO.setAllProfitAndLose(allProfitAndLose.add(profitAndLose)); |
| | | |
| | | // BigDecimal userAllAmt = user.getUserAmt(); |
| | | BigDecimal userAllAmt = user.getEnableAmt(); |
| | | userAllAmt = userAllAmt.add(allProfitAndLose); |
| | | if(null != allProfitAndLose){ |
| | | userInfoVO.setAllProfitAndLose(allProfitAndLose); |
| | | userAllAmt = userAllAmt.add(allProfitAndLose); |
| | | } |
| | | |
| | | |
| | | |
| | | userInfoVO.setEnableIndexAmt(user.getEnableIndexAmt()); |
| | |
| | | userInfoVO.setBuyAmtAutual(buyAmtAutual); |
| | | userAllAmt = userAllAmt.add(buyAmtAutual); |
| | | userInfoVO.setUserAmt(userAllAmt); |
| | | |
| | | List<UserPosition> userPositions = this.userPositionMapper.findMyPositionByCodeAndSpell(user.getId(), "", "", 1); |
| | | if (userPositions.size() > 0) { |
| | | for (UserPosition position : userPositions) { |
| | | UserPositionVO userPositionVO = assembleUserPositionVO(position); |
| | | historyProfitLoss = historyProfitLoss.add(userPositionVO.getProfitAndLose()); |
| | | } |
| | | } |
| | | userInfoVO.setHistoryProfitLoss(historyProfitLoss); |
| | | // List<UserPosition> userPositions = this.userPositionMapper.findMyPositionByCodeAndSpell(user.getId(), "", "", 1); |
| | | // if (userPositions.size() > 0) { |
| | | // for (UserPosition position : userPositions) { |
| | | // UserPositionVO userPositionVO = assembleUserPositionVO(position); |
| | | // historyProfitLoss = historyProfitLoss.add(userPositionVO.getProfitAndLose()); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | // IndexPositionVO indexPositionVO = this.iUserIndexPositionService.findUserIndexPositionAllProfitAndLose(user.getId()); |
| | | // BigDecimal allIndexProfitAndLose = indexPositionVO.getAllIndexProfitAndLose(); |