| | |
| | | package com.vci.ubcs.log.service.impl; |
| | | |
| | | import com.vci.ubcs.log.dto.LocalLogVO; |
| | | import com.vci.ubcs.log.vo.LocalLogVO; |
| | | import com.vci.ubcs.log.service.ILogLocalService; |
| | | import com.vci.ubcs.log.entity.LocalLog; |
| | | import com.vci.ubcs.resource.utils.FileUtil; |
| | | import com.vci.ubcs.resource.utils.ZipUtil; |
| | | import com.vci.ubcs.resource.vo.FileObjectVO; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.web.util.BeanUtil; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | |
| | | import com.vci.ubcs.resource.bo.FileObjectBO; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.*; |
| | | import java.net.MalformedURLException; |
| | | import java.net.URL; |
| | | import java.nio.file.FileSystems; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Path; |
| | |
| | | if(dir.getName().contains("ubcs_")){ |
| | | String fullPath = dir.getPath() + LOGPATH; |
| | | File file = new File(fullPath); |
| | | LocalLog localLog = new LocalLog(); |
| | | localLog.setLastModifier(getLastModifiedOrCreatTime(true,fullPath)); |
| | | localLog.setCreateTime(getLastModifiedOrCreatTime(false,fullPath)); |
| | | localLog.setLogPath(fullPath); |
| | | String serviceId = getServiceId(file.getPath()); |
| | | localLog.setServiceId(serviceId); |
| | | String serviceName = getServiceName(serviceId); |
| | | localLog.setServiceName(serviceName); |
| | | localLog.setLogType(serviceName+"日志父目录"); |
| | | localLog.setLogName(serviceName+"日志父目录"); |
| | | localLog.setHasChildren(true); |
| | | localLogs.add(localLog); |
| | | if(file.exists()){ |
| | | LocalLog localLog = new LocalLog(); |
| | | localLog.setLastModifier(getLastModifiedOrCreatTime(true,fullPath)); |
| | | localLog.setCreateTime(getLastModifiedOrCreatTime(false,fullPath)); |
| | | localLog.setLogPath(fullPath); |
| | | String serviceId = getServiceId(file.getPath()); |
| | | localLog.setServiceId(serviceId); |
| | | String serviceName = getServiceName(serviceId); |
| | | localLog.setServiceName(serviceName); |
| | | localLog.setLogType(serviceName+"日志父目录"); |
| | | localLog.setLogName(serviceName+"日志父目录"); |
| | | localLog.setHasChildren(true); |
| | | localLogs.add(localLog); |
| | | } |
| | | } |
| | | }); |
| | | } |