From 476fa242b2994ac480dedc79cde301bf14aa2026 Mon Sep 17 00:00:00 2001 From: xiejun <xiejun@vci-tech.com> Date: 星期五, 05 一月 2024 18:40:54 +0800 Subject: [PATCH] 获取集团分类根节点前端传null传入后端直接改为空字符串bug修复 --- Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/impl/LogLocalServiceImpl.java | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/impl/LogLocalServiceImpl.java b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/impl/LogLocalServiceImpl.java index 0a2e420..becbc97 100644 --- a/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/impl/LogLocalServiceImpl.java +++ b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/impl/LogLocalServiceImpl.java @@ -26,6 +26,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.attribute.BasicFileAttributes; +import java.nio.file.attribute.FileTime; import java.rmi.ServerException; import java.text.SimpleDateFormat; import java.util.*; @@ -96,8 +97,8 @@ LocalLogVO localLog = new LocalLogVO(); localLog.setLogName(item.getName()); localLog.setLogType(getLogType(item.getName())); - localLog.setCreateTime(getLastModifiedOrCreatTime(false,logParentPath)); - localLog.setLastModifier(getLastModifiedOrCreatTime(true,logParentPath)); + localLog.setCreateTime(getLastModifiedOrCreatTime(false,item.getPath())); + localLog.setLastModifier(getLastModifiedOrCreatTime(true,item.getPath())); localLog.setLogPath(logParentPath); String serviceId = getServiceId(logParentPath); localLog.setServiceId(serviceId); @@ -117,8 +118,8 @@ File file = new File(fullPath); if(file.exists()){ LocalLogVO localLogVO = new LocalLogVO(); - localLogVO.setLastModifier(getLastModifiedOrCreatTime(true,fullPath)); - localLogVO.setCreateTime(getLastModifiedOrCreatTime(false,fullPath)); + localLogVO.setLastModifier(getLastModifiedOrCreatTime(true,file.getPath())); + localLogVO.setCreateTime(getLastModifiedOrCreatTime(false,file.getPath())); localLogVO.setLogPath(fullPath); String serviceId = getServiceId(file.getPath()); localLogVO.setServiceId(serviceId); @@ -265,7 +266,6 @@ if(!logFile.exists() || !logFile.isFile()){ throw new VciBaseException("鏈湴鏃ュ織鏂囦欢璺緞"+item.getPath()+"涓湭鎵惧埌鏃ュ織"); } - try(OutputStream os = new FileOutputStream(file); InputStream ins = new FileInputStream(logFile); ){ @@ -277,10 +277,13 @@ String zipName = new File(tempFolder).getPath() + File.separator + getLogFileName(logFullPaths) + "绛�"+file1.length + "涓枃浠�.zip"; zipUtil.folderToZipFile(tempFolder,zipName); fileObjectBO.setFileLocalPath(zipName); + fileObjectBO.setName(zipName); fileObjectBO.setFileExtension(".log"); if(log.isDebugEnabled()){ log.debug("涓嬭浇鏂囦欢鐨勪俊鎭�,",zipName); } + }else{ + throw new ServerException("璇ョ洰褰曚笅涓嶅瓨鍦ㄦ棩蹇楁枃浠讹紒"); } } return fileObjectBO; -- Gitblit v1.9.3