Commit e7a886f5c1b07f2874883c0a114e1bc91ca46854
1 parent
9d71607ef4
Exists in
master
and in
1 other branch
增加设置parentid
Showing 3 changed files with 192 additions and 40 deletions
platform-dal/src/main/java/com/lyms/platform/query/ReferralApplyOrderQuery.java
View file @
e7a886f
... | ... | @@ -7,6 +7,7 @@ |
7 | 7 | import com.lyms.platform.common.dao.operator.MongoOper; |
8 | 8 | import com.lyms.platform.common.dao.operator.MongoQuery; |
9 | 9 | import com.lyms.platform.common.utils.StringUtils; |
10 | +import org.springframework.data.mongodb.core.query.Criteria; | |
10 | 11 | |
11 | 12 | import java.util.ArrayList; |
12 | 13 | import java.util.Date; |
13 | 14 | |
... | ... | @@ -40,12 +41,13 @@ |
40 | 41 | //年龄 |
41 | 42 | private String age; |
42 | 43 | //孕周 |
43 | - private Date dueDateStart; | |
44 | + private String dueDateStart; | |
44 | 45 | //孕周 |
45 | 46 | private Date dueDateEnd; |
46 | 47 | //风险等级 |
47 | 48 | private String rLevel; |
48 | - private Integer score; | |
49 | + private Integer scoreStart; | |
50 | + private Integer scoreEnd; | |
49 | 51 | private String riskFactor; |
50 | 52 | private String hospitalName; |
51 | 53 | //转入医院 |
... | ... | @@ -57,6 +59,78 @@ |
57 | 59 | //体验会员 0非会员 1会员 |
58 | 60 | private Integer expVip; |
59 | 61 | |
62 | + /** | |
63 | + * 生日 | |
64 | + */ | |
65 | + private Date birthStart; | |
66 | + | |
67 | + /** | |
68 | + * 生日 | |
69 | + */ | |
70 | + private Date birthEnd; | |
71 | + | |
72 | + /** | |
73 | + * 末次月经 | |
74 | + */ | |
75 | + private Date lastMensesStart; | |
76 | + | |
77 | + /** | |
78 | + * 末次月经 | |
79 | + */ | |
80 | + private Date lastMensesEnd; | |
81 | + | |
82 | + public void setDueDateStart(String dueDateStart) { | |
83 | + this.dueDateStart = dueDateStart; | |
84 | + } | |
85 | + | |
86 | + public Integer getScoreEnd() { | |
87 | + return scoreEnd; | |
88 | + } | |
89 | + | |
90 | + public void setScoreEnd(Integer scoreEnd) { | |
91 | + this.scoreEnd = scoreEnd; | |
92 | + } | |
93 | + | |
94 | + public Integer getScoreStart() { | |
95 | + return scoreStart; | |
96 | + } | |
97 | + | |
98 | + public void setScoreStart(Integer scoreStart) { | |
99 | + this.scoreStart = scoreStart; | |
100 | + } | |
101 | + | |
102 | + public Date getLastMensesEnd() { | |
103 | + return lastMensesEnd; | |
104 | + } | |
105 | + | |
106 | + public void setLastMensesEnd(Date lastMensesEnd) { | |
107 | + this.lastMensesEnd = lastMensesEnd; | |
108 | + } | |
109 | + | |
110 | + public Date getLastMensesStart() { | |
111 | + return lastMensesStart; | |
112 | + } | |
113 | + | |
114 | + public void setLastMensesStart(Date lastMensesStart) { | |
115 | + this.lastMensesStart = lastMensesStart; | |
116 | + } | |
117 | + | |
118 | + public Date getBirthEnd() { | |
119 | + return birthEnd; | |
120 | + } | |
121 | + | |
122 | + public void setBirthEnd(Date birthEnd) { | |
123 | + this.birthEnd = birthEnd; | |
124 | + } | |
125 | + | |
126 | + public Date getBirthStart() { | |
127 | + return birthStart; | |
128 | + } | |
129 | + | |
130 | + public void setBirthStart(Date birthStart) { | |
131 | + this.birthStart = birthStart; | |
132 | + } | |
133 | + | |
60 | 134 | public String getHospitalId() { |
61 | 135 | return hospitalId; |
62 | 136 | } |
63 | 137 | |
... | ... | @@ -145,14 +219,7 @@ |
145 | 219 | this.dueDateEnd = dueDateEnd; |
146 | 220 | } |
147 | 221 | |
148 | - public Date getDueDateStart() { | |
149 | - return dueDateStart; | |
150 | - } | |
151 | 222 | |
152 | - public void setDueDateStart(Date dueDateStart) { | |
153 | - this.dueDateStart = dueDateStart; | |
154 | - } | |
155 | - | |
156 | 223 | @Override |
157 | 224 | public MongoQuery convertToQuery() { |
158 | 225 | MongoCondition condition = MongoCondition.newInstance(); |
159 | 226 | |
... | ... | @@ -192,9 +259,25 @@ |
192 | 259 | if(null!=rLevel){ |
193 | 260 | condition=condition.and("rLevel",rLevel, MongoOper.IS); |
194 | 261 | } |
195 | - if(null!=score){ | |
196 | - condition=condition.and("score",score, MongoOper.IS); | |
262 | + boolean isAddStart = Boolean.FALSE; | |
263 | + | |
264 | + Criteria c = null; | |
265 | + if (null != scoreStart) { | |
266 | + c = Criteria.where("score").gte(scoreStart); | |
267 | + isAddStart = Boolean.TRUE; | |
197 | 268 | } |
269 | + if (null != scoreEnd) { | |
270 | + if (isAddStart) { | |
271 | + c = c.lte(scoreEnd); | |
272 | + } else { | |
273 | + c = Criteria.where("score").lte(scoreEnd); | |
274 | + } | |
275 | + isAddStart = Boolean.TRUE; | |
276 | + } | |
277 | + | |
278 | + | |
279 | + | |
280 | + | |
198 | 281 | if(null!=riskFactor){ |
199 | 282 | condition=condition.and("riskFactor",riskFactor, MongoOper.IN); |
200 | 283 | } |
... | ... | @@ -222,6 +305,41 @@ |
222 | 305 | MongoCondition mongoCondition1=MongoCondition.newInstance("transferredHospital", list, MongoOper.IN); |
223 | 306 | condition=condition.andCondition(mongoCondition1); |
224 | 307 | } |
308 | + if (isAddStart) { | |
309 | + return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery(); | |
310 | + } | |
311 | + | |
312 | + if (null != lastMensesStart) { | |
313 | + c = Criteria.where("lastMenses").gte(lastMensesStart); | |
314 | + isAddStart = Boolean.TRUE; | |
315 | + } | |
316 | + if (null != lastMensesEnd) { | |
317 | + if (isAddStart) { | |
318 | + c = c.lte(lastMensesEnd); | |
319 | + } else { | |
320 | + c = Criteria.where("lastMenses").lte(lastMensesEnd); | |
321 | + } | |
322 | + isAddStart = Boolean.TRUE; | |
323 | + } | |
324 | + if (isAddStart) { | |
325 | + return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery(); | |
326 | + } | |
327 | + | |
328 | + if (null != birthStart) { | |
329 | + c = Criteria.where("birth").gte(birthStart); | |
330 | + isAddStart = Boolean.TRUE; | |
331 | + } | |
332 | + if (null != birthEnd) { | |
333 | + if (isAddStart) { | |
334 | + c = c.lte(birthEnd); | |
335 | + } else { | |
336 | + c = Criteria.where("birth").lte(birthEnd); | |
337 | + } | |
338 | + isAddStart = Boolean.TRUE; | |
339 | + } | |
340 | + if (isAddStart) { | |
341 | + return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery(); | |
342 | + } | |
225 | 343 | return condition.toMongoQuery(); |
226 | 344 | } |
227 | 345 | |
228 | 346 | |
... | ... | @@ -268,13 +386,7 @@ |
268 | 386 | this.rLevel = rLevel; |
269 | 387 | } |
270 | 388 | |
271 | - public Integer getScore() { | |
272 | - return score; | |
273 | - } | |
274 | 389 | |
275 | - public void setScore(Integer score) { | |
276 | - this.score = score; | |
277 | - } | |
278 | 390 | |
279 | 391 | public String getServiceStatus() { |
280 | 392 | return serviceStatus; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ApplyOrderFacade.java
View file @
e7a886f
... | ... | @@ -113,7 +113,7 @@ |
113 | 113 | referralApplyOrderModel.setBirth(patients.getBirth()); |
114 | 114 | referralApplyOrderModel.setExpVip(patients.getExpVip()); |
115 | 115 | int days = DateUtil.daysBetween(patients.getLastMenses(), new Date()); |
116 | - HighScoreResult highScoreResult= antenatalExaminationFacade.findLastRisk(patients.getPid(), true); | |
116 | + HighScoreResult highScoreResult = antenatalExaminationFacade.findLastRisk(patients.getPid(), true); | |
117 | 117 | referralApplyOrderModel.setrRisk(highScoreResult.getHighId()); |
118 | 118 | referralApplyOrderModel.setScore(highScoreResult.getScore()); |
119 | 119 | referralApplyOrderModel.setrLevel(highScoreResult.getLevelId()); |
120 | 120 | |
121 | 121 | |
122 | 122 | |
... | ... | @@ -394,16 +394,33 @@ |
394 | 394 | public BaseListResponse queryApplyOrder(ApplyOrderQueryRequest applyOrderQueryRequest, Integer userId) { |
395 | 395 | ReferralApplyOrderQuery referralApplyOrderQuery = new ReferralApplyOrderQuery(); |
396 | 396 | referralApplyOrderQuery.setName(applyOrderQueryRequest.getName()); |
397 | - referralApplyOrderQuery.setAge(applyOrderQueryRequest.getAge()); | |
398 | - if (StringUtils.isNotEmpty(applyOrderQueryRequest.getStartDueWeek())) { | |
399 | - referralApplyOrderQuery.setDueDateStart(DateUtil.parseYMD(applyOrderQueryRequest.getStartDueWeek())); | |
397 | + //根据年龄 | |
398 | + if (null != applyOrderQueryRequest.getStartAge()) { | |
399 | + Date date = DateUtil.addYear(new Date(), -applyOrderQueryRequest.getStartAge()); | |
400 | + referralApplyOrderQuery.setBirthStart(date); | |
400 | 401 | } |
401 | - if (StringUtils.isNotEmpty(applyOrderQueryRequest.getEndDueWeek())) { | |
402 | - referralApplyOrderQuery.setDueDateEnd(DateUtil.parseYMD(applyOrderQueryRequest.getEndDueWeek())); | |
402 | + if(null!=applyOrderQueryRequest.getEndAge()){ | |
403 | + Date date = DateUtil.addYear(new Date(), -applyOrderQueryRequest.getEndAge()); | |
404 | + referralApplyOrderQuery.setBirthEnd(date); | |
403 | 405 | } |
406 | + //根据孕周 | |
407 | + if(null!=applyOrderQueryRequest.getEndDueWeek()){ | |
408 | + | |
409 | + } | |
410 | + if(null!=applyOrderQueryRequest.getStartDueWeek()){ | |
411 | + | |
412 | + } | |
413 | + | |
414 | + if(null!=applyOrderQueryRequest.getStartScore()){ | |
415 | + referralApplyOrderQuery.setScoreStart(applyOrderQueryRequest.getStartScore()); | |
416 | + } | |
417 | + | |
418 | + if(null!=applyOrderQueryRequest.getEndScore()){ | |
419 | + referralApplyOrderQuery.setScoreEnd(applyOrderQueryRequest.getEndScore()); | |
420 | + } | |
421 | + | |
404 | 422 | referralApplyOrderQuery.setRiskFactor(applyOrderQueryRequest.getRiskFactor()); |
405 | 423 | referralApplyOrderQuery.setrLevel(applyOrderQueryRequest.getrLevel()); |
406 | - referralApplyOrderQuery.setScore(applyOrderQueryRequest.getScore()); | |
407 | 424 | referralApplyOrderQuery.setCardNo(applyOrderQueryRequest.getCardNo()); |
408 | 425 | referralApplyOrderQuery.setPage(applyOrderQueryRequest.getPage()); |
409 | 426 | referralApplyOrderQuery.setPhone(applyOrderQueryRequest.getPhone()); |
... | ... | @@ -411,6 +428,7 @@ |
411 | 428 | referralApplyOrderQuery.setLimit(applyOrderQueryRequest.getLimit()); |
412 | 429 | referralApplyOrderQuery.setType(applyOrderQueryRequest.getType()); |
413 | 430 | referralApplyOrderQuery.setNeed("1"); |
431 | + | |
414 | 432 | String hospital = autoMatchFacade.getHospitalId(userId); |
415 | 433 | referralApplyOrderQuery.setHospitalId(hospital); |
416 | 434 | referralApplyOrderQuery.setHospitalName(organizationService.getOrganization(Integer.valueOf(hospital)).getName()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ApplyOrderQueryRequest.java
View file @
e7a886f
... | ... | @@ -29,7 +29,8 @@ |
29 | 29 | private String phone; |
30 | 30 | private String transferredHospital; |
31 | 31 | //年龄 |
32 | - private String age; | |
32 | + private Integer endAge; | |
33 | + private Integer startAge; | |
33 | 34 | //孕周 |
34 | 35 | private String startDueWeek; |
35 | 36 | |
... | ... | @@ -37,7 +38,9 @@ |
37 | 38 | |
38 | 39 | //风险等级 |
39 | 40 | private String rLevel; |
40 | - private Integer score; | |
41 | + private Integer startScore; | |
42 | + private Integer endScore; | |
43 | + | |
41 | 44 | private String riskFactor; |
42 | 45 | /** |
43 | 46 | * 1 转入 0 转出 |
... | ... | @@ -48,6 +51,39 @@ |
48 | 51 | */ |
49 | 52 | private Integer type; |
50 | 53 | |
54 | + | |
55 | + public Integer getEndAge() { | |
56 | + return endAge; | |
57 | + } | |
58 | + | |
59 | + public void setEndAge(Integer endAge) { | |
60 | + this.endAge = endAge; | |
61 | + } | |
62 | + | |
63 | + public Integer getEndScore() { | |
64 | + return endScore; | |
65 | + } | |
66 | + | |
67 | + public void setEndScore(Integer endScore) { | |
68 | + this.endScore = endScore; | |
69 | + } | |
70 | + | |
71 | + public Integer getStartAge() { | |
72 | + return startAge; | |
73 | + } | |
74 | + | |
75 | + public void setStartAge(Integer startAge) { | |
76 | + this.startAge = startAge; | |
77 | + } | |
78 | + | |
79 | + public Integer getStartScore() { | |
80 | + return startScore; | |
81 | + } | |
82 | + | |
83 | + public void setStartScore(Integer startScore) { | |
84 | + this.startScore = startScore; | |
85 | + } | |
86 | + | |
51 | 87 | public String getPhone() { |
52 | 88 | return phone; |
53 | 89 | } |
54 | 90 | |
55 | 91 | |
... | ... | @@ -80,15 +116,8 @@ |
80 | 116 | this.type = type; |
81 | 117 | } |
82 | 118 | |
83 | - public String getAge() { | |
84 | - return age; | |
85 | - } | |
86 | 119 | |
87 | - public void setAge(String age) { | |
88 | - this.age = age; | |
89 | - } | |
90 | 120 | |
91 | - | |
92 | 121 | public String getEndDueWeek() { |
93 | 122 | return endDueWeek; |
94 | 123 | } |
... | ... | @@ -121,13 +150,6 @@ |
121 | 150 | this.rLevel = rLevel; |
122 | 151 | } |
123 | 152 | |
124 | - public Integer getScore() { | |
125 | - return score; | |
126 | - } | |
127 | - | |
128 | - public void setScore(Integer score) { | |
129 | - this.score = score; | |
130 | - } | |
131 | 153 | |
132 | 154 | public String getCardNo() { |
133 | 155 | return cardNo; |