Commit 4e8adbc40b5839729312ef3c0d2380573f1886c7
1 parent
92d20a48cf
Exists in
master
and in
7 other branches
分娩作废产检劵
Showing 3 changed files with 221 additions and 51 deletions
platform-dal/src/main/java/com/lyms/platform/query/AntExRecordQuery.java
View file @
4e8adbc
... | ... | @@ -23,6 +23,36 @@ |
23 | 23 | private String phone; |
24 | 24 | private String barCode; |
25 | 25 | |
26 | + /** | |
27 | + * 末次月经 | |
28 | + */ | |
29 | + private Date lastMensesStart; | |
30 | + | |
31 | + /** | |
32 | + * 末次月经 | |
33 | + */ | |
34 | + private Date lastMensesEnd; | |
35 | + | |
36 | + //生日查询 | |
37 | + private Date birthEnd; | |
38 | + private Date birthStart; | |
39 | + | |
40 | + public Date getBirthEnd() { | |
41 | + return birthEnd; | |
42 | + } | |
43 | + | |
44 | + public void setBirthEnd(Date birthEnd) { | |
45 | + this.birthEnd = birthEnd; | |
46 | + } | |
47 | + | |
48 | + public Date getBirthStart() { | |
49 | + return birthStart; | |
50 | + } | |
51 | + | |
52 | + public void setBirthStart(Date birthStart) { | |
53 | + this.birthStart = birthStart; | |
54 | + } | |
55 | + | |
26 | 56 | public String getBarCode() { |
27 | 57 | return barCode; |
28 | 58 | } |
... | ... | @@ -214,6 +244,22 @@ |
214 | 244 | this.id = id; |
215 | 245 | } |
216 | 246 | |
247 | + public Date getLastMensesStart() { | |
248 | + return lastMensesStart; | |
249 | + } | |
250 | + | |
251 | + public void setLastMensesStart(Date lastMensesStart) { | |
252 | + this.lastMensesStart = lastMensesStart; | |
253 | + } | |
254 | + | |
255 | + public Date getLastMensesEnd() { | |
256 | + return lastMensesEnd; | |
257 | + } | |
258 | + | |
259 | + public void setLastMensesEnd(Date lastMensesEnd) { | |
260 | + this.lastMensesEnd = lastMensesEnd; | |
261 | + } | |
262 | + | |
217 | 263 | @Override |
218 | 264 | public MongoQuery convertToQuery() { |
219 | 265 | MongoCondition condition = MongoCondition.newInstance(); |
220 | 266 | |
... | ... | @@ -304,7 +350,37 @@ |
304 | 350 | c = Criteria.where("checkTime").lte(checkTimeEnd); |
305 | 351 | } |
306 | 352 | } |
353 | + if (null != lastMensesStart) { | |
354 | + if (null != c) { | |
355 | + c = c.and("lastMenses").gte(lastMensesStart); | |
356 | + } else { | |
357 | + c = Criteria.where("lastMenses").gte(lastMensesStart); | |
358 | + } | |
359 | + } | |
360 | + if (null != lastMensesEnd) { | |
361 | + if (c != null) { | |
362 | + c = c.lte(lastMensesEnd); | |
363 | + } else { | |
364 | + c = Criteria.where("lastMenses").lte(lastMensesEnd); | |
365 | + } | |
366 | + } | |
307 | 367 | |
368 | + | |
369 | + if (null != birthStart) { | |
370 | + if (null != c) { | |
371 | + c = c.and("brith").gte(birthStart); | |
372 | + } else { | |
373 | + c = Criteria.where("brith").gte(birthStart); | |
374 | + } | |
375 | + } | |
376 | + | |
377 | + if (null != birthEnd) { | |
378 | + if (null != c) { | |
379 | + c = c.lte(birthEnd); | |
380 | + } else { | |
381 | + c = Criteria.where("brith").lte(birthEnd); | |
382 | + } | |
383 | + } | |
308 | 384 | |
309 | 385 | if (null != c) { |
310 | 386 | condition = condition.andCondition(new MongoCondition(c)); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
View file @
4e8adbc
... | ... | @@ -70,7 +70,7 @@ |
70 | 70 | * @param antExManagerQueryRequest |
71 | 71 | * @param isRegion |
72 | 72 | */ |
73 | - private AntExRecordQuery complayRequest(Integer userId, AntExManagerQueryRequest antExManagerQueryRequest, boolean isRegion,String isPage) { | |
73 | + private AntExRecordQuery complayRequest(Integer userId, AntExManagerQueryRequest antExManagerQueryRequest, boolean isRegion, String isPage) { | |
74 | 74 | |
75 | 75 | AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); |
76 | 76 | antExRecordQuery.setNeed(isPage); |
... | ... | @@ -83,6 +83,8 @@ |
83 | 83 | antExRecordQuery.setBarCode(antExManagerQueryRequest.getBarCode()); |
84 | 84 | antExRecordQuery.setCardNo(antExManagerQueryRequest.getCardNo()); |
85 | 85 | //产检日期 |
86 | + | |
87 | + Date currentDate = DateUtil.formatDate(new Date()); | |
86 | 88 | if (org.apache.commons.lang.StringUtils.isNotEmpty(antExManagerQueryRequest.getcTime())) { |
87 | 89 | String nextDateStr = antExManagerQueryRequest.getcTime(); |
88 | 90 | String[] dates = nextDateStr.split(" - "); |
89 | 91 | |
... | ... | @@ -101,7 +103,14 @@ |
101 | 103 | antExRecordQuery.setBuildTimeEnd(DateUtil.parseYMD(dates[1])); |
102 | 104 | } |
103 | 105 | } |
106 | + //产检孕周 | |
107 | + if (null != antExManagerQueryRequest.getStartDueWeek()) { | |
108 | + antExRecordQuery.setLastMensesEnd(antExManagerQueryRequest.capStart()); | |
109 | + } | |
104 | 110 | |
111 | + if (null != antExManagerQueryRequest.getEndDueWeek()) { | |
112 | + antExRecordQuery.setLastMensesStart(antExManagerQueryRequest.capEnd()); | |
113 | + } | |
105 | 114 | |
106 | 115 | //预产期 |
107 | 116 | if (org.apache.commons.lang.StringUtils.isNotEmpty(antExManagerQueryRequest.getDueTime())) { |
... | ... | @@ -113,6 +122,19 @@ |
113 | 122 | } |
114 | 123 | } |
115 | 124 | |
125 | + //年龄 | |
126 | + if (null != antExManagerQueryRequest.getStartAge()) { | |
127 | + Date date = DateUtil.addYear(currentDate, -antExManagerQueryRequest.getStartAge()); | |
128 | + antExRecordQuery.setBirthEnd(date); | |
129 | + } | |
130 | + | |
131 | + if (null != antExManagerQueryRequest.getEndAge()) { | |
132 | + Date date = DateUtil.addYear(currentDate, -antExManagerQueryRequest.getEndAge()); | |
133 | + date = DateUtil.addYear(date, -1); | |
134 | + antExRecordQuery.setBirthStart(DateUtil.addDay(date, 1)); | |
135 | + } | |
136 | + | |
137 | + | |
116 | 138 | //区域范围内孕妇 |
117 | 139 | if (isRegion) { |
118 | 140 | List<String> hospitalList = null; |
... | ... | @@ -174,8 +196,8 @@ |
174 | 196 | * |
175 | 197 | * @return |
176 | 198 | */ |
177 | - public BaseResponse findList(AntExManagerQueryRequest antExManagerQueryRequest, Integer userId, boolean isRegion,String isPage) { | |
178 | - AntExRecordQuery antExRecordQuery = complayRequest(userId, antExManagerQueryRequest, isRegion,isPage); | |
199 | + public BaseResponse findList(AntExManagerQueryRequest antExManagerQueryRequest, Integer userId, boolean isRegion, String isPage) { | |
200 | + AntExRecordQuery antExRecordQuery = complayRequest(userId, antExManagerQueryRequest, isRegion, isPage); | |
179 | 201 | String hospital = autoMatchFacade.getHospitalId(userId); |
180 | 202 | List<AntExManagerResult> data = new ArrayList<>(); |
181 | 203 | List<AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery); |
182 | 204 | |
... | ... | @@ -236,14 +258,13 @@ |
236 | 258 | antExChuQuery.setStart(e.getCheckTime()); |
237 | 259 | |
238 | 260 | |
239 | - | |
240 | - AntExRecordQuery antExRecordQuery1=new AntExRecordQuery(); | |
261 | + AntExRecordQuery antExRecordQuery1 = new AntExRecordQuery(); | |
241 | 262 | antExRecordQuery1.setCheckTimeEnd(e.getCheckTime()); |
242 | 263 | antExRecordQuery1.setPid(e.getPid()); |
243 | 264 | antExRecordQuery1.setHospitalId(hospital); |
244 | 265 | |
245 | 266 | //本院低次 |
246 | - int dichi =recordService.count(antExRecordQuery1); | |
267 | + int dichi = recordService.count(antExRecordQuery1); | |
247 | 268 | antExRecordQuery1.setHospitalId(null); |
248 | 269 | /* int i = antExService.queryAntenatalExaminationCount(antExQuery.convertToQuery()); |
249 | 270 | antExChuQuery.setHospitalId(null); |
250 | 271 | |
251 | 272 | |
252 | 273 | |
... | ... | @@ -421,34 +442,31 @@ |
421 | 442 | return baseListResponse.setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(data).setPageInfo(antExRecordQuery.getPageInfo()); |
422 | 443 | } |
423 | 444 | |
424 | - public void exportFindAntEx(AntExManagerQueryRequest antExManagerQueryRequest, Integer id, boolean b,HttpServletResponse httpServletResponse) { | |
445 | + public void exportFindAntEx(AntExManagerQueryRequest antExManagerQueryRequest, Integer id, boolean b, HttpServletResponse httpServletResponse) { | |
425 | 446 | |
426 | - BaseListResponse listRep = (BaseListResponse)findList(antExManagerQueryRequest, id, b, null); | |
447 | + BaseListResponse listRep = (BaseListResponse) findList(antExManagerQueryRequest, id, b, null); | |
427 | 448 | List<Map<String, Object>> datas = new ArrayList<>(); |
428 | 449 | try { |
429 | 450 | Map<String, Object> data = new HashMap<>(); |
430 | - if (listRep != null) | |
431 | - { | |
451 | + if (listRep != null) { | |
432 | 452 | List<AntExManagerResult> list = listRep.getData(); |
433 | - if (CollectionUtils.isNotEmpty(list)) | |
434 | - { | |
435 | - for (AntExManagerResult aer : list) | |
436 | - { | |
437 | - data.put("checkTime",aer.getCheckTime()); | |
438 | - data.put("barCode",aer.getBarCode()); | |
439 | - data.put("name",aer.getName()); | |
440 | - data.put("age",aer.getAge()); | |
441 | - data.put("cDueWeek",aer.getcDueWeek()); | |
442 | - data.put("rLevel",getLevel(aer.getrLevel())); | |
443 | - data.put("riskFactor",aer.getRiskFactor()); | |
444 | - data.put("riskScore",aer.getRiskScore()); | |
445 | - data.put("chTimes",aer.getChTimes()); | |
446 | - data.put("tTimes",aer.gettTimes()); | |
447 | - data.put("nextCheckTime",aer.getNextCheckTime()); | |
448 | - data.put("dueDate",aer.getDueDate()); | |
449 | - data.put("checkDoctor",aer.getCheckDoctor()); | |
450 | - data.put("lName",aer.getlName()); | |
451 | - data.put("phone",aer.getPhone()); | |
453 | + if (CollectionUtils.isNotEmpty(list)) { | |
454 | + for (AntExManagerResult aer : list) { | |
455 | + data.put("checkTime", aer.getCheckTime()); | |
456 | + data.put("barCode", aer.getBarCode()); | |
457 | + data.put("name", aer.getName()); | |
458 | + data.put("age", aer.getAge()); | |
459 | + data.put("cDueWeek", aer.getcDueWeek()); | |
460 | + data.put("rLevel", getLevel(aer.getrLevel())); | |
461 | + data.put("riskFactor", aer.getRiskFactor()); | |
462 | + data.put("riskScore", aer.getRiskScore()); | |
463 | + data.put("chTimes", aer.getChTimes()); | |
464 | + data.put("tTimes", aer.gettTimes()); | |
465 | + data.put("nextCheckTime", aer.getNextCheckTime()); | |
466 | + data.put("dueDate", aer.getDueDate()); | |
467 | + data.put("checkDoctor", aer.getCheckDoctor()); | |
468 | + data.put("lName", aer.getlName()); | |
469 | + data.put("phone", aer.getPhone()); | |
452 | 470 | } |
453 | 471 | } |
454 | 472 | |
455 | 473 | |
... | ... | @@ -475,10 +493,10 @@ |
475 | 493 | httpServletResponse.setCharacterEncoding("UTF-8"); |
476 | 494 | httpServletResponse.setHeader("Content-Disposition", "attachment;fileName=" + "data.xls"); |
477 | 495 | ExcelUtil.toExcel(out, datas, cnames); |
478 | - } catch (IOException e) { | |
479 | - e.printStackTrace(); | |
496 | + } catch (IOException e) { | |
497 | + e.printStackTrace(); | |
498 | + } | |
480 | 499 | } |
481 | - } | |
482 | 500 | |
483 | 501 | |
484 | 502 | private String getLevel(List<Map> levels) { |
485 | 503 | |
486 | 504 | |
... | ... | @@ -494,29 +512,26 @@ |
494 | 512 | } |
495 | 513 | |
496 | 514 | public void exportfindRegionAntEx(AntExManagerQueryRequest antExManagerQueryRequest, Integer id, boolean b, HttpServletResponse httpServletResponse) { |
497 | - BaseListResponse listRep = (BaseListResponse)findList(antExManagerQueryRequest, id, b, null); | |
515 | + BaseListResponse listRep = (BaseListResponse) findList(antExManagerQueryRequest, id, b, null); | |
498 | 516 | List<Map<String, Object>> datas = new ArrayList<>(); |
499 | 517 | try { |
500 | 518 | Map<String, Object> data = new HashMap<>(); |
501 | - if (listRep != null) | |
502 | - { | |
519 | + if (listRep != null) { | |
503 | 520 | List<AntExManagerResult> list = listRep.getData(); |
504 | - if (CollectionUtils.isNotEmpty(list)) | |
505 | - { | |
506 | - for (AntExManagerResult aer : list) | |
507 | - { | |
508 | - data.put("checkTime",aer.getCheckTime()); | |
509 | - data.put("barCode",aer.getBarCode()); | |
510 | - data.put("name",aer.getName()); | |
511 | - data.put("age",aer.getAge()); | |
512 | - data.put("cDueWeek",aer.getcDueWeek()); | |
513 | - data.put("rLevel",getLevel(aer.getrLevel())); | |
514 | - data.put("riskFactor",aer.getRiskFactor()); | |
515 | - data.put("riskScore",aer.getRiskScore()); | |
516 | - data.put("cTimes",aer.getcTimes()); | |
517 | - data.put("dueDate",aer.getDueDate()); | |
518 | - data.put("addr",aer.getAddr()); | |
519 | - data.put("checkHospital",aer.getCheckHospital()); | |
521 | + if (CollectionUtils.isNotEmpty(list)) { | |
522 | + for (AntExManagerResult aer : list) { | |
523 | + data.put("checkTime", aer.getCheckTime()); | |
524 | + data.put("barCode", aer.getBarCode()); | |
525 | + data.put("name", aer.getName()); | |
526 | + data.put("age", aer.getAge()); | |
527 | + data.put("cDueWeek", aer.getcDueWeek()); | |
528 | + data.put("rLevel", getLevel(aer.getrLevel())); | |
529 | + data.put("riskFactor", aer.getRiskFactor()); | |
530 | + data.put("riskScore", aer.getRiskScore()); | |
531 | + data.put("cTimes", aer.getcTimes()); | |
532 | + data.put("dueDate", aer.getDueDate()); | |
533 | + data.put("addr", aer.getAddr()); | |
534 | + data.put("checkHospital", aer.getCheckHospital()); | |
520 | 535 | } |
521 | 536 | } |
522 | 537 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/AntExManagerQueryRequest.java
View file @
4e8adbc
1 | 1 | package com.lyms.platform.operate.web.request; |
2 | 2 | |
3 | +import com.lyms.platform.common.core.annotation.form.Form; | |
4 | +import com.lyms.platform.common.core.annotation.form.FormParam; | |
5 | +import com.lyms.platform.common.utils.DateUtil; | |
6 | +import com.lyms.platform.common.utils.StringUtils; | |
7 | +import org.apache.commons.lang.math.NumberUtils; | |
8 | + | |
9 | +import java.util.Date; | |
10 | + | |
3 | 11 | /** |
4 | 12 | * |
5 | 13 | * 产检管理查询 |
6 | 14 | * |
7 | 15 | * Created by Administrator on 2016/12/19 0019. |
8 | 16 | */ |
17 | +@Form | |
9 | 18 | public class AntExManagerQueryRequest extends BasePageQueryRequest { |
10 | 19 | //姓名 |
11 | 20 | private String name; |
12 | 21 | //证件号 |
13 | 22 | private String cardNo; |
23 | + //孕周 | |
24 | + private String startDueWeek; | |
25 | + private String endDueWeek; | |
26 | + | |
27 | + //年龄 | |
28 | + private Integer startAge; | |
29 | + private Integer endAge; | |
14 | 30 | //联系方式 |
15 | 31 | private String phone; |
16 | 32 | //产检日期 |
17 | 33 | private String cTime; |
18 | 34 | //建档时间 |
35 | + @FormParam("bookbuildingDate") | |
19 | 36 | private String bTime; |
20 | 37 | //预产期 |
38 | + @FormParam("dueDate") | |
21 | 39 | private String dueTime; |
22 | 40 | //高危等级 |
23 | 41 | private String level; |
24 | 42 | |
25 | 43 | |
26 | 44 | |
27 | 45 | |
28 | 46 | |
29 | 47 | |
30 | 48 | |
31 | 49 | |
32 | 50 | |
33 | 51 | |
... | ... | @@ -28,22 +46,83 @@ |
28 | 46 | |
29 | 47 | |
30 | 48 | //户籍id |
49 | + @FormParam("registerProvinceId") | |
31 | 50 | private String provinceRegisterId; |
51 | + @FormParam("registerCityId") | |
32 | 52 | private String cityRegisterId; |
53 | + @FormParam("registerAreaId") | |
33 | 54 | private String areaRegisterId; |
34 | 55 | |
35 | 56 | //居住地 |
57 | + @FormParam("livingProvinceId") | |
36 | 58 | private String provinceId; |
59 | + @FormParam("livingCityId") | |
37 | 60 | private String cityId; |
61 | + @FormParam("livingAreaId") | |
38 | 62 | private String areaId; |
39 | 63 | |
40 | 64 | //产检医院 |
65 | + @FormParam("hospitalProvinceId") | |
41 | 66 | private String cprovinceId; |
67 | + @FormParam("hospitalCityId") | |
42 | 68 | private String ccityId; |
69 | + @FormParam("hospitalAreaId") | |
43 | 70 | private String careaId; |
44 | 71 | // 医院id |
72 | + @FormParam("hospitalId") | |
45 | 73 | private String hId; |
46 | 74 | |
75 | + | |
76 | + | |
77 | + public Date capStart() { | |
78 | + if (StringUtils.isNotEmpty(startDueWeek) ) { | |
79 | + int start = NumberUtils.toInt(startDueWeek, 0); | |
80 | + Date endDate = DateUtil.addDay(DateUtil.parseYMD(DateUtil.getyyyy_MM_dd(new Date())), -(start * 7)); | |
81 | + return endDate; | |
82 | + } | |
83 | + return null; | |
84 | + } | |
85 | + | |
86 | + public Date capEnd() { | |
87 | + if (StringUtils.isNotEmpty(endDueWeek)) { | |
88 | + int end = NumberUtils.toInt(endDueWeek, 0); | |
89 | + Date endDate = DateUtil.addDay(DateUtil.parseYMD(DateUtil.getyyyy_MM_dd(new Date())), -(end*7)-6); | |
90 | + return endDate; | |
91 | + } | |
92 | + return null; | |
93 | + } | |
94 | + | |
95 | + public String getStartDueWeek() { | |
96 | + return startDueWeek; | |
97 | + } | |
98 | + | |
99 | + public void setStartDueWeek(String startDueWeek) { | |
100 | + this.startDueWeek = startDueWeek; | |
101 | + } | |
102 | + | |
103 | + public String getEndDueWeek() { | |
104 | + return endDueWeek; | |
105 | + } | |
106 | + | |
107 | + public void setEndDueWeek(String endDueWeek) { | |
108 | + this.endDueWeek = endDueWeek; | |
109 | + } | |
110 | + | |
111 | + public Integer getStartAge() { | |
112 | + return startAge; | |
113 | + } | |
114 | + | |
115 | + public void setStartAge(Integer startAge) { | |
116 | + this.startAge = startAge; | |
117 | + } | |
118 | + | |
119 | + public Integer getEndAge() { | |
120 | + return endAge; | |
121 | + } | |
122 | + | |
123 | + public void setEndAge(Integer endAge) { | |
124 | + this.endAge = endAge; | |
125 | + } | |
47 | 126 | |
48 | 127 | public String getProvinceRegisterId() { |
49 | 128 | return provinceRegisterId; |