Commit 17be64e92f37adb02d2002c527cce9b0aa7c0d96
1 parent
13b97b96bf
Exists in
master
and in
8 other branches
code update
Showing 4 changed files with 21 additions and 5 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BabyBookbuildingService.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/YunBookbuildingService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BabyBookbuildingService.java
View file @
17be64e
... | ... | @@ -49,6 +49,15 @@ |
49 | 49 | return babyBookBuildingDao.queryBabyWithQuery(query.addOrder(Sort.Direction.DESC, "modified")); |
50 | 50 | } |
51 | 51 | |
52 | + public List<BabyModel> queryBabyBuildByCond(BabyModelQuery babyQuery,String sortkey,Sort.Direction sort) { | |
53 | + MongoQuery query = babyQuery.convertToQuery(); | |
54 | + if (StringUtils.isNotEmpty(babyQuery.getNeed())) { | |
55 | + babyQuery.mysqlBuild(babyBookBuildingDao.queryBabyManageCount(babyQuery.convertToQuery())); | |
56 | + query.start(babyQuery.getOffset()).end(babyQuery.getLimit()); | |
57 | + } | |
58 | + return babyBookBuildingDao.queryBabyWithQuery(query.addOrder(sort,sortkey)); | |
59 | + } | |
60 | + | |
52 | 61 | public int queryBabyCount(BabyModelQuery babyQuery) { |
53 | 62 | return babyBookBuildingDao.queryBabyManageCount(babyQuery.convertToQuery()); |
54 | 63 | } |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/YunBookbuildingService.java
View file @
17be64e
... | ... | @@ -39,6 +39,11 @@ |
39 | 39 | return yunBookBuildingDao.queryPatientWithQuery(query.addOrder(Sort.Direction.DESC, "created")); |
40 | 40 | } |
41 | 41 | |
42 | + public List<Patients> queryPregnantWithQuery(PatientsQuery patientsQuery,String sortkey,Sort.Direction sort) { | |
43 | + MongoQuery query = patientsQuery.convertToQuery(); | |
44 | + return yunBookBuildingDao.queryPatientWithQuery(query.addOrder(sort, sortkey)); | |
45 | + } | |
46 | + | |
42 | 47 | public List<String> getBirthPatients(String dateStr) { |
43 | 48 | return yunBookBuildingDao.getBirthIds(dateStr); |
44 | 49 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
17be64e
... | ... | @@ -19,6 +19,7 @@ |
19 | 19 | import com.lyms.platform.query.*; |
20 | 20 | import org.apache.commons.collections.CollectionUtils; |
21 | 21 | import org.springframework.beans.factory.annotation.Autowired; |
22 | +import org.springframework.data.domain.Sort; | |
22 | 23 | import org.springframework.stereotype.Component; |
23 | 24 | |
24 | 25 | import java.util.*; |
... | ... | @@ -1011,7 +1012,7 @@ |
1011 | 1012 | BabyModelQuery babyQuery = new BabyModelQuery(); |
1012 | 1013 | babyQuery.setYn(YnEnums.YES.getId()); |
1013 | 1014 | babyQuery.setPid(babayPerson.getId()); |
1014 | - List<BabyModel> builds = babyBookbuildingService.queryBabyBuildByCond(babyQuery); | |
1015 | + List<BabyModel> builds = babyBookbuildingService.queryBabyBuildByCond(babyQuery,"buildDate", Sort.Direction.DESC); | |
1015 | 1016 | |
1016 | 1017 | List<Map<String, String>> list = new ArrayList<>(); |
1017 | 1018 | if (CollectionUtils.isNotEmpty(builds)) |
... | ... | @@ -1052,7 +1053,7 @@ |
1052 | 1053 | { |
1053 | 1054 | buildInfo = builds.get(0); |
1054 | 1055 | } |
1055 | - | |
1056 | + Collections.reverse(list); | |
1056 | 1057 | result.setBuildRecords(list); |
1057 | 1058 | } |
1058 | 1059 | results.add(result); |
... | ... | @@ -1093,7 +1094,7 @@ |
1093 | 1094 | BabyModelQuery babyBuildQuery = new BabyModelQuery(); |
1094 | 1095 | babyBuildQuery.setYn(YnEnums.YES.getId()); |
1095 | 1096 | babyBuildQuery.setPid(model.getPid()); |
1096 | - List<BabyModel> builds = babyBookbuildingService.queryBabyBuildByCond(babyBuildQuery); | |
1097 | + List<BabyModel> builds = babyBookbuildingService.queryBabyBuildByCond(babyQuery,"buildDate", Sort.Direction.DESC); | |
1097 | 1098 | |
1098 | 1099 | List<Map<String, String>> list = new ArrayList<>(); |
1099 | 1100 | if (CollectionUtils.isNotEmpty(builds)) |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
17be64e
... | ... | @@ -24,6 +24,7 @@ |
24 | 24 | import com.lyms.platform.query.*; |
25 | 25 | import org.apache.commons.collections.CollectionUtils; |
26 | 26 | import org.springframework.beans.factory.annotation.Autowired; |
27 | +import org.springframework.data.domain.Sort; | |
27 | 28 | import org.springframework.stereotype.Component; |
28 | 29 | |
29 | 30 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
... | ... | @@ -443,7 +444,7 @@ |
443 | 444 | if (!StringUtils.isEmpty(bookbuildingQueryRequest.getCardNo())) |
444 | 445 | { |
445 | 446 | patientsQuery.setCardNo(bookbuildingQueryRequest.getCardNo()); |
446 | - patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); | |
447 | + patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery,"bookbuildingDate", Sort.Direction.DESC); | |
447 | 448 | } |
448 | 449 | //否则用就诊卡号 查询到这个孕妇的身份证号码 再用身份证号码查询该孕妇的所有建档 包括产妇记录 |
449 | 450 | else if (!StringUtils.isEmpty(bookbuildingQueryRequest.getVcCardNo()) && !StringUtils.isEmpty(String.valueOf(bookbuildingQueryRequest.getHospitalId()))) |
... | ... | @@ -456,7 +457,7 @@ |
456 | 457 | patientsQuery.setHospitalId(null); |
457 | 458 | patientsQuery.setVcCardNo(null); |
458 | 459 | patientsQuery.setCardNo(patientsVc.get(0).getCardNo()); |
459 | - patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); | |
460 | + patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery,"bookbuildingDate", Sort.Direction.DESC); | |
460 | 461 | } |
461 | 462 | } |
462 | 463 |