peter
2026-01-01 a66b2a41f265cc9526781e39c1d6c6d5f5d7c013
src/main/java/com/nq/service/impl/UserServiceImpl.java
@@ -1842,10 +1842,12 @@
        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);
@@ -1856,13 +1858,21 @@
        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);
@@ -1873,11 +1883,18 @@
        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;
    }