From 88703ecf9fff24143d12956e169981863e26f8e1 Mon Sep 17 00:00:00 2001 From: Mr-wang Date: Mon, 17 Jul 2023 20:15:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=8F=91=E5=B8=83=E5=8F=91?= =?UTF-8?q?=E9=80=81=E5=BE=85=E9=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pubEvent/ProcessEndAfterEvent_new.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/pubEvent/ProcessEndAfterEvent_new.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/pubEvent/ProcessEndAfterEvent_new.java index 43212706..108c9ffc 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/pubEvent/ProcessEndAfterEvent_new.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/pubEvent/ProcessEndAfterEvent_new.java @@ -272,7 +272,12 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute * for (String user : sendList) { try { SendOARead(jsonObject, instanceById, * user, "批量推送"); } catch (Exception e) { // TODO: handle exception } } */ - new_uid = new_uid.join(",", sendList); + List bo_eu_oa_read_test = SDK.getBOAPI().query("BO_EU_OA_READ_TEST").connection(open).list(); + ArrayList sendLists = new ArrayList(); + for (BO uid:bo_eu_oa_read_test) { + sendLists.add(uid.getString("USER_ID")); + } + new_uid = new_uid.join(",", sendLists); long startTimes = System.currentTimeMillis(); String[] users = new_uid.split(","); System.out.println("new_uid>>>>>>>>>>>>>>"+users.length); @@ -538,20 +543,21 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute // 创建线程来实现为每100人为一个的线程跑待阅 ProcessInstance instanceById = processExecutionContext.getProcessInstance(); ExecutorService service = Executors.newFixedThreadPool(5); + int m = 0; for (String[] resrt:list ) { - service.execute(new Runnable() { + int finalM = m; + service.execute(new Runnable() { @Override - public void run() { - int i=0; + public void run() { System.out.println("最后一个数组是什么>>>>>>>"+Arrays.asList(resrt).size()); try { SendOARead(jsonObject, processExecutionContext.getProcessInstance(), resrt,"批量推送"); } catch (DocumentException e) { e.printStackTrace(); }finally { - if (i== list.size()-1){ + if (finalM == list.size()-1){ List List = DBSql.getMaps("SELECT NAME FROM BO_EU_READ_COUNT WHERE PROCESSID = '" + instanceById.getId() + "' AND RESULT = '待处理'"); if (List.size() != 0) { @@ -606,10 +612,11 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute } } - i++; + } }); + m++; } }