From 55cd288dd9b0096e54db8450f3669f4ae8084e40 Mon Sep 17 00:00:00 2001 From: aalehin Date: Mon, 12 Dec 2022 13:15:34 +0300 Subject: [PATCH 1/4] =?UTF-8?q?http://jira.mfd.msk:8088/browse/CLS-57=20--?= =?UTF-8?q?-=20scheduler=5Fservice:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B7=D0=B0=D0=BF=D0=B8=D1=81=D0=B8?= =?UTF-8?q?=20=D0=B2=20launcher=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D1=8B=D0=B9=20=D1=81=D0=B5=D1=80=D0=B2=D0=B8=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scheduler/service/LauncherService.java | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 clearing-parent/scheduler-service/src/main/java/ru/spcex/clearing/scheduler/service/LauncherService.java diff --git a/clearing-parent/scheduler-service/src/main/java/ru/spcex/clearing/scheduler/service/LauncherService.java b/clearing-parent/scheduler-service/src/main/java/ru/spcex/clearing/scheduler/service/LauncherService.java new file mode 100644 index 000000000..82e9862af --- /dev/null +++ b/clearing-parent/scheduler-service/src/main/java/ru/spcex/clearing/scheduler/service/LauncherService.java @@ -0,0 +1,52 @@ +package ru.spcex.clearing.scheduler.service; + +import org.apache.kafka.clients.consumer.Consumer; +import org.apache.kafka.clients.producer.Producer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Autowired; +import ru.clearing.classes.statics.data.scheduler.Launcher; +import ru.spcex.clearing.imdg.IMDGDistributedNames; +import ru.spcex.clearing.platform.messaging.domain.BaseRequest; +import ru.spcex.clearing.platform.messaging.domain.Consts; +import ru.spcex.clearing.platform.messaging.domain.cud.schedule.LauncherCommandRequest; +import ru.spcex.clearing.platform.messaging.service.QueueConsumer; +import ru.spcex.platform.imdg.api.Imdg; +import ru.spcex.platform.imdg.api.ImdgProvider; + +import java.time.Instant; + +public class LauncherService extends QueueConsumer implements InitializingBean { + private final Logger log = LoggerFactory.getLogger(getClass()); + private final Imdg launcherMap; + + @Autowired + public LauncherService(Consumer kafkaQueue, Producer kafkaProducer, + ImdgProvider imdgProvider) { + super(kafkaQueue, kafkaProducer); + this.launcherMap = imdgProvider.getImdg(IMDGDistributedNames.Map_Launcher, Launcher.class); + } + + @Override + public void afterPropertiesSet() { + callback(LauncherCommandRequest.class) + .setConsumer(this::newLauncher) + .forDestination(Consts.LAUNCHER_NEW, callbacks::put); + init(); + } + + private void newLauncher(BaseRequest userRequest) { + LauncherCommandRequest req = userRequest.getRequestPayload(); + log.debug("LauncherCommandRequest received"); + Instant created = Instant.now(); + Launcher launcher = new Launcher(); + launcher.setTask(req.getTaskName()); + launcher.setSenderId(req.getUserId()); + launcher.setCreated(created); + launcher.setUpdated(created); + launcherMap.insert(launcher); + log.debug("successfully processed, new id {}", launcher.getId()); + } + +} From eedb15dba77818903cd926aca140813dd829fe8d Mon Sep 17 00:00:00 2001 From: aalehin Date: Mon, 12 Dec 2022 13:31:53 +0300 Subject: [PATCH 2/4] =?UTF-8?q?http://jira.mfd.msk:8088/browse/CLS-63=20--?= =?UTF-8?q?-=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=20=D0=BD?= =?UTF-8?q?=D0=BB=D0=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../spcex/clearing/imdg/object/UserRoleSessionMapStore.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/object/UserRoleSessionMapStore.java b/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/object/UserRoleSessionMapStore.java index f1f9cd4cf..fdc8edf8b 100644 --- a/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/object/UserRoleSessionMapStore.java +++ b/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/object/UserRoleSessionMapStore.java @@ -29,7 +29,7 @@ public class UserRoleSessionMapStore extends TemplateMapStore { @Override public String[] getFields() { return new String[]{ - "ID", "USER_ID", "USER_ROLE", "COMPANY_ID", "STATUS" + "ID", "USER_ID", "USER_ROLE", "COMPANY_ID", "STATUS" }; } @@ -40,7 +40,7 @@ public class UserRoleSessionMapStore extends TemplateMapStore { object.setId(resultSet.getObject("ID", Long.class)); object.setUserId(resultSet.getObject("USER_ID", Long.class)); object.setUserRole(resultSet.getObject("USER_ROLE", String.class)); - object.setCompanyId(companyId.equals(0L) ? 1 : companyId); + object.setCompanyId(companyId == null || companyId.equals(0L) ? 1 : companyId); object.setStatus(resultSet.getObject("STATUS", String.class)); return object; } From d377a788f28dd8237be6bad32b54919ebeb2e534 Mon Sep 17 00:00:00 2001 From: psemenkov Date: Mon, 12 Dec 2022 14:44:14 +0300 Subject: [PATCH 3/4] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20SDf11,=20SDf11MapStore,=20Sdf11Builder,=20SDf03,=20SDf?= =?UTF-8?q?03MapStore,=20Sdf03Builder=20=D0=BA=D0=B0=D0=BA=20=D0=B2=20?= =?UTF-8?q?=D0=BC=D0=B5=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../classes/statics/data/sdf/SDf03.java | 11 ++- .../classes/statics/data/sdf/SDf11.java | 11 ++- .../clearing/service/order/Sdf03Builder.java | 3 +- .../clearing/service/order/Sdf11Builder.java | 3 +- .../clearing/imdg/object/SDf03MapStore.java | 98 ++++++++++--------- .../clearing/imdg/object/SDf11MapStore.java | 94 +++++++++--------- .../structure/RunnableMapNamesForTesting.java | 19 ++-- 7 files changed, 131 insertions(+), 108 deletions(-) diff --git a/clearing-parent/classes/src/main/java/ru/clearing/classes/statics/data/sdf/SDf03.java b/clearing-parent/classes/src/main/java/ru/clearing/classes/statics/data/sdf/SDf03.java index 4d190fef9..a8ab57740 100644 --- a/clearing-parent/classes/src/main/java/ru/clearing/classes/statics/data/sdf/SDf03.java +++ b/clearing-parent/classes/src/main/java/ru/clearing/classes/statics/data/sdf/SDf03.java @@ -7,7 +7,7 @@ import java.time.Instant; /** * ДФ-03 Сводное платежное поручение - * + *

