execution uploading optimization
This commit is contained in:
parent
21cd02b20a
commit
fc8d235fce
3 changed files with 53 additions and 21 deletions
|
|
@ -106,6 +106,9 @@ public class ExecutionCurrencyComponent implements IExecutionUploadComponent {
|
|||
// }
|
||||
|
||||
public void processNewTS(Long fromId) {
|
||||
if (fromId == null) {
|
||||
cash.clear();
|
||||
}
|
||||
LocalDate today = LocalDate.now();
|
||||
log.debug("Start check new S_TRADE at {}, fromId={}", today, fromId);
|
||||
//выбираем STrades на сегодня с правильным section
|
||||
|
|
@ -139,15 +142,22 @@ public class ExecutionCurrencyComponent implements IExecutionUploadComponent {
|
|||
return true;
|
||||
}
|
||||
// MoneyFlowSide excDepSide = sTrdSide == Side.BUY ? MoneyFlowSide.BUY : MoneyFlowSide.SELL;
|
||||
ExecUploadKey execCash = ExecUploadKey.cash(sTrd.getTradeDate(),
|
||||
ExecUploadKey excKey = ExecUploadKey.cash(sTrd.getTradeDate(),
|
||||
sTrd.getTradeNum(),
|
||||
sTrdSide.getKey());
|
||||
return cash.contains(execCash);
|
||||
// return executionCurrencyImdg.getFirstObjectByFieldValues(
|
||||
// Map.of("tradingDate", sTrd.getTradeDate(),
|
||||
// "exchangeExecutionId", sTrd.getTradeNum(),
|
||||
// "side", sTrdSide.getKey())) != null;
|
||||
|
||||
if (fromId != null) {
|
||||
return cash.contains(excKey);
|
||||
} else {
|
||||
ExecutionCurrency exec = executionCurrencyImdg.getFirstObjectByFieldValues(
|
||||
Map.of("tradingDate", sTrd.getTradeDate(),
|
||||
"exchangeExecutionId", sTrd.getTradeNum(),
|
||||
"side", sTrdSide.getKey()));
|
||||
if (exec != null) {
|
||||
cash.add(excKey);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
log.info("{} strades left after already-added filtering", sTrades.size());
|
||||
|
||||
|
|
|
|||
|
|
@ -105,6 +105,9 @@ public class ExecutionDepositComponent implements IExecutionUploadComponent {
|
|||
}
|
||||
|
||||
public void processNewTS(Long fromId) {
|
||||
if (fromId == null) {
|
||||
cash.clear();
|
||||
}
|
||||
log.debug("Start check new S_TRADE after {}, fromId={}", tradingDay, fromId);
|
||||
//выбираем STrades на сегодня с правильным section
|
||||
Collection<STrades> sTrades;
|
||||
|
|
@ -137,13 +140,22 @@ public class ExecutionDepositComponent implements IExecutionUploadComponent {
|
|||
return true;
|
||||
}
|
||||
MoneyFlowSide excDepSide = sTrdSide.equals(Side.BUY) ? MoneyFlowSide.BUY : MoneyFlowSide.SELL;
|
||||
return cash.contains(
|
||||
ExecUploadKey.cash(sTrd.getTradeDate(), sTrd.getTradeNum(), excDepSide.getKey())
|
||||
);
|
||||
//return executionDepositImdg.getFirstObjectByFieldValues(
|
||||
// Map.of("tradingDate", sTrd.getTradeDate(),
|
||||
// "exchangeExecutionId", sTrd.getTradeNum(),
|
||||
// "side", excDepSide.getKey())) != null;
|
||||
ExecUploadKey excKey = ExecUploadKey.cash(sTrd.getTradeDate(),
|
||||
sTrd.getTradeNum(),
|
||||
excDepSide.getKey());
|
||||
if (fromId != null) {
|
||||
return cash.contains(excKey);
|
||||
} else {
|
||||
ExecutionDeposit exec = executionDepositImdg.getFirstObjectByFieldValues(
|
||||
Map.of("tradingDate", sTrd.getTradeDate(),
|
||||
"exchangeExecutionId", sTrd.getTradeNum(),
|
||||
"side", excDepSide.getKey()));
|
||||
if (exec != null) {
|
||||
cash.add(excKey);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
log.info("{} strades left after already-added filtering", sTrades.size());
|
||||
|
||||
|
|
|
|||
|
|
@ -124,6 +124,9 @@ public class ExecutionFondComponent implements IExecutionUploadComponent {
|
|||
}
|
||||
|
||||
public void processNewTS(Long fromId) {
|
||||
if (fromId == null) {
|
||||
cash.clear();
|
||||
}
|
||||
log.debug("Start check new S_TRADE after {}, fromId={}", tradingDay, fromId);
|
||||
//выбираем STrades на сегодня с правильным section
|
||||
Collection<STrades> sTrades;
|
||||
|
|
@ -156,13 +159,20 @@ public class ExecutionFondComponent implements IExecutionUploadComponent {
|
|||
return true;
|
||||
}
|
||||
Side excDepSide = sTrdSide.equals(Side.BUY) ? Side.BUY : Side.SELL;
|
||||
return cash.contains(
|
||||
ExecUploadKey.cash(sTrd.getTradeDate(), sTrd.getTradeNum(), excDepSide.getKey())
|
||||
);
|
||||
//return executionFondImdg.getFirstObjectByFieldValues(
|
||||
// Map.of("tradingDate", sTrd.getTradeDate(),
|
||||
// "exchangeExecutionId", sTrd.getTradeNum(),
|
||||
// "side", excDepSide.getKey())) != null;
|
||||
ExecUploadKey excKey = ExecUploadKey.cash(sTrd.getTradeDate(), sTrd.getTradeNum(), excDepSide.getKey());
|
||||
if (fromId != null) {
|
||||
return cash.contains(excKey);
|
||||
} else {
|
||||
ExecutionFond exec = executionFondImdg.getFirstObjectByFieldValues(
|
||||
Map.of("tradingDate", sTrd.getTradeDate(),
|
||||
"exchangeExecutionId", sTrd.getTradeNum(),
|
||||
"side", excDepSide.getKey()));
|
||||
if (exec != null) {
|
||||
cash.add(excKey);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
log.info("{} strades left after already-added filtering", sTrades.size());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue