Commit a77d1f0a38c18a364d734f3f4d2069ca1cc8b334
1 parent
5db9ef2530
Exists in
master
and in
6 other branches
访视添加字段
Showing 1 changed file with 19 additions and 12 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
a77d1f0
| ... | ... | @@ -1844,9 +1844,14 @@ |
| 1844 | 1844 | // 年龄段 |
| 1845 | 1845 | if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(startAge) && |
| 1846 | 1846 | com.lyms.platform.common.utils.StringUtils.isNotEmpty(endAge)) { |
| 1847 | - long startTime = System.currentTimeMillis() - Integer.parseInt(startAge) * 356 * 24 * 60 * 60 * 1000; | |
| 1848 | - long endTime = System.currentTimeMillis() - Integer.parseInt(endAge) * 356 * 24 * 60 * 60 * 1000; | |
| 1849 | - List<PersonModel> personModels = mongoTemplate.find(Query.query(Criteria.where("birth").gte(new Date(startTime)).and("birth").lte(new Date(endTime))), PersonModel.class); | |
| 1847 | + Calendar c = Calendar.getInstance(); | |
| 1848 | + c.setTime(new Date()); | |
| 1849 | + c.add(Calendar.YEAR, -Integer.parseInt(startAge)); | |
| 1850 | + Date startDate = c.getTime(); | |
| 1851 | + c.setTime(new Date()); | |
| 1852 | + c.add(Calendar.YEAR, - Integer.parseInt(endAge)); | |
| 1853 | + Date endDate = c.getTime(); | |
| 1854 | + List<PersonModel> personModels = mongoTemplate.find(Query.query(Criteria.where("birth").gte(endDate).lte(startDate)), PersonModel.class); | |
| 1850 | 1855 | for (PersonModel model : personModels) { |
| 1851 | 1856 | pids.add(model.getId()); |
| 1852 | 1857 | } |
| 1853 | 1858 | |
| ... | ... | @@ -1913,16 +1918,18 @@ |
| 1913 | 1918 | |
| 1914 | 1919 | // 高危等级 |
| 1915 | 1920 | String highRiskLevel = matdeliverFollowRequest.getHighRiskLevel(); |
| 1916 | - List<Patients> patientGaoweis = mongoTemplate.find(Query.query(Criteria.where("riskLevelId").regex(highRiskLevel).and("yn").is("1")), Patients.class); | |
| 1917 | - List<String> patientIds = new ArrayList<>(); | |
| 1918 | - for (Patients patient : patientGaoweis) { | |
| 1919 | - patientIds.add(patient.getId()); | |
| 1921 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(highRiskLevel)) { | |
| 1922 | + List<Patients> patientGaoweis = mongoTemplate.find(Query.query(Criteria.where("riskLevelId").regex(highRiskLevel).and("yn").is(1)), Patients.class); | |
| 1923 | + List<String> patientIds = new ArrayList<>(); | |
| 1924 | + for (Patients patient : patientGaoweis) { | |
| 1925 | + patientIds.add(patient.getId()); | |
| 1926 | + } | |
| 1927 | + List<String> parentIdList1 = matDeliverQuery.getParentIdList(); | |
| 1928 | + if (CollectionUtils.isNotEmpty(parentIdList1)) { | |
| 1929 | + patientIds.addAll(parentIdList1); | |
| 1930 | + } | |
| 1931 | + matDeliverQuery.setParentIdList(patientIds); | |
| 1920 | 1932 | } |
| 1921 | - List<String> parentIdList1 = matDeliverQuery.getParentIdList(); | |
| 1922 | - if (CollectionUtils.isNotEmpty(parentIdList1)) { | |
| 1923 | - patientIds.addAll(parentIdList1); | |
| 1924 | - } | |
| 1925 | - matDeliverQuery.setParentIdList(patientIds); | |
| 1926 | 1933 | |
| 1927 | 1934 | |
| 1928 | 1935 | if (StringUtils.isNotEmpty(matdeliverFollowRequest.getNeed())) {//是否分页 |