Commit 77efcfb2dac9f8ce258f8fb29077c7dc1d3aca2c
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 3 changed files
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RiskReportController.java
View file @
77efcfb
... | ... | @@ -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 @
77efcfb
... | ... | @@ -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 | |
... | ... | @@ -725,9 +718,11 @@ |
725 | 718 | |
726 | 719 | Date start = DateUtil.addYear(currentDate, -s); |
727 | 720 | patientsQuery.setBirthEnd(start); |
728 | - | |
721 | + System.out.println(DateUtil.getyyyy_MM_dd(start)); | |
729 | 722 | Date end = DateUtil.addYear(currentDate, -e); |
730 | 723 | patientsQuery.setBirthStart(end); |
724 | + System.out.println(DateUtil.getyyyy_MM_dd(end)); | |
725 | + | |
731 | 726 | } |
732 | 727 | |
733 | 728 | //孕周 0 全部孕周 1:孕12周前 2:13-19 3:20-25 4:26-30 5:31-36 6:37-40 7:40-分娩前 |
734 | 729 | |
... | ... | @@ -803,9 +798,8 @@ |
803 | 798 | { |
804 | 799 | countRequest.setExportType(3); |
805 | 800 | } |
806 | -// currentUserHospPermissions.clear(); | |
807 | -// currentUserHospPermissions.add("216"); | |
808 | 801 | |
802 | + | |
809 | 803 | BasicConfigQuery basicConfigQuery = new BasicConfigQuery(); |
810 | 804 | basicConfigQuery.setYn(YnEnums.YES.getId()); |
811 | 805 | basicConfigQuery.setParentId(SystemConfig.HIGH_RISK_ID); |
... | ... | @@ -823,7 +817,7 @@ |
823 | 817 | } |
824 | 818 | final List<String> organizations = currentUserHospPermissions.subList(i, end); |
825 | 819 | Callable callable = new AreaHighRiskCountExportTask(basicConfigService,usersService,patientsService,organizationService, |
826 | - riskLevelConfig,organizations,countRequest.getExportType()); | |
820 | + riskLevelConfig,organizations,countRequest.getExportType(),this,countRequest); | |
827 | 821 | Future f = commonThreadPool.submit(callable); |
828 | 822 | futures.add(f); |
829 | 823 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/AreaHighRiskCountExportTask.java
View file @
77efcfb
... | ... | @@ -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 | { |