public UshopActivity getOneWithRealContent(UshopActivity ua) throws HtjxException {
try {
if (ua.getId() != null) {
ua=ushopActivityMapper.selectByPrimaryKey(ua.getId());
if(ua!=null && StrUtils.isNotEmpty(ua.getContent())){//ua.getContent()取得html路径url
String aa=ProductConfig.fileServer+ua.getContent().trim();
Document doc = Jsoup.connect(aa).get();
Element element = doc.body();
String s = Jsoup.clean(element.html(), ProductConfig.fileServer, Whitelist.relaxed().addAttributes("a", "style").addAttributes("span","style"), new OutputSettings().prettyPrint(false));
ua.setContent(s);
return ua;
}
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
try {
if (ua.getId() != null) {
ua=ushopActivityMapper.selectByPrimaryKey(ua.getId());
if(ua!=null && StrUtils.isNotEmpty(ua.getContent())){//ua.getContent()取得html路径url
String aa=ProductConfig.fileServer+ua.getContent().trim();
Document doc = Jsoup.connect(aa).get();
Element element = doc.body();
String s = Jsoup.clean(element.html(), ProductConfig.fileServer, Whitelist.relaxed().addAttributes("a", "style").addAttributes("span","style"), new OutputSettings().prettyPrint(false));
ua.setContent(s);
return ua;
}
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}