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 fb2595a..cfb421d 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 @@ -474,7 +474,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl relations = JSONUtil.toList(FileUtil.readString(path, Charset.defaultCharset()), EdFileRelation.class); edFileRelationService.saveOrUpdateBatch(relations); } private void updateFileTageInfo(String prjDirPath) { - String path = prjDirPath + File.separator + USER_ACCESS_LOG + ".json"; + String path = prjDirPath + File.separator + ED_TAG_RELATIONS + ".json"; List relations = JSONUtil.toList(FileUtil.readString(path, Charset.defaultCharset()), FileTagRelation.class); fileTagRelationService.saveOrUpdateBatch(relations); } @@ -692,7 +692,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl needMove2FileSystemFiles, String prjDirPath, int dataOwnCode) { List files = needMove2FileSystemFiles.stream().filter(e -> e.getDataType().equals(EleDataTypeEnum.FILE.code)).toList(); - List files1 = FileUtil.loopFiles(new File(prjDirPath), file -> file.isDirectory() && file.getName().startsWith(EXPORT_PRJ_NAME)); + List files1 = Arrays.stream(Objects.requireNonNull(new File(prjDirPath).listFiles())).filter(e -> e.isDirectory() && e.getName().startsWith(EXPORT_PRJ_NAME)).toList(); String prjFilePath = files1.get(0).getAbsolutePath(); for (EdFileInfo edFileInfo : files) { String id = edFileInfo.getId(); @@ -748,7 +748,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl exportFileIds, String userDownloadDataDir) { + private void exportLogInfo(String nowTimeStr, String userDownloadDataDir) { List userAccessLogs = userAccessLogService.getBaseMapper().selectList(null); String json = JSONUtil.toJsonStr(userAccessLogs); String path = userDownloadDataDir + File.separator + EXPORT_PRJ_NAME + "_" + nowTimeStr + File.separator + USER_ACCESS_LOG + ".json";