Commit a493fd92ac6d78c6d8ed2f84cb9d45c74a40c889
1 parent
de639d30fe
Exists in
master
and in
6 other branches
添加分娩id
Showing 2 changed files with 33 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/CommonRequest.java
View file @
a493fd9
... | ... | @@ -23,6 +23,11 @@ |
23 | 23 | */ |
24 | 24 | private String womenId; |
25 | 25 | |
26 | + /** | |
27 | + * 分娩记录id | |
28 | + */ | |
29 | + private String mataFollowId; | |
30 | + | |
26 | 31 | public CommonRequest clone() throws CloneNotSupportedException { |
27 | 32 | CommonRequest clone = (CommonRequest) super.clone(); |
28 | 33 | String cardNo = clone.getCardNo(); |
... | ... | @@ -38,6 +43,14 @@ |
38 | 43 | clone.setWomenId(""); |
39 | 44 | } |
40 | 45 | return clone; |
46 | + } | |
47 | + | |
48 | + public String getMataFollowId() { | |
49 | + return mataFollowId; | |
50 | + } | |
51 | + | |
52 | + public void setMataFollowId(String mataFollowId) { | |
53 | + this.mataFollowId = mataFollowId; | |
41 | 54 | } |
42 | 55 | |
43 | 56 | public String getCardNo() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/CommonServerImpl.java
View file @
a493fd9
1 | 1 | package com.lyms.platform.operate.web.service.impl; |
2 | 2 | |
3 | +import java.util.List; | |
4 | + | |
3 | 5 | import org.slf4j.Logger; |
4 | 6 | import org.slf4j.LoggerFactory; |
5 | 7 | import org.springframework.beans.factory.annotation.Autowired; |
8 | +import org.springframework.data.domain.Sort; | |
6 | 9 | import org.springframework.data.mongodb.core.MongoTemplate; |
7 | 10 | import org.springframework.data.mongodb.core.query.Criteria; |
8 | 11 | import org.springframework.data.mongodb.core.query.Query; |
... | ... | @@ -13,6 +16,8 @@ |
13 | 16 | import com.lyms.platform.common.utils.StringUtils; |
14 | 17 | import com.lyms.platform.operate.web.request.CommonRequest; |
15 | 18 | import com.lyms.platform.operate.web.service.ICommonServer; |
19 | +import com.lyms.platform.operate.web.utils.CollectionUtils; | |
20 | +import com.lyms.platform.pojo.MaternalDeliverModel; | |
16 | 21 | import com.lyms.platform.pojo.PersonModel; |
17 | 22 | import com.lyms.platform.pojo.ResidentsArchiveModel; |
18 | 23 | |
... | ... | @@ -56,6 +61,11 @@ |
56 | 61 | if (archiveModel != null) { |
57 | 62 | result.setWomenId(archiveModel.getId()); |
58 | 63 | } |
64 | + List<MaternalDeliverModel> models = mongoTemplate.find(Query.query(Criteria.where("pid").is(personModel.getId())).with(new Sort(Sort.Direction.DESC, "created")), MaternalDeliverModel.class); | |
65 | + if (CollectionUtils.isNotEmpty(models)) { | |
66 | + MaternalDeliverModel maternalDeliverModel = models.get(0); | |
67 | + result.setMataFollowId(maternalDeliverModel.getId()); | |
68 | + } | |
59 | 69 | } |
60 | 70 | baseResponse.setObject(result); |
61 | 71 | return baseResponse; |
... | ... | @@ -72,6 +82,11 @@ |
72 | 82 | if (archiveModel != null) { |
73 | 83 | result.setWomenId(archiveModel.getId()); |
74 | 84 | } |
85 | + List<MaternalDeliverModel> models = mongoTemplate.find(Query.query(Criteria.where("pid").is(personModel.getId())).with(new Sort(Sort.Direction.DESC, "created")), MaternalDeliverModel.class); | |
86 | + if (CollectionUtils.isNotEmpty(models)) { | |
87 | + MaternalDeliverModel maternalDeliverModel = models.get(0); | |
88 | + result.setMataFollowId(maternalDeliverModel.getId()); | |
89 | + } | |
75 | 90 | } |
76 | 91 | baseResponse.setObject(result); |
77 | 92 | return baseResponse; |
... | ... | @@ -86,6 +101,11 @@ |
86 | 101 | PersonModel personModel = mongoTemplate.findOne(Query.query(Criteria.where("cardNo").is(archiveModel.getCertificateNum())), PersonModel.class); |
87 | 102 | if (personModel != null) { |
88 | 103 | result.setPid(personModel.getId()); |
104 | + List<MaternalDeliverModel> models = mongoTemplate.find(Query.query(Criteria.where("pid").is(personModel.getId())).with(new Sort(Sort.Direction.DESC, "created")), MaternalDeliverModel.class); | |
105 | + if (CollectionUtils.isNotEmpty(models)) { | |
106 | + MaternalDeliverModel maternalDeliverModel = models.get(0); | |
107 | + result.setMataFollowId(maternalDeliverModel.getId()); | |
108 | + } | |
89 | 109 | } |
90 | 110 | } |
91 | 111 | baseResponse.setObject(result); |