定时任务推送OA待阅问题
This commit is contained in:
parent
eaa283abe8
commit
e8f787d8cd
@ -61,7 +61,7 @@ public class CopyJob implements IJob {
|
||||
+ pc.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="
|
||||
+ "/r/or?cmd=com.yili_process_page_phone&corpid=wwb0ae23173b140618&appAgentId=0014&oauthName=wechat&processInstId="
|
||||
+ pc.getId() + "&taskInstId="
|
||||
+ taskInd;
|
||||
|
||||
@ -147,7 +147,7 @@ public class CopyJob implements IJob {
|
||||
String[] users = new_uid.split(",");
|
||||
System.out.println("new_uid>>>>>>>>>>>>>>"+users.length);
|
||||
System.out.println("new_uids>>>>>>>>>>>>>>"+users);
|
||||
int length = 100;
|
||||
int length = 20;
|
||||
int ys = users.length%length;
|
||||
/**
|
||||
* 这个是以300人作为一个发送单位去放到list中并发送待阅数据
|
||||
@ -160,9 +160,9 @@ public class CopyJob implements IJob {
|
||||
|
||||
for (int i=0;i<size;i++){
|
||||
String[] results;
|
||||
results = Arrays.copyOfRange(users, flag, flag+100);
|
||||
results = Arrays.copyOfRange(users, flag, flag+20);
|
||||
lists.add(results);
|
||||
flag = flag+100;
|
||||
flag = flag+20;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -177,9 +177,9 @@ public class CopyJob implements IJob {
|
||||
|
||||
for (int i=0;i<size;i++){
|
||||
String[] results;
|
||||
results = Arrays.copyOfRange(users, flag, flag+100);
|
||||
results = Arrays.copyOfRange(users, flag, flag+20);
|
||||
lists.add(results);
|
||||
flag = flag+100;
|
||||
flag = flag+20;
|
||||
}
|
||||
String[] redata;
|
||||
redata = Arrays.copyOfRange(users, flag, flag+ys);
|
||||
@ -288,7 +288,7 @@ public class CopyJob implements IJob {
|
||||
|
||||
long endTimes = System.currentTimeMillis();
|
||||
// 存入日志
|
||||
createReadLog(processInstance, jsonObject, sendList, startTime, endTimes);
|
||||
//createReadLog(processInstance, jsonObject, sendList, startTime, endTimes);
|
||||
System.err.println(processInstance.getTitle() + "推送OA待阅执行完毕====>" + "用时:"
|
||||
+ (endTimes - startTime) / 1000 / 60 + "分钟");
|
||||
|
||||
@ -344,7 +344,8 @@ public class CopyJob implements IJob {
|
||||
+ " </soapenv:Body>" + "</soapenv:Envelope>";
|
||||
// System.out.println("xmlStr>>>>>>>>" + xmlStr);
|
||||
String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl");
|
||||
String postSoap = UtilUrl.doPostSoap(readurl, xmlStr, "");
|
||||
UtilUrl uc = new UtilUrl();
|
||||
String postSoap = uc.doPostSoap(readurl, xmlStr, "");
|
||||
Document document = DocumentHelper.parseText(postSoap);
|
||||
Element rootElement = document.getRootElement();
|
||||
Element result = rootElement.element("Body").element("serviceResponse").element("out");
|
||||
@ -455,7 +456,8 @@ public class CopyJob implements IJob {
|
||||
// System.out.println("xmlStr>>>>>>>>" + xmlStr);
|
||||
String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl");
|
||||
SDK.getLogAPI().consoleInfo(xmlStr);
|
||||
String postSoap = UtilUrl.doPostSoap(readurl, xmlStr, "");
|
||||
UtilUrl uc = new UtilUrl();
|
||||
String postSoap = uc.doPostSoap(readurl, xmlStr, "");
|
||||
Document document = DocumentHelper.parseText(postSoap);
|
||||
Element rootElement = document.getRootElement();
|
||||
Element result = rootElement.element("Body").element("serviceResponse").element("out");
|
||||
|
||||
@ -40,7 +40,8 @@ public class DaibanJob implements IJob {
|
||||
"</soapenv:Envelope>";
|
||||
|
||||
System.out.println("xmlstr================" + xmlStr);
|
||||
String postSoap = UtilUrl.doPostSoap(url, xmlStr, "");
|
||||
UtilUrl uc = new UtilUrl();
|
||||
String postSoap = uc.doPostSoap(url, xmlStr, "");
|
||||
return postSoap;
|
||||
}
|
||||
}
|
||||
@ -151,7 +151,7 @@ public class InsertOAJob implements IJob {
|
||||
String[] users = new_uid.split(",");
|
||||
System.out.println("new_uid>>>>>>>>>>>>>>"+users.length);
|
||||
System.out.println("new_uids>>>>>>>>>>>>>>"+users);
|
||||
int length = 100;
|
||||
int length = 20;
|
||||
int ys = users.length%length;
|
||||
/**
|
||||
* 这个是以300人作为一个发送单位去放到list中并发送待阅数据
|
||||
@ -164,9 +164,9 @@ public class InsertOAJob implements IJob {
|
||||
|
||||
for (int i=0;i<size;i++){
|
||||
String[] results;
|
||||
results = Arrays.copyOfRange(users, flag, flag+100);
|
||||
results = Arrays.copyOfRange(users, flag, flag+20);
|
||||
lists.add(results);
|
||||
flag = flag+100;
|
||||
flag = flag+20;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -181,9 +181,9 @@ public class InsertOAJob implements IJob {
|
||||
|
||||
for (int i=0;i<size;i++){
|
||||
String[] results;
|
||||
results = Arrays.copyOfRange(users, flag, flag+100);
|
||||
results = Arrays.copyOfRange(users, flag, flag+20);
|
||||
lists.add(results);
|
||||
flag = flag+100;
|
||||
flag = flag+20;
|
||||
}
|
||||
String[] redata;
|
||||
redata = Arrays.copyOfRange(users, flag, flag+ys);
|
||||
@ -382,7 +382,8 @@ public class InsertOAJob implements IJob {
|
||||
+ " </soapenv:Body>" + "</soapenv:Envelope>";
|
||||
// System.out.println("xmlStr>>>>>>>>" + xmlStr);
|
||||
String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl");
|
||||
String postSoap = UtilUrl.doPostSoap(readurl, xmlStr, "");
|
||||
UtilUrl uc = new UtilUrl();
|
||||
String postSoap = uc.doPostSoap(readurl, xmlStr, "");
|
||||
Document document = DocumentHelper.parseText(postSoap);
|
||||
Element rootElement = document.getRootElement();
|
||||
Element result = rootElement.element("Body").element("serviceResponse").element("out");
|
||||
@ -493,7 +494,8 @@ public class InsertOAJob implements IJob {
|
||||
// System.out.println("xmlStr>>>>>>>>" + xmlStr);
|
||||
String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl");
|
||||
SDK.getLogAPI().consoleInfo(xmlStr);
|
||||
String postSoap = UtilUrl.doPostSoap(readurl, xmlStr, "");
|
||||
UtilUrl uc = new UtilUrl();
|
||||
String postSoap = uc.doPostSoap(readurl, xmlStr, "");
|
||||
Document document = DocumentHelper.parseText(postSoap);
|
||||
Element rootElement = document.getRootElement();
|
||||
Element result = rootElement.element("Body").element("serviceResponse").element("out");
|
||||
|
||||
@ -166,7 +166,8 @@ public class SendOAread implements IJob {
|
||||
// System.out.println("xmlStr>>>>>>>>" + xmlStr);
|
||||
String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl");
|
||||
try {
|
||||
String postSoap = UtilUrl.doPostSoap(readurl, xmlStr, "");
|
||||
UtilUrl uc = new UtilUrl();
|
||||
String postSoap = uc.doPostSoap(readurl, xmlStr, "");
|
||||
Document document = DocumentHelper.parseText(postSoap);
|
||||
Element rootElement = document.getRootElement();
|
||||
// System.out.println("rootElement>>>>>>" + rootElement);
|
||||
|
||||
@ -20,7 +20,7 @@ import java.nio.charset.Charset;
|
||||
public class UtilUrl {
|
||||
|
||||
//使用SOAP1.1发送消息
|
||||
public static String doPostSoap(String postUrl, String soapXml, String soapAction) {
|
||||
public String doPostSoap(String postUrl, String soapXml, String soapAction) {
|
||||
String retStr = "";
|
||||
// 创建HttpClientBuilder
|
||||
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
|
||||
|
||||
@ -194,7 +194,8 @@ public class ijob implements IJob {
|
||||
// System.out.println("xmlStr>>>>>>>>" + xmlStr);
|
||||
String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl");
|
||||
try {
|
||||
String postSoap = UtilUrl.doPostSoap(readurl, xmlStr, "");
|
||||
UtilUrl uc = new UtilUrl();
|
||||
String postSoap = uc.doPostSoap(readurl, xmlStr, "");
|
||||
Document document = DocumentHelper.parseText(postSoap);
|
||||
Element rootElement = document.getRootElement();
|
||||
// System.out.println("rootElement>>>>>>" + rootElement);
|
||||
|
||||
@ -633,7 +633,7 @@ public class DataViewService extends ActionWeb {
|
||||
|
||||
List<RowMap> nodeRowMaps = DBSql.getMaps(
|
||||
"SELECT NODEID,NODENAME,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME FROM BO_EU_PAL_FILENODE6 WHERE POST LIKE '%"
|
||||
+ POSITION_NAME + "%' ");
|
||||
+ POSITION_NAME + "%' AND POST NOT LIKE '%"+uc.getDepartmentModel().getName()+"%' ");
|
||||
for (RowMap nodeRowMap : nodeRowMaps) {
|
||||
String PLID = nodeRowMap.getString("PLID");
|
||||
RowMap fileRowMap = DBSql.getMap(
|
||||
@ -1075,10 +1075,91 @@ public class DataViewService extends ActionWeb {
|
||||
}
|
||||
List<RowMap> nodeRowMaps = DBSql.getMaps(
|
||||
"SELECT NODEID,NODENAME,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME FROM BO_EU_PAL_FILENODE6 WHERE " +
|
||||
" POST LIKE '%内蒙古伊利实业集团股份有限公司%' OR POST in("+depaertName+") OR ROLE LIKE '%内蒙古伊利实业集团股份有限公司%' OR ROLE in("+depaertName+")");
|
||||
" POST LIKE '%内蒙古伊利实业集团股份有限公司%' OR POST IS NOT NULL OR ROLE LIKE '%内蒙古伊利实业集团股份有限公司%' OR ROLE IS NOT NULL");
|
||||
List<RowMap> DepartnodeRowMaps = DBSql.getMaps(
|
||||
"SELECT NODEID,NODENAME,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME FROM BO_EU_PAL_FILENODE6 WHERE " +
|
||||
" POST LIKE '%内蒙古伊利实业集团股份有限公司%' OR POST IN("+depaertName+") OR ROLE LIKE '%内蒙古伊利实业集团股份有限公司%' OR ROLE in("+depaertName+")");
|
||||
" POST LIKE '%内蒙古伊利实业集团股份有限公司%' OR POST IS NOT NULL OR ROLE LIKE '%内蒙古伊利实业集团股份有限公司%' OR ROLE IS NOT NULL");
|
||||
List<RowMap> new_nodeRowMaps = new LinkedList<>();
|
||||
List<RowMap> new_DepartnodeRowMaps = new LinkedList<>();
|
||||
for (RowMap rowMap:
|
||||
nodeRowMaps) {
|
||||
String post = rowMap.getString("POST");
|
||||
String role = rowMap.getString("ROLE");
|
||||
if (role.contains(",")){
|
||||
String[] split = role.split(",");
|
||||
for (String rolw:
|
||||
split) {
|
||||
if (depaertName.contains(rolw)){
|
||||
new_nodeRowMaps.add(rowMap);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else {
|
||||
if (depaertName.contains(role)){
|
||||
new_nodeRowMaps.add(rowMap);
|
||||
}
|
||||
}
|
||||
|
||||
if (post.contains(",")){
|
||||
String[] split = post.split(",");
|
||||
for (String rolw:
|
||||
split) {
|
||||
if (depaertName.contains(rolw)){
|
||||
new_nodeRowMaps.add(rowMap);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else {
|
||||
if (depaertName.contains(post)){
|
||||
new_nodeRowMaps.add(rowMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (RowMap rowMap:
|
||||
DepartnodeRowMaps) {
|
||||
String post = rowMap.getString("POST");
|
||||
String role = rowMap.getString("ROLE");
|
||||
if (role.contains(",")){
|
||||
String[] split = role.split(",");
|
||||
for (String rolw:
|
||||
split) {
|
||||
if (depaertName.contains(rolw)){
|
||||
new_DepartnodeRowMaps.add(rowMap);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else {
|
||||
if (depaertName.contains(role)){
|
||||
new_DepartnodeRowMaps.add(rowMap);
|
||||
}
|
||||
}
|
||||
|
||||
if (post.contains(",")){
|
||||
String[] split = post.split(",");
|
||||
for (String rolw:
|
||||
split) {
|
||||
if (depaertName.contains(rolw)){
|
||||
new_DepartnodeRowMaps.add(rowMap);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else {
|
||||
if (depaertName.contains(post)){
|
||||
new_DepartnodeRowMaps.add(rowMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
nodeRowMaps = new LinkedList<>();
|
||||
for (RowMap rowMap:
|
||||
new_nodeRowMaps) {
|
||||
nodeRowMaps.add(rowMap);
|
||||
}
|
||||
DepartnodeRowMaps = new LinkedList<>();
|
||||
for (RowMap rowMap:
|
||||
new_DepartnodeRowMaps) {
|
||||
DepartnodeRowMaps.add(rowMap);
|
||||
}
|
||||
System.out.println("=========nodeRowMaps========>"+nodeRowMaps);
|
||||
System.out.println("=========DepartnodeRowMaps========>"+DepartnodeRowMaps);
|
||||
for (RowMap nodeRowMap : nodeRowMaps) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user