管道基础大数据平台系统开发-【后端】-Server
13693261870
2024-03-07 e52ea4802e99c4ecbcb1e82cab05a2b29d8f97f0
解决反射调用方法出错
已修改1个文件
7 ■■■■ 文件已修改
src/main/java/com/lf/server/service/sys/ReportService.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/sys/ReportService.java
@@ -16,6 +16,7 @@
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
@@ -371,7 +372,9 @@
        Double allSize = 0d, allArea = 0d;
        for (CountEntity ce : list) {
            ce.setNo(rows++);
            if (StringUtils.isEmpty(ce.getM2())) {
            ce.setM2(FileHelper.getSizes(ce.getSizes()));
            }
            ce.setM3(FileHelper.getSquareMeter(ce.getArea()));
            allCount += ce.getCount();
            allSize += ce.getSizes();
@@ -382,7 +385,9 @@
            ce.setNo(rows);
            ce.setM1("总计");
            ce.setCount(allCount);
            if (StringUtils.isEmpty(ce.getM2())) {
            ce.setM2(FileHelper.getSizes(allSize));
            }
            ce.setM3(FileHelper.getSquareMeter(allArea));
            list.add(ce);
        }
@@ -399,7 +404,7 @@
    private List<CountEntity> selectListByMethodName(ReportEntity re) {
        List<CountEntity> list = null;
        try {
            Method method = ReportService.class.getDeclaredMethod(re.getCode(), ReportService.class);
            Method method = ReportService.class.getDeclaredMethod(re.getCode());
            Object obj = method.invoke(this);
            if (obj instanceof List<?>) {
                list = (List<CountEntity>) obj;