管道基础大数据平台系统开发-【后端】-Server
13693261870
2024-02-29 bc751e01e35da60e41db39501058aeddf3840ad9
修改钻孔数据报告生成功能
已修改4个文件
31 ■■■■ 文件已修改
src/main/java/com/lf/server/controller/all/BaseQueryController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/all/StaticData.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/helper/FileHelper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/sys/ReportService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/all/BaseQueryController.java
@@ -203,7 +203,7 @@
            if (null == limit || limit < 1 || limit > StaticData.I100) {
                limit = 20;
            }
            if (null == buffer || buffer < 0 || buffer > StaticData.ONE_HUNDRED_THOUSAND) {
            if (null == buffer || buffer < 0 || buffer > StaticData.I100000) {
                buffer = 10.0;
            }
src/main/java/com/lf/server/entity/all/StaticData.java
@@ -32,7 +32,9 @@
    public final static int TWO_HUNDRED = 200;
    public final static int ONE_HUNDRED_THOUSAND = 100000;
    public final static int I100000 = 100000;
    public final static int I1000000 = 1000000;
    public static final double D90 = 90.0;
src/main/java/com/lf/server/helper/FileHelper.java
@@ -208,6 +208,19 @@
    }
    /**
     * 获取平方米
     */
    public static String getSquareMeter(double num) {
        if (num < StaticData.I1000000) {
            return new DecimalFormat("#.##平方米").format(num);
        }
        double knum = num / StaticData.I1000000;
        return new DecimalFormat("#.##平方千米").format(knum);
    }
    /**
     * byte转MB
     */
    public static double sizeToMb(long size) {
src/main/java/com/lf/server/service/sys/ReportService.java
@@ -359,16 +359,17 @@
        }
        int rows = 1, allCount = 0;
        Double allSize = 0d;
        Double allSize = 0d, allArea = 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())};
            allArea += ce.getArea();
            String[] strs = new String[]{"" + rows++, ce.getM1(), "" + ce.getCount(), FileHelper.getSizes(ce.getSizes()), FileHelper.getSquareMeter(ce.getArea())};
            addList.add(strs);
        }
        if (addList.size() > 0) {
            addList.add(new String[]{"" + rows, "总计", "" + allCount, FileHelper.getSizes(allSize)});
            addList.add(new String[]{"" + rows, "总计", "" + allCount, FileHelper.getSizes(allSize), FileHelper.getSquareMeter(allArea)});
        }
        WordHelper.generateWord(source, target, null, addList);
@@ -520,12 +521,14 @@
        }
        int rows = 1, allCount = 0;
        Double allSize = 0d;
        Double allSize = 0d, allArea = 0d;
        for (CountEntity ce : list) {
            ce.setNo(rows++);
            ce.setM2(FileHelper.getSizes(ce.getSizes()));
            ce.setM3(FileHelper.getSquareMeter(ce.getArea()));
            allCount += ce.getCount();
            allSize += ce.getSizes();
            allArea += ce.getArea();
        }
        if (list.size() > 0) {
            CountEntity ce = new CountEntity();
@@ -533,6 +536,7 @@
            ce.setM1("总计");
            ce.setCount((long) allCount);
            ce.setM2(FileHelper.getSizes(allSize));
            ce.setM3(FileHelper.getSquareMeter(allArea));
            list.add(ce);
        }