Commit f7b43148baeec176510a4b78c2b23dca9e28603a
1 parent
0faaaa12b5
Exists in
master
and in
8 other branches
增加字段
Showing 3 changed files with 119 additions and 5 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ApplyOrderFacade.java
View file @
f7b4314
... | ... | @@ -118,7 +118,8 @@ |
118 | 118 | SieveApplyOrderModel sieveApplyOrderModel = null; |
119 | 119 | if (CollectionUtils.isNotEmpty(list)) { |
120 | 120 | sieveApplyOrderModel = list.get(0); |
121 | - sieveApplyOrderResult.convertToResult(sieveApplyOrderModel); | |
121 | + Patients patients =patientsService.findOnePatientById(sieveApplyOrderModel.getParentId()); | |
122 | + sieveApplyOrderResult.convertToResult(sieveApplyOrderModel,patients); | |
122 | 123 | } |
123 | 124 | return new BaseObjectResponse().setData(sieveApplyOrderResult).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
124 | 125 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntexListResult.java
View file @
f7b4314
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/SieveApplyOrderResult.java
View file @
f7b4314
1 | 1 | package com.lyms.platform.operate.web.result; |
2 | 2 | |
3 | 3 | import com.lyms.platform.common.base.IBasicResultConvert; |
4 | +import com.lyms.platform.common.utils.DateUtil; | |
4 | 5 | import com.lyms.platform.common.utils.JsonUtil; |
5 | 6 | import com.lyms.platform.pojo.Patients; |
6 | 7 | import com.lyms.platform.pojo.SieveApplyOrderModel; |
7 | 8 | import org.apache.commons.lang.StringUtils; |
8 | 9 | |
10 | +import java.util.Date; | |
9 | 11 | import java.util.List; |
10 | 12 | |
11 | 13 | /** |
12 | 14 | * Created by Administrator on 2016/7/7 0007. |
13 | 15 | */ |
14 | -public class SieveApplyOrderResult implements IBasicResultConvert<SieveApplyOrderResult, SieveApplyOrderModel> { | |
16 | +public class SieveApplyOrderResult { | |
17 | + | |
18 | + //名字 | |
19 | + private String name; | |
20 | + //年龄 | |
21 | + private Integer age; | |
22 | + //孕周 | |
23 | + private String dueWeek; | |
24 | + //预产期 | |
25 | + private String yChanQi; | |
26 | + //手机号 | |
27 | + private String phone; | |
28 | + //高危因素 | |
29 | + private List riskFactor; | |
30 | + //高危评分 | |
31 | + private String riskScore; | |
32 | + //备注 | |
33 | + private String remarks; | |
34 | + //末次月经 | |
35 | + private String lastMenses; | |
36 | + | |
37 | + | |
38 | + | |
15 | 39 | private String id; |
16 | 40 | //患者id |
17 | 41 | private String parentId; |
... | ... | @@ -72,8 +96,7 @@ |
72 | 96 | this.parentId = parentId; |
73 | 97 | } |
74 | 98 | |
75 | - @Override | |
76 | - public SieveApplyOrderResult convertToResult(SieveApplyOrderModel destModel) { | |
99 | + public SieveApplyOrderResult convertToResult(SieveApplyOrderModel destModel,Patients patients) { | |
77 | 100 | setId(destModel.getId()); |
78 | 101 | setParentId(destModel.getParentId()); |
79 | 102 | setApplyDoctor(destModel.getApplyDoctor()); |
80 | 103 | |
... | ... | @@ -82,7 +105,97 @@ |
82 | 105 | if(StringUtils.isNotEmpty(destModel.getCheckItem())){ |
83 | 106 | setCheckItem(JsonUtil.toList(destModel.getCheckItem(),List.class)); |
84 | 107 | } |
108 | + try { | |
109 | + if(null!=patients.getBirth()){ | |
110 | + setAge(DateUtil.getAge(patients.getBirth())); | |
111 | + } | |
112 | + }catch (Exception e){ | |
113 | + } | |
114 | + setName(patients.getUsername()); | |
115 | + setPhone(patients.getPhone()); | |
116 | + setRemarks(patients.getMremark()); | |
117 | + setRiskScore("60"); | |
118 | + | |
119 | + int days= DateUtil.daysBetween(patients.getLastMenses(),new Date()); | |
120 | + String week= (days/7)+""; | |
121 | + int day = (days%7); | |
122 | + this.dueWeek="孕"+week+"周" +(day>0?"+"+day+"天":""); | |
123 | + if(null!=patients.getLastMenses()){ | |
124 | + setLastMenses(DateUtil.getyyyy_MM_dd(patients.getLastMenses())); | |
125 | + } | |
85 | 126 | return this; |
127 | + } | |
128 | + | |
129 | + public Integer getAge() { | |
130 | + return age; | |
131 | + } | |
132 | + | |
133 | + public void setAge(Integer age) { | |
134 | + this.age = age; | |
135 | + } | |
136 | + | |
137 | + public String getDueWeek() { | |
138 | + return dueWeek; | |
139 | + } | |
140 | + | |
141 | + public void setDueWeek(String dueWeek) { | |
142 | + this.dueWeek = dueWeek; | |
143 | + } | |
144 | + | |
145 | + public String getLastMenses() { | |
146 | + return lastMenses; | |
147 | + } | |
148 | + | |
149 | + public void setLastMenses(String lastMenses) { | |
150 | + this.lastMenses = lastMenses; | |
151 | + } | |
152 | + | |
153 | + public String getName() { | |
154 | + return name; | |
155 | + } | |
156 | + | |
157 | + public void setName(String name) { | |
158 | + this.name = name; | |
159 | + } | |
160 | + | |
161 | + public String getPhone() { | |
162 | + return phone; | |
163 | + } | |
164 | + | |
165 | + public void setPhone(String phone) { | |
166 | + this.phone = phone; | |
167 | + } | |
168 | + | |
169 | + public String getRemarks() { | |
170 | + return remarks; | |
171 | + } | |
172 | + | |
173 | + public void setRemarks(String remarks) { | |
174 | + this.remarks = remarks; | |
175 | + } | |
176 | + | |
177 | + public List getRiskFactor() { | |
178 | + return riskFactor; | |
179 | + } | |
180 | + | |
181 | + public void setRiskFactor(List riskFactor) { | |
182 | + this.riskFactor = riskFactor; | |
183 | + } | |
184 | + | |
185 | + public String getRiskScore() { | |
186 | + return riskScore; | |
187 | + } | |
188 | + | |
189 | + public void setRiskScore(String riskScore) { | |
190 | + this.riskScore = riskScore; | |
191 | + } | |
192 | + | |
193 | + public String getyChanQi() { | |
194 | + return yChanQi; | |
195 | + } | |
196 | + | |
197 | + public void setyChanQi(String yChanQi) { | |
198 | + this.yChanQi = yChanQi; | |
86 | 199 | } |
87 | 200 | } |