Commit 890c6fdafa857200ac05470a0437ecb302aeb1d3
1 parent
55d01d6cc1
Exists in
master
and in
6 other branches
加序列化
Showing 1 changed file with 6 additions and 9 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
890c6fd
| ... | ... | @@ -338,7 +338,8 @@ |
| 338 | 338 | // Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(pw)); |
| 339 | 339 | // mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(pw.getId())), update, PatientWeight.class); |
| 340 | 340 | patientWeightService2.update(Query.query(Criteria.where("id").is(pw.getId())), pw); |
| 341 | - return RespBuilder.buildSuccess(pw.getId()); | |
| 341 | +// return RespBuilder.buildSuccess(pw.getId()); | |
| 342 | + return RespBuilder.buildSuccess(pw); | |
| 342 | 343 | } |
| 343 | 344 | |
| 344 | 345 | if(StringUtils.isEmpty(patientWeight.getId()) && patients != null) { |
| ... | ... | @@ -351,7 +352,7 @@ |
| 351 | 352 | patientWeight.setPid(patients.getPid()); |
| 352 | 353 | // mongoTemplate.save(patientWeight); |
| 353 | 354 | patientWeightService2.add(patientWeight); |
| 354 | - return RespBuilder.buildSuccess(patientWeight.getId()); | |
| 355 | + return RespBuilder.buildSuccess(patientWeight); | |
| 355 | 356 | } else { |
| 356 | 357 | // Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(patientWeight)); |
| 357 | 358 | // mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(patientWeight.getId())), update, PatientWeight.class); |
| 358 | 359 | |
| ... | ... | @@ -385,10 +386,10 @@ |
| 385 | 386 | return RespBuilder.buildSuccess(pw.getId()); |
| 386 | 387 | } |
| 387 | 388 | |
| 388 | - if(StringUtils.isEmpty(patientWeight.getId()) && patients != null) { | |
| 389 | + if(patients != null) { | |
| 389 | 390 | patientWeight.setCreated(new Date()); |
| 390 | 391 | patientWeight.setHospitalId(patients.getHospitalId()); |
| 391 | - if(StringUtils.isNotBlank(patientWeight.getNowWeight()) && patientWeight.getBeforeHeight() != null) { | |
| 392 | + if (StringUtils.isNotBlank(patientWeight.getNowWeight()) && patientWeight.getBeforeHeight() != null) { | |
| 392 | 393 | patientWeight.setBmi(getBmi(patientWeight.getNowWeight(), patientWeight.getBeforeHeight())); |
| 393 | 394 | } |
| 394 | 395 | patientWeight.setYn("1"); |
| 395 | 396 | |
| ... | ... | @@ -396,12 +397,8 @@ |
| 396 | 397 | mongoTemplate.save(patientWeight); |
| 397 | 398 | // patientWeightService2.add(patientWeight); |
| 398 | 399 | return RespBuilder.buildSuccess(patientWeight.getId()); |
| 399 | - } else { | |
| 400 | - Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(patientWeight)); | |
| 401 | - mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(patientWeight.getId())), update, PatientWeight.class); | |
| 402 | -// patientWeightService2.update(Query.query(Criteria.where("id").is(patientWeight.getId())), patientWeight); | |
| 403 | - return RespBuilder.buildSuccess(patientWeight.getId()); | |
| 404 | 400 | } |
| 401 | + return RespBuilder.buildSuccess("patients为null"); | |
| 405 | 402 | } |
| 406 | 403 | |
| 407 | 404 | private void setGuide(Integer week, Map<String, Object> map) { |