Commit 2603ac512ca4b60d4468ecddfe1d45fc59ca3ef2
1 parent
906ac169e6
Exists in
master
and in
6 other branches
筛查统计
Showing 2 changed files with 26 additions and 157 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AreaCountFacade.java
View file @
2603ac5
| 1 | 1 | package com.lyms.platform.operate.web.facade; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -import com.lyms.platform.beans.AddressBean; | |
| 5 | 4 | import com.lyms.platform.biz.service.*; |
| 6 | 5 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 7 | 6 | import com.lyms.platform.common.enums.YnEnums; |
| ... | ... | @@ -162,83 +161,6 @@ |
| 162 | 161 | } |
| 163 | 162 | |
| 164 | 163 | |
| 165 | - public boolean hasPermissions(String id,Integer addType,List<DataPermissionsModel> permissionsModels) | |
| 166 | - { | |
| 167 | - | |
| 168 | - if (CollectionUtils.isNotEmpty(permissionsModels) && StringUtils.isNotEmpty(permissionsModels.get(0).getAreaPermission())) | |
| 169 | - { | |
| 170 | - List<AddressBean> addressBeanList = JsonUtil.toList(permissionsModels.get(0).getAreaPermission(), AddressBean.class); | |
| 171 | - if (CollectionUtils.isEmpty(addressBeanList)) | |
| 172 | - { | |
| 173 | - return false; | |
| 174 | - } | |
| 175 | - | |
| 176 | - for (AddressBean bean : addressBeanList) | |
| 177 | - { | |
| 178 | - if (addType == 1) { | |
| 179 | - if (id != null && id.equals(bean.getC())) { | |
| 180 | - return true; | |
| 181 | - } | |
| 182 | - } | |
| 183 | - else if (addType == 2) | |
| 184 | - { | |
| 185 | - if (id != null && id.equals(bean.getA())) | |
| 186 | - { | |
| 187 | - return true; | |
| 188 | - } | |
| 189 | - } | |
| 190 | - else if (addType == 3) | |
| 191 | - { | |
| 192 | - if (id != null && id.equals(bean.getS())) | |
| 193 | - { | |
| 194 | - return true; | |
| 195 | - } | |
| 196 | - } | |
| 197 | - } | |
| 198 | - } | |
| 199 | - return false; | |
| 200 | - } | |
| 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 | - | |
| 242 | 164 | /** |
| 243 | 165 | * 产检节点统计 |
| 244 | 166 | * |
| ... | ... | @@ -290,12 +212,12 @@ |
| 290 | 212 | end = hospitalIds.size(); |
| 291 | 213 | } |
| 292 | 214 | CheckPointCountWorker checkPointCountWorker = new CheckPointCountWorker( patientsService, |
| 293 | - antenatalExaminationService, | |
| 294 | - organizationService, | |
| 295 | - basicConfigService, | |
| 296 | - hospitalIds.subList(i,end), | |
| 297 | - startTime, | |
| 298 | - endTime, | |
| 215 | + antenatalExaminationService, | |
| 216 | + organizationService, | |
| 217 | + basicConfigService, | |
| 218 | + hospitalIds.subList(i,end), | |
| 219 | + startTime, | |
| 220 | + endTime, | |
| 299 | 221 | pointType,recordService); |
| 300 | 222 | listFuture.add(commonThreadPool.submit(checkPointCountWorker)); |
| 301 | 223 | } |
| ... | ... | @@ -506,7 +428,7 @@ |
| 506 | 428 | patientsQuery.setPage(page); |
| 507 | 429 | patientsQuery.setLimit(limit); |
| 508 | 430 | List<Map<String,Object>> list = getCheckPointList( time, hospitalId, |
| 509 | - provinceId, cityId, areaId, userId,patientsQuery); | |
| 431 | + provinceId, cityId, areaId, userId,patientsQuery); | |
| 510 | 432 | |
| 511 | 433 | return new BaseListResponse().setData(list).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION).setPageInfo(patientsQuery.getPageInfo()); |
| 512 | 434 | } |
| ... | ... | @@ -592,7 +514,7 @@ |
| 592 | 514 | String addressRegister = CommonsHelper.getResidence(pat.getProvinceRegisterId(), pat.getCityRegisterId(), |
| 593 | 515 | pat.getAreaRegisterId(), pat.getStreetRegisterId(), pat.getAddressRegister(), basicConfigService); |
| 594 | 516 | map.put("HOME_ADDR", addressRegister); |
| 595 | - | |
| 517 | + | |
| 596 | 518 | map.put("NAME", pat.getUsername()); |
| 597 | 519 | map.put("TEL_NO", pat.getPhone()); |
| 598 | 520 | |
| ... | ... | @@ -665,8 +587,8 @@ |
| 665 | 587 | antExRecordQuery.setLimit(limit); |
| 666 | 588 | antExRecordQuery.setNeed("true"); |
| 667 | 589 | List<Map> results = getCheckDetailData( nodeType, time, hospitalId, |
| 668 | - provinceId, cityId, areaId, | |
| 669 | - userId, nodeName, antExRecordQuery); | |
| 590 | + provinceId, cityId, areaId, | |
| 591 | + userId, nodeName, antExRecordQuery); | |
| 670 | 592 | |
| 671 | 593 | return new BaseListResponse().setData(results).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION).setPageInfo(antExRecordQuery.getPageInfo()); |
| 672 | 594 | } |
| ... | ... | @@ -888,8 +810,8 @@ |
| 888 | 810 | |
| 889 | 811 | AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); |
| 890 | 812 | List<Map> ticketList = getCheckDetailData( nodeType, time, hospitalId, |
| 891 | - provinceId, cityId, areaId, | |
| 892 | - userId, nodeName,antExRecordQuery); | |
| 813 | + provinceId, cityId, areaId, | |
| 814 | + userId, nodeName,antExRecordQuery); | |
| 893 | 815 | |
| 894 | 816 | List<Map<String,Object>> results = new ArrayList<>(); |
| 895 | 817 | if (CollectionUtils.isNotEmpty(ticketList)) |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SieveFacade.java
View file @
2603ac5
| 1 | 1 | package com.lyms.platform.operate.web.facade; |
| 2 | 2 | |
| 3 | -import com.lyms.platform.beans.AddressBean; | |
| 4 | 3 | import com.lyms.platform.beans.MsgRequest; |
| 5 | 4 | import com.lyms.platform.biz.service.*; |
| 6 | 5 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| ... | ... | @@ -1120,7 +1119,7 @@ |
| 1120 | 1119 | |
| 1121 | 1120 | String[] dates = null; |
| 1122 | 1121 | if (StringUtils.isNotEmpty(cqSieveQueryRequest.getTime())) { |
| 1123 | - dates = cqSieveQueryRequest.getTime().split(" - "); | |
| 1122 | + dates = cqSieveQueryRequest.getTime().split(" - "); | |
| 1124 | 1123 | } |
| 1125 | 1124 | |
| 1126 | 1125 | BasicConfigQuery basicQuery = new BasicConfigQuery(); |
| 1127 | 1126 | |
| ... | ... | @@ -1144,20 +1143,12 @@ |
| 1144 | 1143 | //x轴标题数据 |
| 1145 | 1144 | List<String> xAxis = new ArrayList<>(); |
| 1146 | 1145 | |
| 1147 | - List<BasicConfig> configList = new ArrayList<>(); | |
| 1148 | - | |
| 1149 | - DataPermissionsModelQuery dataPermissionsModelQuery = new DataPermissionsModelQuery(); | |
| 1150 | - dataPermissionsModelQuery.setUserId(userId); | |
| 1151 | - List<DataPermissionsModel> permissionsModels = dataPermissionService.queryPermission(dataPermissionsModelQuery); | |
| 1152 | 1146 | //获取地址列表 |
| 1153 | - List<BasicConfig> dataConfigs = basicConfigService.queryBasicConfig(basicQuery); | |
| 1154 | - if (CollectionUtils.isNotEmpty(dataConfigs)) { | |
| 1155 | - for (BasicConfig addr : dataConfigs) { | |
| 1156 | - if (areaCountFacade.hasPermissions(addr.getId(),addrType,permissionsModels)) | |
| 1157 | - { | |
| 1158 | - configList.add(addr); | |
| 1159 | - xAxis.add(addr.getName()); | |
| 1160 | - } | |
| 1147 | + List<BasicConfig> configList = basicConfigService.queryBasicConfig(basicQuery); | |
| 1148 | + | |
| 1149 | + if (CollectionUtils.isNotEmpty(configList)) { | |
| 1150 | + for (BasicConfig addr : configList) { | |
| 1151 | + xAxis.add(addr.getName()); | |
| 1161 | 1152 | } |
| 1162 | 1153 | } |
| 1163 | 1154 | |
| ... | ... | @@ -1299,6 +1290,7 @@ |
| 1299 | 1290 | diagnosisQuery1.setResultDateEnd(DateUtil.parseYMDHMS(dates[1])); |
| 1300 | 1291 | } |
| 1301 | 1292 | } |
| 1293 | + System.out.println("diagnosisQuery1==="+diagnosisQuery1.convertToQuery().convertToMongoQuery()); | |
| 1302 | 1294 | int diagnosisCountAll = diagnosisService.queryDiagnosisCount(diagnosisQuery1); |
| 1303 | 1295 | items.add(String.valueOf(diagnosisCountAll)); |
| 1304 | 1296 | } |
| 1305 | 1297 | |
| 1306 | 1298 | |
| ... | ... | @@ -1334,13 +1326,12 @@ |
| 1334 | 1326 | |
| 1335 | 1327 | @Autowired |
| 1336 | 1328 | private BasicConfigService basicConfigService; |
| 1329 | + | |
| 1337 | 1330 | @Autowired |
| 1338 | - private DataPermissionService dataPermissionService; | |
| 1339 | - @Autowired | |
| 1340 | 1331 | private AreaCountFacade areaCountFacade; |
| 1341 | 1332 | |
| 1342 | 1333 | |
| 1343 | - private List<Map<String,String>> getSieveDatas(List<String> hospitalIds,String[] dates,String cityId,Integer userId) | |
| 1334 | + private List<Map<String,String>> getSieveDatas(List<String> hospitalIds,String[] dates,String cityId) | |
| 1344 | 1335 | { |
| 1345 | 1336 | List<Map<String,String>> list = new ArrayList<>(); |
| 1346 | 1337 | |
| 1347 | 1338 | |
| 1348 | 1339 | |
| ... | ... | @@ -1350,22 +1341,10 @@ |
| 1350 | 1341 | basicQuery.setTypeId("b7ea005c-dfac-4c2a-bdae-25239b3f44fd"); |
| 1351 | 1342 | basicQuery.setParentId(cityId); |
| 1352 | 1343 | |
| 1353 | - List<BasicConfig> configList = new ArrayList<>(); | |
| 1354 | 1344 | |
| 1355 | - DataPermissionsModelQuery dataPermissionsModelQuery = new DataPermissionsModelQuery(); | |
| 1356 | - dataPermissionsModelQuery.setUserId(userId); | |
| 1357 | - List<DataPermissionsModel> permissionsModels = dataPermissionService.queryPermission(dataPermissionsModelQuery); | |
| 1358 | - //获取地址列表 | |
| 1359 | - List<BasicConfig> dataConfigs = basicConfigService.queryBasicConfig(basicQuery); | |
| 1360 | - if (CollectionUtils.isNotEmpty(dataConfigs)) { | |
| 1361 | - for (BasicConfig addr : dataConfigs) { | |
| 1362 | - if (areaCountFacade.hasPermissions(addr.getId(),2,permissionsModels)) | |
| 1363 | - { | |
| 1364 | - configList.add(addr); | |
| 1365 | - } | |
| 1366 | - } | |
| 1367 | - } | |
| 1368 | 1345 | |
| 1346 | + //获取地址列表 | |
| 1347 | + List<BasicConfig> configList = basicConfigService.queryBasicConfig(basicQuery); | |
| 1369 | 1348 | for (BasicConfig bc : configList) |
| 1370 | 1349 | { |
| 1371 | 1350 | int ySieveCount = 0; |
| 1372 | 1351 | |
| ... | ... | @@ -1620,11 +1599,11 @@ |
| 1620 | 1599 | dates = cqSieveQueryRequest.getTime().split(" - "); |
| 1621 | 1600 | titleName+=cqSieveQueryRequest.getTime(); |
| 1622 | 1601 | } |
| 1623 | - List<Map<String,String>> list = getSieveDatas(currentUserHospPermissions, dates, cqSieveQueryRequest.getCityId(),userId); | |
| 1602 | + List<Map<String,String>> list = getSieveDatas(currentUserHospPermissions,dates,cqSieveQueryRequest.getCityId()); | |
| 1624 | 1603 | response.setContentType("application/force-download"); |
| 1625 | 1604 | response.setHeader("Content-Disposition", "attachment;filename=" + new String(("孕妇产前筛查和诊断情况月报表.xls").getBytes("UTF-8"), "ISO-8859-1")); |
| 1626 | 1605 | String path = this.getClass().getResource("/").getPath()+ "whfy_sieve.xls"; |
| 1627 | - ExcelUtil.writeWhSieveExclFile(path, response.getOutputStream(), list, titleName); | |
| 1606 | + ExcelUtil.writeWhSieveExclFile(path, response.getOutputStream(), list,titleName); | |
| 1628 | 1607 | |
| 1629 | 1608 | } catch (Exception e) { |
| 1630 | 1609 | ExceptionUtils.catchException(e, "exportSieveReportExcl error"); |
| 1631 | 1610 | |
| ... | ... | @@ -1646,40 +1625,9 @@ |
| 1646 | 1625 | } |
| 1647 | 1626 | |
| 1648 | 1627 | //获取用户权限医院和筛选条件的交集 |
| 1649 | - List<String> areaHospitalIds = new ArrayList<>(); | |
| 1650 | - | |
| 1651 | - DataPermissionsModelQuery dataPermissionsModelQuery = new DataPermissionsModelQuery(); | |
| 1652 | - dataPermissionsModelQuery.setUserId(userId); | |
| 1653 | - List<DataPermissionsModel> permissionsModels = dataPermissionService.queryPermission(dataPermissionsModelQuery); | |
| 1654 | - if (CollectionUtils.isNotEmpty(permissionsModels)) | |
| 1655 | - { | |
| 1656 | - for (DataPermissionsModel permissionsModel : permissionsModels) | |
| 1657 | - { | |
| 1658 | - if (StringUtils.isNotEmpty(permissionsModel.getAreaPermission())) | |
| 1659 | - { | |
| 1660 | - | |
| 1661 | - List<AddressBean> addressBeanList = JsonUtil.toList(permissionsModels.get(0).getAreaPermission(), AddressBean.class); | |
| 1662 | - if (CollectionUtils.isEmpty(addressBeanList)) | |
| 1663 | - { | |
| 1664 | - continue; | |
| 1665 | - } | |
| 1666 | - | |
| 1667 | - for (AddressBean bean : addressBeanList) | |
| 1668 | - { | |
| 1669 | - areaHospitalIds.addAll(areaCountFacade.getCurrentUserHospPermissions(userId, bean.getP(), | |
| 1670 | - bean.getC(), bean.getA())); | |
| 1671 | - } | |
| 1672 | - } | |
| 1673 | - } | |
| 1674 | - } | |
| 1675 | - | |
| 1676 | - List<Map<String,String>> list = new ArrayList<>(); | |
| 1677 | - //获取用户权限医院和筛选条件的交集 | |
| 1678 | 1628 | List<String> currentUserHospPermissions = areaCountFacade.getCurrentUserHospPermissions(userId, cqSieveQueryRequest.getProvinceId(), |
| 1679 | 1629 | cqSieveQueryRequest.getCityId(), cqSieveQueryRequest.getAreaId()); |
| 1680 | - | |
| 1681 | - currentUserHospPermissions.retainAll(areaHospitalIds); | |
| 1682 | - list = getDiaDatas(currentUserHospPermissions, dates); | |
| 1630 | + List<Map<String,String>> list = getDiaDatas(currentUserHospPermissions, dates); | |
| 1683 | 1631 | response.setContentType("application/force-download"); |
| 1684 | 1632 | response.setHeader("Content-Disposition", "attachment;filename=" + new String(("产前诊断及新生儿疾病筛查工作情况表.xls").getBytes("UTF-8"), "ISO-8859-1")); |
| 1685 | 1633 | String path = this.getClass().getResource("/").getPath()+ "whfy_diagnosis.xls"; |
| ... | ... | @@ -2076,6 +2024,5 @@ |
| 2076 | 2024 | |
| 2077 | 2025 | list.add(dataMap); |
| 2078 | 2026 | } |
| 2079 | - | |
| 2080 | 2027 | } |