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

This commit is contained in:
ialbert 2022-12-06 16:44:09 +03:00
commit b8a218b0c7
10 changed files with 2263 additions and 1379 deletions

View file

@ -55,7 +55,6 @@ public class BankAccountService extends QueueConsumer implements InitializingBea
bankAccount.setDestination(req.getDestination());
bankAccount.setTaxpayerIdentificationNumber(req.getTaxpayerIdentificationNumber());
bankAccount.setTaxRegistrationReasonCode(req.getTaxRegistrationReasonCode());
bankAccount.setAccount(req.getAccount());
bankAccountMap.insert(bankAccount);
log.debug("successfully processed, new id {}", bankAccount.getId());
@ -73,7 +72,6 @@ public class BankAccountService extends QueueConsumer implements InitializingBea
bankAccount.setDestination(req.getDestination());
bankAccount.setTaxpayerIdentificationNumber(req.getTaxpayerIdentificationNumber());
bankAccount.setTaxRegistrationReasonCode(req.getTaxRegistrationReasonCode());
bankAccount.setAccount(req.getAccount());
bankAccountMap.update(bankAccount);
log.debug("successfully update, existing bankAccount with id {}", bankAccount.getId());

View file

@ -104,7 +104,6 @@ public class BankAccountServiceTest {
predictableResult.setDestination("OOO ROGA I KOPITA");
predictableResult.setTaxpayerIdentificationNumber("848484848484");
predictableResult.setTaxRegistrationReasonCode("886886");
predictableResult.setAccount("123456789123");
predictableResult.setId(currentId);
//KAFKA
mockConsumer.schedulePollTask(() -> {
@ -208,7 +207,6 @@ public class BankAccountServiceTest {
predictableUpdateResult.setDestination("OOO NEW BUNK");
predictableUpdateResult.setTaxpayerIdentificationNumber("65468461321");
predictableUpdateResult.setTaxRegistrationReasonCode("532137");
predictableUpdateResult.setAccount("326984656514");
predictableUpdateResult.setId(currentId);
//KAFKA

View file

@ -39,9 +39,6 @@ public class BankAccountNewAction implements IAction<BankAccountNewRequest> {
@ApiModelProperty(value = "Код причины постановки (КПП)", example = "01")
@JsonProperty
private String taxRegistrationReasonCode;
@ApiModelProperty(value = "Номер счета", example = "11111222223333344444")
@JsonProperty
private String account;
@Override
public Collection<EnumMessage> validate() {
@ -67,9 +64,6 @@ public class BankAccountNewAction implements IAction<BankAccountNewRequest> {
if ("RUB".equalsIgnoreCase(this.currency) && !StringUtils.hasLength(taxRegistrationReasonCode)) {
return List.of(new EnumMessage(BackEndError.ValidationError, "taxRegistrationReasonCode"));
}
if (!StringUtils.hasLength(account)) {
return List.of(new EnumMessage(BackEndError.ValidationError, "account"));
}
return Collections.emptyList();
}
@ -85,7 +79,6 @@ public class BankAccountNewAction implements IAction<BankAccountNewRequest> {
req.setDestination(this.destination);
req.setTaxpayerIdentificationNumber(this.taxpayerIdentificationNumber);
req.setTaxRegistrationReasonCode(this.taxRegistrationReasonCode);
req.setAccount(this.account);
return req;
}
@ -158,12 +151,4 @@ public class BankAccountNewAction implements IAction<BankAccountNewRequest> {
public void setTaxRegistrationReasonCode(String taxRegistrationReasonCode) {
this.taxRegistrationReasonCode = taxRegistrationReasonCode;
}
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account;
}
}

View file

@ -20,18 +20,6 @@ public class BankAccountBackendGetAll extends BasicSpcexResponse {
@ApiModelProperty(value = "Полезная нагрузка")
private BankAccountBackendPayload payload = new BankAccountBackendPayload();
private static class BankAccountBackendPayload {
private List<BankAccountBackendGetFields> items = new ArrayList<>();
public List<BankAccountBackendGetFields> getItems() {
return items;
}
public void setItems(List<BankAccountBackendGetFields> items) {
this.items = items;
}
}
public BankAccountBackendPayload getPayload() {
return payload;
}
@ -57,9 +45,20 @@ public class BankAccountBackendGetAll extends BasicSpcexResponse {
singleItem.setSwiftCode(bankAccount.getSwiftCode());
singleItem.setTaxpayerIdentificationNumber(bankAccount.getTaxpayerIdentificationNumber());
singleItem.setTaxRegistrationReasonCode(bankAccount.getTaxRegistrationReasonCode());
singleItem.setAccount(bankAccount.getAccount());
payload.getItems().add(singleItem);
}
}
private static class BankAccountBackendPayload {
private List<BankAccountBackendGetFields> items = new ArrayList<>();
public List<BankAccountBackendGetFields> getItems() {
return items;
}
public void setItems(List<BankAccountBackendGetFields> items) {
this.items = items;
}
}
}

View file

@ -8,6 +8,7 @@ import ru.spcex.clearing.backendapi.controller.response.BasicSpcexResponse;
/**
* Банковские реквизиты для перечисления денежных средств
*
* @ApiModel(description = "Ответ в результате отправки операции в топик Kafka.")
* @ApiModelProperty(value = "Информация о принятом запросе")
**/
@ -42,7 +43,6 @@ public class BankAccountBackendGetById extends BasicSpcexResponse {
payload.setSwiftCode(bankAccount.getSwiftCode());
payload.setTaxpayerIdentificationNumber(bankAccount.getTaxpayerIdentificationNumber());
payload.setTaxRegistrationReasonCode(bankAccount.getTaxRegistrationReasonCode());
payload.setAccount(bankAccount.getAccount());
}
}

View file

@ -3,9 +3,6 @@ package ru.clearing.classes.statics.data.account;
import ru.clearing.classes.ConstSerializable;
import ru.spcex.platform.classes.base.SpcexObjectBase;
import ru.clearing.classes.ConstSerializable;
import ru.spcex.platform.classes.base.SpcexObjectBase;
/**
* Банковские реквизиты для перечисления денежных средств
* <p>
@ -26,7 +23,6 @@ public class BankAccount extends SpcexObjectBase {
private String swiftCode;
private String taxpayerIdentificationNumber;
private String taxRegistrationReasonCode;
private String account;
public Long getAccountId() {
return accountId;
@ -123,13 +119,4 @@ public class BankAccount extends SpcexObjectBase {
public void setTaxRegistrationReasonCode(String value) {
this.taxRegistrationReasonCode = value;
}
public String getAccount() {
return account;
}
public void setAccount(String value) {
this.account = value;
}
}

View file

@ -28,7 +28,7 @@ public class BankAccountHistoryMapStore extends TemplateEventMapStore<BankAccoun
@Override
public String[] getFields() {
return new String[]{"ID", "EVENT_TIME", "EVENT_USER_ID",
"BANK_ACCOUNT_ID", "ACCOUNT_ID", "BANK_IDENTIFICATION_CODE", "BANK_NAME", "CORRESPONDENT_ACCOUNT", "CORRESPONDENT_ACCOUNT_NAME", "CURRENCY", "DESTINATION", "IBAN", "INTERNATIONAL_TRANSFER_SIGN", "SWIFT_CODE", "TAXPAYER_IDENTIFICATION_NUMBER", "TAX_REGISTRATION_REASON_CODE", "ACCOUNT"
"BANK_ACCOUNT_ID", "ACCOUNT_ID", "BANK_IDENTIFICATION_CODE", "BANK_NAME", "CORRESPONDENT_ACCOUNT", "CORRESPONDENT_ACCOUNT_NAME", "CURRENCY", "DESTINATION", "IBAN", "INTERNATIONAL_TRANSFER_SIGN", "SWIFT_CODE", "TAXPAYER_IDENTIFICATION_NUMBER", "TAX_REGISTRATION_REASON_CODE"
};
}
@ -53,7 +53,6 @@ public class BankAccountHistoryMapStore extends TemplateEventMapStore<BankAccoun
object.getSwiftCode(),
object.getTaxpayerIdentificationNumber(),
object.getTaxRegistrationReasonCode(),
object.getAccount()
};
return args;
}

View file

@ -29,7 +29,7 @@ public class BankAccountMapStore extends TemplateMapStore<BankAccount> {
@Override
public String[] getFields() {
return new String[]{
"ID", "ACCOUNT_ID", "BANK_IDENTIFICATION_CODE", "BANK_NAME", "CORRESPONDENT_ACCOUNT", "CORRESPONDENT_ACCOUNT_NAME", "CURRENCY", "DESTINATION", "IBAN", "INTERNATIONAL_TRANSFER_SIGN", "SWIFT_CODE", "TAXPAYER_IDENTIFICATION_NUMBER", "TAX_REGISTRATION_REASON_CODE", "ACCOUNT"
"ID", "ACCOUNT_ID", "BANK_IDENTIFICATION_CODE", "BANK_NAME", "CORRESPONDENT_ACCOUNT", "CORRESPONDENT_ACCOUNT_NAME", "CURRENCY", "DESTINATION", "IBAN", "INTERNATIONAL_TRANSFER_SIGN", "SWIFT_CODE", "TAXPAYER_IDENTIFICATION_NUMBER", "TAX_REGISTRATION_REASON_CODE"
};
}
@ -49,7 +49,6 @@ public class BankAccountMapStore extends TemplateMapStore<BankAccount> {
object.setSwiftCode(resultSet.getObject("SWIFT_CODE", String.class));
object.setTaxpayerIdentificationNumber(resultSet.getObject("TAXPAYER_IDENTIFICATION_NUMBER", String.class));
object.setTaxRegistrationReasonCode(resultSet.getObject("TAX_REGISTRATION_REASON_CODE", String.class));
object.setAccount(resultSet.getObject("ACCOUNT", String.class));
return object;
}
@ -69,7 +68,6 @@ public class BankAccountMapStore extends TemplateMapStore<BankAccount> {
object.getSwiftCode(),
object.getTaxpayerIdentificationNumber(),
object.getTaxRegistrationReasonCode(),
object.getAccount()
};
return args;
}

View file

@ -7,6 +7,7 @@ import org.apache.commons.lang3.exception.ExceptionUtils;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -16,12 +17,16 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.SqlTypeValue;
import org.springframework.jdbc.core.StatementCreatorUtils;
import org.springframework.lang.NonNull;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import ru.clearing.classes.statics.data.company.Company;
import ru.clearing.classes.statics.data.company.CompanyHistory;
import ru.clearing.classes.statics.data.profile.CompanyInfo;
import ru.clearing.platform.dictionary.AbstractDictionary;
import ru.clearing.platform.dictionary.CompanySymbolDictionary;
import ru.spcex.clearing.imdg.base.*;
import ru.spcex.clearing.imdg.config.DbTestConnectionConfig;
import ru.spcex.clearing.imdg.config.TestConfiguration;
import ru.spcex.clearing.imdg.structure.BusinessObjectAndBusinessEventForCheckMapStore;
import ru.spcex.clearing.imdg.structure.DictionaryObjectForCheckMapStore;
@ -42,11 +47,11 @@ import static ru.spcex.clearing.imdg.structure.RunnableMapNamesForTesting.busine
import static ru.spcex.clearing.imdg.structure.RunnableMapNamesForTesting.dictionaryObjectForCheckMapStores;
import static ru.spcex.clearing.imdg.utils.DbDataUtils.generatingRandomString;
//@ContextConfiguration(classes = {
// TestConfiguration.class,
// DbTestConnectionConfig.class})
//@ExtendWith(SpringExtension.class)
//@TestPropertySource(properties = "spring.config.location=D:/repo/mfd/clearing/clearing-parent/imdg/src/main/resources")
@ContextConfiguration(classes = {
TestConfiguration.class,
DbTestConnectionConfig.class})
@ExtendWith(SpringExtension.class)
@TestPropertySource(properties = "spring.config.location=D:/repo/mfd/clearing/clearing-parent/imdg/src/main/resources")
public class AllMapStoreTest {
private static final Long ID = 1000000L;
private final Logger log = LoggerFactory.getLogger(this.getClass());
@ -106,7 +111,7 @@ public class AllMapStoreTest {
}
}
// @Test
// @Test
public void checkAllMapStoreCreatedTest() throws SQLException {
Assumptions.assumeTrue(false, "todo удалить если будет не нужна, пока не работает из-за не все mapStore готовы");
//Поиск таблиц которым нужно добавить mapStore и вывод результата в консоль
@ -116,7 +121,7 @@ public class AllMapStoreTest {
ResultSet rs = md.getTables(null, "clearing_tester", "%", new String[]{"TABLE"});
while (rs.next()) {
String tableName = rs.getString("TABLE_NAME");
//сущности для company_info и company_info_history включены соответсвенно в company и company_history
//сущности для company_info и company_info_history включены соответственно в company и company_history
if (tableName.equals("company_info") || tableName.equals("company_info_history")) {
continue;
}
@ -152,7 +157,7 @@ public class AllMapStoreTest {
Assertions.assertEquals(0, nameTables.size());
}
// @Test
@Test
public void checkSavingForAllMapStoreTest() {
saveBusinessObjectAndBusinessEventToMaps();
saveDictionaryObjectToMaps();

File diff suppressed because it is too large Load diff