1
zj
2026-01-28 86587c1ffa0bdfa2a171dce96540c7617dd44dec
src/main/java/com/nq/service/impl/UserServiceImpl.java
@@ -1831,15 +1831,23 @@
        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());