liujie
2 天以前 e40e5235b571cfb8d3eeca93109d34d0bcdcdf0d
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TScreenContentServiceImpl.java
@@ -101,9 +101,9 @@
        BigDecimal total = vo.getPhotovoltaic().add(vo.getEnergyStorage()).add(vo.getCharge());
        vo.setTotal(total);
        //计算比率
        vo.setPhotovoltaicRate(calculateRatio(vo.getPhotovoltaic(),vo.getTotal()));
        vo.setEnergyStorageRate(calculateRatio(vo.getEnergyStorage(),vo.getTotal()));
        vo.setChargeRate(calculateRatio(vo.getCharge(),vo.getTotal()));
        vo.setPhotovoltaicRate(calculateRatio(vo.getPhotovoltaic(),vo.getTotal()).multiply(new BigDecimal("100")));
        vo.setEnergyStorageRate(calculateRatio(vo.getEnergyStorage(),vo.getTotal()).multiply(new BigDecimal("100")));
        vo.setChargeRate(calculateRatio(vo.getCharge(),vo.getTotal()).multiply(new BigDecimal("100")));
        return vo;
    }
@@ -119,7 +119,7 @@
            throw new ArithmeticException("分母不能为零");
        }
        return part.divide(total, 2, RoundingMode.HALF_UP);
        return part.divide(total, 4, RoundingMode.HALF_UP);
    }
    @Override