Commit 30c2995f8d05649c326481927b88d11b7ca85dfa
1 parent
31b53d0741
Exists in
master
and in
6 other branches
修改体重
Showing 3 changed files with 19 additions and 0 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientWeightController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/PatientWeightService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientWeightController.java
View file @
30c2995
| ... | ... | @@ -119,5 +119,11 @@ |
| 119 | 119 | return patientWeightService.wxAddOrUpdateSync(patientWeight); |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | + @ResponseBody | |
| 123 | + @RequestMapping(value = "/update", method = RequestMethod.POST) | |
| 124 | + public BaseResponse update(String id, String beforeWeight, String beforeHeight) { | |
| 125 | + return patientWeightService.update(id, beforeWeight, beforeHeight); | |
| 126 | + } | |
| 127 | + | |
| 122 | 128 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/PatientWeightService.java
View file @
30c2995
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
30c2995
| ... | ... | @@ -399,6 +399,17 @@ |
| 399 | 399 | return RespBuilder.buildSuccess(patientWeight.getId()); |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | + @Override | |
| 403 | + public BaseResponse update(String id, String beforeWeight, String beforeHeight) { | |
| 404 | + PatientWeight pw = new PatientWeight(); | |
| 405 | + pw.setId(id); | |
| 406 | + pw.setBeforeHeight(beforeHeight); | |
| 407 | + pw.setBeforeWeight(beforeWeight); | |
| 408 | + pw.setBmi(getBmi(beforeWeight, beforeHeight)); | |
| 409 | + patientWeightService2.update(Query.query(Criteria.where("id").is(id)), pw); | |
| 410 | + return RespBuilder.buildSuccess(id); | |
| 411 | + } | |
| 412 | + | |
| 402 | 413 | private void setGuide(Integer week, Map<String, Object> map) { |
| 403 | 414 | if(week <= 12) { |
| 404 | 415 | Map<String, Object> map1 = setData2("膳食清淡、适口", "避免过咸、过甜和油腻的食物,这样能增加食欲,易于消化,有利于降低怀孕早期的妊娠反应,满足营养的需要。每日盐不超过6克,油不超过20克,可食用植物油,少用动物油。"); |