From 0e15a04ed4354aab738256d23573305bea97e0b5 Mon Sep 17 00:00:00 2001 From: Administrator <184677810@qq.com> Date: Tue, 19 Nov 2019 10:54:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=93=E9=87=8D=E6=8A=A5=E5=91=8A=E8=BA=AB?= =?UTF-8?q?=E9=AB=98=E5=AD=97=E6=AE=B5=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operate/web/controller/PatientWeightController.java | 3 ++- .../web/service/impl/PatientWeightServiceImpl.java | 15 +++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientWeightController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientWeightController.java index d985d82..521b105 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientWeightController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientWeightController.java @@ -98,7 +98,8 @@ public class PatientWeightController extends BaseController { @RequestParam(value = "beforeWeight", required = false) String beforeWeight, @RequestParam(value = "bregmatic", required = false) String bregmatic, @RequestParam(value = "bregmaticOther", required = false) String bregmaticOther, - @RequestParam(value = "height", required = false) String height, String version) { + @RequestParam(value = "height", required = false) String height, + String version) { return patientWeightService.report(id, getUserId(request), rid, version, doctorId, beforeWeight, height, bregmatic, bregmaticOther); } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java index e0dcffa..c6f8616 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java @@ -645,16 +645,11 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient if (patientWeight != null && StringUtils.isNotEmpty(beforeWeight) && StringUtils.isNotEmpty(patientWeight.getBeforeHeight())) { isUpdate = true; patientWeightBefore.setBeforeWeight(beforeWeight); - if (StringUtils.isNotEmpty(height)) { - String bmi = getBmi(beforeWeight, height); - patientWeightBefore.setBmi(bmi); - patientWeight.setBmi(bmi); - } else { - String bmi = getBmi(beforeWeight, patientWeight.getBeforeHeight()); - patientWeightBefore.setBmi(bmi); - patientWeight.setBmi(bmi); - } + String bmi = getBmi(beforeWeight, height); + patientWeightBefore.setBmi(bmi); + patientWeight.setBmi(bmi); + patientWeight.setBeforeHeight(height); patientWeight.setBeforeWeight(beforeWeight); } @@ -686,7 +681,7 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient PatientWeight patientWeight = mongoTemplate.findById(id, PatientWeight.class); - updateWeight(beforeWeight, patientWeight, height, bregmatic, bregmaticOther); + updateWeight(beforeWeight, patientWeight, bregmatic, bregmaticOther, height); if (patientWeight != null) { Map map = new LinkedHashMap<>(); -- 1.8.3.1