管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2024-03-07 87149106a9fa5a2df79e8493b1f31c026cf49df1
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++);
            ce.setM2(FileHelper.getSizes(ce.getSizes()));
            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);
            ce.setM2(FileHelper.getSizes(allSize));
            if (StringUtils.isEmpty(ce.getM2())) {
                ce.setM2(FileHelper.getSizes(allSize));
            }
            ce.setM3(FileHelper.getSquareMeter(allArea));
            list.add(ce);
        }
@@ -392,14 +397,11 @@
    /**
     * 根据方法名称查询数据列表
     *
     * @param re
     * @return
     */
    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;