This commit is contained in:
parent
29d62c68cb
commit
27f6382894
1 changed files with 51 additions and 49 deletions
|
|
@ -24,7 +24,6 @@ import ru.spcex.platform.imdg.api.ImdgTransaction;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.ZoneOffset;
|
import java.time.ZoneOffset;
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class Application extends MessageCracker implements quickfix.Application, InitializingBean, DisposableBean {
|
public class Application extends MessageCracker implements quickfix.Application, InitializingBean, DisposableBean {
|
||||||
|
|
@ -114,7 +113,6 @@ public class Application extends MessageCracker implements quickfix.Application,
|
||||||
transaction.beginTransaction();
|
transaction.beginTransaction();
|
||||||
try {
|
try {
|
||||||
if (executionReport.isSetField(ClOrdID.FIELD) && executionReport.isSetField(ExDestination.FIELD) && executionReport.isSetField(TransactTime.FIELD) && executionReport.isSetField(OrdStatus.FIELD)) {
|
if (executionReport.isSetField(ClOrdID.FIELD) && executionReport.isSetField(ExDestination.FIELD) && executionReport.isSetField(TransactTime.FIELD) && executionReport.isSetField(OrdStatus.FIELD)) {
|
||||||
OrderID orderId = executionReport.getOrderID();
|
|
||||||
ExDestination exDestination = (ExDestination) executionReport.getField(new ExDestination());
|
ExDestination exDestination = (ExDestination) executionReport.getField(new ExDestination());
|
||||||
TransactTime transactTime = executionReport.getTransactTime();
|
TransactTime transactTime = executionReport.getTransactTime();
|
||||||
OrdStatus ordStatus = executionReport.getOrdStatus();
|
OrdStatus ordStatus = executionReport.getOrdStatus();
|
||||||
|
|
@ -123,8 +121,11 @@ public class Application extends MessageCracker implements quickfix.Application,
|
||||||
Long orderNum = null;
|
Long orderNum = null;
|
||||||
try {
|
try {
|
||||||
orderNum = Long.parseLong(clOrdID.getValue());
|
orderNum = Long.parseLong(clOrdID.getValue());
|
||||||
} catch (NumberFormatException ignore) {}
|
} catch (NumberFormatException e) {
|
||||||
|
log.warn("failed to parse ClOrdID=" + clOrdID.getValue(), e);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (orderNum != null) {
|
||||||
Imdg<SOrders> sOrdersImdg = transaction.getImdg(IMDGDistributedNames.Map_SOrders, SOrders.class);
|
Imdg<SOrders> sOrdersImdg = transaction.getImdg(IMDGDistributedNames.Map_SOrders, SOrders.class);
|
||||||
SOrders sOrders = sOrdersImdg.getSingleObjectByPredicate(sOrdersImdg.predicateBuilder().and(
|
SOrders sOrders = sOrdersImdg.getSingleObjectByPredicate(sOrdersImdg.predicateBuilder().and(
|
||||||
sOrdersImdg.predicateBuilder().equals("orderNum", orderNum),
|
sOrdersImdg.predicateBuilder().equals("orderNum", orderNum),
|
||||||
|
|
@ -134,10 +135,11 @@ public class Application extends MessageCracker implements quickfix.Application,
|
||||||
sOrders = new SOrders();
|
sOrders = new SOrders();
|
||||||
sOrders.setId(imdgProvider.getImdgIdGenerator().nextId());
|
sOrders.setId(imdgProvider.getImdgIdGenerator().nextId());
|
||||||
sOrders.setOrderNum(orderNum);
|
sOrders.setOrderNum(orderNum);
|
||||||
sOrders.setExchangeOrderNum(orderId.getValue());
|
|
||||||
sOrders.setClassCode(exDestination.getValue());
|
sOrders.setClassCode(exDestination.getValue());
|
||||||
sOrders.setTradeDate(transactTime.getValue().toLocalDate());
|
sOrders.setTradeDate(transactTime.getValue().toLocalDate());
|
||||||
|
|
||||||
|
if (executionReport.isSetOrderID())
|
||||||
|
sOrders.setExchangeOrderNum(executionReport.getOrderID().getValue());
|
||||||
if (executionReport.isSetSecurityID())
|
if (executionReport.isSetSecurityID())
|
||||||
sOrders.setSecCode(executionReport.getSecurityID().getValue());
|
sOrders.setSecCode(executionReport.getSecurityID().getValue());
|
||||||
if (executionReport.isSetPrice())
|
if (executionReport.isSetPrice())
|
||||||
|
|
@ -176,7 +178,7 @@ public class Application extends MessageCracker implements quickfix.Application,
|
||||||
updateRequest.addId(orderNum);
|
updateRequest.addId(orderNum);
|
||||||
kafkaSender.sendRequestToQueue(Consts.ORDER_CURRENCY_STATUS_UPDATE_FIX, updateRequest);
|
kafkaSender.sendRequestToQueue(Consts.ORDER_CURRENCY_STATUS_UPDATE_FIX, updateRequest);
|
||||||
}
|
}
|
||||||
// }
|
}
|
||||||
transaction.commitTransaction();
|
transaction.commitTransaction();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(executionReport.toString(), e);
|
log.error(executionReport.toString(), e);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue