From b6b0cb226fcf184525ee7b36af3a09471e9c0057 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期一, 25 三月 2024 11:29:33 +0800 Subject: [PATCH] 修改数据统计的查询条件 --- src/main/java/com/lf/server/service/sys/ReportService.java | 19 +++++++++++++++---- 1 files changed, 15 insertions(+), 4 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 3ca486a..24a32ad 100644 --- a/src/main/java/com/lf/server/service/sys/ReportService.java +++ b/src/main/java/com/lf/server/service/sys/ReportService.java @@ -251,7 +251,7 @@ @Override public List<CountEntity> countVariousDataByPrj(String code) { - code = StringHelper.getRightLike(code); + code = StringUtils.isEmpty(code) || "ALL".equals(code) ? null : StringHelper.getRightLike(code); return reportMapper.countVariousDataByPrj(code); } @@ -355,6 +355,7 @@ Map<String, String> textMap = new HashMap<>(); if (!StringHelper.isEmpty(code)) { textMap.put("title", dirService.selectNameByCode(code)); + list.remove(list.size() - 1); } List<String[]> tableList = new ArrayList<>(); @@ -386,7 +387,7 @@ tableList.add(new String[]{"" + ce.getNo(), ce.getM1(), "" + ce.getLen()}); break; case "countVariousDataByPrj": - String str = "count".equals(ce.getM2()) ? "" + ce.getCount() : ("area".equals(ce.getM2()) ? "" + ce.getArea() : "" + ce.getLen()); + String str = "count".equals(ce.getM2()) ? ce.getCount() + "涓�" : ("area".equals(ce.getM2()) ? ce.getM3() : ce.getLen() + "鍗冪背"); tableList.add(new String[]{"" + ce.getNo(), ce.getM1(), str}); break; default: @@ -408,6 +409,10 @@ Map<String, Object> map = new HashMap<>(); if (!StringHelper.isEmpty(code)) { map.put("title", dirService.selectNameByCode(code)); + list.remove(list.size() - 1); + for (CountEntity ce : list) { + ce.setM2("count".equals(ce.getM2()) ? ce.getCount() + "涓�" : ("area".equals(ce.getM2()) ? ce.getM3() : ce.getLen() + "鍗冪背")); + } } Map<String, List<CountEntity>> listMap = new HashMap<>(1); @@ -460,8 +465,14 @@ private List<CountEntity> selectListByMethodName(ReportEntity re, String code) { List<CountEntity> list = null; try { - Method method = ReportService.class.getDeclaredMethod(re.getCode()); - Object obj = "countVariousDataByPrj".equals(re.getCode()) ? method.invoke(this, code) : method.invoke(this); + Object obj; + if (null != code) { + Method method = ReportService.class.getDeclaredMethod(re.getCode(), String.class); + obj = method.invoke(this, code); + } else { + Method method = ReportService.class.getDeclaredMethod(re.getCode()); + obj = method.invoke(this); + } if (obj instanceof List<?>) { list = (List<CountEntity>) obj; } -- Gitblit v1.9.3