From e5ec7656c756067706f15e7b906580fa54176d34 Mon Sep 17 00:00:00 2001 From: etreschenkov Date: Tue, 12 May 2026 11:38:18 +0300 Subject: [PATCH] http://jira.mfd.msk:8088/browse/CLS-1002 --- .../db-scripts/src/main/resources/db/DDL.sql | 8 ++++- .../src/main/resources/db/DICTIONARIES.sql | 11 +++++-- .../src/main/resources/db/updateDDL_3.24.sql | 11 +++++++ .../dictionary/CommentDictionary.java | 8 +++++ .../dictionary/CommentDictionaryMapStore.java | 31 +++++++++++++++++++ .../clearing/imdg/IMDGDistributedNames.java | 1 + 6 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 clearing-parent/db-scripts/src/main/resources/db/updateDDL_3.24.sql create mode 100644 clearing-parent/dictionary/src/main/java/ru/clearing/platform/dictionary/CommentDictionary.java create mode 100644 clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/dictionary/CommentDictionaryMapStore.java diff --git a/clearing-parent/db-scripts/src/main/resources/db/DDL.sql b/clearing-parent/db-scripts/src/main/resources/db/DDL.sql index 2362cc7cd..74a2917c3 100644 --- a/clearing-parent/db-scripts/src/main/resources/db/DDL.sql +++ b/clearing-parent/db-scripts/src/main/resources/db/DDL.sql @@ -5766,8 +5766,14 @@ COMMENT ON TABLE ORDER_AFFIL_DICTIONARY IS 'Справочник принадл COMMENT ON COLUMN ORDER_AFFIL_DICTIONARY.ID IS 'Идентификатор'; COMMENT ON COLUMN ORDER_AFFIL_DICTIONARY.CODE IS 'Код'; COMMENT ON COLUMN ORDER_AFFIL_DICTIONARY.NAME IS 'Тип расчета'; + +CREATE TABLE COMMENT_DICTIONARY(ID bigint PRIMARY KEY, CODE varchar(8), NAME varchar(50)); +COMMENT ON TABLE COMMENT_DICTIONARY IS 'Справочник комментариев'; +COMMENT ON COLUMN COMMENT_DICTIONARY.ID IS 'Идентификатор'; +COMMENT ON COLUMN COMMENT_DICTIONARY.CODE IS 'Код'; +COMMENT ON COLUMN COMMENT_DICTIONARY.NAME IS 'Наименование'; /* views */ -- Data types -INSERT INTO DB_VERSION(ID, VERSION) values (1, '3.23') ON CONFLICT (ID) DO UPDATE SET VERSION = EXCLUDED.VERSION \ No newline at end of file +INSERT INTO DB_VERSION(ID, VERSION) values (1, '3.24') ON CONFLICT (ID) DO UPDATE SET VERSION = EXCLUDED.VERSION \ No newline at end of file diff --git a/clearing-parent/db-scripts/src/main/resources/db/DICTIONARIES.sql b/clearing-parent/db-scripts/src/main/resources/db/DICTIONARIES.sql index 68479fc09..e851ab95c 100644 --- a/clearing-parent/db-scripts/src/main/resources/db/DICTIONARIES.sql +++ b/clearing-parent/db-scripts/src/main/resources/db/DICTIONARIES.sql @@ -1361,7 +1361,14 @@ INSERT INTO ORDER_STATUS_DICTIONARY(ID, CODE, NAME) values (6, 'CNCL', 'Снят INSERT INTO ORDER_STATUS_DICTIONARY(ID, CODE, NAME) values (7, 'REPL', 'Заменена') ON CONFLICT (ID) DO UPDATE SET CODE = EXCLUDED.CODE, NAME = EXCLUDED.NAME; INSERT INTO ORDER_STATUS_DICTIONARY(ID, CODE, NAME) values (8, 'RJCT', 'Отклонена') ON CONFLICT (ID) DO UPDATE SET CODE = EXCLUDED.CODE, NAME = EXCLUDED.NAME; - +INSERT INTO COMMENT_DICTIONARY(ID, CODE, NAME) values (1, 'TYPE=1', 'Тип 1 – по сделке с НУК') ON CONFLICT (ID) DO UPDATE SET CODE = EXCLUDED.CODE, NAME = EXCLUDED.NAME; +INSERT INTO COMMENT_DICTIONARY(ID, CODE, NAME) values (2, 'TYPE=2', 'Тип 2 – закрывающая сделка для НУК') ON CONFLICT (ID) DO UPDATE SET CODE = EXCLUDED.CODE, NAME = EXCLUDED.NAME; +INSERT INTO COMMENT_DICTIONARY(ID, CODE, NAME) values (3, 'TYPE=3', 'Тип 3 – по сделке ЦК с ДУК') ON CONFLICT (ID) DO UPDATE SET CODE = EXCLUDED.CODE, NAME = EXCLUDED.NAME; +INSERT INTO COMMENT_DICTIONARY(ID, CODE, NAME) values (4, 'TYPE=4', 'Тип 4 – балансирующая сделка с ДУК') ON CONFLICT (ID) DO UPDATE SET CODE = EXCLUDED.CODE, NAME = EXCLUDED.NAME; +INSERT INTO COMMENT_DICTIONARY(ID, CODE, NAME) values (5, 'TYPE=5', 'Тип 5 – закрывающая сделка для НУК') ON CONFLICT (ID) DO UPDATE SET CODE = EXCLUDED.CODE, NAME = EXCLUDED.NAME; +INSERT INTO COMMENT_DICTIONARY(ID, CODE, NAME) values (6, 'TYPE=6', 'Тип 6 – закрывающая сделка для НУК') ON CONFLICT (ID) DO UPDATE SET CODE = EXCLUDED.CODE, NAME = EXCLUDED.NAME; +INSERT INTO COMMENT_DICTIONARY(ID, CODE, NAME) values (7, 'TYPE=7', 'Тип 7 – закрывающая сделка для УК') ON CONFLICT (ID) DO UPDATE SET CODE = EXCLUDED.CODE, NAME = EXCLUDED.NAME; +INSERT INTO COMMENT_DICTIONARY(ID, CODE, NAME) values (8, 'TYPE=8', 'Тип 8 – балансирующая сделка с ДУК') ON CONFLICT (ID) DO UPDATE SET CODE = EXCLUDED.CODE, NAME = EXCLUDED.NAME; /* Business objects */ -INSERT INTO DB_VERSION(ID, DICTIONARY_VERSION) values (1, '3.23.0.105') ON CONFLICT (ID) DO UPDATE SET DICTIONARY_VERSION = EXCLUDED.DICTIONARY_VERSION +INSERT INTO DB_VERSION(ID, DICTIONARY_VERSION) values (1, '3.24.0.106') ON CONFLICT (ID) DO UPDATE SET DICTIONARY_VERSION = EXCLUDED.DICTIONARY_VERSION diff --git a/clearing-parent/db-scripts/src/main/resources/db/updateDDL_3.24.sql b/clearing-parent/db-scripts/src/main/resources/db/updateDDL_3.24.sql new file mode 100644 index 000000000..3f6f54c6e --- /dev/null +++ b/clearing-parent/db-scripts/src/main/resources/db/updateDDL_3.24.sql @@ -0,0 +1,11 @@ +-- DB version: 3.23 -> 3.24 + + +DROP TABLE IF EXISTS COMMENT_DICTIONARY ; +CREATE TABLE COMMENT_DICTIONARY(ID bigint PRIMARY KEY, CODE varchar(8), NAME varchar(50)); +COMMENT ON TABLE COMMENT_DICTIONARY IS 'Справочник комментариев'; +COMMENT ON COLUMN COMMENT_DICTIONARY.ID IS 'Идентификатор'; +COMMENT ON COLUMN COMMENT_DICTIONARY.CODE IS 'Код'; +COMMENT ON COLUMN COMMENT_DICTIONARY.NAME IS 'Наименование'; + +INSERT INTO DB_VERSION(ID, VERSION) values (1, '3.24') ON CONFLICT (ID) DO UPDATE SET VERSION = EXCLUDED.VERSION; \ No newline at end of file diff --git a/clearing-parent/dictionary/src/main/java/ru/clearing/platform/dictionary/CommentDictionary.java b/clearing-parent/dictionary/src/main/java/ru/clearing/platform/dictionary/CommentDictionary.java new file mode 100644 index 000000000..c3f28e49b --- /dev/null +++ b/clearing-parent/dictionary/src/main/java/ru/clearing/platform/dictionary/CommentDictionary.java @@ -0,0 +1,8 @@ +package ru.clearing.platform.dictionary; + + +public class CommentDictionary extends AbstractDictionary { + private static final long serialVersionUID = ConstDictionarySerializable.serialVersionUID; + + +} diff --git a/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/dictionary/CommentDictionaryMapStore.java b/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/dictionary/CommentDictionaryMapStore.java new file mode 100644 index 000000000..7e6f1922a --- /dev/null +++ b/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/dictionary/CommentDictionaryMapStore.java @@ -0,0 +1,31 @@ +package ru.spcex.clearing.imdg.dictionary; + +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.stereotype.Component; +import ru.clearing.platform.dictionary.CommentDictionary; +import ru.spcex.clearing.imdg.IMDGDistributedNames; +import ru.spcex.clearing.imdg.base.DictionaryTMapStore; + +@Component +public class CommentDictionaryMapStore extends DictionaryTMapStore { + + public CommentDictionaryMapStore(JdbcTemplate jdbcTemplate) { + super(jdbcTemplate); + } + + @Override + public String getMapName() { + return IMDGDistributedNames.Map_CommentDictionary; + } + + @Override + public String getTableName() { + return "COMMENT_DICTIONARY"; + } + + @Override + public CommentDictionary getDictionaryObject() { + return new CommentDictionary(); + } + +} \ No newline at end of file diff --git a/platform-parent/platform-imdg-api/src/main/java/ru/spcex/clearing/imdg/IMDGDistributedNames.java b/platform-parent/platform-imdg-api/src/main/java/ru/spcex/clearing/imdg/IMDGDistributedNames.java index 47a6d108d..b89285a36 100644 --- a/platform-parent/platform-imdg-api/src/main/java/ru/spcex/clearing/imdg/IMDGDistributedNames.java +++ b/platform-parent/platform-imdg-api/src/main/java/ru/spcex/clearing/imdg/IMDGDistributedNames.java @@ -122,6 +122,7 @@ public final class IMDGDistributedNames { public static final String Map_ResidenceDictionary = "Map_ResidenceDictionary"; public static final String Map_OrderStatusDictionary = "Map_OrderStatusDictionary"; public static final String Map_OrderAffilDictionary = "Map_OrderAffilDictionary"; + public static final String Map_CommentDictionary = "Map_CommentDictionary"; public static final String Map_UserSettings = "Map_UserSettings"; public static final String Map_UserRoleSession = "Map_UserRoleSession"; @Deprecated