* DB table: S_DF03 **/ public class SDf03 extends SpcexObjectBase { @@ -61,6 +61,7 @@ public class SDf03 extends SpcexObjectBase { private String imp_result; private Instant generationTime; private Long generationId; + private Long paymentInstructionId; public String getSeg_type() { return seg_type; @@ -445,4 +446,12 @@ public class SDf03 extends SpcexObjectBase { public void setDocnmprev(String docnmprev) { this.docnmprev = docnmprev; } + + public Long getPaymentInstructionId() { + return paymentInstructionId; + } + + public void setPaymentInstructionId(Long paymentInstructionId) { + this.paymentInstructionId = paymentInstructionId; + } } diff --git a/clearing-parent/classes/src/main/java/ru/clearing/classes/statics/data/sdf/SDf11.java b/clearing-parent/classes/src/main/java/ru/clearing/classes/statics/data/sdf/SDf11.java index b8e2f2c69..b0b27136c 100644 --- a/clearing-parent/classes/src/main/java/ru/clearing/classes/statics/data/sdf/SDf11.java +++ b/clearing-parent/classes/src/main/java/ru/clearing/classes/statics/data/sdf/SDf11.java @@ -7,7 +7,7 @@ import java.time.Instant; /** * ДФ-11 Из КС в ПРЦ Платежное распоряжение на перевод средств с ТБС Участника на КС Инициатора - * + *

* DB table: S_DF11 **/ public class SDf11 extends SpcexObjectBase { @@ -60,6 +60,7 @@ public class SDf11 extends SpcexObjectBase { private String doc_result; private Instant generationTime; private Long generationId; + private Long paymentInstructionId; public String getSeg_type() { return seg_type; @@ -436,4 +437,12 @@ public class SDf11 extends SpcexObjectBase { public void setGenerationId(Long generationId) { this.generationId = generationId; } + + public Long getPaymentInstructionId() { + return paymentInstructionId; + } + + public void setPaymentInstructionId(Long paymentInstructionId) { + this.paymentInstructionId = paymentInstructionId; + } } diff --git a/clearing-parent/clearing-service/src/main/java/ru/spcex/clearing/service/order/Sdf03Builder.java b/clearing-parent/clearing-service/src/main/java/ru/spcex/clearing/service/order/Sdf03Builder.java index a16f02452..d91755610 100644 --- a/clearing-parent/clearing-service/src/main/java/ru/spcex/clearing/service/order/Sdf03Builder.java +++ b/clearing-parent/clearing-service/src/main/java/ru/spcex/clearing/service/order/Sdf03Builder.java @@ -47,8 +47,7 @@ public class Sdf03Builder { } sDf03.setGenerationTime(Instant.now()); sDf03.setGenerationId(generationId); - //todo -// sDf03.setPaymentInstructionId(paymentInstruction.getId()); + sDf03.setPaymentInstructionId(paymentInstruction.getId()); return sDf03; } } diff --git a/clearing-parent/clearing-service/src/main/java/ru/spcex/clearing/service/order/Sdf11Builder.java b/clearing-parent/clearing-service/src/main/java/ru/spcex/clearing/service/order/Sdf11Builder.java index 310a77b1d..c609b133e 100644 --- a/clearing-parent/clearing-service/src/main/java/ru/spcex/clearing/service/order/Sdf11Builder.java +++ b/clearing-parent/clearing-service/src/main/java/ru/spcex/clearing/service/order/Sdf11Builder.java @@ -47,8 +47,7 @@ public class Sdf11Builder { } sDf11.setGenerationTime(Instant.now()); sDf11.setGenerationId(generationId); - //todo -// sDf03.setPaymentInstructionId(paymentInstruction.getId()); + sDf11.setPaymentInstructionId(paymentInstruction.getId()); return sDf11; } } diff --git a/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/object/SDf03MapStore.java b/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/object/SDf03MapStore.java index d7b3fe94e..b06068c55 100644 --- a/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/object/SDf03MapStore.java +++ b/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/object/SDf03MapStore.java @@ -29,13 +29,13 @@ public class SDf03MapStore extends TemplateMapStore { @Override public String[] getFields() { - return new String[] { + return new String[]{ "ID", "SEG_TYPE", "DOC_TYPE", "DOCNM_REF", "DOCNMPREV", "PRIORITY", "SBANKCODE", "C_ACC_DEB", "SBANKNAM1", "SBANKNAM2", "SBANKNAM3", "SBANKNAM4", "SBANKNAM5", "RBANKCODE", "C_ACC_CRED", "RBANKNAM1", "RBANKNAM2", "RBANKNAM3", "RBANKNAM4", "RBANKNAM5", "PAY_DATE", "EXT_DATE", "PAY_VAL", "SUM_DEB", "SCLIENTN1", "SCLIENTN2", "SCLIENTN3", "SCLIENTN4", "SC_CODE", "ACC_DEB", "RCLIENTN1", "RCLIENTN2", "RCLIENTN3", "RCLIENTN4", "ACC_KR_1", "ACC_KR_2", "SP_CODE", "SPECIF_1", "SPECIF_2", "SPECIF_3", "SPECIF_4", "SPECIF_5", - "SPECIF_6", "SEND_TYPE", "SERVDATE", "DOC_RESULT", "IMP_RESULT", "GENERATION_TIME", "GENERATION_ID" + "SPECIF_6", "SEND_TYPE", "SERVDATE", "DOC_RESULT", "IMP_RESULT", "GENERATION_TIME", "GENERATION_ID", "PAYMENT_INSTRUCTION_ID" }; } @@ -91,6 +91,7 @@ public class SDf03MapStore extends TemplateMapStore { object.setImp_result(resultSet.getObject("IMP_RESULT", String.class)); object.setGenerationTime(getInstantFromTimestamp(resultSet, "GENERATION_TIME")); object.setGenerationId(resultSet.getObject("GENERATION_ID", Long.class)); + object.setPaymentInstructionId(resultSet.getObject("PAYMENT_INSTRUCTION_ID", Long.class)); return object; } @@ -99,53 +100,54 @@ public class SDf03MapStore extends TemplateMapStore { Object[] args = new Object[]{ object.getId(), object.getSeg_type(), - object.getDoc_type(), - object.getDocnm_ref(), - object.getDocnmprev(), - object.getPriority(), - object.getSbankcode(), - object.getC_acc_deb(), - object.getSbanknam1(), - object.getSbanknam2(), - object.getSbanknam3(), - object.getSbanknam4(), - object.getSbanknam5(), - object.getRbankcode(), - object.getC_acc_cred(), - object.getRbanknam1(), - object.getRbanknam2(), - object.getRbanknam3(), - object.getRbanknam4(), - object.getRbanknam5(), - object.getPay_date(), - object.getExt_date(), - object.getPay_val(), - object.getSum_deb(), - object.getSclientn1(), - object.getSclientn2(), - object.getSclientn3(), - object.getSclientn4(), - object.getSc_code(), - object.getAcc_deb(), - object.getRclientn1(), - object.getRclientn2(), - object.getRclientn3(), - object.getRclientn4(), - object.getAcc_kr_1(), - object.getAcc_kr_2(), - object.getSp_code(), - object.getSpecif_1(), - object.getSpecif_2(), - object.getSpecif_3(), - object.getSpecif_4(), - object.getSpecif_5(), - object.getSpecif_6(), - object.getSend_type(), - object.getServdate(), - object.getDoc_result(), - object.getImp_result(), + object.getDoc_type(), + object.getDocnm_ref(), + object.getDocnmprev(), + object.getPriority(), + object.getSbankcode(), + object.getC_acc_deb(), + object.getSbanknam1(), + object.getSbanknam2(), + object.getSbanknam3(), + object.getSbanknam4(), + object.getSbanknam5(), + object.getRbankcode(), + object.getC_acc_cred(), + object.getRbanknam1(), + object.getRbanknam2(), + object.getRbanknam3(), + object.getRbanknam4(), + object.getRbanknam5(), + object.getPay_date(), + object.getExt_date(), + object.getPay_val(), + object.getSum_deb(), + object.getSclientn1(), + object.getSclientn2(), + object.getSclientn3(), + object.getSclientn4(), + object.getSc_code(), + object.getAcc_deb(), + object.getRclientn1(), + object.getRclientn2(), + object.getRclientn3(), + object.getRclientn4(), + object.getAcc_kr_1(), + object.getAcc_kr_2(), + object.getSp_code(), + object.getSpecif_1(), + object.getSpecif_2(), + object.getSpecif_3(), + object.getSpecif_4(), + object.getSpecif_5(), + object.getSpecif_6(), + object.getSend_type(), + object.getServdate(), + object.getDoc_result(), + object.getImp_result(), TimeUtil.toDateFromInstant(object.getGenerationTime()), - object.getGenerationId() + object.getGenerationId(), + object.getPaymentInstructionId() }; return args; } diff --git a/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/object/SDf11MapStore.java b/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/object/SDf11MapStore.java index 7667a2acd..febedde70 100644 --- a/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/object/SDf11MapStore.java +++ b/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/object/SDf11MapStore.java @@ -29,13 +29,13 @@ public class SDf11MapStore extends TemplateMapStore { @Override public String[] getFields() { - return new String[] { + return new String[]{ "ID", "SEG_TYPE", "DOC_TYPE", "DOCNM_REF", "DOCNMPREV", "PRIORITY", "SBANKCODE", "C_ACC_DEB", "SBANKNAM1", "SBANKNAM2", "SBANKNAM3", "SBANKNAM4", "SBANKNAM5", "RBANKCODE", "C_ACC_CRED", "RBANKNAM1", "RBANKNAM2", "RBANKNAM3", "RBANKNAM4", "RBANKNAM5", "PAY_DATE", "EXT_DATE", "PAY_VAL", "SUM_DEB", "SCLIENTN1", "SCLIENTN2", "SCLIENTN3", "SCLIENTN4", "SC_CODE", "ACC_DEB", "RCLIENTN1", "RCLIENTN2", "RCLIENTN3", "RCLIENTN4", "ACC_KR_1", "ACC_KR_2", "SP_CODE", "SPECIF_1", "SPECIF_2", "SPECIF_3", "SPECIF_4", "SPECIF_5", - "SPECIF_6", "SEND_TYPE", "SERVDATE", "DOC_RESULT", "GENERATION_TIME", "GENERATION_ID" + "SPECIF_6", "SEND_TYPE", "SERVDATE", "DOC_RESULT", "GENERATION_TIME", "GENERATION_ID", "PAYMENT_INSTRUCTION_ID" }; } @@ -90,6 +90,7 @@ public class SDf11MapStore extends TemplateMapStore { object.setDoc_result(resultSet.getObject("DOC_RESULT", String.class)); object.setGenerationTime(getInstantFromTimestamp(resultSet, "GENERATION_TIME")); object.setGenerationId(resultSet.getObject("GENERATION_ID", Long.class)); + object.setPaymentInstructionId(resultSet.getObject("PAYMENT_INSTRUCTION_ID", Long.class)); return object; } @@ -98,52 +99,53 @@ public class SDf11MapStore extends TemplateMapStore { Object[] args = new Object[]{ object.getId(), object.getSeg_type(), - object.getDoc_type(), - object.getDocnm_ref(), + object.getDoc_type(), + object.getDocnm_ref(), object.getDocnmprev(), - object.getPriority(), - object.getSbankcode(), - object.getC_acc_deb(), - object.getSbanknam1(), - object.getSbanknam2(), - object.getSbanknam3(), - object.getSbanknam4(), - object.getSbanknam5(), - object.getRbankcode(), - object.getC_acc_cred(), - object.getRbanknam1(), - object.getRbanknam2(), - object.getRbanknam3(), - object.getRbanknam4(), - object.getRbanknam5(), - object.getPay_date(), - object.getExt_date(), - object.getPay_val(), - object.getSum_deb(), - object.getSclientn1(), - object.getSclientn2(), - object.getSclientn3(), - object.getSclientn4(), - object.getSc_code(), - object.getAcc_deb(), - object.getRclientn1(), - object.getRclientn2(), - object.getRclientn3(), - object.getRclientn4(), - object.getAcc_kr_1(), - object.getAcc_kr_2(), - object.getSp_code(), - object.getSpecif_1(), - object.getSpecif_2(), - object.getSpecif_3(), - object.getSpecif_4(), - object.getSpecif_5(), - object.getSpecif_6(), - object.getSend_type(), - object.getServdate(), - object.getDoc_result(), + object.getPriority(), + object.getSbankcode(), + object.getC_acc_deb(), + object.getSbanknam1(), + object.getSbanknam2(), + object.getSbanknam3(), + object.getSbanknam4(), + object.getSbanknam5(), + object.getRbankcode(), + object.getC_acc_cred(), + object.getRbanknam1(), + object.getRbanknam2(), + object.getRbanknam3(), + object.getRbanknam4(), + object.getRbanknam5(), + object.getPay_date(), + object.getExt_date(), + object.getPay_val(), + object.getSum_deb(), + object.getSclientn1(), + object.getSclientn2(), + object.getSclientn3(), + object.getSclientn4(), + object.getSc_code(), + object.getAcc_deb(), + object.getRclientn1(), + object.getRclientn2(), + object.getRclientn3(), + object.getRclientn4(), + object.getAcc_kr_1(), + object.getAcc_kr_2(), + object.getSp_code(), + object.getSpecif_1(), + object.getSpecif_2(), + object.getSpecif_3(), + object.getSpecif_4(), + object.getSpecif_5(), + object.getSpecif_6(), + object.getSend_type(), + object.getServdate(), + object.getDoc_result(), TimeUtil.toDateFromInstant(object.getGenerationTime()), - object.getGenerationId() + object.getGenerationId(), + object.getPaymentInstructionId() }; return args; } diff --git a/clearing-parent/imdg/src/test/java/ru/spcex/clearing/imdg/structure/RunnableMapNamesForTesting.java b/clearing-parent/imdg/src/test/java/ru/spcex/clearing/imdg/structure/RunnableMapNamesForTesting.java index f97406af2..da87bd596 100644 --- a/clearing-parent/imdg/src/test/java/ru/spcex/clearing/imdg/structure/RunnableMapNamesForTesting.java +++ b/clearing-parent/imdg/src/test/java/ru/spcex/clearing/imdg/structure/RunnableMapNamesForTesting.java @@ -12,6 +12,7 @@ import ru.clearing.classes.statics.data.journal.InDocumentJournal; import ru.clearing.classes.statics.data.journal.OutDocumentJournal; import ru.clearing.classes.statics.data.messages.ErrorText; import ru.clearing.classes.statics.data.misc.KeyRate; +import ru.clearing.classes.statics.data.misc.Listing; import ru.clearing.classes.statics.data.misc.MoneyMarketSecurity; import ru.clearing.classes.statics.data.profile.Contact; import ru.clearing.classes.statics.data.profile.ProfileDocument; @@ -54,18 +55,20 @@ public class RunnableMapNamesForTesting { businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_UserHistory, UserHistory.class)); //business object - businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Account, Account.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_AccountBalance, AccountBalance.class)); + businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Account, Account.class)); + businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_ClearingCalendar, ClearingCalendar.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Company, Company.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_ErrorText, ErrorText.class)); - businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Relation, Relation.class)); + businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Launcher, Launcher.class)); + businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Listing, Listing.class, + new SettingOperation("setLotSize", new Class[]{BigDecimal.class}, new Object[]{new BigDecimal("21.11")}))); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Planner, Planner.class)); + businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_PlannerTemplate, PlannerTemplate.class)); + businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Relation, Relation.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Security, Security.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Statement, Statement.class, new SettingOperation("setAmount", new Class[]{BigDecimal.class}, new Object[]{new BigDecimal("23.22")}))); - businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Launcher, Launcher.class)); - businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_PlannerTemplate, PlannerTemplate.class)); - businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_ClearingCalendar, ClearingCalendar.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_UserConnect, UserConnect.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_User, User.class)); @@ -119,13 +122,13 @@ public class RunnableMapNamesForTesting { businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_CompanySymbols, CompanySymbols.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Contact, Contact.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_InDocumentJournal, InDocumentJournal.class, - new SettingOperation("setAmount", new Class[]{BigDecimal.class}, new Object[]{new BigDecimal("23.22")}))); + new SettingOperation("setAmount", new Class[]{BigDecimal.class}, new Object[]{new BigDecimal("22.12")}))); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_InformationAccount, InformationAccount.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_KeyRate, KeyRate.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_MoneyMarketSecurity, MoneyMarketSecurity.class, - new SettingOperation("setNominalValue", new Class[]{BigDecimal.class}, new Object[]{new BigDecimal("23.22")}))); + new SettingOperation("setNominalValue", new Class[]{BigDecimal.class}, new Object[]{new BigDecimal("25.25")}))); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_OutDocumentJournal, OutDocumentJournal.class, - new SettingOperation("setAmount", new Class[]{BigDecimal.class}, new Object[]{new BigDecimal("23.22")}))); + new SettingOperation("setAmount", new Class[]{BigDecimal.class}, new Object[]{new BigDecimal("28.28")}))); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_ProfileDocument, ProfileDocument.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_PlannerAllToday, PlannerAllToday.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_SDf01, SDf01.class)); From f5afbd5c9f4f0a0f1eb6bf68c8fe964b70c5abc9 Mon Sep 17 00:00:00 2001 From: psemenkov Date: Mon, 12 Dec 2022 15:42:41 +0300 Subject: [PATCH 4/4] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=20=D0=BC=D0=B0=D0=BF=D1=81=D1=82=D0=BE=D1=80=D1=8B=20=D0=B2=20?= =?UTF-8?q?=D1=82=D0=B5=D1=81=D1=82=20=D0=B8=20=D0=B8=D1=81=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=B8=D0=BB=20SessionMapStore,=20PaymentInstructio?= =?UTF-8?q?nMapStore,=20NotificationMapStore,=20ManagementJournalMapStore.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ManagementJournalMapStore.java | 2 +- .../imdg/object/NotificationMapStore.java | 7 ++++--- .../object/PaymentInstructionMapStore.java | 15 +++++++++------ .../clearing/imdg/object/SessionMapStore.java | 7 ++++--- .../structure/RunnableMapNamesForTesting.java | 19 +++++++++++++------ 5 files changed, 31 insertions(+), 19 deletions(-) diff --git a/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/businessobject/ManagementJournalMapStore.java b/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/businessobject/ManagementJournalMapStore.java index b184781ca..67c8d3031 100644 --- a/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/businessobject/ManagementJournalMapStore.java +++ b/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/businessobject/ManagementJournalMapStore.java @@ -75,7 +75,7 @@ public class ManagementJournalMapStore extends TemplateMapStore { protected Object[] objectToField(Notification notification) { Object[] args = new Object[]{ notification.getId(), - notification.getCreated(), - notification.getUpdated(), + TimeUtil.toDateFromInstant(notification.getCreated()), + TimeUtil.toDateFromInstant(notification.getUpdated()), notification.getClearingDate(), notification.getSenderId(), notification.getAddresseeId(), notification.getObjectType(), - notification.getObjectId(), + TimeUtil.toDateFromInstant(notification.getObjectId()), notification.getNotificationStatus() }; return args; diff --git a/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/object/PaymentInstructionMapStore.java b/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/object/PaymentInstructionMapStore.java index fa42fdb6d..47fa2fbcb 100644 --- a/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/object/PaymentInstructionMapStore.java +++ b/clearing-parent/imdg/src/main/java/ru/spcex/clearing/imdg/object/PaymentInstructionMapStore.java @@ -5,6 +5,7 @@ import org.springframework.stereotype.Component; import ru.clearing.classes.statics.data.payment.PaymentInstruction; import ru.spcex.clearing.imdg.IMDGDistributedNames; import ru.spcex.clearing.imdg.base.TemplateMapStore; +import ru.spcex.platform.utils.time.TimeUtil; import java.sql.ResultSet; import java.sql.SQLException; @@ -28,7 +29,9 @@ public class PaymentInstructionMapStore extends TemplateMapStore { protected Object[] objectToField(Session session) { Object[] args = new Object[]{ session.getId(), - session.getCreated(), - session.getUpdated(), - session.getClearingDate(), + TimeUtil.toDateFromInstant(session.getCreated()), + TimeUtil.toDateFromInstant(session.getUpdated()), + TimeUtil.toDateFromLocalDate(session.getClearingDate()), session.getSessionStatus() }; return args; diff --git a/clearing-parent/imdg/src/test/java/ru/spcex/clearing/imdg/structure/RunnableMapNamesForTesting.java b/clearing-parent/imdg/src/test/java/ru/spcex/clearing/imdg/structure/RunnableMapNamesForTesting.java index da87bd596..68991d4be 100644 --- a/clearing-parent/imdg/src/test/java/ru/spcex/clearing/imdg/structure/RunnableMapNamesForTesting.java +++ b/clearing-parent/imdg/src/test/java/ru/spcex/clearing/imdg/structure/RunnableMapNamesForTesting.java @@ -9,11 +9,11 @@ import ru.clearing.classes.statics.data.company.relation.Relation; import ru.clearing.classes.statics.data.company.relation.RelationHistory; import ru.clearing.classes.statics.data.generated.ClearingMemberCategory; import ru.clearing.classes.statics.data.journal.InDocumentJournal; +import ru.clearing.classes.statics.data.journal.ManagementJournal; import ru.clearing.classes.statics.data.journal.OutDocumentJournal; import ru.clearing.classes.statics.data.messages.ErrorText; -import ru.clearing.classes.statics.data.misc.KeyRate; -import ru.clearing.classes.statics.data.misc.Listing; -import ru.clearing.classes.statics.data.misc.MoneyMarketSecurity; +import ru.clearing.classes.statics.data.misc.*; +import ru.clearing.classes.statics.data.payment.PaymentInstruction; import ru.clearing.classes.statics.data.profile.Contact; import ru.clearing.classes.statics.data.profile.ProfileDocument; import ru.clearing.classes.statics.data.scheduler.*; @@ -63,6 +63,8 @@ public class RunnableMapNamesForTesting { businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Launcher, Launcher.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Listing, Listing.class, new SettingOperation("setLotSize", new Class[]{BigDecimal.class}, new Object[]{new BigDecimal("21.11")}))); + businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_ManagementJournal, ManagementJournal.class)); + businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Market, Market.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Planner, Planner.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_PlannerTemplate, PlannerTemplate.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Relation, Relation.class)); @@ -78,6 +80,7 @@ public class RunnableMapNamesForTesting { dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_AllowedDictionary, AllowedDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_BalanceAccountTypeDictionary, BalanceAccountTypeDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_ChargeDirectionDictionary, ChargeDirectionDictionary.class)); + dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_ClearingCategoryDictionary, ClearingCategoryDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_ClearingStatusDictionary, ClearingStatusDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_CompanyRoleDictionary, CompanyRoleDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_CompanySymbolDictionary, CompanySymbolDictionary.class)); @@ -87,6 +90,7 @@ public class RunnableMapNamesForTesting { dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_CountryCodeDictionary, CountryCodeDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_CourierTypeDictionary, CourierTypeDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_CurrencyCodeDictionary, CurrencyCodeDictionary.class)); + dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_DayStatusDictionary, DayStatusDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_DocumentTypeDictionary, DocumentTypeDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_ErrorCodeDictionary, ErrorCodeDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_InOutDirectionDictionary, InOutDirectionDictionary.class)); @@ -100,17 +104,16 @@ public class RunnableMapNamesForTesting { dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_OperationStatusDictionary, OperationStatusDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_OperationTypeDictionary, OperationTypeDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_OrganizationTypeDictionary, OrganizationTypeDictionary.class)); + dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_ParentDictionary, ParentDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_ResultStatusDictionary, ResultStatusDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_SectorDictionary, SectorDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_ServiceDictionary, ServiceDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_ServiceProductDictionary, ServiceProductDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_ServiceStatusDictionary, ServiceStatusDictionary.class)); - dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_ParentDictionary, ParentDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_StatementTypeDictionary, StatementTypeDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_TaskDictionary, TaskDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_TaskStatusDictionary, TaskStatusDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_TermTypeDictionary, TermTypeDictionary.class)); - dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_DayStatusDictionary, DayStatusDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_UserRoleDictionary, UserRoleDictionary.class)); dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_WorkflowStatusDictionary, WorkflowStatusDictionary.class)); @@ -121,16 +124,19 @@ public class RunnableMapNamesForTesting { businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_CompanyRoleSet, CompanyRoleSet.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_CompanySymbols, CompanySymbols.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Contact, Contact.class)); + businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Currency, Currency.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_InDocumentJournal, InDocumentJournal.class, new SettingOperation("setAmount", new Class[]{BigDecimal.class}, new Object[]{new BigDecimal("22.12")}))); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_InformationAccount, InformationAccount.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_KeyRate, KeyRate.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_MoneyMarketSecurity, MoneyMarketSecurity.class, new SettingOperation("setNominalValue", new Class[]{BigDecimal.class}, new Object[]{new BigDecimal("25.25")}))); + businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Notification, Notification.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_OutDocumentJournal, OutDocumentJournal.class, new SettingOperation("setAmount", new Class[]{BigDecimal.class}, new Object[]{new BigDecimal("28.28")}))); - businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_ProfileDocument, ProfileDocument.class)); + businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_PaymentInstruction, PaymentInstruction.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_PlannerAllToday, PlannerAllToday.class)); + businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_ProfileDocument, ProfileDocument.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_SDf01, SDf01.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_SDf02, SDf02.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_SDf03, SDf03.class)); @@ -145,6 +151,7 @@ public class RunnableMapNamesForTesting { businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_SDf16, SDf16.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_SDf17, SDf17.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_SDf18, SDf18.class)); + businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Session, Session.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_UserRoleSession, UserRoleSession.class)); businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_UserSettings, UserSettings.class)); }