Commit 56f63871ba5bc2c157170c5f22db9e89ddd5c895
1 parent
011fefd22a
Exists in
master
and in
6 other branches
小程序组织结构集
Showing 2 changed files with 47 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/StopPregnancyController.java
View file @
56f6387
... | ... | @@ -91,6 +91,15 @@ |
91 | 91 | return stopPregnancyFacade.queryInPerson3(Integer.parseInt(orgId)); |
92 | 92 | } |
93 | 93 | |
94 | + /** | |
95 | + * 小程序返回机构(“小程序自动创建产检”状态为“启动”的机构集) | |
96 | + **/ | |
97 | + @RequestMapping(method = RequestMethod.GET, value = "/wx/organizations") | |
98 | + @ResponseBody | |
99 | + public BaseResponse organizations() { | |
100 | + return stopPregnancyFacade.organizations(); | |
101 | + } | |
102 | + | |
94 | 103 | |
95 | 104 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/StopPregnancyFacade.java
View file @
56f6387
... | ... | @@ -12,14 +12,19 @@ |
12 | 12 | import com.lyms.platform.operate.web.result.AntexListResult; |
13 | 13 | import com.lyms.platform.operate.web.result.StopPregResult; |
14 | 14 | import com.lyms.platform.operate.web.service.ITrackDownService; |
15 | +import com.lyms.platform.permission.model.Organization; | |
15 | 16 | import com.lyms.platform.permission.model.Users; |
16 | 17 | import com.lyms.platform.permission.model.UsersQuery; |
17 | 18 | import com.lyms.platform.permission.service.CouponService; |
19 | +import com.lyms.platform.permission.service.OrganizationService; | |
18 | 20 | import com.lyms.platform.permission.service.UsersService; |
19 | 21 | import com.lyms.platform.pojo.*; |
20 | 22 | import com.lyms.platform.query.*; |
21 | 23 | import org.apache.commons.collections.CollectionUtils; |
22 | 24 | import org.springframework.beans.factory.annotation.Autowired; |
25 | +import org.springframework.data.mongodb.core.MongoTemplate; | |
26 | +import org.springframework.data.mongodb.core.query.Criteria; | |
27 | +import org.springframework.data.mongodb.core.query.Query; | |
23 | 28 | import org.springframework.stereotype.Component; |
24 | 29 | |
25 | 30 | import java.util.*; |
... | ... | @@ -70,6 +75,15 @@ |
70 | 75 | @Autowired |
71 | 76 | private TrackDownRecordService trackDownRecordService; |
72 | 77 | |
78 | + @Autowired | |
79 | + private ModularFunctionConfigService modularFunctionConfigServcie; | |
80 | + | |
81 | + @Autowired | |
82 | + private MongoTemplate mongoTemplate; | |
83 | + | |
84 | + @Autowired | |
85 | + private OrganizationService organizationService; | |
86 | + | |
73 | 87 | /** |
74 | 88 | * 更新终止妊娠 |
75 | 89 | * |
... | ... | @@ -526,5 +540,29 @@ |
526 | 540 | return objectResponse; |
527 | 541 | } |
528 | 542 | |
543 | + /** | |
544 | + * 获取本区域中 “小程序自动创建产检” 状态为启用的医院集 | |
545 | + * | |
546 | + * @return | |
547 | + */ | |
548 | + public BaseResponse organizations() { | |
549 | + List<Organization> organizations = organizationService.queryHospital(); | |
550 | + List<Map<String, String>> orgList = new LinkedList<>(); | |
551 | + for (Organization organization : organizations) { | |
552 | + ModularFunctionConfigModel modularFunctionConfigModel = mongoTemplate.findOne(Query.query(Criteria. | |
553 | + where("configs.type").is("88"). | |
554 | + and("configs.value").is("1").and("hospitalId").is(organization.getId().toString())), | |
555 | + ModularFunctionConfigModel.class); | |
556 | + if (modularFunctionConfigModel != null) { | |
557 | + Map<String, String> map = new HashMap<>(); | |
558 | + map.put("hospitalId", organization.getId().toString()); | |
559 | + map.put("hospitalName", organization.getName()); | |
560 | + orgList.add(map); | |
561 | + } | |
562 | + } | |
563 | + BaseResponse baseResponse = new BaseResponse(); | |
564 | + baseResponse.setObject(orgList); | |
565 | + return baseResponse; | |
566 | + } | |
529 | 567 | } |