diff --git a/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/CommonService.java b/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/CommonService.java index a1549e6..516c02e 100644 --- a/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/CommonService.java +++ b/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/CommonService.java @@ -121,11 +121,11 @@ public class CommonService { PATH_MAP.put(DataOwnEnum.REPO_PRJ.code, elePropertyConfig.getRepoPrjPath()); } - public String getPrjPath(int dataOwnCode) { + public String getPrjRootPath1(int dataOwnCode) { return PATH_MAP.get(dataOwnCode) + File.separator; } - public String getEleDataPath(int dataOwnCode) { + public String getPrjRootPath(int dataOwnCode) { if (DataOwnEnum.isUserCode(dataOwnCode)) { return PATH_MAP.get(dataOwnCode) + File.separator + UserThreadLocal.getUserId() + File.separator; @@ -151,7 +151,7 @@ public class CommonService { public String getFileSysPath(String dbPath, int dataOwnCode) { ArrayList paths = CollUtil.newArrayList(dbPath.split(MYSQL_FILE_PATH_SPLIT)); String path = getDbPath(paths); - String destPath = getEleDataPath(dataOwnCode) + File.separator + path; + String destPath = getPrjRootPath(dataOwnCode) + File.separator + path; return destPath.replace("//", "/"); } @@ -262,7 +262,7 @@ public class CommonService { .setDataOwn(dataOwnCode); edFileInfoMapper.insert(fileInfo); // 保存到文件系统 - String targetFilePath = getEleDataPath(dataOwnCode) + File.separator + getDbPath(paths) + File.separator + folderName; + String targetFilePath = getPrjRootPath(dataOwnCode) + File.separator + getDbPath(paths) + File.separator + folderName; fileSystemService.createDirectory(targetFilePath); return ElectromagneticResultUtil.success(folderId); } catch (Exception e) { diff --git a/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/EdFileInfoServiceImpl.java b/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/EdFileInfoServiceImpl.java index 23ba90f..0151481 100644 --- a/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/EdFileInfoServiceImpl.java +++ b/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/EdFileInfoServiceImpl.java @@ -638,7 +638,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl .setDataOwn(dataOwnCode); this.save(fileInfo); // 保存到文件系统 - fileSystemService.createDirectory(commonService.getEleDataPath(dataOwnCode) + File.separator + prjName); + fileSystemService.createDirectory(commonService.getPrjRootPath(dataOwnCode) + File.separator + prjName); UserThreadLocal.setSuccessInfo("", newPrjId, "创建 {} 项目成功。", prjName); } catch (Exception e) { String info = StrFormatter.format("工程 {} 创建失败,具体为--->{}", prjName, e.getMessage()); @@ -158,7 +158,7 @@ public class EdPrjServiceImpl extends ServiceImpl return ElectromagneticResultUtil.fail("-1", info); } - String newPath = commonService.getEleDataPath(dataOwnCode) + File.separator + newPrjName; + String newPath = commonService.getPrjRootPath(dataOwnCode) + File.separator + newPrjName; if (fileSystemService.checkFolderExist(newPath)) { String tmpPath = newPrjName + "_" + IdUtil.fastSimpleUUID() + DELETE_FLAG; fileSystemService.renameFile(newPath, tmpPath); @@ -166,7 +166,7 @@ public class EdPrjServiceImpl extends ServiceImpl this.baseMapper.update(new EdFileInfo(), Wrappers.lambdaUpdate(EdFileInfo.class) .eq(EdFileInfo::getId, prjId) .set(EdFileInfo::getFileName, newPrjName)); - fileSystemService.renameFile(commonService.getEleDataPath(dataOwnCode), oldPrjName, newPrjName); + fileSystemService.renameFile(commonService.getPrjRootPath(dataOwnCode), oldPrjName, newPrjName); UserThreadLocal.setSuccessInfo("", prjId, "修改工层名 {} 为 {} 成功。", oldPrjName, newPrjName); } catch (Exception e) { String info = StrFormatter.format("修改工程名异常--->{},{}", newPrjName, e.getMessage()); diff --git a/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/FileBackLogServiceImpl.java b/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/FileBackLogServiceImpl.java index 01ebfa4..646f34e 100644 --- a/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/FileBackLogServiceImpl.java +++ b/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/FileBackLogServiceImpl.java @@ -75,9 +75,9 @@ public class FileBackLogServiceImpl extends ServiceImpl