Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Релиз 2022.9.3 #539

Merged
merged 4 commits into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</parent>
<groupId>ru.investbook</groupId>
<artifactId>investbook</artifactId>
<version>2022.9.2</version>
<version>2022.9.3</version>

<name>investbook</name>
<description>Investor Accounting Book</description>
Expand Down Expand Up @@ -62,7 +62,7 @@

<properties>
<!-- Valid version is (0-255).(0-255).(0-65535) -->
<win.msi.version>22.9.2</win.msi.version>
<win.msi.version>22.9.3</win.msi.version>
<java.version>18</java.version>
<!-- version 3.2.0 provided by Spring Boot 2.4.1 bugged, using version from Spring Boot 2.3.4
https://stackoverflow.com/questions/65910112/maven-clean-install-failed-to-execute-goal-org-apache-maven-pluginsmaven-resou
Expand Down Expand Up @@ -429,9 +429,14 @@
</tags>
<publish>true</publish>
<env>
<BP_JVM_VERSION>19</BP_JVM_VERSION> <!-- version >= ${java.version} -->
<BPE_LANG>C.UTF-8</BPE_LANG>
</env>
<buildpacks>
<!-- Defines available bellsoft-liberica java versions from
https://github.com/paketo-buildpacks/java/releases
JRE with ${java.version} will be selected automatically when available -->
<buildpack>gcr.io/paketo-buildpacks/java:7.9.0</buildpack>
</buildpacks>
</image>
<docker>
<publishRegistry>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.spacious_team.broker.pojo.Security;
import org.spacious_team.broker.pojo.SecurityQuote;
import org.spacious_team.broker.pojo.SecurityType;
import org.spacious_team.table_wrapper.api.OptionalTableColumn;
import org.spacious_team.table_wrapper.api.TableColumn;
import org.spacious_team.table_wrapper.api.TableColumnDescription;
import org.spacious_team.table_wrapper.api.TableColumnImpl;
Expand Down Expand Up @@ -167,16 +168,20 @@ protected enum SecurityQuoteTableHeader implements TableColumnDescription {
SHORT_NAME("Сокращенное", "наименование", "актива"),
CODE("Код", "актива"),
COUNT("Исходящий", "остаток"),
PRICE("Рыночная", "цена"), // на одну бумагу
ACCRUED_INTEREST("НКД"), // на все бумаги исходящего остатка
CURRENCY("Валюта", "цены"),
VALUE("Рыночная", "стои", "мость"); // на все бумаги исходящего остатка с учетом НКД
PRICE(optional("Рыночная", "цена")), // на одну бумагу
ACCRUED_INTEREST(optional("НКД")), // на все бумаги исходящего остатка
CURRENCY(optional("Валюта", "цены")),
VALUE(optional("Рыночная", "стои", "мость")); // на все бумаги исходящего остатка с учетом НКД

@Getter
private final TableColumn column;

SecurityQuoteTableHeader(String... words) {
this.column = TableColumnImpl.of(words);
}

private static TableColumn optional(String... words) {
return OptionalTableColumn.of(TableColumnImpl.of(words));
}
}
}
5 changes: 2 additions & 3 deletions src/main/java/ru/investbook/upgrade/SqlDataExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,21 @@
import java.nio.file.Path;
import java.time.Duration;
import java.time.Instant;
import java.util.List;

@Slf4j
@Service
@RequiredArgsConstructor
public class SqlDataExporter {
private static final String EXPORT_FILE_NAME = "export-2022.9.sql";
private final List<String> expectedInvestbookVersionsForExport = List.of("2022.9", "2022.9.1", "2022.9.2");
private final String expectedInvestbookVersionsForExport = "2022.9";
private final BuildProperties buildProperties;
private final InvestbookProperties investbookProperties;
private final JdbcTemplate jdbcTemplate;

@PreDestroy
public void preDestroy() {
String version = buildProperties.getVersion();
if (expectedInvestbookVersionsForExport.contains(version)) {
if (version.startsWith(expectedInvestbookVersionsForExport)) {
Path file = investbookProperties.getDataPath()
.resolve(EXPORT_FILE_NAME)
.toAbsolutePath();
Expand Down