Commit f78bacdda00ba9d8be37062008e036c9f18e9386
1 parent
c98463f3f0
Exists in
master
and in
7 other branches
bug
Showing 2 changed files with 38 additions and 19 deletions
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
f78bacd
| ... | ... | @@ -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/facade/PatientFacade.java
View file @
f78bacd
| ... | ... | @@ -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.*; |
| ... | ... | @@ -774,17 +772,18 @@ |
| 774 | 772 | patientsQuery.setProvinceRegisterId(StringUtils.isEmpty(patientManagerRequest.getProvinceRegisterId()) ? null : patientManagerRequest.getProvinceRegisterId()); |
| 775 | 773 | patientsQuery.setCityRegisterId(StringUtils.isEmpty(patientManagerRequest.getCityRegisterId()) ? null : patientManagerRequest.getCityRegisterId()); |
| 776 | 774 | 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 | - } | |
| 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()); | |
| 788 | 787 | patientsQuery.setProvinceId(StringUtils.isEmpty(patientManagerRequest.getProvinceId()) ? null : patientManagerRequest.getProvinceId()); |
| 789 | 788 | patientsQuery.setCityId(StringUtils.isEmpty(patientManagerRequest.getCityId()) ? null : patientManagerRequest.getCityId()); |
| 790 | 789 | patientsQuery.setAreaId(StringUtils.isEmpty(patientManagerRequest.getAreaId()) ? null : patientManagerRequest.getAreaId()); |
| ... | ... | @@ -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<>(); |