这个是需要补发人员,导入数据后对未补发的人员进行补发
This commit is contained in:
parent
6e77404b96
commit
905c99aff0
@ -124,28 +124,29 @@ public class CopyJob implements IJob {
|
||||
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
|
||||
/* for (String user_id:sendList){
|
||||
for (String user_id:sendList){
|
||||
|
||||
BO bo_eu_require_data = SDK.getBOAPI().query("BO_ACT_DATAID", true).addQuery("PROCESSID = ", cc).addQuery("USER_ID=",user_id).detail();
|
||||
BO bo_eu_require_data = SDK.getBOAPI().query("BO_EU_REQUIRE_DATA", true).addQuery("PROCESS_ID = ", cc).addQuery("USER_ID=",user_id).detail();
|
||||
if (bo_eu_require_data!=null){
|
||||
|
||||
}else {
|
||||
BO bo_eu_Read = SDK.getBOAPI().query("BO_ACT_ALREADY_DATAID", true).addQuery("PROCESSID = ", cc).addQuery("USER_ID=",user_id).detail();
|
||||
/* BO bo_eu_Read = SDK.getBOAPI().query("BO_ACT_ALREADY_DATAID", true).addQuery("PROCESSID = ", cc).addQuery("USER_ID=",user_id).detail();
|
||||
if (bo_eu_Read!=null){
|
||||
|
||||
}else {
|
||||
list.add(user_id);
|
||||
}
|
||||
}*/
|
||||
list.add(user_id);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
// list.add("10036614");
|
||||
// list.add("10056870");
|
||||
|
||||
|
||||
new_uid = new_uid.join(",", sendList);
|
||||
new_uid = new_uid.join(",",list);
|
||||
long startTimes = System.currentTimeMillis();
|
||||
String[] users = new_uid.split(",");
|
||||
System.out.println("new_uid>>>>>>>>>>>>>>"+users.length);
|
||||
System.out.println("new_uids>>>>>>>>>>>>>>"+users);
|
||||
int length = 100;
|
||||
int ys = users.length%length;
|
||||
/**
|
||||
@ -218,15 +219,15 @@ public class CopyJob implements IJob {
|
||||
CountDownLatch countDownLatch = new CountDownLatch(list.size());
|
||||
ExecutorService service = Executors.newFixedThreadPool(5);
|
||||
int m = 0;
|
||||
for (String[] resrt:list
|
||||
) {
|
||||
for (int i=0;i<list.size();i++) {
|
||||
int finalI = i;
|
||||
service.execute(new Runnable() {
|
||||
@Override
|
||||
|
||||
public void run() {
|
||||
System.out.println("最后一个数组是什么>>>>>>>"+Arrays.asList(resrt).size());
|
||||
System.out.println("最后一个数组是什么>>>>>>>"+Arrays.asList(list.get(finalI)).size());
|
||||
String userIds = "";
|
||||
userIds = StringUtils.join(resrt, ",");
|
||||
userIds = StringUtils.join(list.get(finalI), ",");
|
||||
System.out.println("userIDs>>>>>>>>>>>>>>>"+userIds);
|
||||
/*try {
|
||||
SendOARead(jsonObject, processInstance, userIds,"批量推送");
|
||||
@ -239,9 +240,9 @@ public class CopyJob implements IJob {
|
||||
} catch (DocumentException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//InsertBO(jsonObject, processInstance, userIds,"批量推送");
|
||||
countDownLatch.countDown();
|
||||
}
|
||||
|
||||
});
|
||||
m++;
|
||||
}
|
||||
@ -311,6 +312,14 @@ public class CopyJob implements IJob {
|
||||
}
|
||||
|
||||
|
||||
public void InsertBO(JSONObject jsonObject, ProcessInstance processInstance, String userIds,String type){
|
||||
BO bo = new BO();
|
||||
bo.set("PROCESSID",processInstance.getId());
|
||||
bo.set("USERIDS",userIds);
|
||||
SDK.getBOAPI().create("BO_EU_JSIS_DATA",bo,processInstance.getId(),processInstance.getCreateUser());
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void secondSendOARead(JSONObject jsonObject, ProcessInstance processInstance, List<String> idList,String type)
|
||||
throws DocumentException {
|
||||
@ -409,117 +418,7 @@ public class CopyJob implements IJob {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发送OA待阅数据
|
||||
*
|
||||
* @param jsonObject
|
||||
* @param processInstance
|
||||
* @throws DocumentException
|
||||
*/
|
||||
/* public void SendOARead(JSONObject jsonObject, ProcessInstance processInstance, String userIds, String type)
|
||||
throws DocumentException {
|
||||
|
||||
String processInstId = processInstance.getId();
|
||||
// System.err.println(processInstance.getTitle() + "开始发送:" + userId);
|
||||
|
||||
|
||||
if ("".equals(userIds) || UtilString.isEmpty(userIds)) {
|
||||
return;
|
||||
}
|
||||
|
||||
jsonObject.put("userList", userIds);
|
||||
String xmlStr = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"webservices.yili.weaver.com.cn\">\n"
|
||||
+ " <soapenv:Header/>" + " <soapenv:Body>" + " <web:service>" + " <web:in0>"
|
||||
+ "<![CDATA[" + jsonObject + "]]>" + " </web:in0>" + " </web:service>"
|
||||
+ " </soapenv:Body>" + "</soapenv:Envelope>";
|
||||
// System.out.println("xmlStr>>>>>>>>" + xmlStr);
|
||||
String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl");
|
||||
try {
|
||||
String postSoap = UtilUrl.doPostSoap(readurl, xmlStr, "");
|
||||
Document document = DocumentHelper.parseText(postSoap);
|
||||
Element rootElement = document.getRootElement();
|
||||
// System.out.println("rootElement>>>>>>" + rootElement);
|
||||
Element result = rootElement.element("Body").element("serviceResponse").element("out");
|
||||
String resultString = result.getData().toString();
|
||||
JSONObject jsonObject1 = JSON.parseObject(resultString);
|
||||
String datas = jsonObject1.getString("data");
|
||||
String status = jsonObject1.getString("status");
|
||||
// System.out.println("推送》》》》》》》》》》》" + status);
|
||||
if ("true".equals(status)) {
|
||||
JSONArray resultArray = JSONObject.parseArray(datas);
|
||||
//System.out.println(processInstance.getTitle() + "待阅推送成功:" + idList.size()+"人");
|
||||
|
||||
|
||||
int sucount = 1;
|
||||
for (int j = 0; j < resultArray.size(); j++) {
|
||||
|
||||
JSONObject jsonObject2 = resultArray.getJSONObject(j);
|
||||
String user = jsonObject2.get("user").toString();
|
||||
String dataid = jsonObject2.get("dataid").toString();
|
||||
BO bo = new BO();
|
||||
bo.set("TITLE", processInstance.getTitle());
|
||||
bo.set("PROCESSID", processInstance.getId());
|
||||
bo.set("USER_ID", user);
|
||||
bo.set("USERDEP", SDK.getORGAPI().getUser(user).getDepartmentId());
|
||||
bo.set("DATAID", dataid);
|
||||
bo.set("RESULT", status);
|
||||
bo.set("SENDTYPE", "1");
|
||||
bo.set("READSTATE", "未读");
|
||||
bo.set("TYPE", type);
|
||||
SDK.getBOAPI().create("BO_ACT_DATAID", bo, processInstance.getId(), processInstance.getCreateUser());
|
||||
|
||||
|
||||
*//*BO oa_real_time = SDK.getBOAPI().query("BO_ACT_OA_REAL_TIME").addQuery("PROCESSID=", processInstance.getId()).detail();
|
||||
if (oa_real_time != null) {
|
||||
int r1 = DBSql.update("UPDATE BO_ACT_OA_REAL_TIME SET SENDNUMSJ='" + sucount + "'WHERE PROCESSID ='" + processInstId + "'");
|
||||
} else {
|
||||
//插入实时更新人数表
|
||||
BO realTimeBO = new BO();
|
||||
realTimeBO.set("USREID", user);
|
||||
realTimeBO.set("DEPID", SDK.getORGAPI().getUser(user).getDepartmentId());
|
||||
realTimeBO.set("BUNAME", SDK.getORGAPI().getUser(user).getExt4());
|
||||
realTimeBO.set("TITLE", processInstance.getTitle());
|
||||
realTimeBO.set("PROCESSID", processInstance.getId());
|
||||
realTimeBO.set("SENDNUMSJ", 1);
|
||||
|
||||
SDK.getBOAPI().create("BO_ACT_OA_REAL_TIME", bo, processInstance.getId(), processInstance.getCreateUser());
|
||||
}
|
||||
sucount++;*//*
|
||||
|
||||
}
|
||||
if ("单个账号推送".equals(type)) {
|
||||
DBSql.update("UPDATE BO_EU_READ_COUNT SET RESULT = '已重新推送' WHERE PROCESSID = '" + processInstId + "' AND NAME = '" + userIds + "'");
|
||||
}
|
||||
} else {
|
||||
System.out.println(processInstance.getTitle() + "待阅推送失败:" + userIds);
|
||||
try {
|
||||
BO bo = new BO();
|
||||
bo.set("TITLE", processInstance.getTitle());
|
||||
bo.set("NAME", userIds);
|
||||
bo.set("TYPE", type);
|
||||
bo.set("RESULT", "待处理");
|
||||
bo.set("PROCESSID", processInstId);
|
||||
bo.set("DEPNAME", SDK.getORGAPI().getUser(userIds).getDepartmentId());
|
||||
SDK.getBOAPI().create("BO_EU_READ_COUNT", bo, processInstance.getId(), processInstance.getCreateUser());
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println(processInstance.getTitle() + "待阅推送失败:" + userIds);
|
||||
BO bo = new BO();
|
||||
bo.set("TITLE", processInstance.getTitle());
|
||||
bo.set("NAME", userIds);
|
||||
bo.set("TYPE", type);
|
||||
bo.set("RESULT", "待处理");
|
||||
bo.set("PROCESSID", processInstId);
|
||||
bo.set("DEPNAME", SDK.getORGAPI().getUser(userIds).getDepartmentId());
|
||||
SDK.getBOAPI().create("BO_EU_READ_COUNT", bo, processInstance.getId(), processInstance.getCreateUser());
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user