diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitItemsEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitItemsEOServiceImpl.java index 406fbc50d..baf54bd45 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitItemsEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitItemsEOServiceImpl.java @@ -3145,7 +3145,8 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl valContent){ + FileSplitValExportDto fileSplitValExportDto = valContent.get(valContent.size() - 1); // 始终判断最后一个内容是否超出长度 + int lastIndex = valContent.size() - 1; + if ("TEXT".equals(fileSplitValExportDto.getValType())) { + String dtoValContent = fileSplitValExportDto.getValContent(); + //判断是否超长 + if(dtoValContent.length() > 30000){ // 若超出长度 + // 先移除再添加 + valContent.remove(lastIndex); + + //拆分数据 + List content = new ArrayList<>(); // 存放拆出来的内容 + int lastLength = 0; + while (lastLength < dtoValContent.length()) { + if (lastLength == 0) { + String contentOld = dtoValContent.substring(0, 30000); + String contentNew = contentOld.substring(0,contentOld.lastIndexOf("\n")+1); + content.add(contentNew); + lastLength = 30000; + } else if (lastLength > dtoValContent.length() - 30000) { + String contentOld = dtoValContent.substring(lastLength, dtoValContent.length()); + String contentNew = contentOld.substring(0,contentOld.lastIndexOf("\n")+1); + content.add(contentNew); + lastLength = dtoValContent.length(); + } else{ + String contentOld = dtoValContent.substring(lastLength, lastLength + 30000); + String contentNew = contentOld.substring(0,contentOld.lastIndexOf("\n")+1); + content.add(contentNew); + lastLength = lastLength + 30000; + } + } + + // 添加 + for (String c : content) { + FileSplitValExportDto dto = new FileSplitValExportDto(); + dto.setValType(fileSplitValExportDto.getValType()); + dto.setValContent(c); + valContent.add(dto); + } + + } + } + } + public void downLoadImgList(List allImgList, String fileNowPath) throws IOException { for(FileSplitValImgExportDto imgExportDto : allImgList){ @@ -3428,7 +3489,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl