From ea62e1ecb7c424dcb0e72cc579da77164519fbee Mon Sep 17 00:00:00 2001 From: chenxudong Date: Thu, 17 Apr 2025 11:03:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E9=80=9A=E4=BA=86=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E5=AF=BC=E5=85=A5=E7=9A=84=E9=83=A8=E5=88=86=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceimpl/EdFileInfoServiceImpl.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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";