Commit 1d7c20d40682ae88ec659d1c3b89b71b21c81f5f
1 parent
1d9cb73532
Exists in
master
and in
6 other branches
追访
Showing 2 changed files with 23 additions and 51 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PuerperaManageController.java
View file @
1d7c20d
... | ... | @@ -391,12 +391,13 @@ |
391 | 391 | header.put("husbandName", "丈夫姓名"); |
392 | 392 | header.put("address", "居住地"); |
393 | 393 | header.put("addressRegister", "户籍地"); |
394 | - header.put("bookbuildingDate", "建档时间"); | |
394 | + | |
395 | 395 | header.put("bookbuildingDoctor", "建档医生"); |
396 | 396 | |
397 | 397 | String hospitalId = autoMatchFacade.getHospitalId(patientManagerRequest.getOperatorId()); |
398 | 398 | if("1000000117".equals(hospitalId)){ |
399 | 399 | header.put("sendCareMan", "母子保健手册"); |
400 | + header.put("bookbuildingDate", "发放时间"); | |
400 | 401 | } |
401 | 402 | httpServletResponse.setContentType("application/force-download"); |
402 | 403 | httpServletResponse.setHeader("Content-Disposition", "attachment;filename=" + new String(("建档管理.xls").getBytes("UTF-8"), "ISO-8859-1")); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/BabyHiskCountTask.java
View file @
1d7c20d
... | ... | @@ -3,7 +3,6 @@ |
3 | 3 | import com.lyms.platform.biz.service.BabyService; |
4 | 4 | import com.lyms.platform.biz.service.BasicConfigService; |
5 | 5 | import com.lyms.platform.common.enums.YnEnums; |
6 | -import com.lyms.platform.common.utils.ExceptionUtils; | |
7 | 6 | import com.lyms.platform.operate.web.result.RiskReportResult; |
8 | 7 | import com.lyms.platform.pojo.BasicConfig; |
9 | 8 | import com.lyms.platform.query.BabyModelQuery; |
... | ... | @@ -12,7 +11,9 @@ |
12 | 11 | |
13 | 12 | import java.util.ArrayList; |
14 | 13 | import java.util.List; |
15 | -import java.util.concurrent.*; | |
14 | +import java.util.concurrent.Callable; | |
15 | +import java.util.concurrent.ExecutorService; | |
16 | +import java.util.concurrent.Executors; | |
16 | 17 | |
17 | 18 | /** |
18 | 19 | * Created by Administrator on 2016/11/30. |
... | ... | @@ -31,7 +32,7 @@ |
31 | 32 | public BabyHiskCountTask(BasicConfigService basicConfigService, |
32 | 33 | BabyService babyService, BasicConfig levelConfig, |
33 | 34 | BabyModelQuery babyModelQuery, |
34 | - int allPatientCount,int type) { | |
35 | + int allPatientCount, int type) { | |
35 | 36 | this.basicConfigService = basicConfigService; |
36 | 37 | this.babyService = babyService; |
37 | 38 | this.levelConfig = levelConfig; |
38 | 39 | |
39 | 40 | |
40 | 41 | |
41 | 42 | |
42 | 43 | |
... | ... | @@ -42,63 +43,33 @@ |
42 | 43 | |
43 | 44 | @Override |
44 | 45 | public List<RiskReportResult> call() throws Exception { |
45 | - | |
46 | 46 | BasicConfigQuery basicConfigQuery = new BasicConfigQuery(); |
47 | 47 | basicConfigQuery.setYn(YnEnums.YES.getId()); |
48 | 48 | basicConfigQuery.setEnable(1); |
49 | - if(type == 1) { | |
49 | + if (type == 1) { | |
50 | 50 | basicConfigQuery.setParentId(levelConfig.getId()); |
51 | - }else if(type == 2){ | |
51 | + } else if (type == 2) { | |
52 | 52 | basicConfigQuery.setParentId(levelConfig.getParentId()); |
53 | 53 | } |
54 | 54 | List<RiskReportResult> results = new ArrayList<>(); |
55 | 55 | List<BasicConfig> riskConfig = basicConfigService.queryBasicConfig(basicConfigQuery); |
56 | - | |
57 | 56 | if (CollectionUtils.isNotEmpty(riskConfig)) { |
58 | - | |
59 | - int batchSize = 2; | |
60 | - int end = 0; | |
61 | - List<Future> futures = new ArrayList<>(); | |
62 | - for (int i = 0; i < riskConfig.size(); i += batchSize) { | |
63 | - end = (end + batchSize); | |
64 | - if (end > riskConfig.size()) { | |
65 | - end = riskConfig.size(); | |
57 | + for (int i = 0; i < riskConfig.size(); i++) { | |
58 | + BasicConfig config = riskConfig.get(i); | |
59 | + babyModelQuery.setYn(YnEnums.YES.getId()); | |
60 | + if (type == 1) { | |
61 | + babyModelQuery.setHighRiskInfo(config.getId()); | |
62 | + } else if (type == 2) { | |
63 | + babyModelQuery.setWeakSonInfo(config.getId()); | |
66 | 64 | } |
67 | - | |
68 | - final List<BasicConfig> configs = riskConfig.subList(i, end); | |
69 | - Callable c = new Callable() { | |
70 | - @Override | |
71 | - public List<RiskReportResult> call() throws Exception { | |
72 | - List<RiskReportResult> datas = new ArrayList<>(); | |
73 | - | |
74 | - for (BasicConfig config : configs) { | |
75 | - babyModelQuery.setYn(YnEnums.YES.getId()); | |
76 | - if(type == 1){ | |
77 | - babyModelQuery.setHighRiskInfo(config.getId()); | |
78 | - }else if(type == 2){ | |
79 | - babyModelQuery.setWeakSonInfo(config.getId()); | |
80 | - } | |
81 | - int riskPatientCount = babyService.queryBabyCount(babyModelQuery); | |
82 | - // System.out.println("name:"+config.getName()+",riskPatientCount:"+riskPatientCount); | |
83 | - RiskReportResult risk = new RiskReportResult(); | |
84 | - risk.setHighRiskId(config.getId()); | |
85 | - risk.setHighRisk(config.getName()); | |
86 | - risk.setPid(config.getpId()); | |
87 | - risk.setRiskCount(riskPatientCount); | |
88 | - datas.add(risk); | |
89 | - } | |
90 | - return datas; | |
91 | - } | |
92 | - }; | |
93 | - Future f = pool.submit(c); | |
94 | - futures.add(f); | |
95 | - } | |
96 | - for (Future f : futures) { | |
97 | - try { | |
98 | - results.addAll((List) f.get(30, TimeUnit.SECONDS)); | |
99 | - } catch (Exception e) { | |
100 | - ExceptionUtils.catchException(e, "patient hisk count."); | |
101 | - } | |
65 | + int riskPatientCount = babyService.queryBabyCount(babyModelQuery); | |
66 | + System.out.println("name:" + config.getName() + ",riskPatientCount:" + riskPatientCount); | |
67 | + RiskReportResult risk = new RiskReportResult(); | |
68 | + risk.setHighRiskId(config.getId()); | |
69 | + risk.setHighRisk(config.getName()); | |
70 | + risk.setPid(config.getpId()); | |
71 | + risk.setRiskCount(riskPatientCount); | |
72 | + results.add(risk); | |
102 | 73 | } |
103 | 74 | } |
104 | 75 | return results; |