reports-service поправил мелкие баги, подключился к тестовому серверу

This commit is contained in:
AKurakin 2022-12-26 18:26:48 +03:00
parent 4b5667747a
commit 2b0167803b
4 changed files with 6 additions and 5 deletions

View file

@ -28,15 +28,16 @@ public class ReportsServiceApplication {
imdg.waitAvailable();
log.info("Run generate report.");
Map<String, ReportDataCollector> allReports = context.getBeansOfType(ReportDataCollector.class);
System.out.println(allReports);
log.info("Report types: {}", allReports);
for (ReportDataCollector collector:allReports.values()) {
log.info("Make report {}", collector);
XMLReportBuilder xmlReportBuilder = new XMLReportBuilder(collector.getReportClass(), collector);
LocalDate date2 = LocalDate.now();
LocalDate date1 = LocalDate.of(date2.getYear(), date2.getMonth(), 1);//date2.minusMonths(1);
xmlReportBuilder.createReport(date1, date2);
}
} catch (Throwable e) {
LoggerFactory.getLogger(ReportsServiceApplication.class).error("DBF-Loader start failed: {} -> {}", e.getClass().getSimpleName(), ExceptionUtils.getStackTrace(e));
LoggerFactory.getLogger(ReportsServiceApplication.class).error("Report-service start failed: {} -> {}", e.getClass().getSimpleName(), ExceptionUtils.getStackTrace(e));
System.exit(-1);
}
ReportsService reportsService = new ReportsService();

View file

@ -32,7 +32,7 @@ public class XMLReportBuilder<R extends AbstractReport> extends FileReportBuilde
R report = collector.collectReportWithPeriod(startDate, endDate);
String reportName = report.getReportName(LocalDateTime.now());
if (System.getProperty("os.name").contains("windows")) reportName = reportName.replace(":", "_");
if (System.getProperty("os.name").toLowerCase().contains("windows")) reportName = reportName.replace(":", "_");
String reportFileName = reportName + ".xml";
File reportFile = new File(reportFileName);

View file

@ -71,7 +71,7 @@ public class Bt17_1_P1_collector extends ReportDataCollector<ReportBR_0420315_P1
}
final Long allowClearingStatusId = allowClearingStatus.getId(); // "OK"
String ql = String.format("'%s' <= refundDate and refundDate <= '%s' and clearingStatus=",
String ql = String.format("'%s' <= refundDate and refundDate <= '%s' and clearingStatus=%s",
startDate, endDate, allowClearingStatusId);
Collection<LiabilitiesClaimsAssets> liabilities = liabilitiesClaimsAssetsImdg.getCollectionObjectsBySQL(ql);

View file

@ -2,7 +2,7 @@ server.port=8080
server.servlet.context-path=/reports_service
spring.main.web-application-type=servlet
reports-service.hazelcast.cluster-members=127.0.0.1:5701
reports-service.hazelcast.cluster-members=127.0.0.1:5701,10.200.200.181:5701
reports-service.hazelcast.login=dev
reports-service.hazelcast.password=dev-pass
reports-service.ReportModuleOut=./report_out