clearing-service http://jira.mfd.msk:8088/browse/CLS-311 поправил заполнение Sdf54

This commit is contained in:
AKurakin 2023-09-05 12:42:46 +03:00
parent 881c66dc1b
commit 8fbee21a95

View file

@ -125,11 +125,21 @@ public class Sdf54Creator {
sDf54.setC_acc_deb(c_acc_deb);
Account rBnkAccount = accountImdg.getFirstObjectBySQL("companyId=%s and accountType = '%s' and status = '%s'"
.formatted(paymentInstruction.getAddresseeId(), AccountType.Bank.getKey(), Status.Active.getKey()));
BankAccount rBnkAcc = rBnkAccount == null ? null : bankAccountImdg.getFirstObjectBySQL("accountId = %d".formatted(rBnkAccount.getId()));
if (rBnkAcc != null) {
sDf54.setRbankcode(rBnkAcc.getBankIdentificationCode());
if (rBnkAcc.getCorrespondentAccount() != null && !rBnkAcc.getCorrespondentAccount().equals(c_acc_cred)) {
log.warn("By paymentInstruction[{}] found accountId={} with CorrespondentAccount=\"{}\" not same that c_acc_cred=\"{}\"", paymentInstruction.getId(), rBnkAccount.getId(),
rBnkAcc.getCorrespondentAccount(), c_acc_cred);
}
}
sDf54.setC_acc_cred(c_acc_cred);
String addresseeSbankName = "";
if (paymentInstruction.getAddresseeId().equals(1L)) {
if (Sender.One.equalsById(paymentInstruction.getAddresseeId())) { // == 1
addresseeSbankName = paymentInstruction.getAddresseeBankName();
} else {
Company company = companyImdg.getSingleObjectByID(paymentInstruction.getAddresseeId());
@ -145,6 +155,29 @@ public class Sdf54Creator {
sDf54::setRbanknam4,
sDf54::setRbanknam5);
{
Company company1 = companyImdg.getSingleObjectByID(Sender.One.getId());
if (company1 != null) { // "АО СПВБ" company.shortName[id = 1]
SpecifUtil.fillSegmentsBy35Symbols(company1.getShortName(),
sDf54::setSclientn1,
sDf54::setSclientn2,
sDf54::setSclientn3,
sDf54::setSclientn4);
} else {
log.warn("Company id=1 not exist");
}
}
{
Company company = companyImdg.getSingleObjectByID(paymentInstruction.getAddresseeId());
if (company != null) {
SpecifUtil.fillSegmentsBy35Symbols(company.getShortName(),
sDf54::setRclientn1,
sDf54::setRclientn2,
sDf54::setRclientn3,
sDf54::setRclientn4);
}
}
sDf54.setPay_date(payDateFormatter.format(TimeUtil.toLocalDate(paymentInstruction.getPaymentDate())));
sDf54.setPay_val("RUR");
String sumDeb = paymentInstruction.getDebitLeg_amount() != null ? paymentInstruction.getDebitLeg_amount().toString() : "";