Commit 1af226727fcaabe374ad583181d8e6586cdb137c
1 parent
4d753dfa47
Exists in
dev
#fix:优化临时血糖管理
Showing 1 changed file with 17 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TemporaryBloodSugarServiceImpl.java
View file @
1af2267
... | ... | @@ -69,6 +69,7 @@ |
69 | 69 | @Override |
70 | 70 | public BaseResponse addAndUpdate(TemporaryBloodSugar bloodSugar, Integer userId) { |
71 | 71 | TemporaryBloodSugar one = mongoTemplate.findOne(Query.query(Criteria.where("temporaryUserId").is(bloodSugar.getTemporaryUserId()).and("created").gt(DateUtil.getYMDTime()).and("bloodSugarType").is(bloodSugar.getBloodSugarType())), TemporaryBloodSugar.class); |
72 | + | |
72 | 73 | if (one != null) { |
73 | 74 | one.setModified(new Date()); |
74 | 75 | one.setBloodSugar(bloodSugar.getBloodSugar()); |
75 | 76 | |
... | ... | @@ -79,9 +80,25 @@ |
79 | 80 | if(null!=bloodSugar.getIsPrint()){ |
80 | 81 | one.setIsPrint(bloodSugar.getIsPrint()); |
81 | 82 | } |
83 | + String str= getBloodSugarStatus(one.getBloodSugarType(), one.getBloodSugar()); | |
84 | + Integer type=1; | |
85 | + if (str.equals("高血糖")){ | |
86 | + type=3; | |
87 | + }else if (str.equals("低血糖")){ | |
88 | + type=2; | |
89 | + } | |
90 | + one.setSugarType(type); | |
82 | 91 | temporaryBloodSugarDao.updateTemporaryBloodSugar(Query.query(Criteria.where("_id").is(one.getId())), one); |
83 | 92 | return RespBuilder.buildSuccess(one.getId()); |
84 | 93 | } |
94 | + String str= getBloodSugarStatus(bloodSugar.getBloodSugarType(), bloodSugar.getBloodSugar()); | |
95 | + Integer type=1; | |
96 | + if (str.equals("高血糖")){ | |
97 | + type=3; | |
98 | + }else if (str.equals("低血糖")){ | |
99 | + type=2; | |
100 | + } | |
101 | + bloodSugar.setSugarType(type); | |
85 | 102 | bloodSugar.setHospitalId(autoMatchFacade.getHospitalId(userId)); |
86 | 103 | bloodSugar.setCreated(new Date()); |
87 | 104 | bloodSugar.setYn(YnEnums.YES.getId()); |