流程发布发送待阅

This commit is contained in:
Mr-wang 2023-07-17 20:15:15 +08:00
parent 63b29b4e0e
commit 88703ecf9f

View File

@ -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> bo_eu_oa_read_test = SDK.getBOAPI().query("BO_EU_OA_READ_TEST").connection(open).list();
ArrayList<String> sendLists = new ArrayList<String>();
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<RowMap> 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++;
}
}