OA待阅推送
This commit is contained in:
parent
e8f787d8cd
commit
7943b46859
Binary file not shown.
@ -1,18 +1,10 @@
|
||||
package com.actionsoft.apps.coe.pal.publisher.pubEvent;
|
||||
|
||||
import java.io.StringReader;
|
||||
import java.sql.Connection;
|
||||
import java.sql.Timestamp;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
@ -57,6 +49,8 @@ import com.actionsoft.sdk.local.api.AppAPI;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.dom4j.io.SAXReader;
|
||||
import org.xml.sax.InputSource;
|
||||
|
||||
/**
|
||||
* 流程结束后发送待阅数据
|
||||
@ -992,7 +986,7 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute
|
||||
String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl");
|
||||
UtilUrl uc=new UtilUrl();
|
||||
String postSoap =uc.doPostSoap(readurl, xmlStr, "");
|
||||
Document document = DocumentHelper.parseText(postSoap);
|
||||
Document document = uc.parseText(postSoap);
|
||||
Element rootElement = document.getRootElement();
|
||||
Element result = rootElement.element("Body").element("serviceResponse").element("out");
|
||||
String resultString = result.getData().toString();
|
||||
@ -1152,7 +1146,7 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute
|
||||
String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl");
|
||||
UtilUrl uc=new UtilUrl();
|
||||
String postSoap = uc.doPostSoap(readurl, xmlStr, "");
|
||||
Document document = DocumentHelper.parseText(postSoap);
|
||||
Document document = uc.parseText(postSoap);
|
||||
Element rootElement = document.getRootElement();
|
||||
Element result = rootElement.element("Body").element("serviceResponse").element("out");
|
||||
String resultString = result.getData().toString();
|
||||
@ -1217,7 +1211,6 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发送EHSQ数据
|
||||
*
|
||||
|
||||
@ -8,7 +8,14 @@ import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentException;
|
||||
import org.dom4j.io.SAXReader;
|
||||
import org.xml.sax.InputSource;
|
||||
|
||||
import java.io.StringReader;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
/**
|
||||
* @PackageName: com.awspaas.user.apps.yili.integration.util
|
||||
@ -48,4 +55,42 @@ public class UtilUrl {
|
||||
}
|
||||
return retStr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Document parseText(String text) throws DocumentException {
|
||||
Document result = null;
|
||||
SAXReader reader = new SAXReader();
|
||||
String encoding = getEncoding(text);
|
||||
InputSource source = new InputSource(new StringReader(text));
|
||||
source.setEncoding(encoding);
|
||||
result = reader.read(source);
|
||||
if (result.getXMLEncoding() == null) {
|
||||
result.setXMLEncoding(encoding);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private String getEncoding(String text) {
|
||||
String result = null;
|
||||
String xml = text.trim();
|
||||
if (xml.startsWith("<?xml")) {
|
||||
int end = xml.indexOf("?>");
|
||||
String sub = xml.substring(0, end);
|
||||
StringTokenizer tokens = new StringTokenizer(sub, " =\"'");
|
||||
|
||||
while(tokens.hasMoreTokens()) {
|
||||
String token = tokens.nextToken();
|
||||
if ("encoding".equals(token)) {
|
||||
if (tokens.hasMoreTokens()) {
|
||||
result = tokens.nextToken();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user