Commit 70643a02563074de08dae5cf0dfab54bd9bb4106
1 parent
2603ac512c
Exists in
master
and in
6 other branches
筛查统计
Showing 1 changed file with 119 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AreaCountFacade.java
View file @
70643a0
1 | 1 | package com.lyms.platform.operate.web.facade; |
2 | 2 | |
3 | 3 | |
4 | +import com.lyms.platform.beans.AddressBean; | |
4 | 5 | import com.lyms.platform.biz.service.*; |
5 | 6 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
6 | 7 | import com.lyms.platform.common.enums.YnEnums; |
... | ... | @@ -159,6 +160,124 @@ |
159 | 160 | } |
160 | 161 | return hospitalList; |
161 | 162 | } |
163 | + | |
164 | + public boolean hasPermissions(String id,Integer addType,List<DataPermissionsModel> permissionsModels) | |
165 | + { | |
166 | + | |
167 | + if (CollectionUtils.isNotEmpty(permissionsModels) && StringUtils.isNotEmpty(permissionsModels.get(0).getAreaPermission())) | |
168 | + { | |
169 | + List<AddressBean> addressBeanList = JsonUtil.toList(permissionsModels.get(0).getAreaPermission(), AddressBean.class); | |
170 | + if (CollectionUtils.isEmpty(addressBeanList)) | |
171 | + { | |
172 | + return false; | |
173 | + } | |
174 | + | |
175 | + for (AddressBean bean : addressBeanList) | |
176 | + { | |
177 | + if (addType == 1) { | |
178 | + if (id != null && id.equals(bean.getP())) { | |
179 | + return true; | |
180 | + } | |
181 | + } | |
182 | + else if (addType == 2) | |
183 | + { | |
184 | + if (id != null && id.equals(bean.getC())) | |
185 | + { | |
186 | + return true; | |
187 | + } | |
188 | + } | |
189 | + else if (addType == 3) | |
190 | + { | |
191 | + if (id != null && id.equals(bean.getA())) | |
192 | + { | |
193 | + return true; | |
194 | + } | |
195 | + } | |
196 | + } | |
197 | + } | |
198 | + return false; | |
199 | + } | |
200 | + | |
201 | + | |
202 | + | |
203 | + | |
204 | +// public List<String> getCurrentUserHospPermissions(Integer userId, String provinceId, String cityId, String areaId) { | |
205 | +// | |
206 | +// //权限医院列表 | |
207 | +// List<String> perHoapitalList = new ArrayList<>(); | |
208 | +// DataPermissionsModelQuery dataPermissionsModelQuery = new DataPermissionsModelQuery(); | |
209 | +// dataPermissionsModelQuery.setUserId(userId); | |
210 | +// List<DataPermissionsModel> permissionsModels = dataPermissionService.queryPermission(dataPermissionsModelQuery); | |
211 | +// if (CollectionUtils.isNotEmpty(permissionsModels)) { | |
212 | +// Set<String> set = permissionsModels.get(0).getData().keySet(); | |
213 | +// Iterator<String> it = set.iterator(); | |
214 | +// while (it.hasNext()) { | |
215 | +// String id = it.next(); | |
216 | +// if (StringUtils.isNotEmpty(id)) { | |
217 | +// perHoapitalList.add(id); | |
218 | +// } | |
219 | +// } | |
220 | +// //区域查询到的医院 | |
221 | +// List<String> areaHospitalList = new ArrayList<>(); | |
222 | +// if (StringUtils.isNotEmpty(permissionsModels.get(0).getAreaPermission())) | |
223 | +// { | |
224 | +// List<AddressBean> addressBeanList = JsonUtil.toList(permissionsModels.get(0).getAreaPermission(), AddressBean.class); | |
225 | +// if (CollectionUtils.isNotEmpty(addressBeanList)) | |
226 | +// { | |
227 | +// for (AddressBean bean : addressBeanList) | |
228 | +// { | |
229 | +// if (StringUtils.isNotEmpty(bean.getP())) { | |
230 | +// OrganizationQuery organizationQuery = new OrganizationQuery(); | |
231 | +// organizationQuery.setYn(YnEnums.YES.getId()); | |
232 | +// organizationQuery.setProvinceId(bean.getP()); | |
233 | +// if (StringUtils.isNotEmpty(bean.getC())) { | |
234 | +// organizationQuery.setCityId(bean.getC()); | |
235 | +// if (StringUtils.isNotEmpty(bean.getA())) { | |
236 | +// organizationQuery.setAreaId(bean.getA()); | |
237 | +// } | |
238 | +// } | |
239 | +// List<Organization> organizations = organizationService.queryOrganization(organizationQuery); | |
240 | +// if (CollectionUtils.isNotEmpty(organizations)) { | |
241 | +// for (Organization org : organizations) { | |
242 | +// areaHospitalList.add(org.getId() + ""); | |
243 | +// } | |
244 | +// } | |
245 | +// organizations.clear(); | |
246 | +// } | |
247 | +// } | |
248 | +// } | |
249 | +// } | |
250 | +// //权限医院列表与区域列表查询到的医院交集 | |
251 | +// perHoapitalList.retainAll(areaHospitalList); | |
252 | +// } | |
253 | +// | |
254 | +// //条件查询到的医院 | |
255 | +// List<String> conditionHospitalList = new ArrayList<>(); | |
256 | +// if (StringUtils.isNotEmpty(provinceId)) { | |
257 | +// OrganizationQuery organizationQuery = new OrganizationQuery(); | |
258 | +// organizationQuery.setYn(YnEnums.YES.getId()); | |
259 | +// | |
260 | +// organizationQuery.setProvinceId(provinceId); | |
261 | +// if (StringUtils.isNotEmpty(cityId)) { | |
262 | +// organizationQuery.setCityId(cityId); | |
263 | +// if (StringUtils.isNotEmpty(areaId)) { | |
264 | +// organizationQuery.setAreaId(areaId); | |
265 | +// } | |
266 | +// } | |
267 | +// List<Organization> organizations = organizationService.queryOrganization(organizationQuery); | |
268 | +// if (CollectionUtils.isNotEmpty(organizations)) { | |
269 | +// for (Organization org : organizations) { | |
270 | +// if (null != org.getId()) { | |
271 | +// conditionHospitalList.add(org.getId() + ""); | |
272 | +// } | |
273 | +// } | |
274 | +// } | |
275 | +// organizations.clear(); | |
276 | +// } | |
277 | +// | |
278 | +// conditionHospitalList.retainAll(perHoapitalList); | |
279 | +// return conditionHospitalList; | |
280 | +// } | |
162 | 281 | |
163 | 282 | |
164 | 283 | /** |