Commit 5db9ef2530a59cddcec7fee7bf6ae002452bbb74
1 parent
1714772343
Exists in
master
and in
6 other branches
访视添加字段
Showing 3 changed files with 111 additions and 9 deletions
platform-dal/src/main/java/com/lyms/platform/query/MatDeliverQuery.java
View file @
5db9ef2
| ... | ... | @@ -45,6 +45,17 @@ |
| 45 | 45 | private Date modifiedEnd; |
| 46 | 46 | private Integer rHloseBloodL; |
| 47 | 47 | |
| 48 | + private List<String> pids; | |
| 49 | + | |
| 50 | + | |
| 51 | + public List<String> getPids() { | |
| 52 | + return pids; | |
| 53 | + } | |
| 54 | + | |
| 55 | + public void setPids(List<String> pids) { | |
| 56 | + this.pids = pids; | |
| 57 | + } | |
| 58 | + | |
| 48 | 59 | public Integer getrHloseBloodL() { |
| 49 | 60 | return rHloseBloodL; |
| 50 | 61 | } |
| ... | ... | @@ -237,6 +248,10 @@ |
| 237 | 248 | |
| 238 | 249 | if (CollectionUtils.isNotEmpty(siLielevels)) { |
| 239 | 250 | condition = condition.and("siLielevel", siLielevels, MongoOper.IN); |
| 251 | + } | |
| 252 | + | |
| 253 | + if (CollectionUtils.isNotEmpty(pids)) { | |
| 254 | + condition = condition.and("pid", pids, MongoOper.IN); | |
| 240 | 255 | } |
| 241 | 256 | |
| 242 | 257 | if (null != pid) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
5db9ef2
| ... | ... | @@ -33,6 +33,7 @@ |
| 33 | 33 | import org.apache.commons.collections.map.HashedMap; |
| 34 | 34 | import org.apache.commons.lang.StringUtils; |
| 35 | 35 | import org.apache.commons.lang.math.NumberUtils; |
| 36 | +import org.joda.time.format.ISODateTimeFormat; | |
| 36 | 37 | import org.slf4j.Logger; |
| 37 | 38 | import org.slf4j.LoggerFactory; |
| 38 | 39 | import org.springframework.beans.factory.annotation.Autowired; |
| 39 | 40 | |
| 40 | 41 | |
| ... | ... | @@ -1830,13 +1831,29 @@ |
| 1830 | 1831 | // 没有查到,直接抛出 |
| 1831 | 1832 | return listResponse; |
| 1832 | 1833 | } |
| 1834 | + | |
| 1833 | 1835 | List<String> parentIdList = new ArrayList<>(); |
| 1834 | 1836 | for (Patients patients : patientsList) { |
| 1835 | 1837 | parentIdList.add(patients.getId()); |
| 1836 | 1838 | } |
| 1837 | 1839 | matDeliverQuery.setParentIdList(parentIdList); |
| 1838 | 1840 | } |
| 1841 | + String startAge = matdeliverFollowRequest.getStartAge(); | |
| 1842 | + String endAge = matdeliverFollowRequest.getEndAge(); | |
| 1843 | + List<String> pids = new ArrayList(); | |
| 1844 | + // 年龄段 | |
| 1845 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(startAge) && | |
| 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); | |
| 1850 | + for (PersonModel model : personModels) { | |
| 1851 | + pids.add(model.getId()); | |
| 1852 | + } | |
| 1853 | + } | |
| 1854 | + matDeliverQuery.setPids(pids); | |
| 1839 | 1855 | |
| 1856 | + | |
| 1840 | 1857 | matDeliverQuery.setYn(YnEnums.YES.getId()); |
| 1841 | 1858 | //分娩日期 |
| 1842 | 1859 | if (StringUtils.isNotEmpty(matdeliverFollowRequest.getBirthDate())) { |
| 1843 | 1860 | |
| ... | ... | @@ -1894,7 +1911,20 @@ |
| 1894 | 1911 | matDeliverQuery.setParentIdList(parentIdList); |
| 1895 | 1912 | } |
| 1896 | 1913 | |
| 1914 | + // 高危等级 | |
| 1915 | + 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()); | |
| 1920 | + } | |
| 1921 | + List<String> parentIdList1 = matDeliverQuery.getParentIdList(); | |
| 1922 | + if (CollectionUtils.isNotEmpty(parentIdList1)) { | |
| 1923 | + patientIds.addAll(parentIdList1); | |
| 1924 | + } | |
| 1925 | + matDeliverQuery.setParentIdList(patientIds); | |
| 1897 | 1926 | |
| 1927 | + | |
| 1898 | 1928 | if (StringUtils.isNotEmpty(matdeliverFollowRequest.getNeed())) {//是否分页 |
| 1899 | 1929 | matDeliverQuery.setNeed("need"); |
| 1900 | 1930 | matDeliverQuery.setLimit(matdeliverFollowRequest.getLimit()); |
| ... | ... | @@ -2096,15 +2126,7 @@ |
| 2096 | 2126 | MatdeliverFollowModel model = followModels.get(followModels.size() - 1); |
| 2097 | 2127 | Integer contactReason = model.getContactReason(); |
| 2098 | 2128 | if (contactReason != null) { |
| 2099 | - if (contactReason == 1) { | |
| 2100 | - contactReasonStr = "无人接听电话"; | |
| 2101 | - } | |
| 2102 | - if (contactReason == 2) { | |
| 2103 | - contactReasonStr = "拒绝访视"; | |
| 2104 | - } | |
| 2105 | - if (contactReason == 3) { | |
| 2106 | - contactReasonStr = "其他"; | |
| 2107 | - } | |
| 2129 | + contactReasonStr = PostpartumFollowMakeEnums.ReasonEnum.getTitle(contactReason); | |
| 2108 | 2130 | } |
| 2109 | 2131 | } |
| 2110 | 2132 | matdeliverFollowListResult.setCauseFailure(contactReasonStr); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatdeliverFollowRequest.java
View file @
5db9ef2
| ... | ... | @@ -101,6 +101,71 @@ |
| 101 | 101 | //访视机构 |
| 102 | 102 | private String fsHospitalId; |
| 103 | 103 | |
| 104 | + /** | |
| 105 | + * 开始年龄段 | |
| 106 | + */ | |
| 107 | + private String startAge; | |
| 108 | + | |
| 109 | + /** | |
| 110 | + * 结束年龄段 | |
| 111 | + */ | |
| 112 | + private String endAge; | |
| 113 | + | |
| 114 | + /** | |
| 115 | + * 开始访视时间 | |
| 116 | + */ | |
| 117 | + private String fsStartTime; | |
| 118 | + | |
| 119 | + /** | |
| 120 | + * 结束访视时间 | |
| 121 | + */ | |
| 122 | + private String fsEndTime; | |
| 123 | + | |
| 124 | + /** | |
| 125 | + * 高危等级 | |
| 126 | + */ | |
| 127 | + private String highRiskLevel; | |
| 128 | + | |
| 129 | + public String getStartAge() { | |
| 130 | + return startAge; | |
| 131 | + } | |
| 132 | + | |
| 133 | + public void setStartAge(String startAge) { | |
| 134 | + this.startAge = startAge; | |
| 135 | + } | |
| 136 | + | |
| 137 | + public String getEndAge() { | |
| 138 | + return endAge; | |
| 139 | + } | |
| 140 | + | |
| 141 | + public void setEndAge(String endAge) { | |
| 142 | + this.endAge = endAge; | |
| 143 | + } | |
| 144 | + | |
| 145 | + public String getFsStartTime() { | |
| 146 | + return fsStartTime; | |
| 147 | + } | |
| 148 | + | |
| 149 | + public void setFsStartTime(String fsStartTime) { | |
| 150 | + this.fsStartTime = fsStartTime; | |
| 151 | + } | |
| 152 | + | |
| 153 | + public String getFsEndTime() { | |
| 154 | + return fsEndTime; | |
| 155 | + } | |
| 156 | + | |
| 157 | + public void setFsEndTime(String fsEndTime) { | |
| 158 | + this.fsEndTime = fsEndTime; | |
| 159 | + } | |
| 160 | + | |
| 161 | + public String getHighRiskLevel() { | |
| 162 | + return highRiskLevel; | |
| 163 | + } | |
| 164 | + | |
| 165 | + public void setHighRiskLevel(String highRiskLevel) { | |
| 166 | + this.highRiskLevel = highRiskLevel; | |
| 167 | + } | |
| 168 | + | |
| 104 | 169 | public String getFsHospitalId() { |
| 105 | 170 | return fsHospitalId; |
| 106 | 171 | } |