管道基础大数据平台系统开发-【后端】-Server
13693261870
2024-03-21 b20fd29dc3864405af4afa0aeb99d13d74fbfcdc
src/main/java/com/lf/server/service/sys/ReportService.java
@@ -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;
            }