etreshenkov 2023-05-25 17:11:53 +03:00
parent d1ae9e05c8
commit 58b396c849
4 changed files with 19 additions and 10 deletions

View file

@ -62,8 +62,11 @@ public class EventsReceiver extends QueueConsumer implements InitializingBean {
.setConsumer(primaryAuctionBnSession::runSession) .setConsumer(primaryAuctionBnSession::runSession)
.forDestination(Task.startOfClearing.topic(), callbacks::put); .forDestination(Task.startOfClearing.topic(), callbacks::put);
callback(Object.class) callback(Object.class)
.setConsumer(primaryAuctionBnSession::continueSession) .setConsumer(primaryAuctionBnSession::continueSessionFirstPart)
.forDestination(Consts.CONTINUE_SESSION_BN, callbacks::put); .forDestination(Consts.CONTINUE_SESSION_BN_FIRST_PART, callbacks::put);
callback(Object.class)
.setConsumer(primaryAuctionBnSession::continueSessionSecondPart)
.forDestination(Consts.CONTINUE_SESSION_BN_SECOND_PART, callbacks::put);
callback(Object.class) callback(Object.class)
.setConsumer(event -> clearingService.executeSTrade()) .setConsumer(event -> clearingService.executeSTrade())

View file

@ -103,7 +103,7 @@ public class Sdf57Executor extends AbstractExecutor<SDf57> {
public void sendCommand(KafkaSender kafkaSender, Result result) { public void sendCommand(KafkaSender kafkaSender, Result result) {
ContinueSessionBnRequest continueSessionBn = new ContinueSessionBnRequest(); ContinueSessionBnRequest continueSessionBn = new ContinueSessionBnRequest();
continueSessionBn.setGenerationId(result.getGenerationId()); continueSessionBn.setGenerationId(result.getGenerationId());
kafkaSender.sendRequestToQueue(Consts.CONTINUE_SESSION_BN, continueSessionBn); kafkaSender.sendRequestToQueue(Consts.CONTINUE_SESSION_BN_FIRST_PART, continueSessionBn);
} }
//V - Изменение statement по sDf57 //V - Изменение statement по sDf57

View file

@ -89,7 +89,7 @@ public class PrimaryAuctionBnSession extends AbstractSession implements Initiali
} }
} }
public void continueSession(BaseRequest<?> req) { public void continueSessionFirstPart(BaseRequest<?> req) {
try { try {
if (!checkStage(TaskType.StartRevise)) { if (!checkStage(TaskType.StartRevise)) {
log.error("cannot continue session, current stage is {}", currStage.get()); log.error("cannot continue session, current stage is {}", currStage.get());
@ -124,11 +124,16 @@ public class PrimaryAuctionBnSession extends AbstractSession implements Initiali
runStage(TaskType.FormingRegistersOnOS, formingRegistersOnOS); //returns Collection<Registry> runStage(TaskType.FormingRegistersOnOS, formingRegistersOnOS); //returns Collection<Registry>
//stage 7 //stage 7
runStage(TaskType.FormingPaymentInstruction, formingPaymentInstruction); runStage(TaskType.FormingPaymentInstruction, formingPaymentInstruction);
//stage 8 } catch (StageException e) {
{ //already logged
UnlockResourcesPayload unlockResourcesPayload = new UnlockResourcesPayload(); }
//todo set arguments }
runStage(TaskType.UnlockResources, unlockResourcesPayload, unlockResources); //returns Collection<Registry>
public void continueSessionSecondPart(BaseRequest<?> req) {
try {
if (!checkStage(TaskType.FormingPaymentInstruction)) {
log.error("cannot continue session, current stage is {}", currStage.get());
throw new StageException();
} }
//stage 9 //stage 9
{ {

View file

@ -121,7 +121,8 @@ public interface Consts {
String SDF53_PROCESS = "sdf53-process"; String SDF53_PROCESS = "sdf53-process";
String SDF54_PROCESS = "sdf54-process"; String SDF54_PROCESS = "sdf54-process";
String SDF56_PROCESS = "sdf56-process"; String SDF56_PROCESS = "sdf56-process";
String CONTINUE_SESSION_BN = "sdf57-process"; String CONTINUE_SESSION_BN_FIRST_PART = "sdf57-process";
String CONTINUE_SESSION_BN_SECOND_PART = "sdf13-process";
String REVISE_PROCESS = "revise-process"; String REVISE_PROCESS = "revise-process";
String EXPORT_PROCESS = "export-process"; String EXPORT_PROCESS = "export-process";
String EXPORT_COMPLETED = "export_completed"; String EXPORT_COMPLETED = "export_completed";