Commit 82d407ada50d7e970a74917f078f2819a55f4575
1 parent
1df2f671ae
Exists in
master
and in
6 other branches
体重管理
Showing 2 changed files with 13 additions and 1 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/Test.java
View file @
82d407a
... | ... | @@ -5,6 +5,7 @@ |
5 | 5 | import net.sourceforge.pinyin4j.PinyinHelper; |
6 | 6 | import org.apache.log4j.Logger; |
7 | 7 | |
8 | +import java.math.RoundingMode; | |
8 | 9 | import java.util.Comparator; |
9 | 10 | import java.util.Date; |
10 | 11 | import java.util.List; |
... | ... | @@ -151,6 +152,15 @@ |
151 | 152 | } |
152 | 153 | stopWatch.stop(); |
153 | 154 | System.out.println(stopWatch.toString());*/ |
155 | +// | |
156 | +// java.text.DecimalFormat df = new java.text.DecimalFormat("#.#"); | |
157 | +// df.setRoundingMode(RoundingMode.FLOOR); | |
158 | +// double db = Math.pow(Double.parseDouble("160") / 100, 2); | |
159 | +// db = Double.valueOf(String.format("%.2f",db)); | |
160 | +// System.out.println(db); | |
161 | +// double tzzs = Double.parseDouble("47.36") / db; | |
162 | +// System.out.println(tzzs); | |
163 | +// System.out.println(df.format(tzzs)); | |
154 | 164 | } |
155 | 165 | |
156 | 166 | public static void configData(BasicConfig bs, List<BasicConfig> basicConfigList,Map<String, List<BasicConfig>> slaveBasicConfigMap) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
82d407a
... | ... | @@ -551,7 +551,9 @@ |
551 | 551 | if(StringUtils.isNotBlank(weight) && StringUtils.isNotEmpty(height)) { |
552 | 552 | java.text.DecimalFormat df = new java.text.DecimalFormat("#.#"); |
553 | 553 | df.setRoundingMode(RoundingMode.FLOOR); |
554 | - double tzzs = Double.parseDouble(weight) / Math.pow(Double.parseDouble(height) / 100, 2); | |
554 | + double db = Math.pow(Double.parseDouble(height) / 100, 2); | |
555 | + db = Double.valueOf(String.format("%.2f",db)); | |
556 | + double tzzs = Double.parseDouble(weight) / db; | |
555 | 557 | return df.format(tzzs); |
556 | 558 | } |
557 | 559 | return ""; |