From 86587c1ffa0bdfa2a171dce96540c7617dd44dec Mon Sep 17 00:00:00 2001
From: zj <1772600164@qq.com>
Date: Wed, 28 Jan 2026 18:33:54 +0800
Subject: [PATCH] 1
---
src/main/resources/application.properties | 2 +-
src/main/java/com/nq/service/impl/UserServiceImpl.java | 18 +++++++++++++-----
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/src/main/java/com/nq/service/impl/UserServiceImpl.java b/src/main/java/com/nq/service/impl/UserServiceImpl.java
index 12c3e04..5950649 100644
--- a/src/main/java/com/nq/service/impl/UserServiceImpl.java
+++ b/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());
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 2a01dd6..7f3418d 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -8,7 +8,7 @@
ftp.server.ip=127.0.0.1
ftp.user=ftp_red
ftp.pass=ftp_red
-ftp.server.http.prefix=https://ftp.qitiana.cfd/
+ftp.server.http.prefix=https://ftp.bafang.icu/
loca.images.dir=/www/wwwroot/ftp.qitiana.cfd/
#ftp.server.ip=47.56.200.145
#ftp.user=ofsuccess
--
Gitblit v1.9.3