From 7df9803cd672cce9c9c0d06d895911c8f6f87ced Mon Sep 17 00:00:00 2001 From: lijiarao Date: Thu, 1 Aug 2024 17:37:59 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=96=87=E6=A1=A3=E6=8B=86=E5=88=86?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=20=E5=9B=BE=E7=89=87=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/FileSplitItemsEOServiceImpl.java | 45 ++++++++++++------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitItemsEOServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitItemsEOServiceImpl.java index f3faddcb..c6ac96e0 100644 --- a/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitItemsEOServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitItemsEOServiceImpl.java @@ -3960,18 +3960,34 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl allImgList, String fileNowPath) { for(FileSplitValImgExportDto imgExportDto : allImgList){ - String oldPath = uploadCospath + "/" + imgExportDto.getImgPath(); - String newPath = fileNowPath + File.separator + imgExportDto.getImgName(); - if (MinioUtil.doesObjectExist(oldPath)){ - try (InputStream in = MinioUtil.download(oldPath);) { - copyFile1(in, newPath); + String imgName = imgExportDto.getImgName(); + String fileName = imgExportDto.getImgPath(); + String oldPath = getPath(fileName); + String newPath = fileNowPath + File.separator + imgName; + try (InputStream in = ObsBootUtil.getOssFile(oldPath)) { + copyFile1(in, newPath); + } catch (IOException e) { + log.error(e.getMessage(), e); + } + String fileNameTranslation = imgExportDto.getImgPathTranslation(); + if (StringUtils.isNotBlank(fileNameTranslation)){ + String imgNameTranslation = imgName.substring(0,imgName.indexOf("."))+"translation.png"; + String oldPathTranslation = getPath(fileNameTranslation); + String newPathTranslation = fileNowPath + File.separator + imgNameTranslation; + try (InputStream in = ObsBootUtil.getOssFile(oldPathTranslation)) { + copyFile1(in, newPathTranslation); } catch (IOException e) { - e.printStackTrace(); log.error(e.getMessage(), e); } } } + } + private String getPath(String fileName){ + if (!fileName.contains("temp")){ + fileName = "temp\\" + fileName; + } + return fileName.replace("\\\\", "\\"); } @Override @@ -3979,13 +3995,10 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl startRow) { for(int cellNum = 0; cellNum < fieldList.size(); cellNum++) { - if (!"item_content".equals(fieldList.get(cellNum))) { + String s = fieldList.get(cellNum); + if (!"item_content".equals(s) && !"translation".equals(s)) { sheetItems.addMergedRegion(new CellRangeAddress(startRow, allRow, cellNum, cellNum)); } }