优化:添加日志
This commit is contained in:
@ -43,7 +43,7 @@ public class CadToPdf {
|
||||
cadImage.close();
|
||||
return true;
|
||||
} catch (FileNotFoundException e) {
|
||||
logger.error("PDFFileNotFoundException", e);
|
||||
logger.error("PDFFileNotFoundException,inputFilePath:{}", inputFilePath, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,10 +33,7 @@ public class ConverterUtils {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(ConverterUtils.class);
|
||||
|
||||
// @Value("${office.home}")
|
||||
// String officeHome;
|
||||
// OpenOfficeConnection connection;
|
||||
OfficeManager officeManager;
|
||||
private OfficeManager officeManager;
|
||||
|
||||
@PostConstruct
|
||||
public void initOfficeManager() {
|
||||
|
||||
@ -84,7 +84,7 @@ public class DownloadUtils {
|
||||
}
|
||||
return response;
|
||||
} catch (IOException e) {
|
||||
LOGGER.error("文件下载失败", e);
|
||||
LOGGER.error("文件下载失败,url:{}", urlAddress, e);
|
||||
response.setCode(1);
|
||||
response.setContent(null);
|
||||
if (e instanceof FileNotFoundException) {
|
||||
|
||||
@ -36,7 +36,7 @@ public class FileUtils {
|
||||
String fileDir = ConfigConstants.getFileDir();
|
||||
|
||||
/**
|
||||
* 已转换过的文件集合(redis缓存)
|
||||
* 已转换过的文件集合(缓存)
|
||||
* @return
|
||||
*/
|
||||
public Map<String, String> listConvertedFiles() {
|
||||
|
||||
@ -18,7 +18,7 @@ import java.util.List;
|
||||
@Component
|
||||
public class PdfUtils {
|
||||
|
||||
private final Logger LOGGER = LoggerFactory.getLogger(PdfUtils.class);
|
||||
private final Logger logger = LoggerFactory.getLogger(PdfUtils.class);
|
||||
|
||||
@Autowired
|
||||
FileUtils fileUtils;
|
||||
@ -57,7 +57,7 @@ public class PdfUtils {
|
||||
doc.close();
|
||||
fileUtils.addConvertedPdfImage(pdfFilePath, pageCount);
|
||||
} catch (IOException e) {
|
||||
LOGGER.error("Convert pdf to jpg exception", e);
|
||||
logger.error("Convert pdf to jpg exception, pdfFilePath:{}", pdfFilePath, e);
|
||||
}
|
||||
return imageUrls;
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ import org.springframework.stereotype.Component;
|
||||
@ConditionalOnExpression("'${cache.clean.enabled:false}'.equals('true')")
|
||||
public class ShedulerClean {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ShedulerClean.class);
|
||||
private final Logger logger = LoggerFactory.getLogger(ShedulerClean.class);
|
||||
|
||||
@Autowired
|
||||
private CacheService cacheService;
|
||||
@ -27,9 +27,9 @@ public class ShedulerClean {
|
||||
//默认每晚3点执行一次
|
||||
@Scheduled(cron = "${cache.clean.cron:0 0 3 * * ?}")
|
||||
public void clean() {
|
||||
LOGGER.info("Cache clean start");
|
||||
logger.info("Cache clean start");
|
||||
cacheService.cleanCache();
|
||||
DeleteFileUtil.deleteDirectory(fileDir);
|
||||
LOGGER.info("Cache clean end");
|
||||
logger.info("Cache clean end");
|
||||
}
|
||||
}
|
||||
|
||||
@ -427,7 +427,6 @@ public class ZipReader {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println("解析压缩文件开始《《《《《《《《《《《《《《《《《《《《《《《");
|
||||
for (Map<String, ZipArchiveEntry> entryMap : entriesToBeExtracted) {
|
||||
String childName = entryMap.keySet().iterator().next();
|
||||
ZipArchiveEntry entry = entryMap.values().iterator().next();
|
||||
@ -445,7 +444,6 @@ public class ZipReader {
|
||||
if (new File(filePath).exists()) {
|
||||
new File(filePath).delete();
|
||||
}
|
||||
System.out.println("解析压缩文件结束《《《《《《《《《《《《《《《《《《《《《《《");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user