Commit 5cf77982575cb93d8b1d043f42b91c908a6f04db
1 parent
20c1aca556
Exists in
master
and in
1 other branch
儿童查询
Showing 1 changed file with 29 additions and 16 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
5cf7798
... | ... | @@ -825,6 +825,7 @@ |
825 | 825 | List<BabyModel> models = null; |
826 | 826 | if (!StringUtils.isEmpty(param.getCardNo())) { |
827 | 827 | babyQuery.setCardId(param.getCardNo()); |
828 | + babyQuery.setHospitalId(param.getHospitalId()); | |
828 | 829 | |
829 | 830 | //通过查询孕妇 |
830 | 831 | PatientsQuery puerperaQuery = new PatientsQuery(); |
831 | 832 | |
832 | 833 | |
... | ... | @@ -861,23 +862,35 @@ |
861 | 862 | for (BabyModel model : models) { |
862 | 863 | |
863 | 864 | if (id.equals(model.getId())) { |
864 | - Map<String, String> buildRecords = new HashMap<>(); | |
865 | - buildRecords.put("id", model.getId()); | |
866 | - buildRecords.put("buildDate", DateUtil.getyyyy_MM_dd(model.getBuildDate())); | |
867 | 865 | |
868 | - //查询建档医院 | |
869 | - Organization org = organizationService.getOrganization(Integer.valueOf(model.getHospitalId())); | |
870 | - if (org != null) { | |
871 | - buildRecords.put("buildHospital", org.getName()); | |
872 | - } else { | |
873 | - buildRecords.put("buildHospital", ""); | |
874 | - } | |
866 | + BabyModelQuery hospBuildRecordsQuery = new BabyModelQuery(); | |
867 | + hospBuildRecordsQuery.setYn(YnEnums.YES.getId()); | |
868 | + hospBuildRecordsQuery.setMcertNo(model.getMcertNo()); | |
869 | + List<BabyModel> builds = babyBookbuildingService.queryBabyBuildByCond(hospBuildRecordsQuery); | |
870 | + if (CollectionUtils.isNotEmpty(builds)) | |
871 | + { | |
872 | + for(BabyModel build: builds) | |
873 | + { | |
874 | + Map<String, String> buildRecords = new HashMap<>(); | |
875 | + buildRecords.put("id", build.getId()); | |
876 | + buildRecords.put("buildDate", DateUtil.getyyyy_MM_dd(build.getBuildDate())); | |
875 | 877 | |
876 | - result.setId(model.getId()); | |
877 | - result.setCardNo(model.getCardNo()); | |
878 | - result.setName(model.getName()); | |
879 | - result.setMonthAge(DateUtil.getBabyMonthAge(model.getBirth(), new Date())); | |
880 | - list.add(buildRecords); | |
878 | + //查询建档医院 | |
879 | + Organization org = organizationService.getOrganization(Integer.valueOf(build.getHospitalId())); | |
880 | + if (org != null) { | |
881 | + buildRecords.put("buildHospital", org.getName()); | |
882 | + } else { | |
883 | + buildRecords.put("buildHospital", ""); | |
884 | + } | |
885 | + | |
886 | + result.setId(build.getId()); | |
887 | + result.setCardNo(build.getCardNo()); | |
888 | + result.setName(build.getName()); | |
889 | + result.setMonthAge(DateUtil.getBabyMonthAge(build.getBirth(), new Date())); | |
890 | + list.add(buildRecords); | |
891 | + } | |
892 | + | |
893 | + } | |
881 | 894 | |
882 | 895 | } |
883 | 896 | result.setBuildRecords(list); |