fix(asms): 同步问题
This commit is contained in:
+10
-1
File diff suppressed because one or more lines are too long
+9
-1
@@ -399,6 +399,13 @@ public class SynchronizationAsmsService {
|
|||||||
String articleContent = eMap.get("articleContent");
|
String articleContent = eMap.get("articleContent");
|
||||||
// 处理图片
|
// 处理图片
|
||||||
if (articleContent.contains("<img src=")){
|
if (articleContent.contains("<img src=")){
|
||||||
|
log.info("-------" + articleContent);
|
||||||
|
// base64
|
||||||
|
if (articleContent.contains("base64")){
|
||||||
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
|
stringBuilder.append("<p>").append(articleContent).append("</p>");
|
||||||
|
articleContent = stringBuilder.toString();
|
||||||
|
}else {
|
||||||
String urlSuffix = articleContent.substring(articleContent.indexOf("getImg"),
|
String urlSuffix = articleContent.substring(articleContent.indexOf("getImg"),
|
||||||
articleContent.indexOf("\" alt"));
|
articleContent.indexOf("\" alt"));
|
||||||
String imageUrl = asmsPostUtil.getHost() + urlSuffix;
|
String imageUrl = asmsPostUtil.getHost() + urlSuffix;
|
||||||
@@ -411,7 +418,7 @@ public class SynchronizationAsmsService {
|
|||||||
ResponseEntity<byte[]> responseEntity = restTemplate.exchange(imageUrl, HttpMethod.GET, entity, byte[].class);
|
ResponseEntity<byte[]> responseEntity = restTemplate.exchange(imageUrl, HttpMethod.GET, entity, byte[].class);
|
||||||
if (HttpStatus.OK == responseEntity.getStatusCode()) {
|
if (HttpStatus.OK == responseEntity.getStatusCode()) {
|
||||||
byte[] imageBytes = responseEntity.getBody();
|
byte[] imageBytes = responseEntity.getBody();
|
||||||
MultipartFile file = new MockMultipartFile(fileName, fileName,"application/octet-stream" ,imageBytes);
|
MultipartFile file = new MockMultipartFile(fileName, fileName, "application/octet-stream", imageBytes);
|
||||||
// 上传图片
|
// 上传图片
|
||||||
OSSFile oSSFile = ossFileService.uploadLocalForSplit(file, "", "", "");
|
OSSFile oSSFile = ossFileService.uploadLocalForSplit(file, "", "", "");
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
@@ -420,6 +427,7 @@ public class SynchronizationAsmsService {
|
|||||||
articleContent = stringBuilder.toString();
|
articleContent = stringBuilder.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// 处理表格
|
// 处理表格
|
||||||
if (articleContent.contains("<table style=")){
|
if (articleContent.contains("<table style=")){
|
||||||
articleContent = "<p>" + articleContent + "</p>";
|
articleContent = "<p>" + articleContent + "</p>";
|
||||||
|
|||||||
Reference in New Issue
Block a user