Commit 46378a0839159dbc530cc4e686d71bdb8cf5b685
1 parent
467b803ffd
Exists in
dev
#fix:优化血糖统计管理更新逻辑
Showing 1 changed file with 6 additions and 4 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodSugarServiceImpl.java
View file @
46378a0
| ... | ... | @@ -157,10 +157,12 @@ |
| 157 | 157 | String ymd, |
| 158 | 158 | Integer sugarType){ |
| 159 | 159 | if (sugarStatistics!=null){ |
| 160 | - Update up = new Update(); | |
| 161 | - up.set("sugarType", sugarType); | |
| 162 | - up.set("modified",new Date()); | |
| 163 | - mongoTemplate.updateMulti(Query.query(Criteria.where("id").is(sugarStatistics.getId())), up, BloodSugarStatistics.class); | |
| 160 | + if (sugarType!=1){ | |
| 161 | + Update up = new Update(); | |
| 162 | + up.set("sugarType", sugarType); | |
| 163 | + up.set("modified",new Date()); | |
| 164 | + mongoTemplate.updateMulti(Query.query(Criteria.where("id").is(sugarStatistics.getId())), up, BloodSugarStatistics.class); | |
| 165 | + } | |
| 164 | 166 | }else { |
| 165 | 167 | sugarStatistics=new BloodSugarStatistics(); |
| 166 | 168 | sugarStatistics.setParentId(patients.getId()); |