From f26b704b81480a4c894eadb6a39a679b8a6a3f12 Mon Sep 17 00:00:00 2001 From: liquanyu Date: Fri, 10 Nov 2017 10:32:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platform/operate/web/facade/PatientFacade.java | 35 +++++++++++++++------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java index edf3c4b..cb9f2b2 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java @@ -679,11 +679,18 @@ public class PatientFacade { } listFuture.add(commonThreadPool.submit(new QuanChanPatientWorker(patientses.subList(i, end), hospital, usersService, postReviewService, matDeliverService, patientsService, organizationService, basicConfigService))); } - for (Future f : listFuture) { - try { - data.addAll((List) f.get(30, TimeUnit.SECONDS)); - } catch (Exception e) { - ExceptionUtils.catchException(e, "convertToQuanCPatient get result Future error."); + if (CollectionUtils.isNotEmpty(listFuture)) + { + for (Future f : listFuture) { + try { + if (f != null) + { + data.addAll((List) f.get(30, TimeUnit.SECONDS)); + } + + } catch (Exception e) { + ExceptionUtils.catchException(e, "convertToQuanPatient get result Future error."); + } } } return data; @@ -702,13 +709,21 @@ public class PatientFacade { } listFuture.add(commonThreadPool.submit(new QuanPatientWorker(patientses.subList(i, end), usersService, hospital, antExService, basicConfigService, patientsService, organizationService))); } - for (Future f : listFuture) { - try { - data.addAll((List) f.get(30, TimeUnit.SECONDS)); - } catch (Exception e) { - ExceptionUtils.catchException(e, "convertToQuanPatient get result Future error."); + if (CollectionUtils.isNotEmpty(listFuture)) + { + for (Future f : listFuture) { + try { + if (f != null) + { + data.addAll((List) f.get(30, TimeUnit.SECONDS)); + } + + } catch (Exception e) { + ExceptionUtils.catchException(e, "convertToQuanPatient get result Future error."); + } } } + return data; } -- 1.8.3.1