diff --git a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/SecurityService.java b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/SecurityService.java index e87a4d18d..8aa3e60d1 100644 --- a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/SecurityService.java +++ b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/SecurityService.java @@ -37,7 +37,13 @@ public class SecurityService { FondSecurity::getSecuritySymbol, FondSecurity::getWorkflowStatus); List securityList = request.getSecurities().stream() - .filter(r->r.getSecuritySymbol() != null && r.getWorkflowStatus() != null) + .filter(r -> { + boolean ok = r.getSecuritySymbol() != null && r.getWorkflowStatus() != null; + if (!ok) { + log.debug("FondSecurity {}, ignore 1002: required field 'SecuritySymbol' or 'WorkflowStatus' was empty", r.getId()); + } + return ok; + }) .sorted(comparatorBySecSymbolAndWorkflowStatus).toList(); for (FondSecurity security : securityList) { try { diff --git a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/processor/ListingMMProcessor.java b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/processor/ListingMMProcessor.java index 6d9817067..91647e82d 100644 --- a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/processor/ListingMMProcessor.java +++ b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/processor/ListingMMProcessor.java @@ -15,6 +15,7 @@ import ru.spcex.platform.utils.log.ExceptionUtils; import java.util.List; import java.util.UUID; +import java.util.stream.Collectors; @Service public class ListingMMProcessor { @@ -32,9 +33,16 @@ public class ListingMMProcessor { public void process(MMListingsRequest request) { List exchangeInstrumentList = request.getExchangeInstrumentList(); CodeStatusComparator comparatorByCodeAndWorkflowStatus = CodeStatusComparator.create( - ExchangeInstrument::getCode, - ExchangeInstrument::getWorkflowStatus); - exchangeInstrumentList.sort(comparatorByCodeAndWorkflowStatus); + ExchangeInstrument::getCode, + ExchangeInstrument::getWorkflowStatus); + exchangeInstrumentList = exchangeInstrumentList.stream() + .filter(ei -> { + if (ei.getCode() == null) { + log.debug("ExchangeInstrument {}, ignore 1002: required field 'code' was empty", ei.getId()); + } + return ei.getCode() != null; + }) + .sorted(comparatorByCodeAndWorkflowStatus).collect(Collectors.toList()); for (ExchangeInstrument exchangeInstrument : exchangeInstrumentList) { try { UUID exchangeInstrumentId = exchangeInstrument.getId();