Commit 3612cdd31ee09fe64719b3c7d24288b8a26140a6
1 parent
99e09ad9d4
Exists in
master
and in
6 other branches
血糖接口提交
Showing 2 changed files with 9 additions and 9 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TemporaryBloodSugarController.java
View file @
3612cdd
... | ... | @@ -11,6 +11,7 @@ |
11 | 11 | import org.springframework.web.bind.annotation.*; |
12 | 12 | |
13 | 13 | import javax.servlet.http.HttpServletRequest; |
14 | +import javax.validation.Valid; | |
14 | 15 | import java.util.Date; |
15 | 16 | |
16 | 17 | |
... | ... | @@ -24,7 +25,7 @@ |
24 | 25 | @RequestMapping(value = "/addAndUpate", method = RequestMethod.POST) |
25 | 26 | @TokenRequired |
26 | 27 | @ResponseBody |
27 | - public BaseResponse addTempraryBloodSugar(TemporaryBloodSugar bloodSugar) { | |
28 | + public BaseResponse addTempraryBloodSugar(@Valid @RequestBody TemporaryBloodSugar bloodSugar) { | |
28 | 29 | |
29 | 30 | return bloodSugarService.addAndUpdate(bloodSugar); |
30 | 31 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TemporaryWeightServiceImpl.java
View file @
3612cdd
... | ... | @@ -93,7 +93,7 @@ |
93 | 93 | |
94 | 94 | @Override |
95 | 95 | public BaseResponse deleteTemporaryWeight(String phone) { |
96 | - mongoTemplate.updateFirst(Query.query(Criteria.where("_id").is(phone)), Update.update("yn", 1), TemporaryWeightModel.class); | |
96 | + mongoTemplate.updateFirst(Query.query(Criteria.where("_id").is(phone)), Update.update("yn", 0), TemporaryWeightModel.class); | |
97 | 97 | return RespBuilder.buildSuccess(); |
98 | 98 | } |
99 | 99 | |
100 | 100 | |
... | ... | @@ -109,10 +109,10 @@ |
109 | 109 | @Override |
110 | 110 | public BaseResponse queryAll(String key, Integer stateWeek, Integer endWeek, Integer age, Integer page, Integer limit) { |
111 | 111 | boolean flag = false; |
112 | - Criteria pCriteria = Criteria.where("yn").ne("0"); | |
113 | - Criteria criteria = Criteria.where("yn").ne("0"); | |
112 | + Criteria pCriteria = Criteria.where("yn").ne(0); | |
113 | + Criteria criteria = Criteria.where("yn").ne(0); | |
114 | 114 | if (org.apache.commons.lang.StringUtils.isNotBlank(key)) { |
115 | - pCriteria.orOperator(Criteria.where("phone").regex(key), Criteria.where("username").regex(key)); | |
115 | + pCriteria.orOperator(Criteria.where("phone").regex(key), Criteria.where("userName").regex(key)); | |
116 | 116 | flag = true; |
117 | 117 | } |
118 | 118 | if (stateWeek != null && endWeek != null) { |
119 | 119 | |
120 | 120 | |
... | ... | @@ -122,15 +122,14 @@ |
122 | 122 | flag = true; |
123 | 123 | } |
124 | 124 | if (age != null) { |
125 | - Date start = DateUtil.getBeforeAge(age); | |
126 | - pCriteria.and("age").is(start); | |
125 | + pCriteria.and("age").is(age); | |
127 | 126 | flag = true; |
128 | 127 | } |
129 | 128 | if (flag) { |
130 | - List<TemporaryBloodModel> patients = mongoTemplate.find(Query.query(pCriteria), TemporaryBloodModel.class); | |
129 | + List<TemporaryWeightModel> patients = mongoTemplate.find(Query.query(pCriteria), TemporaryWeightModel.class); | |
131 | 130 | List<String> ids = new ArrayList<>(); |
132 | 131 | if (CollectionUtils.isNotEmpty(patients)) { |
133 | - for (TemporaryBloodModel patient : patients) { | |
132 | + for (TemporaryWeightModel patient : patients) { | |
134 | 133 | ids.add(patient.getId()); |
135 | 134 | } |
136 | 135 | } |