Commit 7a83bf449f445a4ff088054b5e449dabfea34950
1 parent
f6f638de4c
Exists in
master
and in
8 other branches
医院基础列表
Showing 2 changed files with 172 additions and 4 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/SmsConfigController.java
View file @
7a83bf4
| ... | ... | @@ -146,5 +146,23 @@ |
| 146 | 146 | objectResponse.setErrormsg("成功"); |
| 147 | 147 | return objectResponse; |
| 148 | 148 | } |
| 149 | + | |
| 150 | + | |
| 151 | + /** | |
| 152 | + * 查询可配置的医院 | |
| 153 | + * @return | |
| 154 | + */ | |
| 155 | + @RequestMapping(value = "/queryConfigHospitals", method = RequestMethod.GET) | |
| 156 | + @ResponseBody | |
| 157 | + public BaseResponse queryConfigHospitals(@RequestParam(required = false) String provinceId, | |
| 158 | + @RequestParam(required = false) String cityId, | |
| 159 | + @RequestParam(required = false) String areaId, | |
| 160 | + @RequestParam(required = false) String hospitalName, | |
| 161 | + @RequestParam(required = false) Integer status, | |
| 162 | + @RequestParam("page") Integer page, | |
| 163 | + @RequestParam("limit") Integer limit | |
| 164 | + ) { | |
| 165 | + return smsConfigFacade.queryConfigHospitals(hospitalName,provinceId, cityId, areaId, status,page,limit); | |
| 166 | + } | |
| 149 | 167 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SmsConfigFacade.java
View file @
7a83bf4
| ... | ... | @@ -2,9 +2,11 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.biz.service.*; |
| 4 | 4 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 5 | +import com.lyms.platform.common.enums.OrganizationTypeEnum; | |
| 5 | 6 | import com.lyms.platform.common.enums.SmsServiceEnums; |
| 6 | 7 | import com.lyms.platform.common.enums.WeekEnums; |
| 7 | 8 | import com.lyms.platform.common.enums.YnEnums; |
| 9 | +import com.lyms.platform.common.result.BaseListResponse; | |
| 8 | 10 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 9 | 11 | import com.lyms.platform.common.result.BaseResponse; |
| 10 | 12 | import com.lyms.platform.common.utils.JsonUtil; |
| ... | ... | @@ -15,6 +17,7 @@ |
| 15 | 17 | import com.lyms.platform.permission.model.Departments; |
| 16 | 18 | import com.lyms.platform.permission.model.DepartmentsQuery; |
| 17 | 19 | import com.lyms.platform.permission.model.Organization; |
| 20 | +import com.lyms.platform.permission.model.OrganizationQuery; | |
| 18 | 21 | import com.lyms.platform.permission.service.DepartmentsService; |
| 19 | 22 | import com.lyms.platform.permission.service.OrganizationService; |
| 20 | 23 | import com.lyms.platform.pojo.*; |
| 21 | 24 | |
| 22 | 25 | |
| 23 | 26 | |
| 24 | 27 | |
| ... | ... | @@ -352,26 +355,29 @@ |
| 352 | 355 | allAddress+=configList.get(0).getName(); |
| 353 | 356 | } |
| 354 | 357 | } |
| 355 | - String areaId = org.getAreaId(); | |
| 358 | + | |
| 359 | + String cityId = org.getCityId(); | |
| 356 | 360 | if (StringUtils.isNotEmpty(provinceId)) |
| 357 | 361 | { |
| 358 | - query.setId(areaId); | |
| 362 | + query.setId(cityId); | |
| 359 | 363 | List<BasicConfig> configList = basicConfigService.queryBasicConfig(query); |
| 360 | 364 | if (CollectionUtils.isNotEmpty(configList)) |
| 361 | 365 | { |
| 362 | 366 | allAddress+=configList.get(0).getName(); |
| 363 | 367 | } |
| 364 | 368 | } |
| 365 | - String cityId = org.getCityId(); | |
| 369 | + | |
| 370 | + String areaId = org.getAreaId(); | |
| 366 | 371 | if (StringUtils.isNotEmpty(provinceId)) |
| 367 | 372 | { |
| 368 | - query.setId(cityId); | |
| 373 | + query.setId(areaId); | |
| 369 | 374 | List<BasicConfig> configList = basicConfigService.queryBasicConfig(query); |
| 370 | 375 | if (CollectionUtils.isNotEmpty(configList)) |
| 371 | 376 | { |
| 372 | 377 | allAddress+=configList.get(0).getName(); |
| 373 | 378 | } |
| 374 | 379 | } |
| 380 | + | |
| 375 | 381 | String address = org.getAddress(); |
| 376 | 382 | allAddress+=address; |
| 377 | 383 | hospital.put("address", allAddress); |
| ... | ... | @@ -436,6 +442,150 @@ |
| 436 | 442 | BaseResponse objectResponse = new BaseResponse(); |
| 437 | 443 | objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 438 | 444 | objectResponse.setErrormsg("保存成功"); |
| 445 | + return objectResponse; | |
| 446 | + } | |
| 447 | + | |
| 448 | + /** | |
| 449 | + * 查询 可配置的医院列表 | |
| 450 | + * @param hospitalName | |
| 451 | + * @param provinceId | |
| 452 | + * @param cityId | |
| 453 | + * @param areaId | |
| 454 | + * @param status | |
| 455 | + * @param page | |
| 456 | + * @param limit | |
| 457 | + * @return | |
| 458 | + */ | |
| 459 | + public BaseResponse queryConfigHospitals(String hospitalName,String provinceId, String cityId, String areaId, Integer status,Integer page,Integer limit) { | |
| 460 | + OrganizationQuery organizationQuery = new OrganizationQuery(); | |
| 461 | + if(null != page && limit != page) { | |
| 462 | + organizationQuery.setNeed("true"); | |
| 463 | + organizationQuery.setPage(page); | |
| 464 | + organizationQuery.setLimit(limit); | |
| 465 | + } | |
| 466 | + | |
| 467 | + List<Integer> typeList = new ArrayList(); | |
| 468 | + typeList.add(OrganizationTypeEnum.XY.getId()); | |
| 469 | + typeList.add(OrganizationTypeEnum.NY.getId()); | |
| 470 | + typeList.add(OrganizationTypeEnum.FB.getId()); | |
| 471 | + typeList.add(OrganizationTypeEnum.TY.getId()); | |
| 472 | + | |
| 473 | + typeList.add(OrganizationTypeEnum.NJY.getId()); | |
| 474 | + typeList.add(OrganizationTypeEnum.JMQY.getId()); | |
| 475 | + typeList.add(OrganizationTypeEnum.GJY.getId()); | |
| 476 | + | |
| 477 | + if (StringUtils.isNotEmpty(provinceId)) | |
| 478 | + { | |
| 479 | + organizationQuery.setProvinceId(provinceId); | |
| 480 | + } | |
| 481 | + if (StringUtils.isNotEmpty(cityId)) | |
| 482 | + { | |
| 483 | + organizationQuery.setCityId(cityId); | |
| 484 | + } | |
| 485 | + if (StringUtils.isNotEmpty(areaId)) | |
| 486 | + { | |
| 487 | + organizationQuery.setAreaId(areaId); | |
| 488 | + } | |
| 489 | + | |
| 490 | + organizationQuery.setTypeList(typeList); | |
| 491 | + organizationQuery.setYn(YnEnums.YES.getId()); | |
| 492 | + organizationQuery.setKeyword(hospitalName); | |
| 493 | + | |
| 494 | + List<Map> hospitals = new ArrayList<>(); | |
| 495 | + | |
| 496 | + List<Organization> organizations = organizationService.queryOrganization(organizationQuery); | |
| 497 | + | |
| 498 | + if (CollectionUtils.isNotEmpty(organizations)) | |
| 499 | + { | |
| 500 | + for(Organization org : organizations) | |
| 501 | + { | |
| 502 | + Map<String,String> hospital = new HashMap<>(); | |
| 503 | + hospital.put("hospitalName",org.getName()); | |
| 504 | + hospital.put("shortCode",org.getShortCode()); | |
| 505 | + | |
| 506 | + | |
| 507 | + String allAddress = ""; | |
| 508 | + String pid = org.getProvinceId(); | |
| 509 | + BasicConfigQuery query = new BasicConfigQuery(); | |
| 510 | + query.setYn(YnEnums.YES.getId()); | |
| 511 | + if (StringUtils.isNotEmpty(pid)) | |
| 512 | + { | |
| 513 | + query.setId(pid); | |
| 514 | + List<BasicConfig> configList = basicConfigService.queryBasicConfig(query); | |
| 515 | + if (CollectionUtils.isNotEmpty(configList)) | |
| 516 | + { | |
| 517 | + allAddress+=configList.get(0).getName(); | |
| 518 | + } | |
| 519 | + } | |
| 520 | + | |
| 521 | + String cid = org.getCityId(); | |
| 522 | + if (StringUtils.isNotEmpty(provinceId)) | |
| 523 | + { | |
| 524 | + query.setId(cid); | |
| 525 | + List<BasicConfig> configList = basicConfigService.queryBasicConfig(query); | |
| 526 | + if (CollectionUtils.isNotEmpty(configList)) | |
| 527 | + { | |
| 528 | + allAddress+=configList.get(0).getName(); | |
| 529 | + } | |
| 530 | + } | |
| 531 | + | |
| 532 | + String aid = org.getAreaId(); | |
| 533 | + if (StringUtils.isNotEmpty(aid)) | |
| 534 | + { | |
| 535 | + query.setId(aid); | |
| 536 | + List<BasicConfig> configList = basicConfigService.queryBasicConfig(query); | |
| 537 | + if (CollectionUtils.isNotEmpty(configList)) | |
| 538 | + { | |
| 539 | + allAddress+=configList.get(0).getName(); | |
| 540 | + } | |
| 541 | + } | |
| 542 | + | |
| 543 | + hospital.put("address",allAddress); | |
| 544 | + | |
| 545 | + String hid= org.getId() == null ? "" : String.valueOf(org.getId()); | |
| 546 | + | |
| 547 | + String sendTime = ""; | |
| 548 | + String statusStr = ""; | |
| 549 | + if (StringUtils.isNotEmpty(hid)) | |
| 550 | + { | |
| 551 | + SmsConfigQuery queryConfig = new SmsConfigQuery(); | |
| 552 | + queryConfig.setYn(YnEnums.YES.getId()); | |
| 553 | + queryConfig.setHospitalId(hid); | |
| 554 | + List<SmsConfigModel> smsmodels = smsConfigService.querySmsConfigByHid(queryConfig); | |
| 555 | + if (CollectionUtils.isNotEmpty(smsmodels)) | |
| 556 | + { | |
| 557 | + SmsConfigModel model = smsmodels.get(0); | |
| 558 | + if (model != null) | |
| 559 | + { | |
| 560 | + sendTime = model.getGuideTime(); | |
| 561 | + // 0运行 1试运行 2停止 | |
| 562 | + if (model.getStatus() == 0) | |
| 563 | + { | |
| 564 | + statusStr = "正式运行"; | |
| 565 | + } | |
| 566 | + else if (model.getStatus() == 1) | |
| 567 | + { | |
| 568 | + statusStr = "试运行"; | |
| 569 | + } | |
| 570 | + else if (model.getStatus() == 2) | |
| 571 | + { | |
| 572 | + statusStr = "停止运行"; | |
| 573 | + } | |
| 574 | + } | |
| 575 | + } | |
| 576 | + } | |
| 577 | + hospital.put("sendTime",sendTime); | |
| 578 | + hospital.put("statusStr",statusStr); | |
| 579 | + hospital.put("hid",hid); | |
| 580 | + hospitals.add(hospital); | |
| 581 | + } | |
| 582 | + } | |
| 583 | + | |
| 584 | + BaseListResponse objectResponse = new BaseListResponse(); | |
| 585 | + objectResponse.setData(hospitals); | |
| 586 | + objectResponse.setPageInfo(organizationQuery.getPageInfo()); | |
| 587 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 588 | + objectResponse.setErrormsg("成功"); | |
| 439 | 589 | return objectResponse; |
| 440 | 590 | } |
| 441 | 591 | } |