From 86418e86e02fdc7aa8a25eebc1069a09dc59452c Mon Sep 17 00:00:00 2001 From: wans <747101512@qq.com> Date: Mon, 25 Oct 2021 15:13:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=A7=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=95=B0=E6=8D=AE=E4=BF=9D=E5=AD=98=E5=B0=8F?= =?UTF-8?q?=E6=95=B0=E7=82=B9=E5=90=8E=E4=B8=A4=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/datarelease/DataReleaseController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/cm/systemcity/controller/datarelease/DataReleaseController.java b/src/main/java/com/cm/systemcity/controller/datarelease/DataReleaseController.java index 71da475..2a0d967 100644 --- a/src/main/java/com/cm/systemcity/controller/datarelease/DataReleaseController.java +++ b/src/main/java/com/cm/systemcity/controller/datarelease/DataReleaseController.java @@ -254,7 +254,9 @@ public class DataReleaseController extends AbstractController { nowGrade += Integer.parseInt(gradeItem.get("grade").toString()); } } - BigDecimal ratioBigDecimal = bdr.getRatio(nowGrade.doubleValue(), totalGrade.doubleValue(), 2); + BigDecimal ratioBigDecimal = new BigDecimal(( nowGrade.doubleValue() / totalGrade.doubleValue() ) * 100) + .setScale(2,BigDecimal.ROUND_HALF_UP); + //bdr.getRatio(nowGrade.doubleValue(), totalGrade.doubleValue(), 2); Map resData = new HashMap<>(4); resData.put("value",ratioBigDecimal.doubleValue()); bdr.setData(resData);