Commit 52b830969f2c763b9216805303bf794e288080e1
Exists in
master
and in
7 other branches
Merge remote-tracking branch 'origin/master'
Showing 6 changed files
- platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatDeliverController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PremaritalCheckupFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
52b8309
... | ... | @@ -959,14 +959,22 @@ |
959 | 959 | MongoCondition con2 = MongoCondition.newInstance("username", queryNo, MongoOper.IS); |
960 | 960 | MongoCondition con3 = MongoCondition.newInstance("cardNo", queryNo, MongoOper.IS); |
961 | 961 | MongoCondition con4 = MongoCondition.newInstance("fileCode", queryNo, MongoOper.IS); |
962 | - c1= c.orCondition(new MongoCondition[]{con1, con2, con3,con4}).getCriteria(); | |
962 | + if(c1!=null) { | |
963 | + c1 = c1.andOperator(c.orCondition(new MongoCondition[]{con1, con2, con3, con4}).getCriteria()); | |
964 | + }else { | |
965 | + c1 = c.orCondition(new MongoCondition[]{con1, con2, con3, con4}).getCriteria(); | |
966 | + } | |
963 | 967 | } |
964 | 968 | |
965 | 969 | if (CollectionUtils.isNotEmpty(fmHospitalQueryList)) { |
966 | 970 | MongoCondition c = MongoCondition.newInstance(); |
967 | 971 | MongoCondition con1 = MongoCondition.newInstance("hospitalId", fmHospitalQueryList, MongoOper.IN); |
968 | 972 | MongoCondition con2 = MongoCondition.newInstance("fmHospital", fmHospitalQueryList, MongoOper.IN); |
969 | - c1= c.orCondition(new MongoCondition[]{con1, con2}).getCriteria(); | |
973 | + if(c1!=null) { | |
974 | + c1 = c1.andOperator(c.orCondition(new MongoCondition[]{con1, con2}).getCriteria()); | |
975 | + }else{ | |
976 | + c1 = c.orCondition(new MongoCondition[]{con1, con2}).getCriteria(); | |
977 | + } | |
970 | 978 | } |
971 | 979 | |
972 | 980 | if (lastCheckEmployeeId != null) { |
973 | 981 | |
... | ... | @@ -975,11 +983,19 @@ |
975 | 983 | else if(lastCheckEId){ |
976 | 984 | condition = condition.and("lastCheckEmployeeId", "", MongoOper.NE); |
977 | 985 | MongoCondition c = MongoCondition.newInstance(); |
978 | - c1= c.andCondition(MongoCondition.newInstance("lastCheckEmployeeId", null, MongoOper.NE)).getCriteria(); | |
986 | + if(c1!=null){ | |
987 | + c1= c1.andOperator(c.andCondition(MongoCondition.newInstance("lastCheckEmployeeId", null, MongoOper.NE)).getCriteria()); | |
988 | + }else { | |
989 | + c1 = c.andCondition(MongoCondition.newInstance("lastCheckEmployeeId", null, MongoOper.NE)).getCriteria(); | |
990 | + } | |
979 | 991 | } |
980 | 992 | |
981 | 993 | if (fmDateStart != null && fmDateEnd != null) { |
982 | - c1 = Criteria.where("fmDate").gte(fmDateStart).lte(fmDateEnd); | |
994 | + if(c1!=null){ | |
995 | + c1 = c1.and("fmDate").gte(fmDateStart).lte(fmDateEnd); | |
996 | + }else { | |
997 | + c1 = Criteria.where("fmDate").gte(fmDateStart).lte(fmDateEnd); | |
998 | + } | |
983 | 999 | } |
984 | 1000 | |
985 | 1001 | if (null != serviceType) { |
... | ... | @@ -1016,7 +1032,11 @@ |
1016 | 1032 | else if(norFactor){ |
1017 | 1033 | condition = condition.and("riskFactorId", new ArrayList<String>(), MongoOper.NE); |
1018 | 1034 | MongoCondition c = MongoCondition.newInstance(); |
1019 | - c1= c.andCondition(MongoCondition.newInstance("riskFactorId", null, MongoOper.NE)).getCriteria(); | |
1035 | + if(c1!=null){ | |
1036 | + c1 = c1.andOperator(c.andCondition(MongoCondition.newInstance("riskFactorId", null, MongoOper.NE)).getCriteria()); | |
1037 | + }else { | |
1038 | + c1 = c.andCondition(MongoCondition.newInstance("riskFactorId", null, MongoOper.NE)).getCriteria(); | |
1039 | + } | |
1020 | 1040 | } |
1021 | 1041 | if (-1 != yn) { |
1022 | 1042 | condition = condition.and("yn", yn, MongoOper.IS); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatDeliverController.java
View file @
52b8309
... | ... | @@ -156,11 +156,13 @@ |
156 | 156 | |
157 | 157 | // 根据查询规则构造返回bean |
158 | 158 | List<Object> objectList = new ArrayList<>(); |
159 | - for (Object temp : childbirthManagerResult.getData()) { | |
160 | - for (String key : query.keySet()) { | |
161 | - query.put(key, BeanUtils.objectToStringMap(temp).get(key)); | |
159 | + if (childbirthManagerResult.getData() != null) { | |
160 | + for (Object temp : childbirthManagerResult.getData()) { | |
161 | + for (String key : query.keySet()) { | |
162 | + query.put(key, BeanUtils.objectToStringMap(temp).get(key)); | |
163 | + } | |
164 | + objectList.add(BeanUtils.createStringBean(query)); | |
162 | 165 | } |
163 | - objectList.add(BeanUtils.createStringBean(query)); | |
164 | 166 | } |
165 | 167 | |
166 | 168 | baseListResponse = new BaseListResponse().setErrorcode(childbirthManagerResult.getErrorcode()).setErrormsg(childbirthManagerResult.getErrormsg()).setData(objectList).setPageInfo(childbirthManagerResult.getPageInfo()); |
... | ... | @@ -176,6 +178,33 @@ |
176 | 178 | public void childbirthManagerExcel(HttpServletRequest httpServletRequest, @RequestBody ChildbirthManagerRequest childbirthManagerRequest, HttpServletResponse httpServletResponse) { |
177 | 179 | try { |
178 | 180 | childbirthManagerRequest.setOperatorId(((LoginContext) httpServletRequest.getAttribute("loginContext")).getId()); |
181 | + | |
182 | + Map<String, String> query; | |
183 | + if (StringUtils.isNotEmpty(childbirthManagerRequest.getInitQuery())) { | |
184 | + // 自定义查询 | |
185 | + query = new HashMap<>(); | |
186 | + String initQuery = childbirthManagerRequest.getInitQuery(); | |
187 | + for (String key : childbirthManagerRequest.getInitQueryMap().keySet()) { | |
188 | + if (initQuery.contains(key)) { | |
189 | + query.put(key, query.get(key)); | |
190 | + } | |
191 | + } | |
192 | + } else { | |
193 | + // 没有自定义查询,开始构造普通查询 | |
194 | + if (StringUtils.isEmpty(childbirthManagerRequest.getIsArea())) { | |
195 | + // 非区域 | |
196 | + query = childbirthManagerRequest.getNormalQueryMap(); | |
197 | + } else { | |
198 | + // 区域 | |
199 | + query = childbirthManagerRequest.getAreaQueryMap(); | |
200 | + } | |
201 | + String queryStr = ""; | |
202 | + for (String key : query.keySet()) { | |
203 | + queryStr += key + ","; | |
204 | + } | |
205 | + childbirthManagerRequest.setInitQuery(queryStr.substring(0, queryStr.length() - 1)); | |
206 | + } | |
207 | + | |
179 | 208 | childbirthManagerRequest.setExcel(true); |
180 | 209 | // 这里返回的结果必然是这个泛型,之所以query返回的结果集没有用泛型是为了更好的传递数据 |
181 | 210 | @SuppressWarnings("unchecked") |
... | ... | @@ -192,6 +221,9 @@ |
192 | 221 | } |
193 | 222 | Map<String, String> header = new LinkedHashMap<>(); |
194 | 223 | Map<String, String> temp = childbirthManagerRequest.getInitQueryMap(); |
224 | + temp.remove("maternalDeliverId"); | |
225 | + temp.remove("patientId"); | |
226 | + temp.remove("pid"); | |
195 | 227 | String initQuery = childbirthManagerRequest.getInitQuery(); |
196 | 228 | for (String key : temp.keySet()) { |
197 | 229 | if (initQuery.contains(key)) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
52b8309
... | ... | @@ -1009,12 +1009,12 @@ |
1009 | 1009 | patientsQuery.setPage(childbirthManagerRequest.getPage()); |
1010 | 1010 | patientsQuery.setNeed("need"); |
1011 | 1011 | } |
1012 | - patientsQuery.setProvinceRegisterId(StringUtils.isEmpty(childbirthManagerRequest.getRegisterProvinceId()) ? null : childbirthManagerRequest.getRegisterProvinceId()); | |
1013 | - patientsQuery.setCityRegisterId(StringUtils.isEmpty(childbirthManagerRequest.getRegisterCityId()) ? null : childbirthManagerRequest.getRegisterCityId()); | |
1014 | - patientsQuery.setAreaRegisterId(StringUtils.isEmpty(childbirthManagerRequest.getRegisterAreaId()) ? null : childbirthManagerRequest.getRegisterAreaId()); | |
1015 | - patientsQuery.setProvinceId(StringUtils.isEmpty(childbirthManagerRequest.getLivingProvinceId()) ? null : childbirthManagerRequest.getLivingProvinceId()); | |
1016 | - patientsQuery.setCityId(StringUtils.isEmpty(childbirthManagerRequest.getLivingCityId()) ? null : childbirthManagerRequest.getLivingCityId()); | |
1017 | - patientsQuery.setAreaId(StringUtils.isEmpty(childbirthManagerRequest.getLivingAreaId()) ? null : childbirthManagerRequest.getLivingAreaId()); | |
1012 | + patientsQuery.setProvinceId(StringUtils.isEmpty(childbirthManagerRequest.getRegisterProvinceId()) ? null : childbirthManagerRequest.getRegisterProvinceId()); | |
1013 | + patientsQuery.setCityId(StringUtils.isEmpty(childbirthManagerRequest.getRegisterCityId()) ? null : childbirthManagerRequest.getRegisterCityId()); | |
1014 | + patientsQuery.setAreaId(StringUtils.isEmpty(childbirthManagerRequest.getRegisterAreaId()) ? null : childbirthManagerRequest.getRegisterAreaId()); | |
1015 | + patientsQuery.setProvinceRegisterId(StringUtils.isEmpty(childbirthManagerRequest.getLivingProvinceId()) ? null : childbirthManagerRequest.getLivingProvinceId()); | |
1016 | + patientsQuery.setCityRegisterId(StringUtils.isEmpty(childbirthManagerRequest.getLivingCityId()) ? null : childbirthManagerRequest.getLivingCityId()); | |
1017 | + patientsQuery.setAreaRegisterId(StringUtils.isEmpty(childbirthManagerRequest.getLivingAreaId()) ? null : childbirthManagerRequest.getLivingAreaId()); | |
1018 | 1018 | patientsQuery.setHusbandPhone(StringUtils.isEmpty(childbirthManagerRequest.getHusbandPhone()) ? null : childbirthManagerRequest.getHusbandPhone()); |
1019 | 1019 | patientsQuery.setQueryNo(StringUtils.isEmpty(childbirthManagerRequest.getQueryNo()) ? null : childbirthManagerRequest.getQueryNo()); |
1020 | 1020 | patientsQuery.setFmHospitalQueryList(hospitalList); |
... | ... | @@ -1026,6 +1026,8 @@ |
1026 | 1026 | patientsQuery.setFmWeekEnd(StringUtils.isEmpty(childbirthManagerRequest.getEndDueWeek()) ? null : Integer.valueOf(childbirthManagerRequest.getEndDueWeek()) * 7); |
1027 | 1027 | // 分娩方式去另外一张表查 |
1028 | 1028 | List<Patients> patientsList = patientsService.queryPatient(patientsQuery); |
1029 | + // 这里就设置分页内容 | |
1030 | + childbirthManagerResult.setPageInfo(patientsQuery.getPageInfo()); | |
1029 | 1031 | List<String> parentIdList = new ArrayList<>(); |
1030 | 1032 | if (CollectionUtils.isEmpty(patientsList)) { |
1031 | 1033 | // 没有查到,直接抛出 |
... | ... | @@ -1412,7 +1414,6 @@ |
1412 | 1414 | |
1413 | 1415 | |
1414 | 1416 | childbirthManagerResult.setData(childbirthManagerQueryModelList); |
1415 | - childbirthManagerResult.setPageInfo(patientsQuery.getPageInfo()); | |
1416 | 1417 | childbirthManagerResult.setErrorcode(ErrorCodeConstants.SUCCESS); |
1417 | 1418 | childbirthManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); |
1418 | 1419 | return childbirthManagerResult; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
52b8309
... | ... | @@ -16,8 +16,6 @@ |
16 | 16 | import com.lyms.platform.operate.web.worker.WorkHR; |
17 | 17 | import com.lyms.platform.permission.model.Organization; |
18 | 18 | import com.lyms.platform.permission.model.OrganizationQuery; |
19 | -import com.lyms.platform.permission.model.Users; | |
20 | -import com.lyms.platform.permission.model.UsersQuery; | |
21 | 19 | import com.lyms.platform.permission.service.OrganizationService; |
22 | 20 | import com.lyms.platform.permission.service.UsersService; |
23 | 21 | import com.lyms.platform.pojo.*; |
... | ... | @@ -771,23 +769,24 @@ |
771 | 769 | } |
772 | 770 | |
773 | 771 | patientsQuery.setHospitalId(autoMatchFacade.getHospitalId(patientManagerRequest.getOperatorId())); |
774 | - patientsQuery.setProvinceRegisterId(StringUtils.isEmpty(patientManagerRequest.getProvinceRegisterId()) ? null : patientManagerRequest.getProvinceRegisterId()); | |
775 | - patientsQuery.setCityRegisterId(StringUtils.isEmpty(patientManagerRequest.getCityRegisterId()) ? null : patientManagerRequest.getCityRegisterId()); | |
776 | - patientsQuery.setAreaRegisterId(StringUtils.isEmpty(patientManagerRequest.getAreaRegisterId()) ? null : patientManagerRequest.getAreaRegisterId()); | |
777 | - UsersQuery usersQuery = new UsersQuery(); | |
778 | - usersQuery.setName(patientManagerRequest.getBookbuildingDoctor()); | |
779 | - usersQuery.setYn(YnEnums.YES.getId()); | |
780 | - List<Users> usersList = usersService.queryUsers(usersQuery); | |
781 | - if (CollectionUtils.isNotEmpty(usersList)) { | |
782 | - List<String> bookbuildingDoctorList = new ArrayList<>(); | |
783 | - for (Users users : usersList) { | |
784 | - bookbuildingDoctorList.add(users.getId().toString()); | |
785 | - } | |
786 | - patientsQuery.setBookbuildingDoctorList(bookbuildingDoctorList); | |
787 | - } | |
788 | - patientsQuery.setProvinceId(StringUtils.isEmpty(patientManagerRequest.getProvinceId()) ? null : patientManagerRequest.getProvinceId()); | |
789 | - patientsQuery.setCityId(StringUtils.isEmpty(patientManagerRequest.getCityId()) ? null : patientManagerRequest.getCityId()); | |
790 | - patientsQuery.setAreaId(StringUtils.isEmpty(patientManagerRequest.getAreaId()) ? null : patientManagerRequest.getAreaId()); | |
772 | + patientsQuery.setProvinceId(StringUtils.isEmpty(patientManagerRequest.getProvinceRegisterId()) ? null : patientManagerRequest.getProvinceRegisterId()); | |
773 | + patientsQuery.setCityId(StringUtils.isEmpty(patientManagerRequest.getCityRegisterId()) ? null : patientManagerRequest.getCityRegisterId()); | |
774 | + patientsQuery.setAreaId(StringUtils.isEmpty(patientManagerRequest.getAreaRegisterId()) ? null : patientManagerRequest.getAreaRegisterId()); | |
775 | + // UsersQuery usersQuery = new UsersQuery(); | |
776 | + // usersQuery.setName(patientManagerRequest.getBookbuildingDoctor()); | |
777 | + // usersQuery.setYn(YnEnums.YES.getId()); | |
778 | + // List<Users> usersList = usersService.queryUsers(usersQuery); | |
779 | + // if (CollectionUtils.isNotEmpty(usersList)) { | |
780 | + // List<String> bookbuildingDoctorList = new ArrayList<>(); | |
781 | + // for (Users users : usersList) { | |
782 | + // bookbuildingDoctorList.add(users.getId().toString()); | |
783 | + // } | |
784 | + // patientsQuery.setBookbuildingDoctorList(bookbuildingDoctorList); | |
785 | + // } | |
786 | + patientsQuery.setBookbuildingDoctor(StringUtils.isEmpty(patientManagerRequest.getBookbuildingDoctor()) ? null : patientManagerRequest.getBookbuildingDoctor()); | |
787 | + patientsQuery.setProvinceRegisterId(StringUtils.isEmpty(patientManagerRequest.getProvinceId()) ? null : patientManagerRequest.getProvinceId()); | |
788 | + patientsQuery.setCityRegisterId(StringUtils.isEmpty(patientManagerRequest.getCityId()) ? null : patientManagerRequest.getCityId()); | |
789 | + patientsQuery.setAreaRegisterId(StringUtils.isEmpty(patientManagerRequest.getAreaId()) ? null : patientManagerRequest.getAreaId()); | |
791 | 790 | if (StringUtils.isNotEmpty(patientManagerRequest.getBookBuildingDate())) { |
792 | 791 | try { |
793 | 792 | patientsQuery.setBookbuildingDateStart(DateUtil.getSNDate(patientManagerRequest.getBookBuildingDate())[0]); |
... | ... | @@ -796,7 +795,7 @@ |
796 | 795 | // 什么都不做,这里是数据传入错误了 |
797 | 796 | } |
798 | 797 | } |
799 | - patientsQuery.setName(StringUtils.isEmpty(patientManagerRequest.getQueryNo()) ? null : patientManagerRequest.getQueryNo()); | |
798 | + patientsQuery.setQueryNo(StringUtils.isEmpty(patientManagerRequest.getQueryNo()) ? null : patientManagerRequest.getQueryNo()); | |
800 | 799 | |
801 | 800 | List<Patients> patientsList = patientsService.queryPatient(patientsQuery); |
802 | 801 | List<PatientManagerQueryModel> patientManagerQueryModelList = new ArrayList<>(); |
... | ... | @@ -828,8 +827,8 @@ |
828 | 827 | patientManagerQueryModel.setBuildWeek(dueWeek); |
829 | 828 | patientManagerQueryModel.setBookbuildingDoctor(StringUtils.isEmpty(patients.getBookbuildingDoctor()) ? "" : usersService.getUsers(Integer.valueOf(patients.getBookbuildingDoctor())).getName()); |
830 | 829 | patientManagerQueryModel.setBookbuildingDate(DateUtil.getyyyy_MM_dd(patients.getBookbuildingDate())); |
831 | - patientManagerQueryModel.setAddress(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService)); | |
832 | - patientManagerQueryModel.setAddressRegister(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); | |
830 | + patientManagerQueryModel.setAddressRegister(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService)); | |
831 | + patientManagerQueryModel.setAddress(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); | |
833 | 832 | patientManagerQueryModelList.add(patientManagerQueryModel); |
834 | 833 | } |
835 | 834 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PremaritalCheckupFacade.java
View file @
52b8309
... | ... | @@ -139,7 +139,7 @@ |
139 | 139 | archiveMap.put("certificateNum", archiveModel.getCertificateNum()); |
140 | 140 | archiveMap.put("certificateTypeId", archiveModel.getCertificateTypeId()); |
141 | 141 | archiveMap.put("username", archiveModel.getUsername()); |
142 | - archiveMap.put("age", archiveModel.getAge()); | |
142 | + archiveMap.put("age", DateUtil.getAge(archiveModel.getBirthday())); | |
143 | 143 | if (archiveModel.getSex()!=null){ |
144 | 144 | if (archiveModel.getSex().equals(SystemConfig.WOMAN_ID)){ |
145 | 145 | archiveMap.put("sex", "女"); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java
View file @
52b8309
... | ... | @@ -213,7 +213,7 @@ |
213 | 213 | |
214 | 214 | //历史建档记录 |
215 | 215 | Map<String,Object> mapData = new HashMap<>(); |
216 | - mapData.put("firstBuildData",newModel); | |
216 | + mapData.put("firstBuildData",getResult(newModel)); | |
217 | 217 | mapData.put("archiveHistory",resultList); |
218 | 218 | mapData.put("initBuildDate", DateUtil.getyyyy_MM_dd(new Date())); |
219 | 219 | list.add(mapData); |
220 | 220 | |
... | ... | @@ -415,11 +415,11 @@ |
415 | 415 | //历史记录 |
416 | 416 | if (model!=null){ |
417 | 417 | ResidentsArchiveQuery archiveQuery = new ResidentsArchiveQuery(); |
418 | - archiveQuery.setHospitalId(model.getHospitalId()); | |
419 | 418 | archiveQuery.setYn(YnEnums.YES.getId()); |
420 | 419 | if (StringUtils.isNotEmpty(model.getCertificateNum())){ |
421 | 420 | archiveQuery.setCertificateNum(model.getCertificateNum()); |
422 | 421 | }else if (StringUtils.isNotEmpty(model.getVcCardNo())){ |
422 | + archiveQuery.setHospitalId(model.getHospitalId()); | |
423 | 423 | archiveQuery.setVcCardNo(model.getVcCardNo()); |
424 | 424 | } |
425 | 425 | List<ResidentsArchiveModel> archiveModelList = residentsArchiveService.queryResident(archiveQuery); |
... | ... | @@ -451,6 +451,9 @@ |
451 | 451 | |
452 | 452 | public ResidentsArchiveResult getResult(ResidentsArchiveModel model){ |
453 | 453 | |
454 | + if (model==null){ | |
455 | + return null; | |
456 | + } | |
454 | 457 | ResidentsArchiveResult result = new ResidentsArchiveResult(); |
455 | 458 | result.setId(model.getId()); |
456 | 459 | result.setUsername(model.getUsername()); |