Commit f207d9dd84f64550dc7a4a55fc9cc236fe06b37f
1 parent
48994baf48
Exists in
master
and in
6 other branches
体重管理修改接口
Showing 3 changed files with 12 additions and 7 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 @
f207d9d
| ... | ... | @@ -122,8 +122,8 @@ |
| 122 | 122 | @ResponseBody |
| 123 | 123 | @RequestMapping(value = "/update", method = RequestMethod.POST) |
| 124 | 124 | @TokenRequired |
| 125 | - public BaseResponse update(String id, String beforeWeight, String beforeHeight, String date, String nowWeight, HttpServletRequest request) { | |
| 126 | - return patientWeightService.update(getUserId(request), id, beforeWeight, beforeHeight, date, nowWeight); | |
| 125 | + public BaseResponse update(String id, String beforeWeight, String beforeHeight, String date, String nowWeight, HttpServletRequest request, String bregmatic, String bregmaticOther) { | |
| 126 | + return patientWeightService.update(getUserId(request), id, beforeWeight, beforeHeight, date, nowWeight, bregmatic, bregmaticOther); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/PatientWeightService.java
View file @
f207d9d
| ... | ... | @@ -27,6 +27,6 @@ |
| 27 | 27 | |
| 28 | 28 | BaseResponse wxAddOrUpdateSync(PatientWeight patientWeight); |
| 29 | 29 | |
| 30 | - BaseResponse update(Integer userId, String id, String beforeWeight, String beforeHeight, String date, String nowWeight); | |
| 30 | + BaseResponse update(Integer userId, String id, String beforeWeight, String beforeHeight, String date, String nowWeight, String bregmatic, String bregmaticOther); | |
| 31 | 31 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
f207d9d
| ... | ... | @@ -8,7 +8,6 @@ |
| 8 | 8 | import com.lyms.platform.common.result.RespBuilder; |
| 9 | 9 | import com.lyms.platform.common.result.ResponseCode; |
| 10 | 10 | import com.lyms.platform.common.utils.*; |
| 11 | -import com.lyms.platform.operate.web.facade.AntenatalExaminationFacade; | |
| 12 | 11 | import com.lyms.platform.operate.web.facade.AutoMatchFacade; |
| 13 | 12 | import com.lyms.platform.operate.web.service.PatientWeightService; |
| 14 | 13 | import com.lyms.platform.operate.web.utils.CollectionUtils; |
| ... | ... | @@ -110,7 +109,7 @@ |
| 110 | 109 | dayWeights2 = pw.getDayWeights2(); |
| 111 | 110 | } |
| 112 | 111 | for (Map<String, Object> map : dayWeights2) { |
| 113 | - if(map.containsKey(ymdDate)) { | |
| 112 | + if(map.get("date").equals(ymdDate)) { | |
| 114 | 113 | flag = false; |
| 115 | 114 | map.put("hospitalId", hospitalId); |
| 116 | 115 | map.put("hospitalName", couponMapper.getHospitalName(hospitalId)); |
| ... | ... | @@ -439,7 +438,7 @@ |
| 439 | 438 | } |
| 440 | 439 | |
| 441 | 440 | @Override |
| 442 | - public BaseResponse update(Integer userId, String id, String beforeWeight, String beforeHeight, String date, String nowWeight) { | |
| 441 | + public BaseResponse update(Integer userId, String id, String beforeWeight, String beforeHeight, String date, String nowWeight, String bregmatic, String bregmaticOther) { | |
| 443 | 442 | PatientWeight patientWeight = mongoTemplate.findById(id, PatientWeight.class); |
| 444 | 443 | if(patientWeight == null) { |
| 445 | 444 | return RespBuilder.buildSuccess("该体重未找到"); |
| 446 | 445 | |
| ... | ... | @@ -454,10 +453,16 @@ |
| 454 | 453 | if(StringUtils.isNotEmpty(nowWeight)) { |
| 455 | 454 | patientWeight.setNowWeight(nowWeight); |
| 456 | 455 | } |
| 456 | + if(StringUtils.isNotEmpty(bregmatic)) { | |
| 457 | + patientWeight.setBregmatic(bregmatic); | |
| 458 | + } | |
| 459 | + if(StringUtils.isNotEmpty(bregmaticOther)) { | |
| 460 | + patientWeight.setBregmaticOther(bregmaticOther); | |
| 461 | + } | |
| 457 | 462 | if(StringUtils.isNotEmpty(date)) { |
| 458 | 463 | List<Map<String, Object>> dayWeights2 = patientWeight.getDayWeights2(); |
| 459 | 464 | for (Map<String, Object> map : dayWeights2) { |
| 460 | - if(date.equals(map.get("date") + "")) { | |
| 465 | + if(date.equals(map.get("date"))) { | |
| 461 | 466 | map.put("hospitalId", hospitalId); |
| 462 | 467 | map.put("hospitalName", couponMapper.getHospitalName(hospitalId)); |
| 463 | 468 | map.put("nowWeight", nowWeight); |