Commit 1f8b2b93576dd7373f8680cf4e49b5d50b0351a3

Authored by liquanyu
1 parent ece04818df

update

Showing 2 changed files with 23 additions and 11 deletions

platform-common/src/main/java/com/lyms/platform/common/dao/BaseMongoDAOImpl.java View file @ 1f8b2b9
... ... @@ -157,6 +157,7 @@
157 157 || "SmsConfigModel".equals(data.getClass().getSimpleName())
158 158 || "OperateLogModel".equals(data.getClass().getSimpleName())
159 159 || "TrackDown".equals(data.getClass().getSimpleName())
  160 + || "ModularFunctionConfigModel".equals(data.getClass().getSimpleName())
160 161 || "ArchiveData".equals(data.getClass().getSimpleName())) {
161 162 if(!"LisReport".equals(data.getClass().getSimpleName())){
162 163 //ExceptionUtils.catchException("NotSerializable for class :"+data.getClass().getSimpleName() );
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/StopPregnancyFacade.java View file @ 1f8b2b9
... ... @@ -554,18 +554,29 @@
554 554 * @return
555 555 */
556 556 public BaseResponse organizations() {
557   - List<Organization> organizations = organizationService.queryHospital();
  557 + List<ModularFunctionConfigModel> modularFunctionConfigModels =
  558 + mongoTemplate.find(Query.query(Criteria.where("configs.type").is("88")),ModularFunctionConfigModel.class);
558 559 List<Map<String, String>> orgList = new LinkedList<>();
559   - for (Organization organization : organizations) {
560   - ModularFunctionConfigModel modularFunctionConfigModel = mongoTemplate.findOne(Query.query(Criteria.
561   - where("configs.type").is("88").
562   - and("configs.value").is("2").and("hospitalId").is(organization.getId().toString())),
563   - ModularFunctionConfigModel.class);
564   - if (modularFunctionConfigModel != null) {
565   - Map<String, String> map = new HashMap<>();
566   - map.put("hospitalId", organization.getId().toString());
567   - map.put("hospitalName", organization.getName());
568   - orgList.add(map);
  560 +
  561 + for (ModularFunctionConfigModel modular : modularFunctionConfigModels)
  562 + {
  563 + if (modular != null) {
  564 + List<Map<String, Object>> items = modular.getConfigs();
  565 + if (CollectionUtils.isNotEmpty(items))
  566 + {
  567 + for (Map<String, Object> map : items)
  568 + {
  569 + if (map.get("type") != null && map.get("type").toString().equals("88") && map.get("value") != null && map.get("value").toString().equals("2"))
  570 + {
  571 + Map<String, String> map1 = new HashMap<>();
  572 + map1.put("hospitalId", modular.getHospitalId());
  573 + map1.put("hospitalName", organizationService.getOrganizationName(modular.getHospitalId()));
  574 + orgList.add(map1);
  575 + }
  576 + }
  577 +
  578 + }
  579 +
569 580 }
570 581 }
571 582 BaseResponse baseResponse = new BaseResponse();