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 b73538f..005845b 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 @@ -338,7 +338,8 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient // Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(pw)); // mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(pw.getId())), update, PatientWeight.class); patientWeightService2.update(Query.query(Criteria.where("id").is(pw.getId())), pw); - return RespBuilder.buildSuccess(pw.getId()); +// return RespBuilder.buildSuccess(pw.getId()); + return RespBuilder.buildSuccess(pw); } if(StringUtils.isEmpty(patientWeight.getId()) && patients != null) { @@ -351,7 +352,7 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient patientWeight.setPid(patients.getPid()); // mongoTemplate.save(patientWeight); patientWeightService2.add(patientWeight); - return RespBuilder.buildSuccess(patientWeight.getId()); + return RespBuilder.buildSuccess(patientWeight); } else { // Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(patientWeight)); // mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(patientWeight.getId())), update, PatientWeight.class); @@ -385,10 +386,10 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient return RespBuilder.buildSuccess(pw.getId()); } - if(StringUtils.isEmpty(patientWeight.getId()) && patients != null) { + if(patients != null) { patientWeight.setCreated(new Date()); patientWeight.setHospitalId(patients.getHospitalId()); - if(StringUtils.isNotBlank(patientWeight.getNowWeight()) && patientWeight.getBeforeHeight() != null) { + if (StringUtils.isNotBlank(patientWeight.getNowWeight()) && patientWeight.getBeforeHeight() != null) { patientWeight.setBmi(getBmi(patientWeight.getNowWeight(), patientWeight.getBeforeHeight())); } patientWeight.setYn("1"); @@ -396,12 +397,8 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient mongoTemplate.save(patientWeight); // patientWeightService2.add(patientWeight); return RespBuilder.buildSuccess(patientWeight.getId()); - } else { - Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(patientWeight)); - mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(patientWeight.getId())), update, PatientWeight.class); -// patientWeightService2.update(Query.query(Criteria.where("id").is(patientWeight.getId())), patientWeight); - return RespBuilder.buildSuccess(patientWeight.getId()); } + return RespBuilder.buildSuccess("patients为null"); } private void setGuide(Integer week, Map map) {