Commit baf6351ebc00d63a95a09e49941cd95f38d121a2
1 parent
9e006b2bcc
Exists in
master
and in
6 other branches
1
Showing 2 changed files with 50 additions and 0 deletions
platform-dal/src/main/java/com/lyms/platform/query/TrackDownRecordQuery.java
View file @
baf6351
... | ... | @@ -9,7 +9,9 @@ |
9 | 9 | import org.apache.commons.collections.CollectionUtils; |
10 | 10 | import org.slf4j.Logger; |
11 | 11 | import org.slf4j.LoggerFactory; |
12 | +import org.springframework.data.mongodb.core.query.Criteria; | |
12 | 13 | |
14 | +import java.util.Date; | |
13 | 15 | import java.util.List; |
14 | 16 | |
15 | 17 | |
16 | 18 | |
... | ... | @@ -36,7 +38,32 @@ |
36 | 38 | private String parentId; |
37 | 39 | private List<String> pids; |
38 | 40 | private String hospitalId; |
41 | + /** | |
42 | + * 末次月经 | |
43 | + */ | |
44 | + private Date lastMensesStart; | |
39 | 45 | |
46 | + /** | |
47 | + * 末次月经 | |
48 | + */ | |
49 | + private Date lastMensesEnd; | |
50 | + | |
51 | + public Date getLastMensesStart() { | |
52 | + return lastMensesStart; | |
53 | + } | |
54 | + | |
55 | + public void setLastMensesStart(Date lastMensesStart) { | |
56 | + this.lastMensesStart = lastMensesStart; | |
57 | + } | |
58 | + | |
59 | + public Date getLastMensesEnd() { | |
60 | + return lastMensesEnd; | |
61 | + } | |
62 | + | |
63 | + public void setLastMensesEnd(Date lastMensesEnd) { | |
64 | + this.lastMensesEnd = lastMensesEnd; | |
65 | + } | |
66 | + | |
40 | 67 | public String getHospitalId() { |
41 | 68 | return hospitalId; |
42 | 69 | } |
... | ... | @@ -134,6 +161,24 @@ |
134 | 161 | } |
135 | 162 | if (null != pids) { |
136 | 163 | condition = condition.and("pid", pids, MongoOper.IN); |
164 | + } | |
165 | + Criteria c1 = null; | |
166 | + if (null != lastMensesStart) { | |
167 | + if (null != c1) { | |
168 | + c1 = c1.and("lastMenses").gte(lastMensesStart); | |
169 | + } else { | |
170 | + c1 = Criteria.where("lastMenses").gte(lastMensesStart); | |
171 | + } | |
172 | + } | |
173 | + if (null != lastMensesEnd) { | |
174 | + if (c1 != null) { | |
175 | + c1 = c1.lte(lastMensesEnd); | |
176 | + } else { | |
177 | + c1 = Criteria.where("lastMenses").lte(lastMensesEnd); | |
178 | + } | |
179 | + } | |
180 | + if (null != c1) { | |
181 | + condition = condition.andCondition(new MongoCondition(c1)); | |
137 | 182 | } |
138 | 183 | return condition.toMongoQuery(); |
139 | 184 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TrackDownFacade.java
View file @
baf6351
... | ... | @@ -91,6 +91,11 @@ |
91 | 91 | downRecordQuery.setCityId(downQueryRequest.getCityId()); |
92 | 92 | downRecordQuery.setStreetId(downQueryRequest.getStreetId()); |
93 | 93 | downRecordQuery.setTrackType(downQueryRequest.getTrackType()); |
94 | + //如果是产筛请求 | |
95 | + if(null!=downQueryRequest.getTrackType() && TrackDownDateEnums.D.getId()==downQueryRequest.getTrackType()){ | |
96 | + downRecordQuery.setLastMensesEnd(DateUtil.addDay(DateUtil.formatDate(new Date()),-140)); | |
97 | + downRecordQuery.setTrackType(3); | |
98 | + } | |
94 | 99 | downRecordQuery.setPage(downQueryRequest.getPage()); |
95 | 100 | downRecordQuery.setLimit(downQueryRequest.getLimit()); |
96 | 101 | downRecordQuery.setNeed("1"); |