Commit ef07cf105a545d68ccf4cfc4cef6e2b30d15d3c9
1 parent
c5ce74ae20
Exists in
master
and in
6 other branches
孕妇学校
Showing 2 changed files with 32 additions and 3 deletions
platform-dal/src/main/java/com/lyms/platform/query/CourseQuery.java
View file @
ef07cf1
| ... | ... | @@ -73,7 +73,6 @@ |
| 73 | 73 | private List<String> hospitalIds; |
| 74 | 74 | |
| 75 | 75 | private Date courseEndTime; |
| 76 | - | |
| 77 | 76 | private String keyword; |
| 78 | 77 | |
| 79 | 78 | @Override |
| ... | ... | @@ -119,6 +118,12 @@ |
| 119 | 118 | condition = condition.and("hospitalId", hospitalIds, MongoOper.IN); |
| 120 | 119 | } |
| 121 | 120 | |
| 121 | + if (null != keyword) { | |
| 122 | + MongoCondition con1 = MongoCondition.newInstance("courseSpeaker", keyword, MongoOper.LIKE); | |
| 123 | + MongoCondition con = MongoCondition.newInstance("courseName", keyword, MongoOper.LIKE); | |
| 124 | + condition = condition.orCondition(new MongoCondition[]{con1, con}); | |
| 125 | + } | |
| 126 | + | |
| 122 | 127 | Criteria c1 = null; |
| 123 | 128 | |
| 124 | 129 | if (null != courseTimeStart) { |
| 125 | 130 | |
| ... | ... | @@ -166,12 +171,11 @@ |
| 166 | 171 | return condition.toMongoQuery(); |
| 167 | 172 | } |
| 168 | 173 | |
| 169 | - @Override | |
| 174 | + | |
| 170 | 175 | public String getKeyword() { |
| 171 | 176 | return keyword; |
| 172 | 177 | } |
| 173 | 178 | |
| 174 | - @Override | |
| 175 | 179 | public void setKeyword(String keyword) { |
| 176 | 180 | this.keyword = keyword; |
| 177 | 181 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientCourseFacade.java
View file @
ef07cf1
| ... | ... | @@ -16,6 +16,7 @@ |
| 16 | 16 | import com.lyms.platform.operate.web.result.CourseTypeResult; |
| 17 | 17 | import com.lyms.platform.operate.web.result.PatientCourseResult; |
| 18 | 18 | import com.lyms.platform.permission.model.Organization; |
| 19 | +import com.lyms.platform.permission.model.OrganizationQuery; | |
| 19 | 20 | import com.lyms.platform.permission.model.Users; |
| 20 | 21 | import com.lyms.platform.permission.service.OrganizationService; |
| 21 | 22 | import com.lyms.platform.permission.service.UsersService; |
| ... | ... | @@ -356,6 +357,30 @@ |
| 356 | 357 | if (StringUtils.isNotEmpty(hospitalIds)) |
| 357 | 358 | { |
| 358 | 359 | hospitalIdList = Arrays.asList(hospitalIds.split(",")); |
| 360 | + } | |
| 361 | + | |
| 362 | + if (StringUtils.isNotEmpty(keyword)) | |
| 363 | + { | |
| 364 | + List<String> conditionHospitalIds = new ArrayList<>(); | |
| 365 | + OrganizationQuery organizationQuery = new OrganizationQuery(); | |
| 366 | + organizationQuery.setNeed("true"); | |
| 367 | + organizationQuery.setPage(0); | |
| 368 | + organizationQuery.setLimit(100); | |
| 369 | + organizationQuery.setSort("modified desc"); | |
| 370 | + organizationQuery.setYn(YnEnums.YES.getId()); | |
| 371 | + organizationQuery.setKeyword(keyword); | |
| 372 | + List<Organization> organizations = organizationService.queryHospitals(organizationQuery); | |
| 373 | + if (CollectionUtils.isNotEmpty(organizations)) | |
| 374 | + { | |
| 375 | + for (Organization org : organizations) | |
| 376 | + { | |
| 377 | + conditionHospitalIds.add(String.valueOf(org.getId())); | |
| 378 | + } | |
| 379 | + } | |
| 380 | + if (CollectionUtils.isNotEmpty(conditionHospitalIds)) | |
| 381 | + { | |
| 382 | + hospitalIdList.retainAll(conditionHospitalIds); | |
| 383 | + } | |
| 359 | 384 | } |
| 360 | 385 | |
| 361 | 386 | CourseQuery query = new CourseQuery(); |