From e40e5235b571cfb8d3eeca93109d34d0bcdcdf0d Mon Sep 17 00:00:00 2001 From: liujie <1793218484@qq.com> Date: 星期四, 05 六月 2025 09:09:54 +0800 Subject: [PATCH] 调整参数 --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TScreenContentServiceImpl.java | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TScreenContentServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TScreenContentServiceImpl.java index 3dd359e..9fc1fe5 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TScreenContentServiceImpl.java +++ b/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 -- Gitblit v1.7.1