From ccb038bea3b82d6743281b8a0517c48d4413d8fa Mon Sep 17 00:00:00 2001 From: yangfei Date: Mon, 14 May 2018 17:31:03 +0800 Subject: [PATCH] =?UTF-8?q?bmi=E4=BF=9D=E7=95=99=E4=B8=A4=E4=BD=8D?= =?UTF-8?q?=E5=B0=8F=E6=95=B0=EF=BC=8C=E4=B8=8D=E8=BF=9B=E8=A1=8C=E5=9B=9B?= =?UTF-8?q?=E8=88=8D=E4=BA=94=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/lyms/platform/operate/web/facade/ViewFacade.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java index e4d33fb..704777b 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java @@ -36,6 +36,7 @@ import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Component; +import java.math.RoundingMode; import java.text.SimpleDateFormat; import java.util.*; @@ -1412,6 +1413,7 @@ public class ViewFacade { map.put("height", UnitUtils.unitSplice(data.getHeight(), UnitConstants.CM)); map.put("weight", UnitUtils.unitSplice(data.getWeight(), UnitConstants.KG)); + //bmi指数 map.put("baricIndex", data.getBaricIndex()); map.put("yqWeight", UnitUtils.unitSplice(data.getYqWeight(), UnitConstants.KG)); // 血压 @@ -1779,8 +1781,9 @@ public class ViewFacade { try { //体重指数计算规则:孕前体重/身高(单位米)的平方 java.text.DecimalFormat df = new java.text.DecimalFormat("#.#"); + df.setRoundingMode(RoundingMode.FLOOR); double tzzs = Double.parseDouble(data.getYqWeight()) / Math.pow(Double.parseDouble(data.getHeight()) / 100, 2); - System.out.println("tzzs==================" + tzzs); + System.out.println("tzzs==================" + tzzs+""); map.put("tzzs", df.format(tzzs)); } catch (Exception e) { ExceptionUtils.catchException(e, "体重指数计算错误"); -- 1.8.3.1