文档拆分-bug59041,58779

This commit is contained in:
liyawei
2022-09-01 16:20:34 +08:00
parent 6481275adc
commit 3e75d0a093
2 changed files with 34 additions and 6 deletions
@@ -2586,7 +2586,7 @@ public class FileSpiltService {
String path = splitUrl+"/jero-boot/sys/split/file/getImage?fileUrl="+filepathandname;
CosBootUtil.uploadByte(bytev, filepathandname);
String imgCon = path;
String imgConVal = "<img class=\"wordImg\" src=\"" + path + "\">";
String imgConVal = "<img class=\"wordImg\" style=\"width:100%;height:100%\" src=\"" + path + "\">";
message.getItemsCondi().add(imgConVal);
message.setItermsConditions(message.getItermsConditions() + imgConVal);
itemsValList.add(getSplitItemsValObject(message.getId(), SplitFilePragraTypeEnum.IMG.getValue(), imgCon, message.getItemsCondi().size(), null));
@@ -158,7 +158,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} else if ("IMG".equals(valEO.getType())) {
String imgUrl = valEO.getItemContent();
valEO.setItemContent(imgUrl);
valContent = "<img class=\"wordImg\" src=\""+ valEO.getItemContent() +"\">";
valContent = "<img class=\"wordImg\" style=\"width:100%;height:100%\" src=\""+ valEO.getItemContent() +"\">";
// valContent = valEO.getItemContent();
} else if ("TABLE".equals(valEO.getType())) {
valContent = valEO.getItemContent();
@@ -233,7 +233,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} else if ("IMG".equals(valEO.getType())) {
String imgUrl = valEO.getItemContent();
valEO.setItemContent(imgUrl);
valContent = "<img class=\"wordImg\" src=\"" + valEO.getItemContent() + "\">";
valContent = "<img class=\"wordImg\" style=\"width:100%;height:100%\" src=\"" + valEO.getItemContent() + "\">";
// valContent = valEO.getItemContent();
} else if ("TABLE".equals(valEO.getType())) {
valContent = valEO.getItemContent();
@@ -1693,7 +1693,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
return mFile;
}
private List<Map<String, Object>> read(File file, List<String> dbfieldList, String[] titles, String cut) throws IOException, InvalidFormatException {
private List<Map<String, Object>> read(File file, List<String> dbfieldList, String[] titles, String cut) throws Exception {
//最终返回数据
List<Map<String, Object>> list = new ArrayList<>();
@@ -1744,10 +1744,38 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
}
}
}
Row rowDescription= sheet.getRow(1);
if (rowDescription != null) {
Cell cell = rowDescription.getCell(0);
if(ObjectUtil.isNotNull(cell)){
//设置单元格类型
cell.setCellType(CellType.STRING);
String cellValue = cell.getStringCellValue();
if(!cellValue.contains("填写说明")){
if(CutEnum.CN.getValue().equals(cut)){
throw new JeroBootException("请导入正确模板!");
} else {
throw new JeroBootException("Please import the correct template");
}
}
} else{
if(CutEnum.CN.getValue().equals(cut)){
throw new JeroBootException("请导入正确模板!");
} else {
throw new JeroBootException("Please import the correct template");
}
}
}else{
if(CutEnum.CN.getValue().equals(cut)){
throw new JeroBootException("请导入正确模板!");
} else {
throw new JeroBootException("Please import the correct template");
}
}
Map<String, Object> map = null;
//获得所有数据
//从第x行开始获取
//从第3行开始获取,第一行是表头,第二行是填写说明
for (int x = 2; x <= totalRowNum; x++) {
map = new HashMap<String, Object>();
//获得第i行对象
@@ -2461,7 +2489,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\" style=\"width:100%;height:100%\" src=\""+ valEO.getItemContent() +"\">";
// valContent += valEO.getItemContent();
} else if ("TABLE".equals(valEO.getType())) {
valContent += valEO.getItemContent();