clearing-service Sdf04 ожидание полностью готовой группы в SessionMonitor

This commit is contained in:
AKurakin 2023-08-30 17:39:50 +03:00
parent 546359752b
commit 47d0830e9e
3 changed files with 5 additions and 3 deletions

View file

@ -1,5 +1,6 @@
package ru.spcex.clearing.service;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@ -36,7 +37,7 @@ public class PaymentUpdateBySdf04 {
continue;
}
PaymentInstruction payment = paymentImdgs.getFirstObjectByFieldValues(Map.of("id", paymentId));
if ("OK!".equals(sDf04.getImp_result())) {
if (StringUtils.startsWith(sDf04.getImp_result(), "OK")) {
payment.setTransactionStatus(TransactionStatus.ok.getKey());
} else {
payment.setTransactionStatus(TransactionStatus.fail.getKey());

View file

@ -1,5 +1,6 @@
package ru.spcex.clearing.service.executors;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
@ -70,7 +71,7 @@ public class Sdf04Executor extends AbstractExecutor<SDf04> {
public Result execute(Collection<SDf04> sdf, StatementRequest statementRequest) {
Result result = new Result();
for (SDf04 sdf04 : sdf) {
if (!("OK!".equals(sdf04.getImp_result()))) {
if (!StringUtils.startsWith(sdf04.getImp_result(), "OK")) {
log.warn("groupId={} stop execute, cause: sdf04[{}].Imp_result=\"{}\" was not ok.", statementRequest.getGroupId(),
sdf04.getId(), sdf04.getImp_result());
result.setAnyHasError(true);

View file

@ -58,7 +58,7 @@ class PaymentUpdateBySdf04Test extends AbstractClearingTest {
SDf04 sDf04s = new SDf04();
sDf04s.setGenerationId(sdf04GroupId);
sDf04s.setDocnm_ref(docnm_ref);
sDf04s.setImp_result("OK!");
sDf04s.setImp_result("OK");
sdf04Imdg.insert(sDf04s);
PaymentInstruction payment = new PaymentInstruction();