http://jira.mfd.msk:8088/browse/CLS-189 PaymentInstructionCreator добавил проверку на liabilitiesClaimsAssets.settlementDate = сегодня
This commit is contained in:
parent
4d804f9644
commit
535908f169
2 changed files with 13 additions and 5 deletions
|
|
@ -253,8 +253,12 @@ public class Clearing {
|
||||||
|
|
||||||
log.trace("creating paymentInstructions");
|
log.trace("creating paymentInstructions");
|
||||||
List<PaymentInstruction> paymentInstructions = paymentInstructionCreator.createAndSavePaymentInstructions(execDeposit, lcaFirstLeg, Collections.singleton(category));
|
List<PaymentInstruction> paymentInstructions = paymentInstructionCreator.createAndSavePaymentInstructions(execDeposit, lcaFirstLeg, Collections.singleton(category));
|
||||||
paymentInstructionCreator.updateFieldLiabilitiesClaimsAssetsByPayment(lcaFirstLeg, lcmFirstLeg, paymentInstructions, Collections.singleton(category));
|
if (paymentInstructions.isEmpty()) {
|
||||||
liabilitiesClaimsAssetsImdg.update(lcaFirstLeg);
|
log.trace("For lcaFirstLeg[{}] did not creaded paymentInstruction's", lcaFirstLeg.getId());
|
||||||
|
} else {
|
||||||
|
paymentInstructionCreator.updateFieldLiabilitiesClaimsAssetsByPayment(lcaFirstLeg, lcmFirstLeg, paymentInstructions, Collections.singleton(category));
|
||||||
|
liabilitiesClaimsAssetsImdg.update(lcaFirstLeg);
|
||||||
|
}
|
||||||
log.trace("lcaFirstLeg {}, lcaSecondLeg {}", lcaFirstLeg, lcaSecondLeg);
|
log.trace("lcaFirstLeg {}, lcaSecondLeg {}", lcaFirstLeg, lcaSecondLeg);
|
||||||
|
|
||||||
// log.trace("updating LiabilitiesClaimsMoney by payment");
|
// log.trace("updating LiabilitiesClaimsMoney by payment");
|
||||||
|
|
|
||||||
|
|
@ -77,8 +77,8 @@ public class PaymentInstructionCreator {
|
||||||
public List<PaymentInstruction> createAndSavePaymentInstructions(ExecutionDeposit executionDeposit, LiabilitiesClaimsAssets liabilitiesClaimsAssets,
|
public List<PaymentInstruction> createAndSavePaymentInstructions(ExecutionDeposit executionDeposit, LiabilitiesClaimsAssets liabilitiesClaimsAssets,
|
||||||
Collection<ClearingCategory> clearingCategory) {
|
Collection<ClearingCategory> clearingCategory) {
|
||||||
List<PaymentInstruction> newPaymentInstructions = createPaymentInstructions(executionDeposit, liabilitiesClaimsAssets, clearingCategory);
|
List<PaymentInstruction> newPaymentInstructions = createPaymentInstructions(executionDeposit, liabilitiesClaimsAssets, clearingCategory);
|
||||||
log.trace("Created {} PaymentInstruction by LiabilitiesClaimsAssets[{}]. Do save ti IMDG.",
|
log.trace("Created {} PaymentInstruction by LiabilitiesClaimsAssets[{}], category {}. Do save in IMDG.",
|
||||||
newPaymentInstructions.size(), liabilitiesClaimsAssets.getId());
|
newPaymentInstructions.size(), liabilitiesClaimsAssets.getId(), clearingCategory);
|
||||||
for (PaymentInstruction instruction : newPaymentInstructions) {
|
for (PaymentInstruction instruction : newPaymentInstructions) {
|
||||||
paymentInstructionImdg.insert(instruction);
|
paymentInstructionImdg.insert(instruction);
|
||||||
}
|
}
|
||||||
|
|
@ -98,7 +98,11 @@ public class PaymentInstructionCreator {
|
||||||
Collection<ClearingCategory> clearingCategory) {
|
Collection<ClearingCategory> clearingCategory) {
|
||||||
List<PaymentInstruction> newPaymentInstructions = new ArrayList<>();
|
List<PaymentInstruction> newPaymentInstructions = new ArrayList<>();
|
||||||
Instant now = Instant.now();
|
Instant now = Instant.now();
|
||||||
|
LocalDate today = LocalDate.now();
|
||||||
|
if (!today.equals(liabilitiesClaimsAssets.getSettlementDate())) {
|
||||||
|
log.debug("For liabilitiesClaimsAssets.SettlementDate={} is not today.", liabilitiesClaimsAssets.getSettlementDate());
|
||||||
|
return newPaymentInstructions;
|
||||||
|
}
|
||||||
// I
|
// I
|
||||||
if (clearingCategory.contains(ClearingCategory.I)) {
|
if (clearingCategory.contains(ClearingCategory.I)) {
|
||||||
log.debug("By liabilitiesClaimsAssets[{}] create for category I 1 PaymentInstruction record", liabilitiesClaimsAssets.getId());
|
log.debug("By liabilitiesClaimsAssets[{}] create for category I 1 PaymentInstruction record", liabilitiesClaimsAssets.getId());
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue