tcr strip from sdf57 specif TKR/TCR
SDF03 for non RUB currencies in session
This commit is contained in:
parent
1037b27165
commit
fafa3b455a
2 changed files with 19 additions and 11 deletions
|
|
@ -116,7 +116,7 @@ public class AnltSearcher {
|
|||
return new AnltSearch(infoAcc, company, tcr, tcrList, currencyCode);
|
||||
}
|
||||
|
||||
private static final Pattern tcrPattern = Pattern.compile("ТКР|TKR.*?([0-9A-Z-]{12})");
|
||||
private static final Pattern tcrPattern = Pattern.compile("(?:ТКР|TKR).*?([0-9A-Z-]{12})");
|
||||
|
||||
private static String getTkrCodeFromComment(String comment) {
|
||||
if (TextUtil.isEmpty(comment)) {
|
||||
|
|
|
|||
|
|
@ -47,9 +47,11 @@ import ru.spcex.clearing.session.stage.util.RegistryUtil;
|
|||
import ru.spcex.platform.enumeration.AccountStatus;
|
||||
import ru.spcex.platform.enumeration.AccountType;
|
||||
import ru.spcex.platform.enumeration.Allowed;
|
||||
import ru.spcex.platform.enumeration.CurrencyCode;
|
||||
import ru.spcex.platform.enumeration.InstrumentType;
|
||||
import ru.spcex.platform.enumeration.OperationStatus;
|
||||
import ru.spcex.platform.enumeration.RegistryDesignation;
|
||||
import ru.spcex.platform.enumeration.RegistryInstrumentType;
|
||||
import ru.spcex.platform.enumeration.RegistryStatus;
|
||||
import static ru.spcex.platform.enumeration.RegistryTradingParams.*;
|
||||
import ru.spcex.platform.enumeration.RegistryUnit;
|
||||
|
|
@ -403,8 +405,10 @@ public class FormingPaymentInstructionAssets implements ISessionStage {
|
|||
Registry rgs = pair.getSecond();
|
||||
Account account = accountImdg.getSingleObjectByID(paymentInstruction.getCreditLeg_accountId());
|
||||
Security security = securityImdg.getSingleObjectByID(paymentInstruction.getCreditLeg_securityId());
|
||||
if (SessionType.CURR.equals(sessionType) || (rgs != null && Section.CURR.equalsByKey(rgs.getSection()))) {
|
||||
boolean madeStatements = createStatementsIfNeeded(paymentInstruction, rgs);
|
||||
if (SessionType.CURR.equals(sessionType) || (rgs != null
|
||||
&& RegistryInstrumentType.M.equalsByKey(rgs.getRegistryInstrumentType())
|
||||
&& !CurrencyCode.isRub(rgs.getSecuritySymbol()))) {
|
||||
boolean madeStatements = statementsWereMade(paymentInstruction, rgs);
|
||||
if (madeStatements) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -487,16 +491,20 @@ public class FormingPaymentInstructionAssets implements ISessionStage {
|
|||
return sDf12;
|
||||
}
|
||||
|
||||
private boolean createStatementsIfNeeded(PaymentInstruction pmt, Registry am_b) {
|
||||
private boolean statementsWereMade(PaymentInstruction pmt, Registry am_b) {
|
||||
ImdgPredicateBuilder pb = stlmHPropsImdg.predicateBuilder();
|
||||
String curCode = pmt.getCreditLeg_currencyCode();
|
||||
boolean noNeedForStatements = stlmHPropsImdg.getFirstObjectByPredicate(
|
||||
pb.and(
|
||||
pb.in("currencyCode", curCode),
|
||||
pb.equals("companyId", Sender.Prc.getId())
|
||||
)
|
||||
) != null;
|
||||
if (noNeedForStatements) return false;
|
||||
{
|
||||
SettlementHouseProperties sttHs = stlmHPropsImdg.getFirstObjectByPredicate(
|
||||
pb.and(
|
||||
pb.in("currencyCode", curCode),
|
||||
pb.equals("companyId", Sender.Prc.getId())
|
||||
)
|
||||
);
|
||||
if (sttHs != null) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Supplier<Statement> stmtBldr = () -> {
|
||||
Statement stmt = new Statement();
|
||||
stmt.setSenderId(Sender.One.getId());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue