Commit 8837d8630fe36f338096cdcd73f2cb90369743ff

Authored by liquanyu
1 parent 926b18d9b3

体重管理

Showing 1 changed file with 5 additions and 4 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java View file @ 8837d86
... ... @@ -1331,6 +1331,7 @@
1331 1331 String status = "";
1332 1332  
1333 1333 double add = currentWeight.subtract(beforeWeight).doubleValue();
  1334 + add = Math.round(add * 100) * 0.01;
1334 1335 //孕早期
1335 1336 if (week <= 12)
1336 1337 {
1337 1338  
... ... @@ -1385,13 +1386,13 @@
1385 1386 double kend = (beforeWeight.add(new BigDecimal(addWeightEnd)).doubleValue()) * 25 + basekul;
1386 1387  
1387 1388 status = "处于";
1388   - if (addWeightEnd < add && (add - addWeightEnd) > 0.5)
  1389 + if (addWeightEnd < add && (add - addWeightEnd) >= 0.5)
1389 1390 {
1390 1391 status = "高于";
1391 1392 kstart -= 500;
1392 1393 kend -= 500;
1393 1394 }
1394   - else if (addWeightStart > add && (addWeightStart - add) > 0.5)
  1395 + else if (addWeightStart > add && (addWeightStart - add) >= 0.5)
1395 1396 {
1396 1397 status = "低于";
1397 1398 kstart += 500;
... ... @@ -1410,8 +1411,8 @@
1410 1411  
1411 1412 public static void main(String[] args) {
1412 1413 PatientWeightServiceImpl patientWeightService = new PatientWeightServiceImpl();
1413   - String bmi = patientWeightService.getBmi("49", "150");
1414   - Map<String,String> map = patientWeightService.getComputeKul(49 , 51.7, 16, Double.parseDouble(bmi));
  1414 + String bmi = patientWeightService.getBmi("77.52", "161");
  1415 + Map<String,String> map = patientWeightService.getComputeKul(77.52 , 85.58, 39, Double.parseDouble(bmi));
1415 1416 System.out.println(map);
1416 1417  
1417 1418 // double kulStart = 750;