ludc
2023-12-29 430b59d0fe5593e96a1f56eb90b50e2d3f248b2e
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);
@@ -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;