Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
ialbert 2022-12-12 17:09:03 +03:00
commit 7ddad9bd21
13 changed files with 215 additions and 128 deletions

View file

@ -7,7 +7,7 @@ import java.time.Instant;
/**
* ДФ-03 Сводное платежное поручение
*
* <p>
* 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;
}
}

View file

@ -7,7 +7,7 @@ import java.time.Instant;
/**
* ДФ-11 Из КС в ПРЦ Платежное распоряжение на перевод средств с ТБС Участника на КС Инициатора
*
* <p>
* 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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -75,7 +75,7 @@ public class ManagementJournalMapStore extends TemplateMapStore<ManagementJourna
object.getText(),
object.getChangeAccessSign(),
object.getChangeDataSign(),
object.getEventDate(),
TimeUtil.toDateFromInstant(object.getEventDate()),
TimeUtil.toDateFromInstant(object.getUpdated()),
TimeUtil.toDateFromInstant(object.getCreated()),
};

View file

@ -5,6 +5,7 @@ import org.springframework.stereotype.Component;
import ru.clearing.classes.statics.data.misc.Notification;
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;
@ -60,13 +61,13 @@ public class NotificationMapStore extends TemplateMapStore<Notification> {
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;

View file

@ -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<PaymentInstruct
@Override
public String[] getFields() {
return new String[]{"id", "created_at", "updated_at", "sender_id", "addressee_id", "adressee_b_i_c", "payee_bank_name", "payee_b_i_c", "addressee_bank_name", "payment_date", "_payment_purpose", "settlement_date", "credit_leg_amount", "debit_leg_amount", "credit_leg_account_id", "credit_cs_account", "credit_leg_account", "debit_leg_account_id", "debit_cs_account", "debit_leg_account", "credit_leg_direction", "debit_leg_direction", "credit_leg_currency_code", "debit_leg_currency_code", "clearing_date", "transaction_status", "document_number"};
return new String[]{"id", "created_at", "updated_at", "sender_id", "addressee_id", "adressee_b_i_c", "payee_bank_name", "payee_b_i_c", "addressee_bank_name", "payment_date",
"payment_purpose", "settlement_date", "credit_leg_amount", "debit_leg_amount", "credit_leg_account_id", "credit_cs_account", "credit_leg_account", "debit_leg_account_id",
"debit_cs_account", "debit_leg_account", "credit_leg_direction", "debit_leg_direction", "credit_leg_currency_code", "debit_leg_currency_code", "clearing_date", "transaction_status", "document_number"};
}
@Override
@ -68,17 +71,17 @@ public class PaymentInstructionMapStore extends TemplateMapStore<PaymentInstruct
protected Object[] objectToField(PaymentInstruction paymentInstruction) {
Object[] args = new Object[]{
paymentInstruction.getId(),
paymentInstruction.getCreated(),
paymentInstruction.getUpdated(),
TimeUtil.toDateFromInstant(paymentInstruction.getCreated()),
TimeUtil.toDateFromInstant(paymentInstruction.getUpdated()),
paymentInstruction.getSenderId(),
paymentInstruction.getAddresseeId(),
paymentInstruction.getAdresseeBIC(),
paymentInstruction.getPayeeBankName(),
paymentInstruction.getPayeeBIC(),
paymentInstruction.getAddresseeBankName(),
paymentInstruction.getPaymentDate(),
TimeUtil.toDateFromInstant(paymentInstruction.getPaymentDate()),
paymentInstruction.getPaymentPurpose(),
paymentInstruction.getSettlementDate(),
TimeUtil.toDateFromLocalDate(paymentInstruction.getSettlementDate()),
paymentInstruction.getCreditLegAmount(),
paymentInstruction.getDebitLegAmount(),
paymentInstruction.getCreditLegAccountId(),
@ -91,7 +94,7 @@ public class PaymentInstructionMapStore extends TemplateMapStore<PaymentInstruct
paymentInstruction.getDebitLegDirection(),
paymentInstruction.getCreditLegCurrencyCode(),
paymentInstruction.getDebitLegCurrencyCode(),
paymentInstruction.getClearingDate(),
TimeUtil.toDateFromLocalDate(paymentInstruction.getClearingDate()),
paymentInstruction.getTransactionStatus(),
paymentInstruction.getDocumentNumber(),
};

View file

@ -29,13 +29,13 @@ public class SDf03MapStore extends TemplateMapStore<SDf03> {
@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<SDf03> {
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<SDf03> {
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;
}

View file

@ -29,13 +29,13 @@ public class SDf11MapStore extends TemplateMapStore<SDf11> {
@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<SDf11> {
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<SDf11> {
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;
}

View file

@ -5,6 +5,7 @@ import org.springframework.stereotype.Component;
import ru.clearing.classes.statics.data.misc.Session;
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;
@ -46,9 +47,9 @@ public class SessionMapStore extends TemplateMapStore<Session> {
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;

View file

@ -29,7 +29,7 @@ public class UserRoleSessionMapStore extends TemplateMapStore<UserRoleSession> {
@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<UserRoleSession> {
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;
}

View file

@ -9,10 +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.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.*;
@ -54,18 +55,22 @@ 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_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));
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));
@ -75,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));
@ -84,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));
@ -97,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));
@ -118,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("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_Notification, Notification.class));
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_OutDocumentJournal, OutDocumentJournal.class,
new SettingOperation("setAmount", new Class[]{BigDecimal.class}, new Object[]{new BigDecimal("23.22")})));
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_ProfileDocument, ProfileDocument.class));
new SettingOperation("setAmount", new Class[]{BigDecimal.class}, new Object[]{new BigDecimal("28.28")})));
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));
@ -142,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));
}

View file

@ -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<Launcher> launcherMap;
@Autowired
public LauncherService(Consumer<String, Object> kafkaQueue, Producer<String, Object> 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<LauncherCommandRequest> 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());
}
}