Commit 470fd5be7aeb1af4628e41a248959fa3d583452e
1 parent
9f3dc8c730
Exists in
master
and in
6 other branches
123
Showing 5 changed files with 32 additions and 1 deletions
- platform-dal/src/main/java/com/lyms/platform/pojo/BloodPressure.java
- platform-dal/src/main/java/com/lyms/platform/pojo/BloodSugar.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodPressureServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodSugarServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/MongoUtil.java
platform-dal/src/main/java/com/lyms/platform/pojo/BloodPressure.java
View file @
470fd5b
| ... | ... | @@ -19,6 +19,8 @@ |
| 19 | 19 | |
| 20 | 20 | private String parentId; |
| 21 | 21 | |
| 22 | + private String pid; | |
| 23 | + | |
| 22 | 24 | private Date created; |
| 23 | 25 | |
| 24 | 26 | private Date modified; |
| ... | ... | @@ -35,6 +37,14 @@ |
| 35 | 37 | private String ssy; |
| 36 | 38 | // ่ๆ |
| 37 | 39 | private Integer pulse; |
| 40 | + | |
| 41 | + public String getPid() { | |
| 42 | + return pid; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public void setPid(String pid) { | |
| 46 | + this.pid = pid; | |
| 47 | + } | |
| 38 | 48 | |
| 39 | 49 | private Map<String, Map<String, Object>> infos; |
| 40 | 50 |
platform-dal/src/main/java/com/lyms/platform/pojo/BloodSugar.java
View file @
470fd5b
| ... | ... | @@ -18,6 +18,8 @@ |
| 18 | 18 | |
| 19 | 19 | private String parentId; |
| 20 | 20 | |
| 21 | + private String pid; | |
| 22 | + | |
| 21 | 23 | private Date created; |
| 22 | 24 | |
| 23 | 25 | private String creatYmdDate; |
| ... | ... | @@ -36,6 +38,14 @@ |
| 36 | 38 | private String bloodSugar; |
| 37 | 39 | |
| 38 | 40 | private Integer bloodSugarType; |
| 41 | + | |
| 42 | + public String getPid() { | |
| 43 | + return pid; | |
| 44 | + } | |
| 45 | + | |
| 46 | + public void setPid(String pid) { | |
| 47 | + this.pid = pid; | |
| 48 | + } | |
| 39 | 49 | |
| 40 | 50 | public Date getModified() { |
| 41 | 51 | return modified; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodPressureServiceImpl.java
View file @
470fd5b
| ... | ... | @@ -60,6 +60,7 @@ |
| 60 | 60 | BloodPressure bp = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(bloodPressure.getParentId()).and("yn").ne(0)), BloodPressure.class); |
| 61 | 61 | if(bp == null) { |
| 62 | 62 | String parentId = mongoUtil.doHidePatient(bloodPressure.getParentId(), hospitalId); |
| 63 | + bloodPressure.setPid(mongoUtil.getPid(parentId)); | |
| 63 | 64 | bloodPressure.setParentId(parentId); |
| 64 | 65 | bloodPressure.setYn(YnEnums.YES.getId()); |
| 65 | 66 | bloodPressure.setCreated(new Date()); |
| ... | ... | @@ -74,6 +75,7 @@ |
| 74 | 75 | infos.put(DateUtil.getyyyy_MM_dd(new Date()), temp); |
| 75 | 76 | bloodPressure.setInfos(infos); |
| 76 | 77 | bloodPressure.setId(bp.getId()); |
| 78 | + bloodPressure.setPid(bp.getPid()); | |
| 77 | 79 | bloodPressureService.update(bloodPressure); |
| 78 | 80 | } |
| 79 | 81 | return RespBuilder.buildSuccess(); |
| ... | ... | @@ -219,6 +221,7 @@ |
| 219 | 221 | infos.put(DateUtil.getyyyy_MM_dd(new Date()), temp); |
| 220 | 222 | bloodPressure.setInfos(infos); |
| 221 | 223 | // bloodPressureService.add(bloodPressure); |
| 224 | + bloodPressure.setPid(mongoUtil.getPid(parentId)); | |
| 222 | 225 | mongoTemplate.save(bloodPressure); |
| 223 | 226 | } else { |
| 224 | 227 | Map<String, Map<String, Object>> infos = bp.getInfos(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodSugarServiceImpl.java
View file @
470fd5b
| ... | ... | @@ -59,6 +59,7 @@ |
| 59 | 59 | bloodSugar.setYn(YnEnums.YES.getId()); |
| 60 | 60 | bloodSugar.setModified(new Date()); |
| 61 | 61 | bloodSugar.setCreatYmdDate(DateUtil.getyyyy_MM_dd(new Date())); |
| 62 | + bloodSugar.setPid(mongoUtil.getPid(bloodSugar.getParentId())); | |
| 62 | 63 | bloodSugarService.add(bloodSugar); |
| 63 | 64 | return RespBuilder.buildSuccess(bloodSugar.getId()); |
| 64 | 65 | } |
| ... | ... | @@ -210,6 +211,7 @@ |
| 210 | 211 | return RespBuilder.buildSuccess(one.getId()); |
| 211 | 212 | } |
| 212 | 213 | one = new BloodSugar(); |
| 214 | + one.setPid(mongoUtil.getPid(parentId)); | |
| 213 | 215 | one.setParentId(parentId); |
| 214 | 216 | one.setHospitalId(mongoUtil.getHidByParentId(parentId)); |
| 215 | 217 | one.setBloodSugar(bloodSugar); |
| ... | ... | @@ -227,7 +229,7 @@ |
| 227 | 229 | @Override |
| 228 | 230 | public BaseResponse wxInfo(String parentId, Integer type) { |
| 229 | 231 | List<Map<String, Object>> restList = new ArrayList<>(); |
| 230 | - List<BloodSugar> bloodSugars = mongoTemplate.find(Query.query(Criteria.where("parentId").is(parentId)).with(new Sort(Sort.Direction.DESC, "created")), BloodSugar.class); | |
| 232 | + List<BloodSugar> bloodSugars = mongoTemplate.find(Query.query(Criteria.where("pid").is(parentId)).with(new Sort(Sort.Direction.DESC, "created")), BloodSugar.class); | |
| 231 | 233 | Set<String> dayCountSet = new HashSet<>(); |
| 232 | 234 | Set<String> monthCountSet = new HashSet<>(); |
| 233 | 235 | for (BloodSugar bloodSugar : bloodSugars) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/MongoUtil.java
View file @
470fd5b
| ... | ... | @@ -638,5 +638,11 @@ |
| 638 | 638 | Patients patients = mongoTemplate.findById(parentId, Patients.class); |
| 639 | 639 | return patients == null ? null : patients.getHospitalId(); |
| 640 | 640 | } |
| 641 | + | |
| 642 | + | |
| 643 | + public String getPid(String parentId) { | |
| 644 | + Patients patients = mongoTemplate.findById(parentId, Patients.class); | |
| 645 | + return patients == null ? null : patients.getPid(); | |
| 646 | + } | |
| 641 | 647 | } |