Commit 72339ec9dd0bc28680f9ad2b8b3df1c09bda0742
1 parent
8903538522
Exists in
master
and in
6 other branches
筛查统计
Showing 2 changed files with 80 additions and 9 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AreaCountFacade.java
View file @
72339ec
| ... | ... | @@ -199,6 +199,46 @@ |
| 199 | 199 | return false; |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | + | |
| 203 | + | |
| 204 | + public boolean hasPermissions2(String id,Integer addType,List<DataPermissionsModel> permissionsModels) | |
| 205 | + { | |
| 206 | + | |
| 207 | + if (CollectionUtils.isNotEmpty(permissionsModels) && StringUtils.isNotEmpty(permissionsModels.get(0).getAreaPermission())) | |
| 208 | + { | |
| 209 | + List<AddressBean> addressBeanList = JsonUtil.toList(permissionsModels.get(0).getAreaPermission(), AddressBean.class); | |
| 210 | + if (CollectionUtils.isEmpty(addressBeanList)) | |
| 211 | + { | |
| 212 | + return false; | |
| 213 | + } | |
| 214 | + | |
| 215 | + for (AddressBean bean : addressBeanList) | |
| 216 | + { | |
| 217 | + if (addType == 1) { | |
| 218 | + if (id != null && id.equals(bean.getP())) { | |
| 219 | + return true; | |
| 220 | + } | |
| 221 | + } | |
| 222 | + else if (addType == 2) | |
| 223 | + { | |
| 224 | + if (id != null && id.equals(bean.getC())) | |
| 225 | + { | |
| 226 | + return true; | |
| 227 | + } | |
| 228 | + } | |
| 229 | + else if (addType == 3) | |
| 230 | + { | |
| 231 | + if (id != null && id.equals(bean.getA())) | |
| 232 | + { | |
| 233 | + return true; | |
| 234 | + } | |
| 235 | + } | |
| 236 | + } | |
| 237 | + } | |
| 238 | + return false; | |
| 239 | + } | |
| 240 | + | |
| 241 | + | |
| 202 | 242 | /** |
| 203 | 243 | * 产检节点统计 |
| 204 | 244 | * |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SieveFacade.java
View file @
72339ec
| ... | ... | @@ -1150,7 +1150,7 @@ |
| 1150 | 1150 | List<DataPermissionsModel> permissionsModels = dataPermissionService.queryPermission(dataPermissionsModelQuery); |
| 1151 | 1151 | //获取地址列表 |
| 1152 | 1152 | List<BasicConfig> dataConfigs = basicConfigService.queryBasicConfig(basicQuery); |
| 1153 | - if (CollectionUtils.isNotEmpty(configList)) { | |
| 1153 | + if (CollectionUtils.isNotEmpty(dataConfigs)) { | |
| 1154 | 1154 | for (BasicConfig addr : dataConfigs) { |
| 1155 | 1155 | if (areaCountFacade.hasPermissions(addr.getId(),addrType,permissionsModels)) |
| 1156 | 1156 | { |
| ... | ... | @@ -1339,7 +1339,7 @@ |
| 1339 | 1339 | private AreaCountFacade areaCountFacade; |
| 1340 | 1340 | |
| 1341 | 1341 | |
| 1342 | - private List<Map<String,String>> getSieveDatas(List<String> hospitalIds,String[] dates,String cityId) | |
| 1342 | + private List<Map<String,String>> getSieveDatas(List<String> hospitalIds,String[] dates,String cityId,Integer userId) | |
| 1343 | 1343 | { |
| 1344 | 1344 | List<Map<String,String>> list = new ArrayList<>(); |
| 1345 | 1345 | |
| 1346 | 1346 | |
| 1347 | 1347 | |
| ... | ... | @@ -1349,10 +1349,22 @@ |
| 1349 | 1349 | basicQuery.setTypeId("b7ea005c-dfac-4c2a-bdae-25239b3f44fd"); |
| 1350 | 1350 | basicQuery.setParentId(cityId); |
| 1351 | 1351 | |
| 1352 | + List<BasicConfig> configList = new ArrayList<>(); | |
| 1352 | 1353 | |
| 1353 | - | |
| 1354 | + DataPermissionsModelQuery dataPermissionsModelQuery = new DataPermissionsModelQuery(); | |
| 1355 | + dataPermissionsModelQuery.setUserId(userId); | |
| 1356 | + List<DataPermissionsModel> permissionsModels = dataPermissionService.queryPermission(dataPermissionsModelQuery); | |
| 1354 | 1357 | //获取地址列表 |
| 1355 | - List<BasicConfig> configList = basicConfigService.queryBasicConfig(basicQuery); | |
| 1358 | + List<BasicConfig> dataConfigs = basicConfigService.queryBasicConfig(basicQuery); | |
| 1359 | + if (CollectionUtils.isNotEmpty(dataConfigs)) { | |
| 1360 | + for (BasicConfig addr : dataConfigs) { | |
| 1361 | + if (areaCountFacade.hasPermissions(addr.getId(),2,permissionsModels)) | |
| 1362 | + { | |
| 1363 | + configList.add(addr); | |
| 1364 | + } | |
| 1365 | + } | |
| 1366 | + } | |
| 1367 | + | |
| 1356 | 1368 | for (BasicConfig bc : configList) |
| 1357 | 1369 | { |
| 1358 | 1370 | int ySieveCount = 0; |
| ... | ... | @@ -1607,7 +1619,7 @@ |
| 1607 | 1619 | dates = cqSieveQueryRequest.getTime().split(" - "); |
| 1608 | 1620 | titleName+=cqSieveQueryRequest.getTime(); |
| 1609 | 1621 | } |
| 1610 | - List<Map<String,String>> list = getSieveDatas(currentUserHospPermissions, dates, cqSieveQueryRequest.getCityId()); | |
| 1622 | + List<Map<String,String>> list = getSieveDatas(currentUserHospPermissions, dates, cqSieveQueryRequest.getCityId(),userId); | |
| 1611 | 1623 | response.setContentType("application/force-download"); |
| 1612 | 1624 | response.setHeader("Content-Disposition", "attachment;filename=" + new String(("孕妇产前筛查和诊断情况月报表.xls").getBytes("UTF-8"), "ISO-8859-1")); |
| 1613 | 1625 | String path = this.getClass().getResource("/").getPath()+ "whfy_sieve.xls"; |
| ... | ... | @@ -1632,10 +1644,29 @@ |
| 1632 | 1644 | h1+=" "+cqSieveQueryRequest.getTime(); |
| 1633 | 1645 | } |
| 1634 | 1646 | |
| 1635 | - //获取用户权限医院和筛选条件的交集 | |
| 1636 | - List<String> currentUserHospPermissions = areaCountFacade.getCurrentUserHospPermissions(userId, cqSieveQueryRequest.getProvinceId(), | |
| 1637 | - cqSieveQueryRequest.getCityId(), cqSieveQueryRequest.getAreaId()); | |
| 1638 | - List<Map<String,String>> list = getDiaDatas(currentUserHospPermissions, dates); | |
| 1647 | + DataPermissionsModelQuery dataPermissionsModelQuery = new DataPermissionsModelQuery(); | |
| 1648 | + dataPermissionsModelQuery.setUserId(userId); | |
| 1649 | + List<DataPermissionsModel> permissionsModels = dataPermissionService.queryPermission(dataPermissionsModelQuery); | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + boolean hasPermission = false; | |
| 1653 | + if (StringUtils.isNotEmpty(cqSieveQueryRequest.getProvinceId())) { | |
| 1654 | + hasPermission = areaCountFacade.hasPermissions2(cqSieveQueryRequest.getProvinceId(), 1, permissionsModels); | |
| 1655 | + } | |
| 1656 | + if (StringUtils.isNotEmpty(cqSieveQueryRequest.getCityId())) { | |
| 1657 | + hasPermission = areaCountFacade.hasPermissions2(cqSieveQueryRequest.getProvinceId(), 2, permissionsModels); | |
| 1658 | + } | |
| 1659 | + if (StringUtils.isNotEmpty(cqSieveQueryRequest.getAreaId())) { | |
| 1660 | + hasPermission = areaCountFacade.hasPermissions2(cqSieveQueryRequest.getProvinceId(), 3, permissionsModels); | |
| 1661 | + } | |
| 1662 | + List<Map<String,String>> list = new ArrayList<>(); | |
| 1663 | + if (hasPermission) | |
| 1664 | + { | |
| 1665 | + //获取用户权限医院和筛选条件的交集 | |
| 1666 | + List<String> currentUserHospPermissions = areaCountFacade.getCurrentUserHospPermissions(userId, cqSieveQueryRequest.getProvinceId(), | |
| 1667 | + cqSieveQueryRequest.getCityId(), cqSieveQueryRequest.getAreaId()); | |
| 1668 | + list = getDiaDatas(currentUserHospPermissions, dates); | |
| 1669 | + } | |
| 1639 | 1670 | response.setContentType("application/force-download"); |
| 1640 | 1671 | response.setHeader("Content-Disposition", "attachment;filename=" + new String(("产前诊断及新生儿疾病筛查工作情况表.xls").getBytes("UTF-8"), "ISO-8859-1")); |
| 1641 | 1672 | String path = this.getClass().getResource("/").getPath()+ "whfy_diagnosis.xls"; |