balance-service fix
This commit is contained in:
parent
b4c3388e06
commit
dd117b09b1
3 changed files with 14 additions and 6 deletions
|
|
@ -4,6 +4,8 @@ import org.springframework.context.annotation.Bean;
|
|||
import org.springframework.context.annotation.Configuration;
|
||||
import ru.spcex.clearing.balance.service.AbstractExecutor;
|
||||
import ru.spcex.clearing.balance.service.Sdf01Executor;
|
||||
import ru.spcex.clearing.balance.service.Sdf09Executor;
|
||||
import ru.spcex.clearing.balance.service.Sdf16Executor;
|
||||
import ru.spcex.platform.classes.base.interfaces.WithAccount;
|
||||
import ru.spcex.platform.enumeration.SdfTable;
|
||||
|
||||
|
|
@ -14,9 +16,13 @@ import java.util.Map;
|
|||
public class SdfExecutorsConfig {
|
||||
|
||||
@Bean("sdfExecutors")
|
||||
public Map<SdfTable, AbstractExecutor<? extends WithAccount>> executorsMap(Sdf01Executor sdf01Executor) {
|
||||
public Map<SdfTable, AbstractExecutor<? extends WithAccount>> executorsMap(Sdf01Executor sdf01Executor,
|
||||
Sdf09Executor sdf09Executor,
|
||||
Sdf16Executor sdf16Executor) {
|
||||
Map<SdfTable, AbstractExecutor<? extends WithAccount>> executors = new HashMap<>();
|
||||
executors.put(SdfTable.SDF_01, sdf01Executor);
|
||||
executors.put(SdfTable.SDF_09, sdf09Executor);
|
||||
executors.put(SdfTable.SDF_16, sdf16Executor);
|
||||
return executors;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,9 @@ public class DbfImportKafkaMessenger implements InitializingBean {
|
|||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
messengers.put(ETable.DF_01, this::messageDf01);
|
||||
messengers.put(ETable.DF_01, groupId -> messageBalance(groupId, SdfTable.SDF_01));
|
||||
messengers.put(ETable.DF_09, groupId -> messageBalance(groupId, SdfTable.SDF_09));
|
||||
messengers.put(ETable.DF_16, groupId -> messageBalance(groupId, SdfTable.SDF_16));
|
||||
messengers.put(ETable.DF_04, this::messageDf04);
|
||||
}
|
||||
|
||||
|
|
@ -41,10 +43,10 @@ public class DbfImportKafkaMessenger implements InitializingBean {
|
|||
}
|
||||
}
|
||||
|
||||
private void messageDf01(Long groupId) {
|
||||
private void messageBalance(Long groupId, SdfTable table) {
|
||||
StatementRequest statementRequest = new StatementRequest();
|
||||
statementRequest.setGroupId(groupId);
|
||||
statementRequest.setTable(SdfTable.SDF_01);
|
||||
statementRequest.setTable(table);
|
||||
kafka.get().sendRequestToQueue(Consts.STATEMENT_PROCESS, statementRequest);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@ package ru.spcex.platform.enumeration;
|
|||
import ru.spcex.platform.utils.enumeration.IEnumKey;
|
||||
|
||||
public enum SdfTable implements IEnumKey {
|
||||
SDF_01("SDF_01");
|
||||
SDF_01("SDF_01"), SDF_09("SDF_09"), SDF_16("SDF_16");
|
||||
|
||||
SdfTable(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
private String key;
|
||||
private final String key;
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue