文档拆分条款-图片回显
This commit is contained in:
+11
-6
@@ -2,6 +2,7 @@ package com.jero.modules.split.service.impl;
|
||||
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -147,7 +148,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
String ossFileId = valEO.getItemContent();
|
||||
OSSFile ossFile = ossFileService.getById(ossFileId);
|
||||
String url = ossFile.getUrl();
|
||||
String imgUrl = "uploadPath/" + url.substring(url.lastIndexOf("/")+1); // TODO 本地是反斜杠,服务器上是正斜杠?
|
||||
String imgUrl = imgpath + url.substring(url.lastIndexOf("/")); // TODO 本地是反斜杠,服务器上是正斜杠?
|
||||
valEO.setItemContent(imgUrl);
|
||||
valContent = "<img class=\"wordImg\" src=\""+ valEO.getItemContent() +"\">";
|
||||
// valContent = valEO.getItemContent();
|
||||
@@ -226,7 +227,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
String ossFileId = valEO.getItemContent();
|
||||
OSSFile ossFile = ossFileService.getById(ossFileId);
|
||||
String url = ossFile.getUrl();
|
||||
String imgUrl = "uploadPath/" + url.substring(url.lastIndexOf("/") + 1);
|
||||
String imgUrl = imgpath + url.substring(url.lastIndexOf("/"));
|
||||
valEO.setItemContent(imgUrl);
|
||||
}
|
||||
valContent = "<img class=\"wordImg\" src=\"" + valEO.getItemContent() + "\">";
|
||||
@@ -1145,10 +1146,13 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
int a = 0;
|
||||
for (int y = 0; y < cellLength; y++) {
|
||||
if (!(row == null)) {
|
||||
Cell cell = row.getCell(y);
|
||||
Cell cell = row.getCell(y); // cell 为空时会抛空指针异常
|
||||
if(ObjectUtil.isNull(cell)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//设置单元格类型
|
||||
cell.setCellType(CellType.STRING);
|
||||
|
||||
String cellValue = null;
|
||||
boolean isMerge = isMergedRegion(sheet, row.getRowNum(), cell.getColumnIndex());
|
||||
//判断是否具有合并单元格
|
||||
@@ -1168,6 +1172,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
}
|
||||
}
|
||||
}
|
||||
// 当前行所有单元格均不为空时
|
||||
if (a != cellLength && row != null) {
|
||||
list.add(map);
|
||||
}
|
||||
@@ -1595,7 +1600,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
sarFileSplitItemsEO.put("menu_id", menuId);
|
||||
|
||||
//添加val表数据
|
||||
List<SarFileSplitItemsValEO> getValList = (List<SarFileSplitItemsValEO>) sarFileSplitItemsEO.get("itemValEOList"); // TODO
|
||||
List<SarFileSplitItemsValEO> getValList = (List<SarFileSplitItemsValEO>) sarFileSplitItemsEO.get("itemValEOList");
|
||||
String itemConditions = "";
|
||||
int ind = 1;
|
||||
if (getValList != null && !getValList.isEmpty()) {
|
||||
@@ -1605,7 +1610,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
if ("TEXT".equals(valEO.getType())) {
|
||||
valContent += "<p>" + valEO.getItemContent() + "</p>";
|
||||
} else if ("IMG".equals(valEO.getType())) {
|
||||
// valContent += "<img class=\'wordImg\' src=\'"+ valEO.getItemContent() +"\'>";
|
||||
valContent += "<img class=\"wordImg\" src=\""+ valEO.getItemContent() +"\">";
|
||||
valContent += valEO.getItemContent();
|
||||
} else if ("TABLE".equals(valEO.getType())) {
|
||||
valContent += valEO.getItemContent();
|
||||
|
||||
Reference in New Issue
Block a user