Commit a38c34bb9b585ecefead2f630e30af1dcdfe22c4
1 parent
8784971aff
Exists in
master
and in
1 other branch
1
Showing 4 changed files with 58 additions and 3 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/MatDeliverService.java
- platform-dal/src/main/java/com/lyms/platform/pojo/MaternalDeliverModel.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PostReviewListResult.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/MatDeliverService.java
View file @
a38c34b
1 | 1 | package com.lyms.platform.biz.service; |
2 | 2 | |
3 | 3 | import com.lyms.platform.biz.dal.IMatDeliverDao; |
4 | +import com.lyms.platform.common.enums.YnEnums; | |
4 | 5 | import com.lyms.platform.pojo.MaternalDeliverModel; |
5 | 6 | import com.lyms.platform.query.MatDeliverQuery; |
6 | 7 | import org.springframework.beans.factory.annotation.Autowired; |
8 | +import org.springframework.data.domain.Sort; | |
7 | 9 | import org.springframework.stereotype.Service; |
8 | 10 | |
11 | +import java.util.Date; | |
9 | 12 | import java.util.List; |
10 | 13 | |
11 | 14 | /** |
12 | 15 | |
... | ... | @@ -27,11 +30,14 @@ |
27 | 30 | * @return |
28 | 31 | */ |
29 | 32 | public MaternalDeliverModel addMatDeliver(MaternalDeliverModel deliverModel) { |
33 | + deliverModel.setYn(YnEnums.YES.getId()); | |
34 | + deliverModel.setCreated(new Date()); | |
35 | + deliverModel.setModified(new Date()); | |
30 | 36 | return iMatDeliverDao.addMatDeliver(deliverModel); |
31 | 37 | } |
32 | 38 | |
33 | 39 | public List<MaternalDeliverModel> query(MatDeliverQuery deliverQuery){ |
34 | - return iMatDeliverDao.queryWithList(deliverQuery.convertToQuery()); | |
40 | + return iMatDeliverDao.queryWithList(deliverQuery.convertToQuery().addOrder(Sort.Direction.DESC,"created")); | |
35 | 41 | } |
36 | 42 | public void deleteOne(String id){ |
37 | 43 | iMatDeliverDao.deleteOne(id); |
platform-dal/src/main/java/com/lyms/platform/pojo/MaternalDeliverModel.java
View file @
a38c34b
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | |
3 | 3 | import org.springframework.data.mongodb.core.mapping.Document; |
4 | 4 | |
5 | +import java.util.Date; | |
5 | 6 | import java.util.List; |
6 | 7 | |
7 | 8 | /** |
... | ... | @@ -94,6 +95,25 @@ |
94 | 95 | //接生医生 |
95 | 96 | private String deliverDoctor; |
96 | 97 | private Integer yn; |
98 | + private Date created; | |
99 | + private Date modified; | |
100 | + | |
101 | + public Date getCreated() { | |
102 | + return created; | |
103 | + } | |
104 | + | |
105 | + public void setCreated(Date created) { | |
106 | + this.created = created; | |
107 | + } | |
108 | + | |
109 | + public Date getModified() { | |
110 | + return modified; | |
111 | + } | |
112 | + | |
113 | + public void setModified(Date modified) { | |
114 | + this.modified = modified; | |
115 | + } | |
116 | + | |
97 | 117 | public static class ExtPlacenta{ |
98 | 118 | //胎盘娩出方式 |
99 | 119 | private String tpmcType; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java
View file @
a38c34b
1 | 1 | package com.lyms.platform.operate.web.facade; |
2 | 2 | |
3 | +import com.lyms.platform.biz.service.MatDeliverService; | |
3 | 4 | import com.lyms.platform.biz.service.PatientsService; |
4 | 5 | import com.lyms.platform.biz.service.PostReviewService; |
5 | 6 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
6 | 7 | |
7 | 8 | |
... | ... | @@ -11,10 +12,13 @@ |
11 | 12 | import com.lyms.platform.operate.web.request.PostReviewRequest; |
12 | 13 | import com.lyms.platform.operate.web.result.PostReviewListResult; |
13 | 14 | import com.lyms.platform.operate.web.result.PostReviewResult; |
15 | +import com.lyms.platform.pojo.MaternalDeliverModel; | |
14 | 16 | import com.lyms.platform.pojo.Patients; |
15 | 17 | import com.lyms.platform.pojo.PostReviewModel; |
18 | +import com.lyms.platform.query.MatDeliverQuery; | |
16 | 19 | import com.lyms.platform.query.PatientsQuery; |
17 | 20 | import com.lyms.platform.query.PostReviewQuery; |
21 | +import org.apache.commons.collections.CollectionUtils; | |
18 | 22 | import org.apache.commons.lang.StringUtils; |
19 | 23 | import org.springframework.beans.factory.annotation.Autowired; |
20 | 24 | import org.springframework.stereotype.Component; |
... | ... | @@ -33,6 +37,8 @@ |
33 | 37 | private PostReviewService postReviewService; |
34 | 38 | @Autowired |
35 | 39 | private PatientsService patientsService; |
40 | + @Autowired | |
41 | + private MatDeliverService matDeliverService; | |
36 | 42 | |
37 | 43 | public BaseResponse addPostReview(PostReviewRequest postReviewRequest) { |
38 | 44 | if (StringUtils.isEmpty(postReviewRequest.getId())) { |
... | ... | @@ -55,7 +61,17 @@ |
55 | 61 | postReviewQuery.setParentId(patientsList.getId()); |
56 | 62 | postReviewQuery.setYn(YnEnums.YES.getId()); |
57 | 63 | List<PostReviewModel> postReviewModels = postReviewService.findWithList(postReviewQuery); |
58 | - postReviewListResult.convertToResult(postReviewModels, patientsList); | |
64 | + MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); | |
65 | + matDeliverQuery.setParentId(patientsList.getId()); | |
66 | + matDeliverQuery.setYn(YnEnums.YES.getId()); | |
67 | + | |
68 | + List<MaternalDeliverModel> list = matDeliverService.query(matDeliverQuery); | |
69 | + String dueDate=""; | |
70 | + if(CollectionUtils.isNotEmpty(list)){ | |
71 | + dueDate= list.get(0).getDueDate(); | |
72 | + | |
73 | + } | |
74 | + postReviewListResult.convertToResult(postReviewModels, patientsList,dueDate); | |
59 | 75 | } |
60 | 76 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(postReviewListResult); |
61 | 77 | } |
... | ... | @@ -68,6 +84,8 @@ |
68 | 84 | */ |
69 | 85 | public BaseResponse findById(String id) { |
70 | 86 | PostReviewModel postReviewModel = postReviewService.findOneById(id); |
87 | + | |
88 | + | |
71 | 89 | Assert.notNull(postReviewModel, "没有对应的数据."); |
72 | 90 | PostReviewResult postReviewResult = new PostReviewResult(); |
73 | 91 | postReviewResult.convertToResult(postReviewModel); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PostReviewListResult.java
View file @
a38c34b
... | ... | @@ -37,9 +37,19 @@ |
37 | 37 | private String remarks; |
38 | 38 | //末次月经 |
39 | 39 | private String lastMenses; |
40 | + //分娩时间 | |
41 | + private String dueDate; | |
40 | 42 | //<!---------基本信息-----------> |
41 | 43 | private List data = new ArrayList(); |
42 | 44 | |
45 | + public String getDueDate() { | |
46 | + return dueDate; | |
47 | + } | |
48 | + | |
49 | + public void setDueDate(String dueDate) { | |
50 | + this.dueDate = dueDate; | |
51 | + } | |
52 | + | |
43 | 53 | public List getRiskFactor() { |
44 | 54 | return riskFactor; |
45 | 55 | } |
... | ... | @@ -128,7 +138,8 @@ |
128 | 138 | this.yChanQi = yChanQi; |
129 | 139 | } |
130 | 140 | |
131 | - public PostReviewListResult convertToResult(List<PostReviewModel> destModel,Patients patients) { | |
141 | + public PostReviewListResult convertToResult(List<PostReviewModel> destModel,Patients patients,String dueDate) { | |
142 | + setDueDate(dueDate); | |
132 | 143 | setId(patients.getId()); |
133 | 144 | try { |
134 | 145 | if(null!=patients.getBirth()){ |