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 946bcdc..92045f8 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 @@ -2255,7 +2255,8 @@ public class StatisticAnalysisImpl implements IStatisticAnalysisService { dto.setAccountId(analysisDto.getId()); dto.setChildCategory(analysisDto.getChildCategory()); List accountsDealRecordVoList=statisticAnalysisMapper.selectDailyExpensesList(dto); - + //日常支出 1 + double dailyExpenses=0; for (AccountsDealRecordVo vo:accountsDealRecordVoList ){ if (null != vo.getChildCategory()) { @@ -2263,10 +2264,35 @@ public class StatisticAnalysisImpl implements IStatisticAnalysisService { }else{ vo.setName("未分类"); } + dailyExpenses+=vo.getAmount(); + } + //日常支出总额 + map.put("dailyExpenses",decimalFormat.format(dailyExpenses)); + if(accountsDealRecordVoList.size()>0){ + map.put("top1Name",accountsDealRecordVoList.get(0).getName()); + map.put("top1",accountsDealRecordVoList.get(0).getAmount()); + } + if(accountsDealRecordVoList.size()>1){ + map.put("top2Name",accountsDealRecordVoList.get(1).getName()); + map.put("top2",accountsDealRecordVoList.get(1).getAmount()); + } + if(accountsDealRecordVoList.size()>2){ + map.put("top3Name",accountsDealRecordVoList.get(2).getName()); + map.put("top3",accountsDealRecordVoList.get(2).getAmount()); + } + if(accountsDealRecordVoList.size()>3){ + map.put("top4Name",accountsDealRecordVoList.get(3).getName()); + map.put("top4",accountsDealRecordVoList.get(3).getAmount()); + } + if(accountsDealRecordVoList.size()>4){ + map.put("top5Name",accountsDealRecordVoList.get(4).getName()); + map.put("top5",accountsDealRecordVoList.get(4).getAmount()); + } + if(accountsDealRecordVoList.size()>5){ + map.put("top6Name",accountsDealRecordVoList.get(5).getName()); + map.put("top6",accountsDealRecordVoList.get(5).getAmount()); } - ArrayList> acccountsList = new ArrayList<>(); - Collections.reverse(accountsDealRecordVoList); for (AccountsDealRecordVo vo:accountsDealRecordVoList ) { Map datamap = new HashMap<>(); diff --git a/ruoyi-modules/intc-invest/src/main/resources/mapper/invest/StatisticAnalysisMapper.xml b/ruoyi-modules/intc-invest/src/main/resources/mapper/invest/StatisticAnalysisMapper.xml index 489eab0..e2e2dd9 100644 --- a/ruoyi-modules/intc-invest/src/main/resources/mapper/invest/StatisticAnalysisMapper.xml +++ b/ruoyi-modules/intc-invest/src/main/resources/mapper/invest/StatisticAnalysisMapper.xml @@ -173,6 +173,6 @@ ${params.dataScope} group by a.child_category - order by sum(a.amount) asc + order by sum(a.amount) desc \ No newline at end of file