From 76888937ff6070d074896675f962d20f4551cc1b Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期一, 26 二月 2024 17:48:26 +0800 Subject: [PATCH] 添加统计数据功能 --- src/main/java/com/lf/server/service/sys/ReportService.java | 68 +++++++++++++++++++++++++++++++--- 1 files changed, 62 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/lf/server/service/sys/ReportService.java b/src/main/java/com/lf/server/service/sys/ReportService.java index 1790071..ab0863b 100644 --- a/src/main/java/com/lf/server/service/sys/ReportService.java +++ b/src/main/java/com/lf/server/service/sys/ReportService.java @@ -199,11 +199,15 @@ return; } - int rows = 1; + int rows = 1, allCount = 0; ArrayList<String[]> addList = new ArrayList<>(); for (CountEntity ce : list) { + allCount += ce.getCount(); String[] strs = new String[]{"" + rows++, ce.getM1(), ce.getM2(), ce.getCount().toString()}; addList.add(strs); + } + if (addList.size() > 0) { + addList.add(new String[]{"" + rows, "鎬昏", " ", "" + allCount}); } WordHelper.generateWord(source, target, null, addList); @@ -218,11 +222,15 @@ return; } - int rows = 1; + int rows = 1, allCount = 0; ArrayList<String[]> addList = new ArrayList<>(); for (CountEntity ce : list) { + allCount += ce.getCount(); String[] strs = new String[]{"" + rows++, ce.getM1(), ce.getCount().toString()}; addList.add(strs); + } + if (addList.size() > 0) { + addList.add(new String[]{"" + rows, "鎬昏", "" + allCount}); } WordHelper.generateWord(source, target, null, addList); @@ -238,10 +246,15 @@ } int rows = 1; + Double allSize = 0d; ArrayList<String[]> addList = new ArrayList<>(); for (CountEntity ce : list) { + allSize += ce.getSizes(); String[] strs = new String[]{"" + rows++, ce.getM1(), FileHelper.getSizes(ce.getSizes())}; addList.add(strs); + } + if (addList.size() > 0) { + addList.add(new String[]{"" + rows, "鎬昏", FileHelper.getSizes(allSize)}); } WordHelper.generateWord(source, target, null, addList); @@ -256,11 +269,17 @@ return; } - int rows = 1; + int rows = 1, allCount = 0; + Double allSize = 0d; ArrayList<String[]> addList = new ArrayList<>(); for (CountEntity ce : list) { + allSize += ce.getSizes(); + allCount += ce.getCount(); String[] strs = new String[]{"" + rows++, ce.getM1(), "" + ce.getCount(), FileHelper.getSizes(ce.getSizes())}; addList.add(strs); + } + if (addList.size() > 0) { + addList.add(new String[]{"" + rows, "鎬昏", "" + allCount, FileHelper.getSizes(allSize)}); } WordHelper.generateWord(source, target, null, addList); @@ -275,9 +294,17 @@ return; } - int rows = 1; + int rows = 1, allCount = 0; for (CountEntity ce : list) { ce.setNo(rows++); + allCount += ce.getCount(); + } + if (list.size() > 0) { + CountEntity ce = new CountEntity(); + ce.setNo(rows); + ce.setM1("鎬昏"); + ce.setCount((long) allCount); + list.add(ce); } Map<String, List<CountEntity>> map = new HashMap<>(1); @@ -295,9 +322,17 @@ return; } - int rows = 1; + int rows = 1, allCount = 0; for (CountEntity ce : list) { ce.setNo(rows++); + allCount += ce.getCount(); + } + if (list.size() > 0) { + CountEntity ce = new CountEntity(); + ce.setNo(rows); + ce.setM1("鎬昏"); + ce.setCount((long) allCount); + list.add(ce); } Map<String, List<CountEntity>> map = new HashMap<>(1); @@ -316,9 +351,18 @@ } int rows = 1; + Double allSize = 0d; for (CountEntity ce : list) { ce.setNo(rows++); ce.setM2(FileHelper.getSizes(ce.getSizes())); + allSize += ce.getSizes(); + } + if (list.size() > 0) { + CountEntity ce = new CountEntity(); + ce.setNo(rows); + ce.setM1("鎬昏"); + ce.setM2(FileHelper.getSizes(allSize)); + list.add(ce); } Map<String, List<CountEntity>> map = new HashMap<>(1); @@ -336,9 +380,21 @@ return; } - int rows = 1; + int rows = 1, allCount = 0; + Double allSize = 0d; for (CountEntity ce : list) { ce.setNo(rows++); + ce.setM2(FileHelper.getSizes(ce.getSizes())); + allCount += ce.getCount(); + allSize += ce.getSizes(); + } + if (list.size() > 0) { + CountEntity ce = new CountEntity(); + ce.setNo(rows); + ce.setM1("鎬昏"); + ce.setCount((long) allCount); + ce.setM2(FileHelper.getSizes(allSize)); + list.add(ce); } Map<String, List<CountEntity>> map = new HashMap<>(1); -- Gitblit v1.9.3