создание PaymentInstruction при обработке сделок для итоговой сессии МКР поля AdresseeBic/PayeeBic

This commit is contained in:
ialbert 2023-06-08 15:09:13 +03:00
parent 5ed749dbab
commit 2319f1a345

View file

@ -92,24 +92,31 @@ public class PaymentInstructionBuilderFinalMkrDeals {
payment1.setClearingDate(TimeUtil.toLocalDate(now)); payment1.setClearingDate(TimeUtil.toLocalDate(now));
payment1.setSenderId(lm_t.getCompanyId()); payment1.setSenderId(lm_t.getCompanyId());
payment1.setAddresseeId(Sender.One.getId()); payment1.setAddresseeId(Sender.One.getId());
String symbol1 = selectSymbolValue(payment1.getAddresseeId(), CompanySymbol.BIC); {
if (symbol1 == null) { String addresseeBic = selectSymbolValue(payment1.getAddresseeId(), CompanySymbol.BIC);
log.warn("CompanySymbols BIC not found for companyId={}", payment1.getAddresseeId()); if (addresseeBic == null) {
} else { log.warn("CompanySymbols BIC not found for companyId={}", payment1.getAddresseeId());
payment1.setAdresseeBic(symbol1); } else {
payment1.setAdresseeBic(addresseeBic);
}
} }
{
Company companyPRC = companyImdg.getSingleObjectByID(Sender.Prc.getId()); // 2 "НКО АО ПРЦ" Company companyPRC = companyImdg.getSingleObjectByID(Sender.Prc.getId()); // 2 "НКО АО ПРЦ"
String companyPRCName = null; if (companyPRC == null) {
if (companyPRC == null) { log.warn("Company.id={} not found", Sender.Prc.getId());
log.warn("Company.id={} not found", Sender.Prc.getId()); } else {
} else { payment1.setPayeeBankName(companyPRC.getShortName());
companyPRCName = companyPRC.getShortName(); payment1.setAddresseeBankName(companyPRC.getShortName());
}
}
{
String payeeBic = selectSymbolValue(payment1.getSenderId(), CompanySymbol.BIC);
if (payeeBic == null) {
log.warn("payeeBic by senderId={} not found", payment1.getSenderId());
} else {
payment1.setPayeeBic(payeeBic);
}
} }
payment1.setPayeeBankName(companyPRCName);
payment1.setPayeeBic(symbolPRC);
payment1.setAddresseeBankName(companyPRCName);
payment1.setPaymentDate(TimeUtil.localDateToInstant(lm_t.getSettlementDate())); payment1.setPaymentDate(TimeUtil.localDateToInstant(lm_t.getSettlementDate()));