拆分流程图片展示以及导出出片超链接格式

This commit is contained in:
gaojiabao
2022-12-28 10:42:03 +08:00
parent 372408ac30
commit 422de0ec29
6 changed files with 144 additions and 12 deletions
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.util.List;
public interface IAttFileEOService extends IService<AttFileEO> {
@@ -30,4 +31,5 @@ public interface IAttFileEOService extends IService<AttFileEO> {
public AttFileVo insertFileInfo(File file,String fileName);
void downLoadFileList(List<AttFileEO> multiFileInfos, String fileNowPath) throws IOException;
}
@@ -20,6 +20,8 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Comparator;
@@ -426,7 +428,30 @@ public class AttFileEOServiceImpl extends ServiceImpl<AttFileEODao, AttFileEO> i
}
return fileObj;
}
public void downLoadFileList(List<AttFileEO> AttFileList,String fileNowPath) throws IOException {
for(AttFileEO fileExportDto : AttFileList){
String oldPath = filePath+ "/" + fileExportDto.getFilePath() + fileExportDto.getFileName();
String newPath = fileNowPath + "/" + fileExportDto.getOldFileName();
File oldFile = new File(oldPath);
if (oldFile.exists()){
copyFile1(oldPath, newPath);
}
}
}
public static void copyFile1(String srcPath, String destPath) throws IOException {
// 打开输入流
FileInputStream fis = new FileInputStream(srcPath);
// 打开输出流
FileOutputStream fos = new FileOutputStream(destPath);
// 读取和写入信息
int len = 0;
while ((len = fis.read()) != -1) {
fos.write(len);
}
// 关闭流 先开后关 后开先关
fos.close(); // 后开先关
fis.close(); // 先开后关
}
/**