Commit 60b57d9bd86a38787e04e07151c6fb4bd25c14db
1 parent
164d8b1ffd
Exists in
master
and in
8 other branches
增加是否通知
Showing 2 changed files with 39 additions and 10 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
60b57d9
... | ... | @@ -8,10 +8,10 @@ |
8 | 8 | import com.lyms.platform.common.result.BaseResponse; |
9 | 9 | import com.lyms.platform.common.utils.Assert; |
10 | 10 | import com.lyms.platform.common.utils.DateUtil; |
11 | -import com.lyms.platform.common.utils.JsonUtil; | |
12 | 11 | import com.lyms.platform.operate.web.request.*; |
13 | 12 | import com.lyms.platform.operate.web.result.*; |
14 | 13 | import com.lyms.platform.operate.web.utils.CommonsHelper; |
14 | +import com.lyms.platform.pojo.AntenatalExaminationModel; | |
15 | 15 | import com.lyms.platform.pojo.BabyModel; |
16 | 16 | import com.lyms.platform.pojo.CommunityConfig; |
17 | 17 | import com.lyms.platform.pojo.Patients; |
... | ... | @@ -22,6 +22,7 @@ |
22 | 22 | import org.apache.commons.collections.CollectionUtils; |
23 | 23 | import org.apache.commons.lang.StringUtils; |
24 | 24 | import org.springframework.beans.factory.annotation.Autowired; |
25 | +import org.springframework.data.domain.Sort; | |
25 | 26 | import org.springframework.stereotype.Component; |
26 | 27 | |
27 | 28 | import java.util.ArrayList; |
28 | 29 | |
29 | 30 | |
30 | 31 | |
31 | 32 | |
32 | 33 | |
33 | 34 | |
34 | 35 | |
35 | 36 | |
... | ... | @@ -216,39 +217,56 @@ |
216 | 217 | data = convertToQuanPatient(patientses); |
217 | 218 | //处理全部产妇 |
218 | 219 | } else if (type == 3) { |
219 | - data=convertToQuanCPatient(patientses); | |
220 | + data = convertToQuanCPatient(patientses); | |
220 | 221 | } |
221 | 222 | } |
222 | 223 | return new BaseObjectResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(data); |
223 | 224 | } |
224 | 225 | |
225 | - public BaseResponse findPatient(PatientQueryRequest patientQueryRequest){ | |
226 | - PatientsQuery patientsQuery=new PatientsQuery(); | |
226 | + public BaseResponse findPatient(PatientQueryRequest patientQueryRequest) { | |
227 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
227 | 228 | |
228 | 229 | patientsQuery.setId(patientQueryRequest.getId()); |
229 | 230 | patientsQuery.setPhone(patientQueryRequest.getPhone()); |
230 | 231 | patientsQuery.setCardNo(patientQueryRequest.getCardNo()); |
231 | - Patients patients= patientsService.findOnePatientByCardNo(patientsQuery); | |
232 | - PatientBaseResult patientBaseResult=new PatientBaseResult(); | |
233 | - if(null!=patients){ | |
232 | + Patients patients = patientsService.findOnePatientByCardNo(patientsQuery); | |
233 | + PatientBaseResult patientBaseResult = new PatientBaseResult(); | |
234 | + if (null != patients) { | |
234 | 235 | patientBaseResult.convert(patients); |
235 | 236 | } |
236 | 237 | try { |
237 | 238 | patientBaseResult.setRiskFactor(antenatalExaminationFacade.queryRisk(patients.getFirstRiskFactorId())); |
238 | - }catch (Exception e){} | |
239 | + } catch (Exception e) { | |
240 | + } | |
239 | 241 | return new BaseObjectResponse().setData(patientBaseResult).setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS); |
240 | 242 | } |
243 | + | |
241 | 244 | /** |
242 | 245 | * 转成全部产妇的返回数据 |
243 | 246 | * |
244 | 247 | * @param patientses 符合条件的产妇 |
245 | 248 | * @return |
246 | 249 | */ |
247 | - private List convertToQuanCPatient(List<Patients> patientses){ | |
250 | + private List convertToQuanCPatient(List<Patients> patientses) { | |
248 | 251 | List data = new ArrayList<>(); |
252 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
253 | + AntExQuery antExQuery = new AntExQuery(); | |
249 | 254 | for (Patients patients : patientses) { |
250 | - QuanChanResult chanResult =new QuanChanResult(); | |
255 | + QuanChanResult chanResult = new QuanChanResult(); | |
251 | 256 | chanResult.convertToResult(patients); |
257 | + antExQuery.setParentId(patients.getId()); | |
258 | + antExQuery.setYn(YnEnums.YES.getId()); | |
259 | + //复诊次数 | |
260 | + int i = antExService.queryAntenatalExaminationCount(antExQuery.convertToQuery()); | |
261 | + chanResult.setcTime(i + ""); | |
262 | + antExChuQuery.setParentId(patients.getId()); | |
263 | + antExChuQuery.setYn(YnEnums.YES.getId()); | |
264 | + List<AntenatalExaminationModel> ant = antExService.queryAntenatalExamination(antExChuQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); | |
265 | + String nextCheckTime = ""; | |
266 | + if (CollectionUtils.isNotEmpty(ant)) { | |
267 | + nextCheckTime = ant.get(0).getNextCheckTime(); | |
268 | + } | |
269 | + chanResult.setNextCheckTime(nextCheckTime); | |
252 | 270 | data.add(chanResult); |
253 | 271 | } |
254 | 272 | return data; |
... | ... | @@ -262,6 +280,8 @@ |
262 | 280 | for (Patients patients : patientses) { |
263 | 281 | QuanPatientsResult quanPatientsResult = new QuanPatientsResult(); |
264 | 282 | quanPatientsResult.convertToResult(patients); |
283 | + antExQuery.setParentId(patients.getId()); | |
284 | + antExQuery.setYn(YnEnums.YES.getId()); | |
265 | 285 | //复诊次数 |
266 | 286 | int i = antExService.queryAntenatalExaminationCount(antExQuery.convertToQuery()); |
267 | 287 | antExChuQuery.setParentId(patients.getId()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanChanResult.java
View file @
60b57d9
... | ... | @@ -29,6 +29,15 @@ |
29 | 29 | |
30 | 30 | //联系方式 |
31 | 31 | private String phone; |
32 | + private String nextCheckTime; | |
33 | + | |
34 | + public String getNextCheckTime() { | |
35 | + return nextCheckTime; | |
36 | + } | |
37 | + | |
38 | + public void setNextCheckTime(String nextCheckTime) { | |
39 | + this.nextCheckTime = nextCheckTime; | |
40 | + } | |
32 | 41 | |
33 | 42 | public Integer getAge() { |
34 | 43 | return age; |