Commit 2753ff1112009644ec65ad403876db420af445c8

Authored by liquanyu
1 parent 3d47a0e92a

产检追访导出

Showing 1 changed file with 46 additions and 43 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TrackDownFacade.java View file @ 2753ff1
... ... @@ -735,6 +735,51 @@
735 735 downRecordQuery.setNextCheckTimeEnd(downQueryRequest.getEndNextCheckTime());
736 736 }
737 737  
  738 +
  739 + //初诊医院查询
  740 + List <String> chospitalList = new ArrayList <>();
  741 + if (StringUtils.isNotEmpty(downQueryRequest.getCzHospitalId())) {
  742 + chospitalList.add(downQueryRequest.getCzHospitalId());
  743 + } else if (StringUtils.isNotEmpty(downQueryRequest.getCprovinceId())) {
  744 + OrganizationQuery organizationQuery = new OrganizationQuery();
  745 + organizationQuery.setYn(YnEnums.YES.getId());
  746 + organizationQuery.setProvinceId(downQueryRequest.getCprovinceId());
  747 + if (StringUtils.isNotEmpty(downQueryRequest.getCcityId())) {
  748 + organizationQuery.setCityId(downQueryRequest.getCcityId());
  749 + if (StringUtils.isNotEmpty(downQueryRequest.getCareaId())) {
  750 + organizationQuery.setAreaId(downQueryRequest.getCareaId());
  751 + }
  752 + }
  753 + List <String> orgId = new ArrayList <>();
  754 + List <Organization> organizations = organizationService.queryOrganization(organizationQuery);
  755 + if (CollectionUtils.isNotEmpty(organizations)) {
  756 + for (Organization org : organizations) {
  757 + if (null != org.getId()) {
  758 + orgId.add(org.getId() + "");
  759 + }
  760 + }
  761 + }
  762 + if (CollectionUtils.isNotEmpty(orgId)) {
  763 + chospitalList.addAll(orgId);
  764 + }
  765 + }
  766 + if (CollectionUtils.isNotEmpty(chospitalList)) {
  767 + AntExChuQuery antExChuQuery1 = new AntExChuQuery();
  768 + antExChuQuery1.setHospitalList(chospitalList);
  769 + antExChuQuery1.setCheckTimeStart(DateUtil.getDayStartTime(DateUtil.parseYMD(downQueryRequest.getCzDateStart())));
  770 + antExChuQuery1.setCheckTimeEnd(DateUtil.getDayEndTime(DateUtil.parseYMD(downQueryRequest.getCzDateEnd())));
  771 + antExChuQuery1.setYn(YnEnums.YES.getId());
  772 + List <AntExChuModel> data1 = antenatalExaminationService.queryAntExChu(antExChuQuery1);
  773 + List <String> ids = (List <String>) CollectionUtils.collect(data1, new Transformer() {
  774 + @Override
  775 + public Object transform(Object o) {
  776 + AntExChuModel antExChuModel = (AntExChuModel) o;
  777 + return antExChuModel.getParentId();
  778 + }
  779 + });
  780 + downRecordQuery.setParentIds(ids);
  781 + }
  782 +
738 783 return downRecordQuery;
739 784 }
740 785  
... ... @@ -897,49 +942,7 @@
897 942 pageResult.setGrid(new ArrayList<>());
898 943 return RespBuilder.buildSuccess(pageResult);
899 944 }
900   - //初诊医院查询
901   - List <String> chospitalList = new ArrayList <>();
902   - if (StringUtils.isNotEmpty(downQueryRequest.getCzHospitalId())) {
903   - chospitalList.add(downQueryRequest.getCzHospitalId());
904   - } else if (StringUtils.isNotEmpty(downQueryRequest.getCprovinceId())) {
905   - OrganizationQuery organizationQuery = new OrganizationQuery();
906   - organizationQuery.setYn(YnEnums.YES.getId());
907   - organizationQuery.setProvinceId(downQueryRequest.getCprovinceId());
908   - if (StringUtils.isNotEmpty(downQueryRequest.getCcityId())) {
909   - organizationQuery.setCityId(downQueryRequest.getCcityId());
910   - if (StringUtils.isNotEmpty(downQueryRequest.getCareaId())) {
911   - organizationQuery.setAreaId(downQueryRequest.getCareaId());
912   - }
913   - }
914   - List <String> orgId = new ArrayList <>();
915   - List <Organization> organizations = organizationService.queryOrganization(organizationQuery);
916   - if (CollectionUtils.isNotEmpty(organizations)) {
917   - for (Organization org : organizations) {
918   - if (null != org.getId()) {
919   - orgId.add(org.getId() + "");
920   - }
921   - }
922   - }
923   - if (CollectionUtils.isNotEmpty(orgId)) {
924   - chospitalList.addAll(orgId);
925   - }
926   - }
927   - if (CollectionUtils.isNotEmpty(chospitalList)) {
928   - AntExChuQuery antExChuQuery1 = new AntExChuQuery();
929   - antExChuQuery1.setHospitalList(chospitalList);
930   - antExChuQuery1.setCheckTimeStart(DateUtil.getDayStartTime(DateUtil.parseYMD(downQueryRequest.getCzDateStart())));
931   - antExChuQuery1.setCheckTimeEnd(DateUtil.getDayEndTime(DateUtil.parseYMD(downQueryRequest.getCzDateEnd())));
932   - antExChuQuery1.setYn(YnEnums.YES.getId());
933   - List <AntExChuModel> data1 = antenatalExaminationService.queryAntExChu(antExChuQuery1);
934   - List <String> ids = (List <String>) CollectionUtils.collect(data1, new Transformer() {
935   - @Override
936   - public Object transform(Object o) {
937   - AntExChuModel antExChuModel = (AntExChuModel) o;
938   - return antExChuModel.getParentId();
939   - }
940   - });
941   - downRecordQuery.setParentIds(ids);
942   - }
  945 +
943 946  
944 947 List<TrackDownRecord> downRecordList = trackDownRecordService.queryTrackDown(downRecordQuery);
945 948 List<Map> data = new ArrayList<>();