StatementServiceV2 move to package
This commit is contained in:
parent
afb21eb2ba
commit
2b4e189a54
3 changed files with 33 additions and 20 deletions
|
|
@ -21,6 +21,7 @@ import ru.spcex.clearing.platform.messaging.service.sender.KafkaSender;
|
|||
import ru.spcex.clearing.service.executors.AbstractExecutor;
|
||||
import ru.spcex.clearing.service.executors.Reviser;
|
||||
import ru.spcex.clearing.service.model.Result;
|
||||
import ru.spcex.clearing.statement.StatementServiceV2;
|
||||
import ru.spcex.platform.classes.base.SpcexObjectBase;
|
||||
import ru.spcex.platform.enumeration.ObjectType;
|
||||
import ru.spcex.platform.enumeration.Priority;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
package ru.spcex.clearing.statement;
|
||||
|
||||
import ru.spcex.platform.enumeration.SdfTable;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public enum SdfGroup {
|
||||
Sdf01And57(SdfTable.SDF_01, SdfTable.SDF_57),
|
||||
Triple(SdfTable.SDF_04, SdfTable.SDF_01, SdfTable.SDF_57),
|
||||
Quad(SdfTable.SDF_04, SdfTable.SDF_13, SdfTable.SDF_01, SdfTable.SDF_57),
|
||||
Sdf08And21(SdfTable.SDF_08, SdfTable.SDF_21);
|
||||
private final Collection<SdfTable> group;
|
||||
|
||||
SdfGroup(SdfTable... group) {
|
||||
this.group = List.of(group);
|
||||
}
|
||||
|
||||
public Collection<SdfTable> getGroup() {
|
||||
return group;
|
||||
}
|
||||
|
||||
public static Optional<SdfGroup> groupByTable(SdfTable t) {
|
||||
return Arrays.stream(SdfGroup.values())
|
||||
.filter(g -> g.getGroup().contains(t))
|
||||
.findFirst();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package ru.spcex.clearing.service;
|
||||
package ru.spcex.clearing.statement;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
@ -11,6 +11,7 @@ import ru.spcex.clearing.platform.messaging.domain.Consts;
|
|||
import ru.spcex.clearing.platform.messaging.domain.cud.account.sdf01.AccountSdf01Request;
|
||||
import ru.spcex.clearing.platform.messaging.domain.cud.balance.StatementRequest;
|
||||
import ru.spcex.clearing.platform.messaging.service.sender.KafkaSender;
|
||||
import ru.spcex.clearing.service.StatementService;
|
||||
import ru.spcex.clearing.service.executors.*;
|
||||
import ru.spcex.clearing.service.model.Result;
|
||||
import ru.spcex.platform.enumeration.SdfTable;
|
||||
|
|
@ -177,23 +178,4 @@ public class StatementServiceV2 {
|
|||
}
|
||||
}
|
||||
|
||||
private enum SdfGroup {
|
||||
Sdf01And57(SdfTable.SDF_01, SdfTable.SDF_57),
|
||||
Sdf08And21(SdfTable.SDF_08, SdfTable.SDF_21);
|
||||
private final Collection<SdfTable> group;
|
||||
|
||||
SdfGroup(SdfTable... group) {
|
||||
this.group = List.of(group);
|
||||
}
|
||||
|
||||
public Collection<SdfTable> getGroup() {
|
||||
return group;
|
||||
}
|
||||
|
||||
public static Optional<SdfGroup> groupByTable(SdfTable t) {
|
||||
return Arrays.stream(SdfGroup.values())
|
||||
.filter(g -> g.getGroup().contains(t))
|
||||
.findFirst();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue