Commit d89cf67672d58600d70aa30fdd659cd7bc951209
1 parent
28c184782c
Exists in
master
and in
6 other branches
统计
Showing 3 changed files with 26 additions and 34 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RiskReportController.java
View file @
d89cf67
| ... | ... | @@ -63,17 +63,17 @@ |
| 63 | 63 | * @return |
| 64 | 64 | */ |
| 65 | 65 | @RequestMapping(method = RequestMethod.GET, value = "/exportAreaHighRisk") |
| 66 | -// @TokenRequired | |
| 66 | + @TokenRequired | |
| 67 | 67 | public void exportAreaHighRisk(@Valid RiskPatientsCountRequest riskPatientsCountRequest, |
| 68 | 68 | HttpServletRequest request, |
| 69 | 69 | HttpServletResponse response) { |
| 70 | -// LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 71 | -// riskReportFacade.exportAreaHighRisk(riskPatientsCountRequest, | |
| 72 | -// loginState.getId(), response); | |
| 73 | -// | |
| 74 | - | |
| 70 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 75 | 71 | riskReportFacade.exportAreaHighRisk(riskPatientsCountRequest, |
| 76 | - 1000000185, response); | |
| 72 | + loginState.getId(), response); | |
| 73 | + | |
| 74 | + | |
| 75 | +// riskReportFacade.exportAreaHighRisk(riskPatientsCountRequest, | |
| 76 | +// 1000000185, response); | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RiskReportFacade.java
View file @
d89cf67
| ... | ... | @@ -246,8 +246,6 @@ |
| 246 | 246 | |
| 247 | 247 | if (StringUtils.isNotEmpty(countRequest.getTimeStart()) && StringUtils.isNotEmpty(countRequest.getTimeEnd())) |
| 248 | 248 | { |
| 249 | - patientsQuery.setBookbuildingDateStart(DateUtil.parseYMD(countRequest.getTimeStart())); | |
| 250 | - patientsQuery.setBookbuildingDateEnd(DateUtil.parseYMD(countRequest.getTimeEnd())); | |
| 251 | 249 | times = DateUtil.getRange(DateUtil.parseYMD(countRequest.getTimeStart()), |
| 252 | 250 | DateUtil.parseYMD(countRequest.getTimeEnd())); |
| 253 | 251 | } |
| 254 | 252 | |
| ... | ... | @@ -474,17 +472,7 @@ |
| 474 | 472 | } |
| 475 | 473 | result.addAll(totalAllList); |
| 476 | 474 | } |
| 477 | -// | |
| 478 | -// for (List<String> items : result) | |
| 479 | -// { | |
| 480 | -// for (String item : items) | |
| 481 | -// { | |
| 482 | -// System.out.print(" "+ item); | |
| 483 | -// } | |
| 484 | -// System.out.println(); | |
| 485 | -// } | |
| 486 | 475 | |
| 487 | - | |
| 488 | 476 | //统计柱状图数据封装-------------------------------- |
| 489 | 477 | |
| 490 | 478 | //图标数据 |
| 491 | 479 | |
| ... | ... | @@ -693,12 +681,17 @@ |
| 693 | 681 | * @param countRequest |
| 694 | 682 | */ |
| 695 | 683 | |
| 696 | - private PatientsQuery getRequestQuery(RiskPatientsCountRequest countRequest) { | |
| 684 | + public PatientsQuery getRequestQuery(RiskPatientsCountRequest countRequest) { | |
| 697 | 685 | |
| 698 | 686 | //孕妇基础查询对象 |
| 699 | 687 | PatientsQuery patientsQuery = new PatientsQuery(); |
| 700 | 688 | patientsQuery.setYn(YnEnums.YES.getId()); |
| 701 | 689 | |
| 690 | + if (StringUtils.isNotEmpty(countRequest.getTimeStart()) && StringUtils.isNotEmpty(countRequest.getTimeEnd())) { | |
| 691 | + patientsQuery.setBookbuildingDateStart(DateUtil.parseYMD(countRequest.getTimeStart())); | |
| 692 | + patientsQuery.setBookbuildingDateEnd(DateUtil.parseYMD(countRequest.getTimeEnd())); | |
| 693 | + } | |
| 694 | + | |
| 702 | 695 | Date currentDate = DateUtil.getYear(); |
| 703 | 696 | |
| 704 | 697 | //0:全部 1:20岁一下 2:25-30 3:30-40 4:40岁以上 |
| 705 | 698 | |
| ... | ... | @@ -803,9 +796,8 @@ |
| 803 | 796 | { |
| 804 | 797 | countRequest.setExportType(3); |
| 805 | 798 | } |
| 806 | -// currentUserHospPermissions.clear(); | |
| 807 | -// currentUserHospPermissions.add("216"); | |
| 808 | 799 | |
| 800 | + | |
| 809 | 801 | BasicConfigQuery basicConfigQuery = new BasicConfigQuery(); |
| 810 | 802 | basicConfigQuery.setYn(YnEnums.YES.getId()); |
| 811 | 803 | basicConfigQuery.setParentId(SystemConfig.HIGH_RISK_ID); |
| ... | ... | @@ -823,7 +815,7 @@ |
| 823 | 815 | } |
| 824 | 816 | final List<String> organizations = currentUserHospPermissions.subList(i, end); |
| 825 | 817 | Callable callable = new AreaHighRiskCountExportTask(basicConfigService,usersService,patientsService,organizationService, |
| 826 | - riskLevelConfig,organizations,countRequest.getExportType()); | |
| 818 | + riskLevelConfig,organizations,countRequest.getExportType(),this,countRequest); | |
| 827 | 819 | Future f = commonThreadPool.submit(callable); |
| 828 | 820 | futures.add(f); |
| 829 | 821 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/AreaHighRiskCountExportTask.java
View file @
d89cf67
| ... | ... | @@ -7,6 +7,8 @@ |
| 7 | 7 | import com.lyms.platform.common.utils.DateUtil; |
| 8 | 8 | import com.lyms.platform.common.utils.ExceptionUtils; |
| 9 | 9 | import com.lyms.platform.common.utils.StringUtils; |
| 10 | +import com.lyms.platform.operate.web.facade.RiskReportFacade; | |
| 11 | +import com.lyms.platform.operate.web.request.RiskPatientsCountRequest; | |
| 10 | 12 | import com.lyms.platform.operate.web.result.RiskReportResult; |
| 11 | 13 | import com.lyms.platform.permission.model.Organization; |
| 12 | 14 | import com.lyms.platform.permission.model.OrganizationQuery; |
| ... | ... | @@ -37,6 +39,8 @@ |
| 37 | 39 | private List<String> organizations; |
| 38 | 40 | |
| 39 | 41 | private List<BasicConfig> riskLevelConfig; |
| 42 | + private RiskReportFacade riskReportFacade; | |
| 43 | + private RiskPatientsCountRequest countRequest; | |
| 40 | 44 | |
| 41 | 45 | public AreaHighRiskCountExportTask(BasicConfigService basicConfigService, |
| 42 | 46 | UsersService usersService, |
| ... | ... | @@ -44,7 +48,9 @@ |
| 44 | 48 | OrganizationService organizationService, |
| 45 | 49 | List<BasicConfig> riskLevelConfig, |
| 46 | 50 | List<String> organizations, |
| 47 | - Integer exportType) | |
| 51 | + Integer exportType, | |
| 52 | + RiskReportFacade riskReportFacade, | |
| 53 | + RiskPatientsCountRequest countRequest) | |
| 48 | 54 | { |
| 49 | 55 | this.basicConfigService = basicConfigService; |
| 50 | 56 | this.organizationService = organizationService; |
| ... | ... | @@ -53,6 +59,8 @@ |
| 53 | 59 | this.organizations = organizations; |
| 54 | 60 | this.riskLevelConfig = riskLevelConfig; |
| 55 | 61 | this.exportType = exportType; |
| 62 | + this.riskReportFacade = riskReportFacade; | |
| 63 | + this.countRequest = countRequest; | |
| 56 | 64 | } |
| 57 | 65 | @Override |
| 58 | 66 | public List<Map<String, Object>> call() throws Exception { |
| 59 | 67 | |
| ... | ... | @@ -93,17 +101,9 @@ |
| 93 | 101 | data.put("hospitalName", organization.getName()); |
| 94 | 102 | |
| 95 | 103 | int riskPatientCount = 0; |
| 96 | - | |
| 97 | - PatientsQuery query1 = new PatientsQuery(); | |
| 104 | + PatientsQuery query1 = riskReportFacade.getRequestQuery(countRequest); | |
| 98 | 105 | query1.setHospitalId(String.valueOf(organization.getId())); |
| 99 | - query1.setYn(YnEnums.YES.getId()); | |
| 100 | - query1.setType(1); | |
| 101 | - //高危等级 | |
| 102 | - query1.setrLevel(config.getId()); | |
| 103 | - List buildType = new ArrayList(); | |
| 104 | - buildType.add(0); | |
| 105 | - buildType.add(2); | |
| 106 | - query1.setBuildTypeList(buildType); | |
| 106 | + | |
| 107 | 107 | |
| 108 | 108 | if (exportType == 3) |
| 109 | 109 | { |