change logging
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
package com.pledge.torgi.service;
|
package com.pledge.torgi.service;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
import com.pledge.torgi.model.TorgiEvent;
|
import com.pledge.torgi.model.TorgiEvent;
|
||||||
import com.pledge.torgi.repositories.TorgiEventRepository;
|
import com.pledge.torgi.repositories.TorgiEventRepository;
|
||||||
import org.apache.poi.ss.usermodel.Row;
|
import org.apache.poi.ss.usermodel.Row;
|
||||||
@@ -27,6 +26,7 @@ import static java.util.Objects.nonNull;
|
|||||||
public class DownloadHeadlessService {
|
public class DownloadHeadlessService {
|
||||||
|
|
||||||
private final Logger logger = LoggerFactory.getLogger(DownloadHeadlessService.class);
|
private final Logger logger = LoggerFactory.getLogger(DownloadHeadlessService.class);
|
||||||
|
private static final Logger businessLogger = LoggerFactory.getLogger("BUSINESS");
|
||||||
private static final int COL_TYPE = 1;
|
private static final int COL_TYPE = 1;
|
||||||
private static final int COL_NOTICE = 3;
|
private static final int COL_NOTICE = 3;
|
||||||
private static final int COL_BID_START = 6;
|
private static final int COL_BID_START = 6;
|
||||||
@@ -149,12 +149,12 @@ public class DownloadHeadlessService {
|
|||||||
int currentRow = 1;
|
int currentRow = 1;
|
||||||
setRowBodyNew(sheet, currentRow, data);
|
setRowBodyNew(sheet, currentRow, data);
|
||||||
|
|
||||||
logger.error("before write to file");
|
businessLogger.info("before write to file");
|
||||||
try (FileOutputStream fileOut = new FileOutputStream(getFileToSave(now))) {
|
try (FileOutputStream fileOut = new FileOutputStream(getFileToSave(now))) {
|
||||||
workbook.write(fileOut);
|
workbook.write(fileOut);
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
logger.error("in createNewDocument " + ex.getMessage());
|
logger.error("in createNewDocument", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,10 +166,10 @@ public class DownloadHeadlessService {
|
|||||||
try {
|
try {
|
||||||
events.addAll(eventRepository.findAllByFullInfoLikeOrderByCreatedAtDesc("%" + cadastral + "%"));
|
events.addAll(eventRepository.findAllByFullInfoLikeOrderByCreatedAtDesc("%" + cadastral + "%"));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Error during process cadastral = " + cadastral + " " + e);
|
logger.error("Error during process cadastral = {}", cadastral, e);
|
||||||
}
|
}
|
||||||
if (i % 100 == 0) {
|
if (i % 100 == 0) {
|
||||||
logger.error("executed = " + i + " added = " + events.size());
|
businessLogger.info("executed = {} added = {}", i ,events.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return events.stream().map(Lot::new).toList();
|
return events.stream().map(Lot::new).toList();
|
||||||
@@ -193,7 +193,7 @@ public class DownloadHeadlessService {
|
|||||||
rowHead.createCell(13).setCellValue("Время получения события");
|
rowHead.createCell(13).setCellValue("Время получения события");
|
||||||
}
|
}
|
||||||
|
|
||||||
private int setRowBodyNew(XSSFSheet sheet, int currentRow, Collection<Lot> contents) throws JsonProcessingException {
|
private int setRowBodyNew(XSSFSheet sheet, int currentRow, Collection<Lot> contents) {
|
||||||
for (Lot lot : contents) {
|
for (Lot lot : contents) {
|
||||||
currentRow = createRow(sheet, currentRow, lot);
|
currentRow = createRow(sheet, currentRow, lot);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user