Commit b4d9e94f040026b258c8bcd618f06a14b4440187
1 parent
a27bd73ebc
Exists in
master
and in
6 other branches
体重管理
Showing 1 changed file with 10 additions and 4 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
b4d9e94
... | ... | @@ -1462,9 +1462,15 @@ |
1462 | 1462 | double addWeightStart = Double.parseDouble(rangeWeight[0]); |
1463 | 1463 | double addWeightEnd = Double.parseDouble(rangeWeight[1]); |
1464 | 1464 | |
1465 | - double kstart = (beforeWeight + addWeightStart) * 25 + basekul; | |
1466 | - double kend = (beforeWeight + addWeightEnd) * 25 + basekul; | |
1465 | + BigDecimal b1 = new BigDecimal(Double.toString(addWeightStart)); | |
1466 | + BigDecimal b2 = new BigDecimal(Double.toString(addWeightEnd)); | |
1467 | + BigDecimal bw = new BigDecimal(Double.toString(beforeWeight)); | |
1468 | + double kstart = (bw.add(b1)).multiply(new BigDecimal(25)).doubleValue() + basekul; | |
1469 | + double kend = (bw.add(b2)).multiply(new BigDecimal(25)).doubleValue() + basekul; | |
1467 | 1470 | |
1471 | +// double kstart = (beforeWeight + addWeightStart) * 25 + basekul; | |
1472 | +// double kend = (beforeWeight + addWeightEnd) * 25 + basekul; | |
1473 | + | |
1468 | 1474 | status = "处于"; |
1469 | 1475 | if (addWeightEnd < add && (Double.valueOf(String.format("%.2f",add - addWeightEnd))) >= 0.5) |
1470 | 1476 | { |
... | ... | @@ -1491,8 +1497,8 @@ |
1491 | 1497 | |
1492 | 1498 | public static void main(String[] args) { |
1493 | 1499 | PatientWeightServiceImpl patientWeightService = new PatientWeightServiceImpl(); |
1494 | - String bmi = patientWeightService.getBmi("68.07", "165"); | |
1495 | - Map<String,String> map = patientWeightService.getComputeKul(68.07 , 70.43, 13, Double.parseDouble(bmi),"1"); | |
1500 | + String bmi = patientWeightService.getBmi("50", "170"); | |
1501 | + Map<String,String> map = patientWeightService.getComputeKul(50 , 59.05, 27, Double.parseDouble(bmi),"2"); | |
1496 | 1502 | System.out.println(map); |
1497 | 1503 | } |
1498 | 1504 | } |