Commit 74f89ce8351b463465344fffb8d0004d9636d8e3
1 parent
e78151ff6b
Exists in
master
and in
6 other branches
update
Showing 3 changed files with 72 additions and 16 deletions
platform-biz-service/src/main/java/com/lyms/platform/permission/model/LisReportModel.java
View file @
74f89ce
| ... | ... | @@ -57,6 +57,17 @@ |
| 57 | 57 | //检验明细json |
| 58 | 58 | private String itemJson; |
| 59 | 59 | |
| 60 | + //医院名称 | |
| 61 | + private String hospitalName; | |
| 62 | + | |
| 63 | + public String getHospitalName() { | |
| 64 | + return hospitalName; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public void setHospitalName(String hospitalName) { | |
| 68 | + this.hospitalName = hospitalName; | |
| 69 | + } | |
| 70 | + | |
| 60 | 71 | public Integer getStatus() { |
| 61 | 72 | return status; |
| 62 | 73 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/LisController.java
View file @
74f89ce
| ... | ... | @@ -126,7 +126,7 @@ |
| 126 | 126 | */ |
| 127 | 127 | @RequestMapping(method = RequestMethod.GET, value = "/getAppLis") |
| 128 | 128 | @ResponseBody |
| 129 | - public BaseResponse getLisAndRisData(@RequestParam("patientIds") String patientIds, | |
| 129 | + public List<LisReportModel> getLisAndRisData(@RequestParam("patientIds") String patientIds, | |
| 130 | 130 | @RequestParam("page") Integer page, |
| 131 | 131 | @RequestParam("limit") Integer limit, |
| 132 | 132 | @RequestParam(required = false) Integer status, |
| ... | ... | @@ -135,7 +135,7 @@ |
| 135 | 135 | if (!"3d19960bf3e81e7d816c4f26051c49ba".equals(token)) |
| 136 | 136 | { |
| 137 | 137 | ExceptionUtils.catchException("The request token is " + token); |
| 138 | - return new BaseResponse().setErrorcode(ErrorCodeConstants.TOKEN_EXPIRE).setErrormsg("Token is error"); | |
| 138 | + return new ArrayList<>(); | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | return lisFacade.getAppLisList(patientIds, status, page, limit); |
| 142 | 142 | |
| ... | ... | @@ -150,13 +150,13 @@ |
| 150 | 150 | */ |
| 151 | 151 | @RequestMapping(method = RequestMethod.GET, value = "/getAppLisById") |
| 152 | 152 | @ResponseBody |
| 153 | - public BaseResponse getAppLisById(@RequestParam("id") Integer id, | |
| 153 | + public List<LisReportModel> getAppLisById(@RequestParam("id") Integer id, | |
| 154 | 154 | @RequestHeader("Authorization") String token) { |
| 155 | 155 | |
| 156 | 156 | if (!"3d19960bf3e81e7d816c4f26051c49ba".equals(token)) |
| 157 | 157 | { |
| 158 | 158 | ExceptionUtils.catchException("The request token is " + token); |
| 159 | - return new BaseResponse().setErrorcode(ErrorCodeConstants.TOKEN_EXPIRE).setErrormsg("Token is error"); | |
| 159 | + return new ArrayList<>(); | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | return lisFacade.getAppLisById(id); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java
View file @
74f89ce
| ... | ... | @@ -403,7 +403,7 @@ |
| 403 | 403 | * @param patientIds 院内系统孕妇建档id |
| 404 | 404 | * @return |
| 405 | 405 | */ |
| 406 | - public BaseResponse getAppLisList(String patientIds,Integer status,Integer page,Integer limit) { | |
| 406 | + public List<LisReportModel> getAppLisList(String patientIds,Integer status,Integer page,Integer limit) { | |
| 407 | 407 | |
| 408 | 408 | List<String> ids = new ArrayList<>(); |
| 409 | 409 | if (StringUtils.isNotEmpty(patientIds)) |
| 410 | 410 | |
| ... | ... | @@ -448,11 +448,14 @@ |
| 448 | 448 | query.setStatus(status); |
| 449 | 449 | query.setHospitalIds(hosptalIds); |
| 450 | 450 | |
| 451 | + Map<String,String> hospitalNames = getHospitalNames(hosptalIds); | |
| 452 | + | |
| 451 | 453 | lises = lisService.queryLisDataByQuery(query); |
| 452 | 454 | if (CollectionUtils.isNotEmpty(lises)) |
| 453 | 455 | { |
| 454 | 456 | for(LisReportModel lisReportModel : lises) |
| 455 | 457 | { |
| 458 | + lisReportModel.setHospitalName(hospitalNames.get(lisReportModel.getHospitalId())); | |
| 456 | 459 | String json = lisReportModel.getItemJson(); |
| 457 | 460 | if (StringUtils.isNotEmpty(json)) |
| 458 | 461 | { |
| ... | ... | @@ -463,11 +466,12 @@ |
| 463 | 466 | } |
| 464 | 467 | } |
| 465 | 468 | } |
| 466 | - BaseObjectResponse objectResponse = new BaseObjectResponse(); | |
| 467 | - objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 468 | - objectResponse.setData(lises); | |
| 469 | - objectResponse.setErrormsg("成功"); | |
| 470 | - return objectResponse; | |
| 469 | +// BaseObjectResponse objectResponse = new BaseObjectResponse(); | |
| 470 | +// objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 471 | +// objectResponse.setData(lises); | |
| 472 | +// objectResponse.setErrormsg("成功"); | |
| 473 | +// return objectResponse; | |
| 474 | + return lises; | |
| 471 | 475 | } |
| 472 | 476 | |
| 473 | 477 | /** |
| ... | ... | @@ -500,7 +504,7 @@ |
| 500 | 504 | * @param id |
| 501 | 505 | * @return |
| 502 | 506 | */ |
| 503 | - public BaseResponse getAppLisById(Integer id) { | |
| 507 | + public List<LisReportModel> getAppLisById(Integer id) { | |
| 504 | 508 | |
| 505 | 509 | LisReportQuery query = new LisReportQuery(); |
| 506 | 510 | query.setId(id); |
| 507 | 511 | |
| 508 | 512 | |
| ... | ... | @@ -510,20 +514,61 @@ |
| 510 | 514 | { |
| 511 | 515 | for(LisReportModel lisReportModel : lises) |
| 512 | 516 | { |
| 517 | + Organization organization = null; | |
| 518 | + if (StringUtils.isNotEmpty(lisReportModel.getHospitalId())) | |
| 519 | + { | |
| 520 | + organization = organizationService.getOrganization(Integer.parseInt(lisReportModel.getHospitalId())); | |
| 521 | + } | |
| 513 | 522 | String json = lisReportModel.getItemJson(); |
| 514 | 523 | if (StringUtils.isNotEmpty(json)) |
| 515 | 524 | { |
| 525 | + if (organization != null) | |
| 526 | + { | |
| 527 | + lisReportModel.setHospitalName(organization.getName()); | |
| 528 | + } | |
| 516 | 529 | List<LisReportItemModel> items = JsonUtil.toList(json, LisReportItemModel.class); |
| 517 | 530 | lisReportModel.setItems(items); |
| 518 | 531 | lisReportModel.setItemJson(null); |
| 519 | 532 | } |
| 520 | 533 | } |
| 521 | 534 | } |
| 522 | - BaseObjectResponse objectResponse = new BaseObjectResponse(); | |
| 523 | - objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 524 | - objectResponse.setData(lises); | |
| 525 | - objectResponse.setErrormsg("成功"); | |
| 526 | - return objectResponse; | |
| 535 | +// BaseObjectResponse objectResponse = new BaseObjectResponse(); | |
| 536 | +// objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 537 | +// objectResponse.setData(lises); | |
| 538 | +// objectResponse.setErrormsg("成功"); | |
| 539 | +// return objectResponse; | |
| 540 | + return lises; | |
| 541 | + } | |
| 542 | + | |
| 543 | + | |
| 544 | + /** | |
| 545 | + * 查询医院名称 | |
| 546 | + * @param hospitalIds | |
| 547 | + * @return | |
| 548 | + */ | |
| 549 | + private Map<String,String> getHospitalNames(List<String> hospitalIds) | |
| 550 | + { | |
| 551 | + Map<String,String> hospitalNames = new HashMap<>(); | |
| 552 | + List<Integer> ids = new ArrayList<>(); | |
| 553 | + if (CollectionUtils.isNotEmpty(hospitalIds)) | |
| 554 | + { | |
| 555 | + for(String hId : hospitalIds) | |
| 556 | + { | |
| 557 | + ids.add(Integer.parseInt(hId)); | |
| 558 | + } | |
| 559 | + } | |
| 560 | + | |
| 561 | + OrganizationQuery query = new OrganizationQuery(); | |
| 562 | + query.setIdList(ids); | |
| 563 | + | |
| 564 | + List<Organization> organizations = organizationService.queryHospitals(query); | |
| 565 | + if (CollectionUtils.isNotEmpty(organizations)) | |
| 566 | + { | |
| 567 | + for (Organization organization : organizations){ | |
| 568 | + hospitalNames.put(organization.getId()+"",organization.getName()); | |
| 569 | + } | |
| 570 | + } | |
| 571 | + return hospitalNames; | |
| 527 | 572 | } |
| 528 | 573 | } |