Merge branch 'dev' into plan_balance_dmx_dmt
This commit is contained in:
commit
96b5e90ebf
22 changed files with 200 additions and 359 deletions
|
|
@ -13,6 +13,10 @@ public class NotificationUpdateAction implements IAction<NotificationUpdateReque
|
||||||
@ApiModelProperty(value = "Наименование статуса сообщения", example = "ACTV")
|
@ApiModelProperty(value = "Наименование статуса сообщения", example = "ACTV")
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
public String notificationStatus;
|
public String notificationStatus;
|
||||||
|
@ApiModelProperty(value = "Наименование отправителя (не исопльзуется)", example = "1234")
|
||||||
|
@JsonProperty(required = false)
|
||||||
|
@Deprecated
|
||||||
|
public Long senderId;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NotificationUpdateRequest toRequest() {
|
public NotificationUpdateRequest toRequest() {
|
||||||
|
|
@ -43,4 +47,12 @@ public class NotificationUpdateAction implements IAction<NotificationUpdateReque
|
||||||
public void setNotificationStatus(String notificationStatus) {
|
public void setNotificationStatus(String notificationStatus) {
|
||||||
this.notificationStatus = notificationStatus;
|
this.notificationStatus = notificationStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getSenderId() {
|
||||||
|
return senderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSenderId(Long senderId) {
|
||||||
|
this.senderId = senderId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -466,7 +466,7 @@
|
||||||
<errorCode id="5423" code="CLRN" name="Новые сделки отсутствуют."/>
|
<errorCode id="5423" code="CLRN" name="Новые сделки отсутствуют."/>
|
||||||
<errorCode id="5424" code="CLRN" name="Идентифицированные средства по возврату депозита превышают обязательства"/>
|
<errorCode id="5424" code="CLRN" name="Идентифицированные средства по возврату депозита превышают обязательства"/>
|
||||||
<errorCode id="5425" code="CLRN" name="Запрещена идентификация средства по рассчитанным обязательствам."/>
|
<errorCode id="5425" code="CLRN" name="Запрещена идентификация средства по рассчитанным обязательствам."/>
|
||||||
<errorCode id="5426" code="CLRN" name="Режим списаний и зачислений отключен в настройках модуля."/>
|
<errorCode id="5426" code="CLRN" name="Дата оплаты вклада депозита меньше новой даты возврата."/>
|
||||||
<errorCode id="5427" code="CLRN" name="Найдено больше одной записи %s."/>
|
<errorCode id="5427" code="CLRN" name="Найдено больше одной записи %s."/>
|
||||||
<errorCode id="5428" code="CLRN" name="Активная клиринговая сессия уже существует."/>
|
<errorCode id="5428" code="CLRN" name="Активная клиринговая сессия уже существует."/>
|
||||||
<errorCode id="5429" code="CLRN" name="ДФ57 Счет %s не соответствует компании %s"/>
|
<errorCode id="5429" code="CLRN" name="ДФ57 Счет %s не соответствует компании %s"/>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
"version": "3.8.0.55",
|
"version": "3.8.0.57",
|
||||||
|
|
||||||
"enums": {
|
"enums": {
|
||||||
|
|
||||||
|
|
@ -6961,11 +6961,11 @@
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{"code": "updatedAt",
|
{"code": "updatedAt",
|
||||||
"field": "updated","type": 4,"webtype": "5","dbname": "Дата-время изменения записи","name": "Время прочтения записи","shortname": "Прочитано","searchable": true,"sortable": true
|
"field": "updated","type": 4,"webtype": "5","dbname": "Дата-время изменения записи","name": "Время изменения записи","shortname": "Изменено","searchable": true,"sortable": true
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{"code": "senderId",
|
{"code": "senderId",
|
||||||
"type": 1,"dbname": "Идентификатор компании-отправителя","name": "Наименование компании-отправителя","shortname": "Отправитель","searchable": true,"sortable": true,"link": "company","ignore": true
|
"type": 1,"dbname": "Идентификатор отправителя","name": "Наименование отправителя","shortname": "Отправитель","searchable": true,"sortable": true,"visible": true,"link": "userCls","linkCode": "identifier"
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{"code": "addresseeId",
|
{"code": "addresseeId",
|
||||||
|
|
@ -6981,7 +6981,7 @@
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{"code": "notificationStatus",
|
{"code": "notificationStatus",
|
||||||
"type": 12,"dbname": "Код статуса сообщения","name": "Наименование статуса сообщения","shortname": "Статус","searchable": true,"sortable": true,"visible": true,"link": "notificationStatus","ignore": true
|
"type": 12,"dbname": "Код статуса сообщения","name": "Наименование статуса сообщения","shortname": "Статус","searchable": true,"sortable": true,"visible": true,"link": "notificationStatus"
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{"code": "comment",
|
{"code": "comment",
|
||||||
|
|
@ -6997,6 +6997,8 @@
|
||||||
|
|
||||||
"name": "Изменение статуса сообщения",
|
"name": "Изменение статуса сообщения",
|
||||||
|
|
||||||
|
"class": "ru.spcex.clearing.backendapi.controller.request.cud.registry.NotificationUpdateAction",
|
||||||
|
|
||||||
"fields": [
|
"fields": [
|
||||||
{"code": "id",
|
{"code": "id",
|
||||||
"type": 1,"name": "Идентификатор записи","shortname": "ID","link": "notification","linkCode": "id","required": true
|
"type": 1,"name": "Идентификатор записи","shortname": "ID","link": "notification","linkCode": "id","required": true
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!--?xml-stylesheet type="text/xsl" href="\..\corp-reports\src\data\meta\meta.server.xslt"?-->
|
<!--?xml-stylesheet type="text/xsl" href="\..\corp-reports\src\data\meta\meta.server.xslt"?-->
|
||||||
<meta version="3.8.0.55">
|
<meta version="3.8.0.57">
|
||||||
<!-- _xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" _xsi:noNamespaceSchemaLocation="file:///E:/d/projects/meta/from/meta.xsd" -->
|
<!-- _xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" _xsi:noNamespaceSchemaLocation="file:///E:/d/projects/meta/from/meta.xsd" -->
|
||||||
<!--Здесь словари-->
|
<!--Здесь словари-->
|
||||||
<enums>
|
<enums>
|
||||||
|
|
@ -1610,16 +1610,16 @@
|
||||||
<id type="1" name="Идентификатор записи" shortname="ID" searchable="true" sortable="true"/>
|
<id type="1" name="Идентификатор записи" shortname="ID" searchable="true" sortable="true"/>
|
||||||
<clearingDate type="6" name="Дата" shortname="Дата" searchable="true" sortable="true" visible="true"/>
|
<clearingDate type="6" name="Дата" shortname="Дата" searchable="true" sortable="true" visible="true"/>
|
||||||
<createdAt field="created" type="4" webtype="5" dbname="Дата-время создания записи" name="Время создания записи" shortname="Создано" searchable="true" sortable="true" visible="true"/>
|
<createdAt field="created" type="4" webtype="5" dbname="Дата-время создания записи" name="Время создания записи" shortname="Создано" searchable="true" sortable="true" visible="true"/>
|
||||||
<updatedAt field="updated" type="4" webtype="5" dbname="Дата-время изменения записи" name="Время прочтения записи" shortname="Прочитано" searchable="true" sortable="true"/>
|
<updatedAt field="updated" type="4" webtype="5" dbname="Дата-время изменения записи" name="Время изменения записи" shortname="Изменено" searchable="true" sortable="true"/>
|
||||||
<senderId type="1" dbname="Идентификатор компании-отправителя" name="Наименование компании-отправителя" shortname="Отправитель" searchable="true" sortable="true" link="company" ignore="true"/>
|
<senderId type="1" dbname="Идентификатор отправителя" name="Наименование отправителя" shortname="Отправитель" searchable="true" sortable="true" visible="true" link="userCls" linkCode="identifier"/>
|
||||||
<addresseeId type="1" dbname="Идентификатор компании-получателя" name="Наименование компании-получателя" shortname="Получатель" searchable="true" sortable="true" link="company" ignore="true"/>
|
<addresseeId type="1" dbname="Идентификатор компании-получателя" name="Наименование компании-получателя" shortname="Получатель" searchable="true" sortable="true" link="company" ignore="true"/>
|
||||||
<objectType type="12" dbname="Код типа объекта" name="Наименование типа объекта" shortname="Объект" searchable="true" sortable="true" link="objectType" ignore="true"/>
|
<objectType type="12" dbname="Код типа объекта" name="Наименование типа объекта" shortname="Объект" searchable="true" sortable="true" link="objectType" ignore="true"/>
|
||||||
<objectId type="1" name="Идентификатор объекта" shortname="ID объекта" searchable="true" sortable="true" ignore="true"/>
|
<objectId type="1" name="Идентификатор объекта" shortname="ID объекта" searchable="true" sortable="true" ignore="true"/>
|
||||||
<notificationStatus type="12" dbname="Код статуса сообщения" name="Наименование статуса сообщения" shortname="Статус" searchable="true" sortable="true" visible="true" link="notificationStatus" ignore="true"/>
|
<notificationStatus type="12" dbname="Код статуса сообщения" name="Наименование статуса сообщения" shortname="Статус" searchable="true" sortable="true" visible="true" link="notificationStatus"/>
|
||||||
<comment type="2" length="255" name="Текст сообщения" shortname="Сообщение" searchable="true" sortable="true" visible="true"/>
|
<comment type="2" length="255" name="Текст сообщения" shortname="Сообщение" searchable="true" sortable="true" visible="true"/>
|
||||||
<priority type="12" dbname="Код приоритета отображения" name="Наименование приоритета отображения" shortname="Приоритет отображения" searchable="true" sortable="true" link="priority"/>
|
<priority type="12" dbname="Код приоритета отображения" name="Наименование приоритета отображения" shortname="Приоритет отображения" searchable="true" sortable="true" link="priority"/>
|
||||||
<actions>
|
<actions>
|
||||||
<put name="Изменение статуса сообщения">
|
<put name="Изменение статуса сообщения" class="ru.spcex.clearing.backendapi.controller.request.cud.registry.NotificationUpdateAction">
|
||||||
<id type="1" name="Идентификатор записи" shortname="ID" link="notification" linkCode="id" required="true"/>
|
<id type="1" name="Идентификатор записи" shortname="ID" link="notification" linkCode="id" required="true"/>
|
||||||
<notificationStatus type="12" name="Наименование статуса сообщения" shortname="Статус" link="notificationStatus" required="true"/>
|
<notificationStatus type="12" name="Наименование статуса сообщения" shortname="Статус" link="notificationStatus" required="true"/>
|
||||||
</put>
|
</put>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
"version": "3.8.0.55",
|
"version": "3.8.0.57",
|
||||||
|
|
||||||
"enums": {
|
"enums": {
|
||||||
|
|
||||||
|
|
@ -6961,11 +6961,11 @@
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{"code": "updatedAt",
|
{"code": "updatedAt",
|
||||||
"field": "updated","type": 4,"webtype": "5","dbname": "Дата-время изменения записи","name": "Время прочтения записи","shortname": "Прочитано","searchable": true,"sortable": true
|
"field": "updated","type": 4,"webtype": "5","dbname": "Дата-время изменения записи","name": "Время изменения записи","shortname": "Изменено","searchable": true,"sortable": true
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{"code": "senderId",
|
{"code": "senderId",
|
||||||
"type": 1,"dbname": "Идентификатор компании-отправителя","name": "Наименование компании-отправителя","shortname": "Отправитель","searchable": true,"sortable": true,"link": "company","ignore": true
|
"type": 1,"dbname": "Идентификатор отправителя","name": "Наименование отправителя","shortname": "Отправитель","searchable": true,"sortable": true,"visible": true,"link": "userCls","linkCode": "identifier"
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{"code": "addresseeId",
|
{"code": "addresseeId",
|
||||||
|
|
@ -6981,7 +6981,7 @@
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{"code": "notificationStatus",
|
{"code": "notificationStatus",
|
||||||
"type": 12,"dbname": "Код статуса сообщения","name": "Наименование статуса сообщения","shortname": "Статус","searchable": true,"sortable": true,"visible": true,"link": "notificationStatus","ignore": true
|
"type": 12,"dbname": "Код статуса сообщения","name": "Наименование статуса сообщения","shortname": "Статус","searchable": true,"sortable": true,"visible": true,"link": "notificationStatus"
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{"code": "comment",
|
{"code": "comment",
|
||||||
|
|
@ -6997,6 +6997,8 @@
|
||||||
|
|
||||||
"name": "Изменение статуса сообщения",
|
"name": "Изменение статуса сообщения",
|
||||||
|
|
||||||
|
"class": "ru.spcex.clearing.backendapi.controller.request.cud.registry.NotificationUpdateAction",
|
||||||
|
|
||||||
"fields": [
|
"fields": [
|
||||||
{"code": "id",
|
{"code": "id",
|
||||||
"type": 1,"name": "Идентификатор записи","shortname": "ID","link": "notification","linkCode": "id","required": true
|
"type": 1,"name": "Идентификатор записи","shortname": "ID","link": "notification","linkCode": "id","required": true
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ public enum ClearingError implements IErrorEnumId {
|
||||||
NewDealsNotFound(5423L),
|
NewDealsNotFound(5423L),
|
||||||
IdentifiedFundsExceedObligations(5424L),
|
IdentifiedFundsExceedObligations(5424L),
|
||||||
ObligationsAlreadyCalculated(5425L),
|
ObligationsAlreadyCalculated(5425L),
|
||||||
|
RefundDtLessThatValueDt(5426L),
|
||||||
ActiveSessionIsPresent(5428L),
|
ActiveSessionIsPresent(5428L),
|
||||||
AccountIsNotMatchedWithCompany(5429L),
|
AccountIsNotMatchedWithCompany(5429L),
|
||||||
RgsWrongCode(5430L),
|
RgsWrongCode(5430L),
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ public enum RefundDateValidationRule implements IValidationRule<ImdgValidationCo
|
||||||
}
|
}
|
||||||
for (Registry rgs : rgss) {
|
for (Registry rgs : rgss) {
|
||||||
if (!validatedObject.getRefundDate().isAfter(rgs.getValueDate())) { // если request.RefundDate <= ValueDate - то ошибка
|
if (!validatedObject.getRefundDate().isAfter(rgs.getValueDate())) { // если request.RefundDate <= ValueDate - то ошибка
|
||||||
return of(ClearingError.WrongField, "refundDate");
|
return of(ClearingError.RefundDtLessThatValueDt, "refundDate");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
context.storeObject(ValidationStored.RefundDateChangeRegistries, rgss);
|
context.storeObject(ValidationStored.RefundDateChangeRegistries, rgss);
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,7 @@ public class IntermediateMkrSession extends AbstractSession implements Initializ
|
||||||
inspectionObligations.setSessionType(sessionType());
|
inspectionObligations.setSessionType(sessionType());
|
||||||
inspectionObligations.setSection(section());
|
inspectionObligations.setSection(section());
|
||||||
formingPaymentInstructionDeals.setSection(section());
|
formingPaymentInstructionDeals.setSection(section());
|
||||||
|
formingPaymentInstructionDeals.setSessionType(sessionType());
|
||||||
imdgProvider.waitAvailable();
|
imdgProvider.waitAvailable();
|
||||||
initSessionIfPresent();
|
initSessionIfPresent();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ public class FormingPaymentInstructionAssets implements ISessionStage {
|
||||||
|
|
||||||
private StageResult<?> formingPaymentInstructions(FormingPaymentInstructionPayload payload) {
|
private StageResult<?> formingPaymentInstructions(FormingPaymentInstructionPayload payload) {
|
||||||
Long sessionId = payload.getSessionId();
|
Long sessionId = payload.getSessionId();
|
||||||
if (SessionType.FINL.equals(sessionType)) {
|
if (SessionType.FINL.equals(sessionType) || SessionType.MEDM.equals(sessionType)) {
|
||||||
dmvSrv.createDmv(sessionId);
|
dmvSrv.createDmv(sessionId);
|
||||||
}
|
}
|
||||||
Collection<Registry> AMBregistries = selectAMBRegistries(sessionId);
|
Collection<Registry> AMBregistries = selectAMBRegistries(sessionId);
|
||||||
|
|
|
||||||
|
|
@ -902,7 +902,7 @@ INSERT INTO ERROR_CODE_DICTIONARY(ID, CODE, NAME) values (5424, 'CLRN', 'Иде
|
||||||
|
|
||||||
INSERT INTO ERROR_CODE_DICTIONARY(ID, CODE, NAME) values (5425, 'CLRN', 'Запрещена идентификация средства по рассчитанным обязательствам.') ON CONFLICT (ID) DO UPDATE SET CODE = EXCLUDED.CODE, NAME = EXCLUDED.NAME;
|
INSERT INTO ERROR_CODE_DICTIONARY(ID, CODE, NAME) values (5425, 'CLRN', 'Запрещена идентификация средства по рассчитанным обязательствам.') ON CONFLICT (ID) DO UPDATE SET CODE = EXCLUDED.CODE, NAME = EXCLUDED.NAME;
|
||||||
|
|
||||||
INSERT INTO ERROR_CODE_DICTIONARY(ID, CODE, NAME) values (5426, 'CLRN', 'Режим списаний и зачислений отключен в настройках модуля.') ON CONFLICT (ID) DO UPDATE SET CODE = EXCLUDED.CODE, NAME = EXCLUDED.NAME;
|
INSERT INTO ERROR_CODE_DICTIONARY(ID, CODE, NAME) values (5426, 'CLRN', 'Дата оплаты вклада депозита меньше новой даты возврата.') ON CONFLICT (ID) DO UPDATE SET CODE = EXCLUDED.CODE, NAME = EXCLUDED.NAME;
|
||||||
|
|
||||||
INSERT INTO ERROR_CODE_DICTIONARY(ID, CODE, NAME) values (5427, 'CLRN', 'Найдено больше одной записи %s.') ON CONFLICT (ID) DO UPDATE SET CODE = EXCLUDED.CODE, NAME = EXCLUDED.NAME;
|
INSERT INTO ERROR_CODE_DICTIONARY(ID, CODE, NAME) values (5427, 'CLRN', 'Найдено больше одной записи %s.') ON CONFLICT (ID) DO UPDATE SET CODE = EXCLUDED.CODE, NAME = EXCLUDED.NAME;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,12 +53,14 @@ public class Journal extends Stage implements InitializingBean {
|
||||||
|
|
||||||
//удалим временный файл
|
//удалим временный файл
|
||||||
File dbfFile = resultContainer.getFileForExport();
|
File dbfFile = resultContainer.getFileForExport();
|
||||||
try {
|
// try {
|
||||||
log.debug("Uuid {}, delete tem file \"{}\"", resultContainer.getUuid(), dbfFile);
|
// log.debug("Uuid {}, delete temp file \"{}\"", resultContainer.getUuid(), dbfFile);
|
||||||
Files.deleteIfExists(dbfFile.toPath());
|
// Files.deleteIfExists(dbfFile.toPath());
|
||||||
} catch (IOException e) {
|
// } catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
// throw new RuntimeException(e);
|
||||||
}
|
// }
|
||||||
|
// Надо сохранять для разбора истории и отладки по логам
|
||||||
|
log.debug("Uuid {}, save temp file \"{}\"", resultContainer.getUuid(), dbfFile);
|
||||||
return StageResult.COMPLETE;
|
return StageResult.COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import ru.spcex.platform.enumeration.RegistryStatus;
|
||||||
import ru.spcex.platform.enumeration.RegistryUnit;
|
import ru.spcex.platform.enumeration.RegistryUnit;
|
||||||
import ru.spcex.platform.imdg.api.Imdg;
|
import ru.spcex.platform.imdg.api.Imdg;
|
||||||
import ru.spcex.platform.imdg.api.ImdgProvider;
|
import ru.spcex.platform.imdg.api.ImdgProvider;
|
||||||
|
import ru.spcex.platform.imdg.api.predicate.specific.SecuritySelector;
|
||||||
import ru.spcex.platform.utils.enumeration.EnumMessage;
|
import ru.spcex.platform.utils.enumeration.EnumMessage;
|
||||||
import ru.spcex.platform.utils.validation.IValidator;
|
import ru.spcex.platform.utils.validation.IValidator;
|
||||||
|
|
||||||
|
|
@ -42,7 +43,7 @@ public class AdmittedLiabilitiesRegisterService extends QueueConsumer implements
|
||||||
private final Imdg<AdmittedLiabilitiesRegister> admittedLiabilitiesRegisterMap;
|
private final Imdg<AdmittedLiabilitiesRegister> admittedLiabilitiesRegisterMap;
|
||||||
private final Imdg<Registry> registryMap;
|
private final Imdg<Registry> registryMap;
|
||||||
private final Imdg<Company> companyMap;
|
private final Imdg<Company> companyMap;
|
||||||
private final Imdg<Security> securityMap;
|
private final SecuritySelector<Security> securitySelector;
|
||||||
private final Function<Map<String, ?>, IValidator> fieldValuesValidator;
|
private final Function<Map<String, ?>, IValidator> fieldValuesValidator;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
@ -54,7 +55,7 @@ public class AdmittedLiabilitiesRegisterService extends QueueConsumer implements
|
||||||
this.admittedLiabilitiesRegisterMap = imdgProvider.getImdg(IMDGDistributedNames.Map_AdmittedLiabilitiesRegister, AdmittedLiabilitiesRegister.class);
|
this.admittedLiabilitiesRegisterMap = imdgProvider.getImdg(IMDGDistributedNames.Map_AdmittedLiabilitiesRegister, AdmittedLiabilitiesRegister.class);
|
||||||
this.registryMap = imdgProvider.getImdg(IMDGDistributedNames.Map_Registry, Registry.class);
|
this.registryMap = imdgProvider.getImdg(IMDGDistributedNames.Map_Registry, Registry.class);
|
||||||
this.companyMap = imdgProvider.getImdg(IMDGDistributedNames.Map_Company, Company.class);
|
this.companyMap = imdgProvider.getImdg(IMDGDistributedNames.Map_Company, Company.class);
|
||||||
this.securityMap = imdgProvider.getImdg(IMDGDistributedNames.Map_Security, Security.class);
|
this.securitySelector = new SecuritySelector<>(imdgProvider, Security.class);
|
||||||
this.fieldValuesValidator = fieldValuesValidator;
|
this.fieldValuesValidator = fieldValuesValidator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -90,13 +91,12 @@ public class AdmittedLiabilitiesRegisterService extends QueueConsumer implements
|
||||||
log.trace("Started generating AdmittedLiabilitiesRegister entity...");
|
log.trace("Started generating AdmittedLiabilitiesRegister entity...");
|
||||||
AdmittedLiabilitiesRegister admittedLiabilitiesRegister = new AdmittedLiabilitiesRegister();
|
AdmittedLiabilitiesRegister admittedLiabilitiesRegister = new AdmittedLiabilitiesRegister();
|
||||||
Company company = companyMap.getFirstObjectByFieldValues(Map.of("id", 1L));
|
Company company = companyMap.getFirstObjectByFieldValues(Map.of("id", 1L));
|
||||||
Security security = securityMap.getFirstObjectByFieldValues(Map.of("id", registry.getSecurityId()));
|
Security security = securitySelector.selectSecurityById(registry.getSecurityId());
|
||||||
String securitySymbol = security != null ? security.getSecuritySymbol() : null;
|
String securityFullName = security != null ? security.getFullName() : null;
|
||||||
String securityFullName = security != null ? security.getShortName() : null;
|
String companyFullName = company != null ? company.getFullName() : null;
|
||||||
String companyFullName = security != null ? company.getFullName() : null;
|
|
||||||
admittedLiabilitiesRegister.setCompanyFullName(companyFullName);
|
admittedLiabilitiesRegister.setCompanyFullName(companyFullName);
|
||||||
admittedLiabilitiesRegister.setSessionId(registry.getSessionId());
|
admittedLiabilitiesRegister.setSessionId(registry.getSessionId());
|
||||||
admittedLiabilitiesRegister.setSecuritySymbol(securitySymbol);
|
admittedLiabilitiesRegister.setSecuritySymbol(registry.getSecuritySymbol());
|
||||||
admittedLiabilitiesRegister.setSecurityFullName(securityFullName);
|
admittedLiabilitiesRegister.setSecurityFullName(securityFullName);
|
||||||
admittedLiabilitiesRegister.setCompanyId(registry.getCompanyId());
|
admittedLiabilitiesRegister.setCompanyId(registry.getCompanyId());
|
||||||
admittedLiabilitiesRegister.setClearingCode(registry.getClearingCode());
|
admittedLiabilitiesRegister.setClearingCode(registry.getClearingCode());
|
||||||
|
|
@ -113,7 +113,7 @@ public class AdmittedLiabilitiesRegisterService extends QueueConsumer implements
|
||||||
return String.format("registryDesignation = '%s' and " +
|
return String.format("registryDesignation = '%s' and " +
|
||||||
"registryInstrumentType in ('%s','%s') and " +
|
"registryInstrumentType in ('%s','%s') and " +
|
||||||
"registryUnit = '%s' and " +
|
"registryUnit = '%s' and " +
|
||||||
"registryStatus in ('%s','%s','%s','%s','%s')"
|
"registryStatus in ('%s','%s','%s','%s','%s', '%s')"
|
||||||
,
|
,
|
||||||
RegistryDesignation.O.getKey(),
|
RegistryDesignation.O.getKey(),
|
||||||
RegistryInstrumentType.S.getKey(),
|
RegistryInstrumentType.S.getKey(),
|
||||||
|
|
@ -123,19 +123,27 @@ public class AdmittedLiabilitiesRegisterService extends QueueConsumer implements
|
||||||
RegistryStatus.NACK.getKey(),
|
RegistryStatus.NACK.getKey(),
|
||||||
RegistryStatus.UNCV.getKey(),
|
RegistryStatus.UNCV.getKey(),
|
||||||
RegistryStatus.NACC.getKey(),
|
RegistryStatus.NACC.getKey(),
|
||||||
RegistryStatus.FAIL.getKey()
|
RegistryStatus.FAIL.getKey(),
|
||||||
|
RegistryStatus.CLRD.getKey()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<AdmittedLiabilitiesRegister> isDuplicateInMap(Registry entity) {
|
public Optional<AdmittedLiabilitiesRegister> isDuplicateInMap(Registry entity) {
|
||||||
Map<String, ? extends Comparable<?>> fieldValues = Map.of("companyId", entity.getCompanyId(), "sessionId", entity.getSessionId());
|
return Optional.empty();
|
||||||
Optional<EnumMessage> message = fieldValuesValidator.apply(fieldValues).tillFirstError();
|
// Map<String, ? extends Comparable<?>> fieldValues = Map.of(
|
||||||
if (message.isPresent()) {
|
// "companyId", entity.getRegistryCode(),
|
||||||
log.warn("Illegal value in map for request to imdg: {}", message.get());
|
// "sessionId", entity.getSessionId(),
|
||||||
throw new IllegalArgumentException(MessageFormat.format("Illegal value in request to imdg: {0}", message.get()));
|
// "securitySymbol", entity.getSecuritySymbol(),
|
||||||
}
|
// "clearingDate", entity.getClearingDate(),
|
||||||
return Optional.ofNullable(admittedLiabilitiesRegisterMap.getFirstObjectByFieldValues(fieldValues));
|
// "account", entity.getAccount()
|
||||||
|
// );
|
||||||
|
// Optional<EnumMessage> message = fieldValuesValidator.apply(fieldValues).tillFirstError();
|
||||||
|
// if (message.isPresent()) {
|
||||||
|
// log.warn("Illegal value in map for request to imdg: {}", message.get());
|
||||||
|
// throw new IllegalArgumentException(MessageFormat.format("Illegal value in request to imdg: {0}", message.get()));
|
||||||
|
// }
|
||||||
|
// return Optional.ofNullable(admittedLiabilitiesRegisterMap.getFirstObjectByFieldValues(fieldValues));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import ru.spcex.platform.enumeration.RegistryStatus;
|
||||||
import ru.spcex.platform.enumeration.RegistryUnit;
|
import ru.spcex.platform.enumeration.RegistryUnit;
|
||||||
import ru.spcex.platform.imdg.api.Imdg;
|
import ru.spcex.platform.imdg.api.Imdg;
|
||||||
import ru.spcex.platform.imdg.api.ImdgProvider;
|
import ru.spcex.platform.imdg.api.ImdgProvider;
|
||||||
|
import ru.spcex.platform.imdg.api.predicate.specific.SecuritySelector;
|
||||||
import ru.spcex.platform.utils.enumeration.EnumMessage;
|
import ru.spcex.platform.utils.enumeration.EnumMessage;
|
||||||
import ru.spcex.platform.utils.validation.IValidator;
|
import ru.spcex.platform.utils.validation.IValidator;
|
||||||
|
|
||||||
|
|
@ -42,7 +43,7 @@ public class CoveredLiabilitiesRegisterService extends QueueConsumer implements
|
||||||
private final Imdg<CoveredLiabilitiesRegister> coveredLiabilitiesRegisterMap;
|
private final Imdg<CoveredLiabilitiesRegister> coveredLiabilitiesRegisterMap;
|
||||||
private final Imdg<Registry> registryMap;
|
private final Imdg<Registry> registryMap;
|
||||||
private final Imdg<Company> companyMap;
|
private final Imdg<Company> companyMap;
|
||||||
private final Imdg<Security> securityMap;
|
private final SecuritySelector<Security> securitySelector;
|
||||||
private final Function<Map<String, ?>, IValidator> fieldValuesValidator;
|
private final Function<Map<String, ?>, IValidator> fieldValuesValidator;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
@ -54,7 +55,7 @@ public class CoveredLiabilitiesRegisterService extends QueueConsumer implements
|
||||||
this.coveredLiabilitiesRegisterMap = imdgProvider.getImdg(IMDGDistributedNames.Map_CoveredLiabilitiesRegister, CoveredLiabilitiesRegister.class);
|
this.coveredLiabilitiesRegisterMap = imdgProvider.getImdg(IMDGDistributedNames.Map_CoveredLiabilitiesRegister, CoveredLiabilitiesRegister.class);
|
||||||
this.registryMap = imdgProvider.getImdg(IMDGDistributedNames.Map_Registry, Registry.class);
|
this.registryMap = imdgProvider.getImdg(IMDGDistributedNames.Map_Registry, Registry.class);
|
||||||
this.companyMap = imdgProvider.getImdg(IMDGDistributedNames.Map_Company, Company.class);
|
this.companyMap = imdgProvider.getImdg(IMDGDistributedNames.Map_Company, Company.class);
|
||||||
this.securityMap = imdgProvider.getImdg(IMDGDistributedNames.Map_Security, Security.class);
|
this.securitySelector = new SecuritySelector<>(imdgProvider, Security.class);
|
||||||
this.fieldValuesValidator = fieldValuesValidator;
|
this.fieldValuesValidator = fieldValuesValidator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -91,13 +92,12 @@ public class CoveredLiabilitiesRegisterService extends QueueConsumer implements
|
||||||
log.trace("insert CoveredLiabilitiesRegister in map...");
|
log.trace("insert CoveredLiabilitiesRegister in map...");
|
||||||
CoveredLiabilitiesRegister coveredLiabilitiesRegister = new CoveredLiabilitiesRegister();
|
CoveredLiabilitiesRegister coveredLiabilitiesRegister = new CoveredLiabilitiesRegister();
|
||||||
Company company = companyMap.getFirstObjectByFieldValues(Map.of("id", 1L));
|
Company company = companyMap.getFirstObjectByFieldValues(Map.of("id", 1L));
|
||||||
Security security = securityMap.getFirstObjectByFieldValues(Map.of("id", registry.getSecurityId()));
|
Security security = securitySelector.selectSecurityById(registry.getSecurityId());
|
||||||
String securitySymbol = security != null ? security.getSecuritySymbol() : null;
|
String securityFullName = security != null ? security.getFullName() : null;
|
||||||
String securityFullName = security != null ? security.getShortName() : null;
|
String companyFullName = company != null ? company.getFullName() : null;
|
||||||
String companyFullName = security != null ? company.getFullName() : null;
|
|
||||||
coveredLiabilitiesRegister.setCompanyFullName(companyFullName);
|
coveredLiabilitiesRegister.setCompanyFullName(companyFullName);
|
||||||
coveredLiabilitiesRegister.setSessionId(registry.getSessionId());
|
coveredLiabilitiesRegister.setSessionId(registry.getSessionId());
|
||||||
coveredLiabilitiesRegister.setSecuritySymbol(securitySymbol);
|
coveredLiabilitiesRegister.setSecuritySymbol(registry.getSecuritySymbol());
|
||||||
coveredLiabilitiesRegister.setSecurityFullName(securityFullName);
|
coveredLiabilitiesRegister.setSecurityFullName(securityFullName);
|
||||||
coveredLiabilitiesRegister.setCompanyId(registry.getCompanyId());
|
coveredLiabilitiesRegister.setCompanyId(registry.getCompanyId());
|
||||||
coveredLiabilitiesRegister.setClearingCode(registry.getClearingCode());
|
coveredLiabilitiesRegister.setClearingCode(registry.getClearingCode());
|
||||||
|
|
@ -114,22 +114,25 @@ public class CoveredLiabilitiesRegisterService extends QueueConsumer implements
|
||||||
return String.format("registryDesignation = '%s' and " +
|
return String.format("registryDesignation = '%s' and " +
|
||||||
"registryInstrumentType in ('%s','%s') and " +
|
"registryInstrumentType in ('%s','%s') and " +
|
||||||
"registryUnit = '%s' and " +
|
"registryUnit = '%s' and " +
|
||||||
"registryStatus = '%s'",
|
"registryStatus in ('%s', '%s')",
|
||||||
RegistryDesignation.O.getKey(),
|
RegistryDesignation.O.getKey(),
|
||||||
RegistryInstrumentType.S.getKey(),
|
RegistryInstrumentType.S.getKey(),
|
||||||
RegistryInstrumentType.M.getKey(),
|
RegistryInstrumentType.M.getKey(),
|
||||||
RegistryUnit.T.getKey(),
|
RegistryUnit.T.getKey(),
|
||||||
RegistryStatus.OK.getKey());
|
RegistryStatus.OK.getKey(),
|
||||||
|
RegistryStatus.CLRD.getKey()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<CoveredLiabilitiesRegister> isDuplicateInMap(Registry entity) {
|
public Optional<CoveredLiabilitiesRegister> isDuplicateInMap(Registry entity) {
|
||||||
Map<String, ? extends Comparable<?>> fieldValues = Map.of("companyId", entity.getCompanyId(), "sessionId", entity.getSessionId());
|
return Optional.empty();
|
||||||
Optional<EnumMessage> message = fieldValuesValidator.apply(fieldValues).tillFirstError();
|
// Map<String, ? extends Comparable<?>> fieldValues = Map.of("companyId", entity.getCompanyId(), "sessionId", entity.getSessionId());
|
||||||
if (message.isPresent()) {
|
// Optional<EnumMessage> message = fieldValuesValidator.apply(fieldValues).tillFirstError();
|
||||||
log.warn("Illegal value in map for request to imdg: {}", message.get());
|
// if (message.isPresent()) {
|
||||||
throw new IllegalArgumentException(MessageFormat.format("Illegal value in request to imdg: {0}", message.get()));
|
// log.warn("Illegal value in map for request to imdg: {}", message.get());
|
||||||
}
|
// throw new IllegalArgumentException(MessageFormat.format("Illegal value in request to imdg: {0}", message.get()));
|
||||||
return Optional.ofNullable(coveredLiabilitiesRegisterMap.getFirstObjectByFieldValues(fieldValues));
|
// }
|
||||||
|
// return Optional.ofNullable(coveredLiabilitiesRegisterMap.getFirstObjectByFieldValues(fieldValues));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,10 +60,6 @@ public class DepoBalanceRegisterService extends QueueConsumer implements Initial
|
||||||
|
|
||||||
public void depoBalanceRegisterNew(BaseRequest<LauncherCommandRequest> userRequest) {
|
public void depoBalanceRegisterNew(BaseRequest<LauncherCommandRequest> userRequest) {
|
||||||
log.debug("LauncherCommandRequest received from {}", createRegistry_GRRT.topic());
|
log.debug("LauncherCommandRequest received from {}", createRegistry_GRRT.topic());
|
||||||
if (userRequest.getRequestPayload().getCompanyId() == null) {
|
|
||||||
log.debug("No companyId in LauncherCommandRequest.id={}", userRequest.getId());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ImdgPredicate prdctForRegistries = getPredicateForRegistries(userRequest.getRequestPayload().getCompanyId());
|
ImdgPredicate prdctForRegistries = getPredicateForRegistries(userRequest.getRequestPayload().getCompanyId());
|
||||||
Collection<Registry> registries = registryMap.getCollectionObjectsByPredicate(prdctForRegistries);
|
Collection<Registry> registries = registryMap.getCollectionObjectsByPredicate(prdctForRegistries);
|
||||||
log.trace("Started searching depoBalanceRegister in register by '{}'", prdctForRegistries);
|
log.trace("Started searching depoBalanceRegister in register by '{}'", prdctForRegistries);
|
||||||
|
|
@ -84,14 +80,12 @@ public class DepoBalanceRegisterService extends QueueConsumer implements Initial
|
||||||
log.trace("Started generating DepoBalanceRegister entity...");
|
log.trace("Started generating DepoBalanceRegister entity...");
|
||||||
DepoBalanceRegister depoBalanceRegister = new DepoBalanceRegister();
|
DepoBalanceRegister depoBalanceRegister = new DepoBalanceRegister();
|
||||||
depoBalanceRegister.setUpdated(Instant.now());
|
depoBalanceRegister.setUpdated(Instant.now());
|
||||||
depoBalanceRegister.setCreated(Instant.now());
|
depoBalanceRegister.setCreated(depoBalanceRegister.getUpdated());
|
||||||
depoBalanceRegister.setCompanyId(registry.getCompanyId());
|
depoBalanceRegister.setCompanyId(registry.getCompanyId());
|
||||||
depoBalanceRegister.setSessionId(registry.getSessionId());
|
depoBalanceRegister.setSessionId(registry.getSessionId());
|
||||||
depoBalanceRegister.setDepoCode(registry.getAccountType());
|
depoBalanceRegister.setDepoCode(registry.getAccountType());
|
||||||
depoBalanceRegister.setQuantity(registry.getCloseBalance());
|
depoBalanceRegister.setQuantity(registry.getCloseBalance());
|
||||||
depoBalanceRegister.setSecuritySymbol(registry.getSecuritySymbol());
|
depoBalanceRegister.setSecuritySymbol(registry.getSecuritySymbol());
|
||||||
depoBalanceRegister.setCreated(Instant.now());
|
|
||||||
depoBalanceRegister.setUpdated(Instant.now());
|
|
||||||
depoBalanceRegisterMap.insert(depoBalanceRegister);
|
depoBalanceRegisterMap.insert(depoBalanceRegister);
|
||||||
log.debug("inserted successfully DepoBalanceRegister entity with id: {}", depoBalanceRegister.getId());
|
log.debug("inserted successfully DepoBalanceRegister entity with id: {}", depoBalanceRegister.getId());
|
||||||
}
|
}
|
||||||
|
|
@ -99,20 +93,24 @@ public class DepoBalanceRegisterService extends QueueConsumer implements Initial
|
||||||
private ImdgPredicate getPredicateForRegistries(Long companyId) {
|
private ImdgPredicate getPredicateForRegistries(Long companyId) {
|
||||||
ImdgPredicateBuilder pb = registryMap.predicateBuilder();
|
ImdgPredicateBuilder pb = registryMap.predicateBuilder();
|
||||||
RegistryCodeSqlBuilder codeSql = RegistryCodeSqlBuilder.getInstance(RegistryTradingParams.AS_T);
|
RegistryCodeSqlBuilder codeSql = RegistryCodeSqlBuilder.getInstance(RegistryTradingParams.AS_T);
|
||||||
return pb.and(
|
if (companyId == null) // default use case
|
||||||
pb.equals("companyId", companyId),
|
return pb.sql(codeSql.build());
|
||||||
pb.sql(codeSql.build())
|
else
|
||||||
);
|
return pb.and(
|
||||||
|
pb.equals("companyId", companyId),
|
||||||
|
pb.sql(codeSql.build())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<DepoBalanceRegister> isDuplicateInMap(Registry entity) {
|
public Optional<DepoBalanceRegister> isDuplicateInMap(Registry entity) {
|
||||||
Map<String, ? extends Comparable<?>> fieldValues = Map.of("companyId", entity.getCompanyId(), "sessionId", entity.getSessionId());
|
return Optional.empty();
|
||||||
Optional<EnumMessage> message = fieldValuesValidator.apply(fieldValues).tillFirstError();
|
// Map<String, ? extends Comparable<?>> fieldValues = Map.of("companyId", entity.getCompanyId(), "sessionId", entity.getSessionId());
|
||||||
if (message.isPresent()) {
|
// Optional<EnumMessage> message = fieldValuesValidator.apply(fieldValues).tillFirstError();
|
||||||
log.warn("Illegal value in map for request to imdg: {}", message.get());
|
// if (message.isPresent()) {
|
||||||
throw new IllegalArgumentException(MessageFormat.format("Illegal value in request to imdg: {0}", message.get()));
|
// log.warn("Illegal value in map for request to imdg: {}", message.get());
|
||||||
}
|
// throw new IllegalArgumentException(MessageFormat.format("Illegal value in request to imdg: {0}", message.get()));
|
||||||
return Optional.ofNullable(depoBalanceRegisterMap.getFirstObjectByFieldValues(fieldValues));
|
// }
|
||||||
|
// return Optional.ofNullable(depoBalanceRegisterMap.getFirstObjectByFieldValues(fieldValues));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -89,34 +89,38 @@ public class DepoPaymentInstructionRegisterService extends QueueConsumer impleme
|
||||||
private void insertDepoPaymentInstructionRegister(PaymentInstruction paymentInstruction) {
|
private void insertDepoPaymentInstructionRegister(PaymentInstruction paymentInstruction) {
|
||||||
log.trace("Started generating DepoPaymentInstructionRegister entity...");
|
log.trace("Started generating DepoPaymentInstructionRegister entity...");
|
||||||
DepoPaymentInstructionRegister depoPaymentInstructionRegister = new DepoPaymentInstructionRegister();
|
DepoPaymentInstructionRegister depoPaymentInstructionRegister = new DepoPaymentInstructionRegister();
|
||||||
TradingClearingRegistry tradingClearingRegistry = tradingClearingRegistryMap.getFirstObjectByFieldValues(Map.of("depoAccountId", paymentInstruction.getCreditLeg_accountId()));
|
TradingClearingRegistry tradingClearingRegistry = paymentInstruction.getSenderId() == null ? null : tradingClearingRegistryMap.getFirstObjectByFieldValues(Map.of("companyId", paymentInstruction.getSenderId()));
|
||||||
InOutDirectionDictionary inOutDirectionDictionary = InOutDirectionDictionaryMap.getFirstObjectByFieldValues(Map.of("code", paymentInstruction.getCreditLeg_direction()));
|
InOutDirectionDictionary inOutDirectionDictionary = InOutDirectionDictionaryMap.getFirstObjectByFieldValues(Map.of("code", paymentInstruction.getCreditLeg_direction()));
|
||||||
depoPaymentInstructionRegister.setCreated(Instant.now());
|
depoPaymentInstructionRegister.setCreated(Instant.now());
|
||||||
depoPaymentInstructionRegister.setUpdated(Instant.now());
|
depoPaymentInstructionRegister.setUpdated(Instant.now());
|
||||||
depoPaymentInstructionRegister.setCompanyId(paymentInstruction.getSenderId());
|
depoPaymentInstructionRegister.setCompanyId(paymentInstruction.getSenderId());
|
||||||
depoPaymentInstructionRegister.setTradingClearingRegistryType(tradingClearingRegistry.getTradingClearingRegistryType());
|
if (tradingClearingRegistry == null) {
|
||||||
depoPaymentInstructionRegister.setTradingClearingRegistry(tradingClearingRegistry.getCode());
|
log.warn("For paymentInstruction[{}].CreditLeg_accountId={} can not find TradingClearingRegistry.",
|
||||||
|
paymentInstruction.getId(), paymentInstruction.getCreditLeg_accountId());
|
||||||
|
} else {
|
||||||
|
depoPaymentInstructionRegister.setTradingClearingRegistryType(tradingClearingRegistry.getTradingClearingRegistryType());
|
||||||
|
depoPaymentInstructionRegister.setTradingClearingRegistry(tradingClearingRegistry.getCode());
|
||||||
|
}
|
||||||
depoPaymentInstructionRegister.setCbCode("RNCB-BE-01");
|
depoPaymentInstructionRegister.setCbCode("RNCB-BE-01");
|
||||||
depoPaymentInstructionRegister.setQuantity(paymentInstruction.getCreditLeg_amount());
|
depoPaymentInstructionRegister.setQuantity(paymentInstruction.getCreditLeg_amount());
|
||||||
depoPaymentInstructionRegister.setDirection(inOutDirectionDictionary.getId());
|
depoPaymentInstructionRegister.setDirection(inOutDirectionDictionary.getId());
|
||||||
depoPaymentInstructionRegister.setSessionId(paymentInstruction.getSessionId());
|
depoPaymentInstructionRegister.setSessionId(paymentInstruction.getSessionId());
|
||||||
depoPaymentInstructionRegister.setCreated(Instant.now());
|
|
||||||
depoPaymentInstructionRegister.setUpdated(Instant.now());
|
|
||||||
depoPaymentInstructionRegisterMap.insert(depoPaymentInstructionRegister);
|
depoPaymentInstructionRegisterMap.insert(depoPaymentInstructionRegister);
|
||||||
log.debug("inserted successfully DepoBalanceRegister entity with id: {}", depoPaymentInstructionRegister.getId());
|
log.debug("inserted successfully DepoBalanceRegister entity with id: {}", depoPaymentInstructionRegister.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<DepoPaymentInstructionRegister> isDuplicateInMap(PaymentInstruction entity) {
|
public Optional<DepoPaymentInstructionRegister> isDuplicateInMap(PaymentInstruction entity) {
|
||||||
Map<String, ? extends Comparable<?>> fieldValues = Map.of(
|
return Optional.empty();
|
||||||
"companyId", entity.getSenderId(),
|
// Map<String, ? extends Comparable<?>> fieldValues = Map.of(
|
||||||
"sessionId", entity.getSessionId()
|
// "companyId", entity.getSenderId(),
|
||||||
);
|
// "sessionId", entity.getSessionId()
|
||||||
Optional<EnumMessage> message = fieldValuesValidator.apply(fieldValues).tillFirstError();
|
// );
|
||||||
if (message.isPresent()) {
|
// Optional<EnumMessage> message = fieldValuesValidator.apply(fieldValues).tillFirstError();
|
||||||
log.warn("Illegal value in map for request to imdg: {}", message.get());
|
// if (message.isPresent()) {
|
||||||
throw new IllegalArgumentException(MessageFormat.format("Illegal value in request to imdg: {0}", message.get()));
|
// log.warn("Illegal value in map for request to imdg: {}", message.get());
|
||||||
}
|
// throw new IllegalArgumentException(MessageFormat.format("Illegal value in request to imdg: {0}", message.get()));
|
||||||
return Optional.ofNullable(depoPaymentInstructionRegisterMap.getFirstObjectByFieldValues(fieldValues));
|
// }
|
||||||
|
// return Optional.ofNullable(depoPaymentInstructionRegisterMap.getFirstObjectByFieldValues(fieldValues));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,12 @@ import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import ru.clearing.classes.statics.data.instrument.issue.FixedIncomeSecurity;
|
||||||
import ru.clearing.classes.statics.data.misc.Session;
|
import ru.clearing.classes.statics.data.misc.Session;
|
||||||
import ru.clearing.classes.statics.data.register.ExcludeLiabilitiesRegister;
|
import ru.clearing.classes.statics.data.register.ExcludeLiabilitiesRegister;
|
||||||
import ru.clearing.classes.statics.data.registry.Registry;
|
import ru.clearing.classes.statics.data.registry.Registry;
|
||||||
import ru.clearing.classes.statics.data.security.MoneyMarketSecurity;
|
import ru.clearing.classes.statics.data.security.MoneyMarketSecurity;
|
||||||
|
import ru.clearing.classes.statics.data.security.Security;
|
||||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||||
import ru.spcex.clearing.platform.messaging.domain.BaseRequest;
|
import ru.spcex.clearing.platform.messaging.domain.BaseRequest;
|
||||||
import ru.spcex.clearing.platform.messaging.domain.Consts;
|
import ru.spcex.clearing.platform.messaging.domain.Consts;
|
||||||
|
|
@ -20,6 +22,7 @@ import ru.spcex.clearing.platform.messaging.service.QueueConsumer;
|
||||||
import ru.spcex.platform.enumeration.*;
|
import ru.spcex.platform.enumeration.*;
|
||||||
import ru.spcex.platform.imdg.api.Imdg;
|
import ru.spcex.platform.imdg.api.Imdg;
|
||||||
import ru.spcex.platform.imdg.api.ImdgProvider;
|
import ru.spcex.platform.imdg.api.ImdgProvider;
|
||||||
|
import ru.spcex.platform.imdg.api.predicate.specific.SecuritySelector;
|
||||||
import ru.spcex.platform.utils.enumeration.EnumMessage;
|
import ru.spcex.platform.utils.enumeration.EnumMessage;
|
||||||
import ru.spcex.platform.utils.time.TimeUtil;
|
import ru.spcex.platform.utils.time.TimeUtil;
|
||||||
import ru.spcex.platform.utils.validation.IValidator;
|
import ru.spcex.platform.utils.validation.IValidator;
|
||||||
|
|
@ -42,7 +45,7 @@ public class ExcludeLiabilitiesRegisterService extends QueueConsumer implements
|
||||||
private final Imdg<Registry> registryMap;
|
private final Imdg<Registry> registryMap;
|
||||||
private final Imdg<Session> sessionMap;
|
private final Imdg<Session> sessionMap;
|
||||||
private final Imdg<ru.clearing.classes.statics.data.company.CompanySymbols> companySymbolMap;
|
private final Imdg<ru.clearing.classes.statics.data.company.CompanySymbols> companySymbolMap;
|
||||||
private final Imdg<MoneyMarketSecurity> moneyMarketSecurityMap;
|
private final SecuritySelector<Security> securitySelector;
|
||||||
private final Function<Map<String, ?>, IValidator> fieldValuesValidator;
|
private final Function<Map<String, ?>, IValidator> fieldValuesValidator;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
@ -55,7 +58,7 @@ public class ExcludeLiabilitiesRegisterService extends QueueConsumer implements
|
||||||
this.registryMap = imdgProvider.getImdg(IMDGDistributedNames.Map_Registry, Registry.class);
|
this.registryMap = imdgProvider.getImdg(IMDGDistributedNames.Map_Registry, Registry.class);
|
||||||
this.sessionMap = imdgProvider.getImdg(IMDGDistributedNames.Map_Session, Session.class);
|
this.sessionMap = imdgProvider.getImdg(IMDGDistributedNames.Map_Session, Session.class);
|
||||||
this.companySymbolMap = imdgProvider.getImdg(IMDGDistributedNames.Map_CompanySymbols, ru.clearing.classes.statics.data.company.CompanySymbols.class);
|
this.companySymbolMap = imdgProvider.getImdg(IMDGDistributedNames.Map_CompanySymbols, ru.clearing.classes.statics.data.company.CompanySymbols.class);
|
||||||
this.moneyMarketSecurityMap = imdgProvider.getImdg(IMDGDistributedNames.Map_MoneyMarketSecurity, MoneyMarketSecurity.class);
|
this.securitySelector = new SecuritySelector<>(imdgProvider, Security.class);
|
||||||
this.fieldValuesValidator = fieldValuesValidator;
|
this.fieldValuesValidator = fieldValuesValidator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -97,17 +100,30 @@ public class ExcludeLiabilitiesRegisterService extends QueueConsumer implements
|
||||||
Map<String, ? extends Comparable<?>> innPredicates = Map.of("companySymbol", CompanySymbol.INN.getKey(),
|
Map<String, ? extends Comparable<?>> innPredicates = Map.of("companySymbol", CompanySymbol.INN.getKey(),
|
||||||
"companyId", registry.getCompanyId());
|
"companyId", registry.getCompanyId());
|
||||||
ru.clearing.classes.statics.data.company.CompanySymbols companySymbol = companySymbolMap.getFirstObjectByFieldValues(innPredicates);
|
ru.clearing.classes.statics.data.company.CompanySymbols companySymbol = companySymbolMap.getFirstObjectByFieldValues(innPredicates);
|
||||||
MoneyMarketSecurity moneyMarketSecurity = moneyMarketSecurityMap.getFirstObjectByFieldValues(Map.of("securityId", registry.getSecurityId()));
|
Security security = securitySelector.selectSecurityById(registry.getSecurityId());
|
||||||
|
|
||||||
excludeLiabilitiesRegister.setSessionId(registry.getSessionId());
|
excludeLiabilitiesRegister.setSessionId(registry.getSessionId());
|
||||||
excludeLiabilitiesRegister.setValidFromDate(sessionBySessionId.getClearingDate());
|
excludeLiabilitiesRegister.setValidFromDate(sessionBySessionId.getClearingDate());
|
||||||
excludeLiabilitiesRegister.setValidToDate(validToDate);
|
excludeLiabilitiesRegister.setValidToDate(validToDate);
|
||||||
excludeLiabilitiesRegister.setCompanyId(registry.getCompanyId());
|
excludeLiabilitiesRegister.setCompanyId(registry.getCompanyId());
|
||||||
|
excludeLiabilitiesRegister.setCompanyFullName(registry.getFullName());
|
||||||
excludeLiabilitiesRegister.setInn(companySymbol.getCompanySymbolValue());
|
excludeLiabilitiesRegister.setInn(companySymbol.getCompanySymbolValue());
|
||||||
excludeLiabilitiesRegister.setRegistryCode(registry.getRegistryCode());
|
excludeLiabilitiesRegister.setRegistryCode(registry.getRegistryCode());
|
||||||
excludeLiabilitiesRegister.setAccount(registry.getAccount());
|
excludeLiabilitiesRegister.setAccount(registry.getAccount());
|
||||||
excludeLiabilitiesRegister.setRegistryStatus(registry.getRegistryStatus());
|
excludeLiabilitiesRegister.setRegistryStatus(registry.getRegistryStatus());
|
||||||
excludeLiabilitiesRegister.setCurrency(moneyMarketSecurity.getNominalCurrency());
|
if (security == null) {
|
||||||
|
log.warn("Security id={} not found for registry id={}", registry.getSecurityId(), registry.getId());
|
||||||
|
} else {
|
||||||
|
if (InstrumentType.RATE.equalsByKey(security.getInstrumentType())) {
|
||||||
|
excludeLiabilitiesRegister.setCurrency(((MoneyMarketSecurity) security).getNominalCurrency());
|
||||||
|
} else if (InstrumentType.BOND.equalsByKey(security.getInstrumentType())) {
|
||||||
|
excludeLiabilitiesRegister.setCurrency(((FixedIncomeSecurity) security).getNominalCurrency());
|
||||||
|
} else if (InstrumentType.EQTY.equalsByKey(security.getInstrumentType())) {
|
||||||
|
// не заполняется Currency
|
||||||
|
} else { // never
|
||||||
|
log.warn("Unexpected security[{}] type {}", security.getId(), security.getInstrumentType());
|
||||||
|
}
|
||||||
|
}
|
||||||
excludeLiabilitiesRegister.setSumLiabilities(registry.getBalance());
|
excludeLiabilitiesRegister.setSumLiabilities(registry.getBalance());
|
||||||
excludeLiabilitiesRegister.setSettlementDate(registry.getSettlementDate());
|
excludeLiabilitiesRegister.setSettlementDate(registry.getSettlementDate());
|
||||||
excludeLiabilitiesRegister.setCreated(Instant.now());
|
excludeLiabilitiesRegister.setCreated(Instant.now());
|
||||||
|
|
@ -120,22 +136,25 @@ public class ExcludeLiabilitiesRegisterService extends QueueConsumer implements
|
||||||
return String.format("registryDesignation = '%s' and " +
|
return String.format("registryDesignation = '%s' and " +
|
||||||
"registryInstrumentType in ('%s','%s') and " +
|
"registryInstrumentType in ('%s','%s') and " +
|
||||||
"registryUnit = '%s' and " +
|
"registryUnit = '%s' and " +
|
||||||
"registryStatus = '%s'",
|
"registryStatus in ('%s', '%s')",
|
||||||
RegistryDesignation.O.getKey(),
|
RegistryDesignation.O.getKey(),
|
||||||
RegistryInstrumentType.S.getKey(),
|
RegistryInstrumentType.S.getKey(),
|
||||||
RegistryInstrumentType.M.getKey(),
|
RegistryInstrumentType.M.getKey(),
|
||||||
RegistryUnit.T.getKey(),
|
RegistryUnit.T.getKey(),
|
||||||
RegistryStatus.FAIL.getKey());
|
RegistryStatus.FAIL.getKey(),
|
||||||
|
RegistryStatus.UNCV.getKey()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<ExcludeLiabilitiesRegister> isDuplicateInMap(Registry entity) {
|
public Optional<ExcludeLiabilitiesRegister> isDuplicateInMap(Registry entity) {
|
||||||
Map<String, ? extends Comparable<?>> fieldValues = Map.of("companyId", entity.getCompanyId(), "sessionId", entity.getSessionId());
|
return Optional.empty();
|
||||||
Optional<EnumMessage> message = fieldValuesValidator.apply(fieldValues).tillFirstError();
|
// Map<String, ? extends Comparable<?>> fieldValues = Map.of("companyId", entity.getCompanyId(), "sessionId", entity.getSessionId());
|
||||||
if (message.isPresent()) {
|
// Optional<EnumMessage> message = fieldValuesValidator.apply(fieldValues).tillFirstError();
|
||||||
log.warn("Illegal value in map for request to imdg: {}", message.get());
|
// if (message.isPresent()) {
|
||||||
throw new IllegalArgumentException(MessageFormat.format("Illegal value in request to imdg: {0}", message.get()));
|
// log.warn("Illegal value in map for request to imdg: {}", message.get());
|
||||||
}
|
// throw new IllegalArgumentException(MessageFormat.format("Illegal value in request to imdg: {0}", message.get()));
|
||||||
return Optional.ofNullable(excludeLiabilitiesRegisterMap.getFirstObjectByFieldValues(fieldValues));
|
// }
|
||||||
|
// return Optional.ofNullable(excludeLiabilitiesRegisterMap.getFirstObjectByFieldValues(fieldValues));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -283,14 +283,15 @@ public class ExecutionRegisterService extends QueueConsumer implements Initializ
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<ExecutionRegister> isDuplicateInMap(ExecutionCommon entity) {
|
public Optional<ExecutionRegister> isDuplicateInMap(ExecutionCommon entity) {
|
||||||
Map<String, ? extends Comparable<?>> map = Map.of("exchangeExecutionId", entity.getExchangeExecutionId(),
|
return Optional.empty();
|
||||||
"tradingDate", LocalDate.now()); //clarify timezone
|
// Map<String, ? extends Comparable<?>> map = Map.of("exchangeExecutionId", entity.getExchangeExecutionId(),
|
||||||
Optional<EnumMessage> message = fieldValuesValidator.apply(map).tillFirstError();
|
// "tradingDate", LocalDate.now()); //clarify timezone
|
||||||
if (message.isPresent()) {
|
// Optional<EnumMessage> message = fieldValuesValidator.apply(map).tillFirstError();
|
||||||
log.warn("Illegal value in map for request to imdg: {}", message.get());
|
// if (message.isPresent()) {
|
||||||
throw new IllegalArgumentException(MessageFormat.format("Illegal value in request to imdg: {0}", message.get()));
|
// log.warn("Illegal value in map for request to imdg: {}", message.get());
|
||||||
}
|
// throw new IllegalArgumentException(MessageFormat.format("Illegal value in request to imdg: {0}", message.get()));
|
||||||
return Optional.ofNullable(executionRegisterMap.getSingleObjectByFieldValues(map));
|
// }
|
||||||
|
// return Optional.ofNullable(executionRegisterMap.getSingleObjectByFieldValues(map));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -150,12 +150,13 @@ public class LiabilitiesRegisterService extends QueueConsumer implements Initial
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<LiabilitiesRegister> isDuplicateInMap(Registry entity) {
|
public Optional<LiabilitiesRegister> isDuplicateInMap(Registry entity) {
|
||||||
Map<String, ? extends Comparable<?>> fieldValues = Map.of("companyId", entity.getCompanyId(), "sessionId", entity.getSessionId());
|
return Optional.empty();
|
||||||
Optional<EnumMessage> message = fieldValuesValidator.apply(fieldValues).tillFirstError();
|
// Map<String, ? extends Comparable<?>> fieldValues = Map.of("companyId", entity.getCompanyId(), "sessionId", entity.getSessionId());
|
||||||
if (message.isPresent()) {
|
// Optional<EnumMessage> message = fieldValuesValidator.apply(fieldValues).tillFirstError();
|
||||||
log.warn("Illegal value in map for request to imdg: {}", message.get());
|
// if (message.isPresent()) {
|
||||||
throw new IllegalArgumentException(MessageFormat.format("Illegal value in request to imdg: {0}", message.get()));
|
// log.warn("Illegal value in map for request to imdg: {}", message.get());
|
||||||
}
|
// throw new IllegalArgumentException(MessageFormat.format("Illegal value in request to imdg: {0}", message.get()));
|
||||||
return Optional.ofNullable(liabilitiesRegisterMap.getFirstObjectByFieldValues(fieldValues));
|
// }
|
||||||
|
// return Optional.ofNullable(liabilitiesRegisterMap.getFirstObjectByFieldValues(fieldValues));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import ru.spcex.platform.utils.validation.IValidator;
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
@ -69,10 +70,6 @@ public class MoneyBalanceRegisterService extends QueueConsumer implements Initia
|
||||||
|
|
||||||
public void moneyBalanceRegisterNew(BaseRequest<LauncherCommandRequest> userRequest) {
|
public void moneyBalanceRegisterNew(BaseRequest<LauncherCommandRequest> userRequest) {
|
||||||
log.debug("LauncherCommandRequest received from {}", createRegistry_GBRR.topic());
|
log.debug("LauncherCommandRequest received from {}", createRegistry_GBRR.topic());
|
||||||
if (userRequest.getRequestPayload().getCompanyId() == null) {
|
|
||||||
log.warn("LauncherCommandRequest.id={} without companyId", userRequest.getId());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ImdgPredicate sqlConditionForRegistry = getSqlForRegistries(userRequest.getRequestPayload().getCompanyId());
|
ImdgPredicate sqlConditionForRegistry = getSqlForRegistries(userRequest.getRequestPayload().getCompanyId());
|
||||||
Collection<Registry> registries = registryMap.getCollectionObjectsByPredicate(sqlConditionForRegistry);
|
Collection<Registry> registries = registryMap.getCollectionObjectsByPredicate(sqlConditionForRegistry);
|
||||||
if (registries == null) {
|
if (registries == null) {
|
||||||
|
|
@ -128,10 +125,15 @@ public class MoneyBalanceRegisterService extends QueueConsumer implements Initia
|
||||||
|
|
||||||
private ImdgPredicate getSqlForRegistries(Long companyId) {
|
private ImdgPredicate getSqlForRegistries(Long companyId) {
|
||||||
ImdgPredicateBuilder pb = registryMap.predicateBuilder();
|
ImdgPredicateBuilder pb = registryMap.predicateBuilder();
|
||||||
ImdgPredicate prdct = pb.and(
|
ImdgPredicate prdct;
|
||||||
pb.equals("companyId", companyId),
|
if (companyId == null) {
|
||||||
pb.sql(RegistryCodeSqlBuilder.getInstance(RegistryTradingParams.AM__).build())
|
prdct = pb.sql(RegistryCodeSqlBuilder.getInstance(RegistryTradingParams.AM__).build());
|
||||||
);
|
} else {
|
||||||
|
prdct = pb.and(
|
||||||
|
pb.equals("companyId", companyId),
|
||||||
|
pb.sql(RegistryCodeSqlBuilder.getInstance(RegistryTradingParams.AM__).build())
|
||||||
|
);
|
||||||
|
}
|
||||||
log.trace("sql predicate for registries {}", prdct);
|
log.trace("sql predicate for registries {}", prdct);
|
||||||
return prdct;
|
return prdct;
|
||||||
}
|
}
|
||||||
|
|
@ -171,17 +173,15 @@ public class MoneyBalanceRegisterService extends QueueConsumer implements Initia
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<MoneyBalanceRegister> isDuplicateInMap(Registry entity) {
|
public Optional<MoneyBalanceRegister> isDuplicateInMap(Registry entity) {
|
||||||
Map<String, ? extends Comparable<?>> fieldValues = Map.of(
|
return Optional.empty();
|
||||||
"companyId",
|
// Map<String, Long> fieldValues = new HashMap<>();
|
||||||
entity.getCompanyId(),
|
// fieldValues.put("companyId", entity.getCompanyId());
|
||||||
"sessionId",
|
// fieldValues.put("sessionId", entity.getSessionId());
|
||||||
entity.getSessionId()
|
// Optional<EnumMessage> message = fieldValuesValidator.apply(fieldValues).tillFirstError();
|
||||||
);
|
// if (message.isPresent()) {
|
||||||
Optional<EnumMessage> message = fieldValuesValidator.apply(fieldValues).tillFirstError();
|
// log.warn("Illegal value in map for request to imdg: {}", message.get());
|
||||||
if (message.isPresent()) {
|
// throw new IllegalArgumentException(MessageFormat.format("Illegal value in request to imdg: {0}", message.get()));
|
||||||
log.warn("Illegal value in map for request to imdg: {}", message.get());
|
// }
|
||||||
throw new IllegalArgumentException(MessageFormat.format("Illegal value in request to imdg: {0}", message.get()));
|
// return Optional.ofNullable(moneyBalanceRegisterMap.getFirstObjectByFieldValues(fieldValues));
|
||||||
}
|
|
||||||
return Optional.ofNullable(moneyBalanceRegisterMap.getFirstObjectByFieldValues(fieldValues));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,12 +92,13 @@ public class MoneyPaymentInstructionRegisterService extends QueueConsumer implem
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<MoneyPaymentInstructionRegister> isDuplicateInMap(PaymentInstruction entity) {
|
public Optional<MoneyPaymentInstructionRegister> isDuplicateInMap(PaymentInstruction entity) {
|
||||||
Map<String, ? extends Comparable<?>> fieldValuesCompanyIdSessionId = Map.of("senderId", entity.getSenderId(), "date", entity.getClearingDate());
|
return Optional.empty();
|
||||||
Optional<EnumMessage> message = fieldValuesValidator.apply(fieldValuesCompanyIdSessionId).tillFirstError();
|
// Map<String, ? extends Comparable<?>> fieldValuesCompanyIdSessionId = Map.of("senderId", entity.getSenderId(), "date", entity.getClearingDate());
|
||||||
if (message.isPresent()) {
|
// Optional<EnumMessage> message = fieldValuesValidator.apply(fieldValuesCompanyIdSessionId).tillFirstError();
|
||||||
log.warn("Illegal value in map for request to imdg: {}", message.get());
|
// if (message.isPresent()) {
|
||||||
throw new IllegalArgumentException(MessageFormat.format("Illegal value in request to imdg: {0}", message.get()));
|
// log.warn("Illegal value in map for request to imdg: {}", message.get());
|
||||||
}
|
// throw new IllegalArgumentException(MessageFormat.format("Illegal value in request to imdg: {0}", message.get()));
|
||||||
return Optional.ofNullable(moneyPaymentInstructionRegisterMap.getFirstObjectByFieldValues(fieldValuesCompanyIdSessionId));
|
// }
|
||||||
|
// return Optional.ofNullable(moneyPaymentInstructionRegisterMap.getFirstObjectByFieldValues(fieldValuesCompanyIdSessionId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,12 +62,13 @@ public class NotificationService extends QueueConsumer implements InitializingBe
|
||||||
private void notificationUpdateRequest(BaseRequest<NotificationUpdateRequest> notificationUpdateRequestBaseRequest) {
|
private void notificationUpdateRequest(BaseRequest<NotificationUpdateRequest> notificationUpdateRequestBaseRequest) {
|
||||||
NotificationUpdateRequest request = notificationUpdateRequestBaseRequest.getRequestPayload();
|
NotificationUpdateRequest request = notificationUpdateRequestBaseRequest.getRequestPayload();
|
||||||
Long id = request == null ? null : request.getId();
|
Long id = request == null ? null : request.getId();
|
||||||
log.info("Starting notificationUpdateRequest {} processing by id: {} ...", notificationUpdateRequestBaseRequest.getId(), id);
|
log.info("Starting notificationUpdateRequest {} processing by id: {} from user {}", notificationUpdateRequestBaseRequest.getId(), id, notificationUpdateRequestBaseRequest.getUserId());
|
||||||
Notification notification = notificationMap.getSingleObjectByID(id);
|
Notification notification = notificationMap.getSingleObjectByID(id);
|
||||||
if (notification == null) {
|
if (notification == null) {
|
||||||
throw new NullPointerException("Notification by id:{" + id + "} is null!");
|
throw new NullPointerException("Notification by id:{" + id + "} is null!");
|
||||||
}
|
}
|
||||||
notification.setNotificationStatus(request.getNotificationStatus());
|
notification.setNotificationStatus(request.getNotificationStatus());
|
||||||
|
notification.setSenderId(notificationUpdateRequestBaseRequest.getUserId());
|
||||||
notification.setUpdated(Instant.now());
|
notification.setUpdated(Instant.now());
|
||||||
notificationMap.update(notification);
|
notificationMap.update(notification);
|
||||||
sendFeedbackString(notification);
|
sendFeedbackString(notification);
|
||||||
|
|
|
||||||
|
|
@ -1,215 +0,0 @@
|
||||||
package ru.spcex.clearing.platform.messaging.domain.cud.registry;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
||||||
import ru.spcex.clearing.platform.messaging.domain.json.deserialize.InstantDateTimeDeserializer;
|
|
||||||
import ru.spcex.clearing.platform.messaging.domain.json.deserialize.LocalDateDeserializer;
|
|
||||||
import ru.spcex.clearing.platform.messaging.domain.json.serialize.InstantDateTimeSerializer;
|
|
||||||
import ru.spcex.clearing.platform.messaging.domain.json.serialize.LocalDateSerializer;
|
|
||||||
|
|
||||||
import java.time.Instant;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
|
|
||||||
@Deprecated // Не используется. Возможно артефакт мёржа.
|
|
||||||
public class ContractRegisterNewRequest {
|
|
||||||
|
|
||||||
@JsonProperty
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@JsonProperty
|
|
||||||
private String number;
|
|
||||||
|
|
||||||
@JsonSerialize(using = LocalDateSerializer.class)
|
|
||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
|
||||||
@JsonProperty
|
|
||||||
private LocalDate issueDate;
|
|
||||||
|
|
||||||
@JsonProperty
|
|
||||||
private String companyFullName;
|
|
||||||
|
|
||||||
@JsonProperty
|
|
||||||
private Long companyId;
|
|
||||||
|
|
||||||
@JsonProperty
|
|
||||||
private String documentType;
|
|
||||||
|
|
||||||
@JsonProperty
|
|
||||||
private String issuePlace;
|
|
||||||
|
|
||||||
@JsonProperty
|
|
||||||
private String issuer;
|
|
||||||
|
|
||||||
@JsonProperty
|
|
||||||
private String issuerCode;
|
|
||||||
|
|
||||||
@JsonProperty
|
|
||||||
private String place;
|
|
||||||
|
|
||||||
@JsonSerialize(using = LocalDateSerializer.class)
|
|
||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
|
||||||
@JsonProperty
|
|
||||||
private LocalDate validFromDate;
|
|
||||||
|
|
||||||
@JsonSerialize(using = LocalDateSerializer.class)
|
|
||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
|
||||||
@JsonProperty
|
|
||||||
private LocalDate validToDate;
|
|
||||||
|
|
||||||
@JsonSerialize(using = LocalDateSerializer.class)
|
|
||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
|
||||||
@JsonProperty
|
|
||||||
private LocalDate closeDate;
|
|
||||||
|
|
||||||
@JsonProperty
|
|
||||||
private String comment;
|
|
||||||
|
|
||||||
@JsonProperty
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@JsonSerialize(using = InstantDateTimeSerializer.class)
|
|
||||||
@JsonDeserialize(using = InstantDateTimeDeserializer.class)
|
|
||||||
@JsonProperty
|
|
||||||
private Instant createdAt;
|
|
||||||
|
|
||||||
@JsonSerialize(using = InstantDateTimeSerializer.class)
|
|
||||||
@JsonDeserialize(using = InstantDateTimeDeserializer.class)
|
|
||||||
@JsonProperty
|
|
||||||
private Instant updatedAt;
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getCloseDate() {
|
|
||||||
return closeDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCloseDate(LocalDate closeDate) {
|
|
||||||
this.closeDate = closeDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getComment() {
|
|
||||||
return comment;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setComment(String comment) {
|
|
||||||
this.comment = comment;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Instant getCreatedAt() {
|
|
||||||
return createdAt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCreatedAt(Instant createdAt) {
|
|
||||||
this.createdAt = createdAt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Instant getUpdatedAt() {
|
|
||||||
return updatedAt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUpdatedAt(Instant updatedAt) {
|
|
||||||
this.updatedAt = updatedAt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNumber() {
|
|
||||||
return number;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNumber(String number) {
|
|
||||||
this.number = number;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getIssueDate() {
|
|
||||||
return issueDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIssueDate(LocalDate issueDate) {
|
|
||||||
this.issueDate = issueDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCompanyFullName() {
|
|
||||||
return companyFullName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCompanyFullName(String companyFullName) {
|
|
||||||
this.companyFullName = companyFullName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getCompanyId() {
|
|
||||||
return companyId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCompanyId(Long companyId) {
|
|
||||||
this.companyId = companyId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDocumentType() {
|
|
||||||
return documentType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDocumentType(String documentType) {
|
|
||||||
this.documentType = documentType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIssuePlace() {
|
|
||||||
return issuePlace;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIssuePlace(String issuePlace) {
|
|
||||||
this.issuePlace = issuePlace;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIssuer() {
|
|
||||||
return issuer;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIssuer(String issuer) {
|
|
||||||
this.issuer = issuer;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIssuerCode() {
|
|
||||||
return issuerCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIssuerCode(String issuerCode) {
|
|
||||||
this.issuerCode = issuerCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPlace() {
|
|
||||||
return place;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPlace(String place) {
|
|
||||||
this.place = place;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getValidFromDate() {
|
|
||||||
return validFromDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValidFromDate(LocalDate validFromDate) {
|
|
||||||
this.validFromDate = validFromDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getValidToDate() {
|
|
||||||
return validToDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValidToDate(LocalDate validToDate) {
|
|
||||||
this.validToDate = validToDate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Reference in a new issue