Commit e42c66df26b84d70f98245b0b0bbf312b48f43d0
1 parent
f2f5707b94
Exists in
master
and in
6 other branches
123
Showing 1 changed file with 4 additions and 2 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodSugarServiceImpl.java
View file @
e42c66d
... | ... | @@ -46,7 +46,8 @@ |
46 | 46 | |
47 | 47 | |
48 | 48 | public BaseResponse add(Integer userId, BloodSugar bloodSugar) { |
49 | - BloodSugar one = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(bloodSugar.getParentId()).and("created").gt(DateUtil.getYMDTime()).and("bloodSugarType").is(bloodSugar.getBloodSugarType())), BloodSugar.class); | |
49 | +// BloodSugar one = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(bloodSugar.getParentId()).and("created").gt(DateUtil.getYMDTime()).and("bloodSugarType").is(bloodSugar.getBloodSugarType())), BloodSugar.class); | |
50 | + BloodSugar one = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(mongoUtil.getPid(bloodSugar.getParentId())).and("created").gt(DateUtil.getYMDTime()).and("bloodSugarType").is(bloodSugar.getBloodSugarType())), BloodSugar.class); | |
50 | 51 | if(one != null) { |
51 | 52 | one.setModified(new Date()); |
52 | 53 | one.setBloodSugar(bloodSugar.getBloodSugar()); |
... | ... | @@ -203,7 +204,8 @@ |
203 | 204 | |
204 | 205 | @Override |
205 | 206 | public BaseResponse wxAdd(String parentId, String bloodSugar, Integer bloodSugarType) { |
206 | - BloodSugar one = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(parentId).and("created").gt(DateUtil.getYMDTime()).and("bloodSugarType").is(bloodSugarType)), BloodSugar.class); | |
207 | + BloodSugar one = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(mongoUtil.getPid(parentId)).and("created").gt(DateUtil.getYMDTime()).and("bloodSugarType").is(bloodSugarType)), BloodSugar.class); | |
208 | +// BloodSugar one = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(parentId).and("created").gt(DateUtil.getYMDTime()).and("bloodSugarType").is(bloodSugarType)), BloodSugar.class); | |
207 | 209 | if(one != null) { |
208 | 210 | one.setModified(new Date()); |
209 | 211 | one.setBloodSugar(bloodSugar); |