etreschenkov 2026-05-22 11:26:59 +03:00
parent c8f1610eba
commit b86c8676b2
3 changed files with 17 additions and 9 deletions

View file

@ -1,6 +1,6 @@
{
"version": "3.26.301.177",
"version": "3.26.301.178",
"enums": {
@ -4218,7 +4218,7 @@
"name": "Добавление кода клиента",
"confirmation": "companyId,code,tradingClearingRegistryId,moneyAccountId,depoAccountId,status",
"confirmation": "companyId,code,tradingClearingRegistryId,status",
"class": "ru.spcex.clearing.backendapi.controller.request.cud.account.ClientCodeNewAction",
@ -4245,7 +4245,7 @@
"name": "Изменение кода клиента",
"confirmation": "companyId,code,tradingClearingRegistryId,moneyAccountId,depoAccountId,status",
"confirmation": "companyId,code,tradingClearingRegistryId,status",
"class": "ru.spcex.clearing.backendapi.controller.request.cud.account.ClientCodeUpdateAction",

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--?xml-stylesheet type="text/xsl" href="\..\corp-reports\src\data\meta\meta.server.xslt"?-->
<meta version="3.26.301.177">
<meta version="3.26.301.178">
<!-- _xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" _xsi:noNamespaceSchemaLocation="file:///E:/d/projects/meta/from/meta.xsd" -->
<!--Здесь словари-->
<enums>
@ -975,13 +975,13 @@
<createdAt field="created" 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"/>
<actions>
<post name="Добавление кода клиента" confirmation="companyId,code,tradingClearingRegistryId,moneyAccountId,depoAccountId,status" class="ru.spcex.clearing.backendapi.controller.request.cud.account.ClientCodeNewAction">
<post name="Добавление кода клиента" confirmation="companyId,code,tradingClearingRegistryId,status" class="ru.spcex.clearing.backendapi.controller.request.cud.account.ClientCodeNewAction">
<companyId type="1" name="Наименование компании" shortname="Компания" link="company" linkCode="shortName" required="true" enabled="false"/>
<code type="2" length="255" name="Код клиента" shortname="Код клиента" required="true"/>
<tradingClearingRegistryId type="1" name="Торгово-клиринговый регистр" shortname="ТКР" link="tradingClearingRegistry" linkCode="code"/>
<status type="12" name="Наименование статуса" shortname="Статус" link="workflowStatus"/>
</post>
<put name="Изменение кода клиента" confirmation="companyId,code,tradingClearingRegistryId,moneyAccountId,depoAccountId,status" class="ru.spcex.clearing.backendapi.controller.request.cud.account.ClientCodeUpdateAction">
<put name="Изменение кода клиента" confirmation="companyId,code,tradingClearingRegistryId,status" class="ru.spcex.clearing.backendapi.controller.request.cud.account.ClientCodeUpdateAction">
<id type="1" name="Идентификатор записи" shortname="ID" link="clientCode" linkCode="id" required="true"/>
<companyId type="1" name="Наименование компании" shortname="Компания" link="company" linkCode="shortName" enabled="false"/>
<code type="2" length="255" name="Код клиента" shortname="Код клиента"/>

View file

@ -11,6 +11,7 @@ import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.commons.lang3.StringUtils;
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.producer.Producer;
import org.slf4j.Logger;
@ -442,7 +443,9 @@ public class OrderCurrencyListener extends QueueConsumer implements Initializing
continue;
}
orderCurrency.setStatus(status.getKey());
orderCurrency.setExchangeOrderId(normalize(sOrder.getExchangeOrderNum()));
if (orderCurrency.getExchangeOrderId() == null) {
orderCurrency.setExchangeOrderId(normalize(sOrder.getExchangeOrderNum()));
}
orderCurrency.setUpdated(Instant.now());
orderCurrencyImdg.update(orderCurrency);
} catch (Exception e) {
@ -464,7 +467,9 @@ public class OrderCurrencyListener extends QueueConsumer implements Initializing
continue;
}
orderCurrency.setStatus(status.getKey());
orderCurrency.setExchangeOrderId(normalize(sOrder.getExchangeOrderNum()));
if (orderCurrency.getExchangeOrderId() == null) {
orderCurrency.setExchangeOrderId(normalize(sOrder.getExchangeOrderNum()));
}
orderCurrency.setUpdated(Instant.now());
orderCurrencyImdg.update(orderCurrency);
} catch (Exception e) {
@ -497,12 +502,15 @@ public class OrderCurrencyListener extends QueueConsumer implements Initializing
}
private Long normalize(String value) {
if (StringUtils.isEmpty(value) || value.equals("0")){
return 0L;
}
String[] parts = value.split("-", 3);
if (parts.length != 3) {
throw new IllegalArgumentException("Ожидается формат: digits-text-digits");
}
String digits = parts[1] + parts[2];
String digits = parts[0] + parts[2];
return Long.valueOf(digits);
}
}