diff --git a/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar b/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar index 30a6a1e5..5c606c3e 100644 Binary files a/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar and b/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar differ 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 815d6121..43b5d8f0 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 @@ -214,7 +214,7 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute ProcessInstance instanceById = processExecutionContext.getProcessInstance(); if (bo_act_coe_publish1 != null && instanceById != null) { System.err.println(instanceById.getTitle() + "推送OA待阅执行开始====>"); - long startTime = System.currentTimeMillis(); + long sendUserstartTime = System.currentTimeMillis(); ArrayList sendList = new ArrayList(); // 发送全集团 if ("1".equals(bo_act_coe_publish1.getString("SEND_SCOP"))) { @@ -263,7 +263,7 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute long countTime = System.currentTimeMillis(); System.err.println(instanceById.getTitle() + "待发送人员数量====>" + sendList.size() + " 计算用时===>" - + (countTime - startTime) + "毫秒"); + + (countTime - sendUserstartTime) + "毫秒"); /* * for (String user : sendList) { try { SendOARead(jsonObject, instanceById, * user, "批量推送"); } catch (Exception e) { // TODO: handle exception } } @@ -294,7 +294,10 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute SDK.getBOAPI().createDataBO("BO_EU__OA_MONITOR",bo,UserContext.fromUID(ta.getTarget())); } System.out.println("new_uid>>>>>>>>>>>>>>"+users.length); - int length = 100; + + long startTime = System.currentTimeMillis(); + + int length = 200; int ys = users.length%length; /** * 这个是以300人作为一个发送单位去放到list中并发送待阅数据 @@ -307,9 +310,9 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute for (int i=0;i list = new LinkedList(); for (int i=0;i idList,String type) + public void secondSendOARead(ProcessInstance processInstance, List idList,String type) throws DocumentException { @@ -1196,11 +1198,57 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute return; } + // System.err.println(processInstance.getTitle() + "开始发送:" + userId); + + /* + * if ("".equals(userId) || UtilString.isEmpty(userId)) { return; } + */ + + + BO bo_act_coe_publish1 = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH", true) + .addQuery("BINDID=", processInstance.getId()) + .addQuery("OPTIONTYPE IS NOT NULL", null).detail(); + + String sql = "SELECT ID FROM WFH_TASK WHERE PROCESSINSTID = '" + processInstance.getId() + + "' AND ACTIVITYDEFID = 'obj_c9e5a3144b200001b68cffa01ed0153e' "; + String taskInd = DBSql.getString(sql); + + TaskInstance ta = SDK.getTaskAPI().getInstanceById(taskInd); + String portalUrl = SDK.getPortalAPI().getPortalUrl(); + + String url = portalUrl + "/r/or?cmd=com.yili_process_page&oauthName=oauthLogin&processInstId=" + + processInstance.getId() + "&taskInstId=" + + taskInd; + String mobileurl = "https://bpm.yili.com:8088/portal" + + "/r/or?cmd=com.yili_process_page_phone&corpid=wwb0ae23173b140618&appAgentId=1000014&oauthName=wechat&processInstId=" + + processInstance.getId() + "&taskInstId=" + + taskInd; + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + //Timestamp endTime = processExecutionContext.getTaskInstance().getBeginTime(); + Timestamp endTime = new Timestamp(System.currentTimeMillis()); + + JSONObject jsonObjects = new JSONObject(new LinkedHashMap()); + jsonObjects.put("action", "read"); + jsonObjects.put("title", " " + "" + bo_act_coe_publish1.getString("PROCESS_TITLE") + ""); + jsonObjects.put("dept", SDK.getORGAPI() + .getDepartmentByUser(ta.getTarget()).getNo());// SDK.getORGAPI().getDepartmentByUser(processExecutionContext.getProcessInstance().getCreateUser()).getNo() + String target = ta.getTarget(); + + jsonObjects.put("user", target); + // jsonObject.put("user",);//processExecutionContext.getProcessInstance().getCreateUser() + jsonObjects.put("date", sdf.format(endTime)); + jsonObjects.put("remark", bo_act_coe_publish1.getString("PROCESS_TITLE")); + jsonObjects.put("status", "0"); + jsonObjects.put("dataid", processInstance.getId()); + jsonObjects.put("pcurl", url); + jsonObjects.put("mobileurl", mobileurl); + String userIds = StringUtils.join(idList, ","); - jsonObject.put("userList", userIds); + jsonObjects.put("userList", userIds); String xmlStr = "\n" + " " + " " + " " + " " - + "" + " " + " " + + "" + " " + " " + " " + ""; // System.out.println("xmlStr>>>>>>>>" + xmlStr); String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl"); @@ -1255,8 +1303,8 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute BO oa_real_time=SDK.getBOAPI().query("BO_ACT_OA_REAL_TIME").addQuery("PROCESSID=",processInstance.getId()).detail(); - String sqly = "SELECT COUNT(1) FROM BO_ACT_DATAID WHERE PROCESSID =? AND SENDTYPE = '1'"; - int mapsy = DBSql.getInt(sqly,processInstId); + String sqly = "SELECT COUNT(1) FROM BO_ACT_DATAID WHERE PROCESSID=? AND SENDTYPE='1'"; + int mapsy = DBSql.getInt(sqly, new Object[]{processInstance.getId()}); if(oa_real_time!=null){ int r1 = DBSql.update("UPDATE BO_ACT_OA_REAL_TIME SET SENDNUMSJ='" +mapsy + "'WHERE PROCESSID ='" + processInstance.getId() + "'");