From b6b3f28e374de7d41d864ba8b18e0035f6de0fab Mon Sep 17 00:00:00 2001 From: tianyongbao Date: Wed, 22 May 2024 15:21:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B4=A6=E6=88=B7=E6=94=B6=E6=94=AF?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=EF=BC=8C=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/StatisticAnalysisImpl.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/ruoyi-modules/intc-invest/src/main/java/com/ruoyi/invest/service/impl/StatisticAnalysisImpl.java b/ruoyi-modules/intc-invest/src/main/java/com/ruoyi/invest/service/impl/StatisticAnalysisImpl.java index 6749912..cac5d55 100644 --- a/ruoyi-modules/intc-invest/src/main/java/com/ruoyi/invest/service/impl/StatisticAnalysisImpl.java +++ b/ruoyi-modules/intc-invest/src/main/java/com/ruoyi/invest/service/impl/StatisticAnalysisImpl.java @@ -1964,8 +1964,8 @@ public class StatisticAnalysisImpl implements IStatisticAnalysisService { double balance =0; //支出总额 double totalOutcome =0; - //收益总额 - double totalIncome =0; + //投资亏损 + double investOutcome =0; //刷卡手续费 13 double posExpenses =0; //信用卡分期利息 14 @@ -1974,14 +1974,13 @@ public class StatisticAnalysisImpl implements IStatisticAnalysisService { double onLineInterest=0; //日常支出 1 double dailyExpenses=0; - //投资收益 2 + //投资盈利 2 double investIncome=0; //工资收入 11 double salaryIncome=0; for (AccountsDealRecordVo vo:accountsDealRecordVoList ) { if(vo.getDealType().equals("1")){ - totalIncome+=vo.getAmount(); if(vo.getDealCategory().equals("11")){ salaryIncome+=vo.getAmount(); } @@ -1991,12 +1990,15 @@ public class StatisticAnalysisImpl implements IStatisticAnalysisService { } //支出 if(vo.getDealType().equals("2")){ - totalOutcome+=vo.getAmount(); + //非投资支出 + if(!vo.getDealCategory().equals("2")){ + totalOutcome+=vo.getAmount(); + } if(vo.getDealCategory().equals("1")){ dailyExpenses+=vo.getAmount(); } if(vo.getDealCategory().equals("2")){ - investIncome-=vo.getAmount(); + investOutcome+=vo.getAmount(); } if(vo.getDealCategory().equals("13")){ posExpenses+=vo.getAmount(); @@ -2010,11 +2012,11 @@ public class StatisticAnalysisImpl implements IStatisticAnalysisService { } } //收支差额 - map.put("balance",decimalFormat.format(totalIncome-totalOutcome)); - //支出总额 + map.put("balance",decimalFormat.format(investIncome+salaryIncome-totalOutcome-investOutcome)); + //非投资收益支出总额 map.put("totalOutcome",decimalFormat.format(totalOutcome)); - //收益总额 - map.put("totalIncome",decimalFormat.format(totalIncome)); + //投资亏损 + map.put("investOutcome",decimalFormat.format(investOutcome)); //刷卡手续费 13 map.put("posExpenses",decimalFormat.format(posExpenses)); //信用卡分期利息 14 @@ -2028,7 +2030,7 @@ public class StatisticAnalysisImpl implements IStatisticAnalysisService { //工资收入 11 map.put("salaryIncome",decimalFormat.format(salaryIncome)); //非日常支出 1 - map.put("notDailyExpenses",decimalFormat.format(totalOutcome-dailyExpenses)); + map.put("notDailyExpenses",decimalFormat.format(onLineInterest+creditInterest+posExpenses)); List queryList =new ArrayList<>();