Commit 82ed32ce8f1ff854a18b022f38b7370801d9e18d
1 parent
5908a8c189
Exists in
master
and in
6 other branches
血糖相关接口
Showing 2 changed files with 19 additions and 1 deletions
platform-dal/src/main/java/com/lyms/platform/pojo/BloodSugar.java
View file @
82ed32c
... | ... | @@ -28,12 +28,22 @@ |
28 | 28 | |
29 | 29 | private String hospitalId; |
30 | 30 | |
31 | + private Date modified; | |
32 | + | |
31 | 33 | /** |
32 | 34 | * 血糖 |
33 | 35 | */ |
34 | 36 | private String bloodSugar; |
35 | 37 | |
36 | 38 | private Integer bloodSugarType; |
39 | + | |
40 | + public Date getModified() { | |
41 | + return modified; | |
42 | + } | |
43 | + | |
44 | + public void setModified(Date modified) { | |
45 | + this.modified = modified; | |
46 | + } | |
37 | 47 | |
38 | 48 | public String getCreatYmdDate() { |
39 | 49 | return creatYmdDate; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodSugarServiceImpl.java
View file @
82ed32c
... | ... | @@ -15,7 +15,6 @@ |
15 | 15 | import com.lyms.platform.operate.web.service.IBloodSugarService; |
16 | 16 | import com.lyms.platform.operate.web.utils.CollectionUtils; |
17 | 17 | import com.lyms.platform.operate.web.utils.MongoUtil; |
18 | -import com.lyms.platform.pojo.BloodPressure; | |
19 | 18 | import com.lyms.platform.pojo.BloodSugar; |
20 | 19 | import com.lyms.platform.pojo.Patients; |
21 | 20 | import org.springframework.beans.factory.annotation.Autowired; |
22 | 21 | |
... | ... | @@ -47,10 +46,18 @@ |
47 | 46 | |
48 | 47 | |
49 | 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); | |
50 | + if(one != null) { | |
51 | + one.setModified(new Date()); | |
52 | + one.setBloodSugar(bloodSugar.getBloodSugar()); | |
53 | + bloodSugarService.update(one); | |
54 | + return RespBuilder.buildSuccess(one.getId()); | |
55 | + } | |
50 | 56 | bloodSugar.setHospitalId(autoMatchFacade.getHospitalId(userId)); |
51 | 57 | bloodSugar.setCreated(new Date()); |
52 | 58 | bloodSugar.setCreateUser(userId); |
53 | 59 | bloodSugar.setYn(YnEnums.YES.getId()); |
60 | + bloodSugar.setModified(new Date()); | |
54 | 61 | bloodSugar.setCreatYmdDate(DateUtil.getyyyy_MM_dd(new Date())); |
55 | 62 | bloodSugarService.add(bloodSugar); |
56 | 63 | return RespBuilder.buildSuccess(bloodSugar.getId()); |
... | ... | @@ -78,6 +85,7 @@ |
78 | 85 | temp.put("dueDate", DateUtil.getyyyy_MM_dd(p.getDueDate())); |
79 | 86 | temp.put("bloodSugar", bloodSugar.getBloodSugar() + "mmol/L"); |
80 | 87 | temp.put("bloodSugarType", BloodSugarEnums.getName(bloodSugar.getBloodSugarType())); |
88 | + temp.put("bloodSugarId", bloodSugar.getBloodSugarType()); | |
81 | 89 | temp.put("status", getBloodSugarStatus(bloodSugar.getBloodSugarType(), bloodSugar.getBloodSugar())); |
82 | 90 | temp.put("vcCardNo", p.getVcCardNo()); |
83 | 91 | temp.put("pcerteTypeId", p.getPcerteTypeId()); |