etreschenkov 2023-05-29 16:03:49 +03:00
parent eff05cb619
commit e110b10cb9
5 changed files with 45 additions and 18 deletions

View file

@ -14,6 +14,7 @@ public class Session extends BusinessObject {
private Long userId;
private String section;
private String sessionType;
private String workflowStatus;
public LocalDate getClearingDate() {
return clearingDate;
@ -70,4 +71,12 @@ public class Session extends BusinessObject {
public void setSessionType(String sessionType) {
this.sessionType = sessionType;
}
public String getWorkflowStatus() {
return workflowStatus;
}
public void setWorkflowStatus(String workflowStatus) {
this.workflowStatus = workflowStatus;
}
}

View file

@ -63,6 +63,7 @@ public abstract class AbstractSession {
protected void continueRunning(TaskType t) {
synchronized (this.currStage) {
this.currStage.set(t);
sessionImdg.update(this.currSession);
}
}

View file

@ -185,17 +185,19 @@ public class PrimaryAuctionBnSession extends AbstractSession implements Initiali
log.info("already running session.id={}", this.currSession.getId());
return false;
} else {
TaskType startStatus = TaskType.StartRevise;
Session newSession = new Session();
newSession.setSection(Section.FOND.getKey());
newSession.setSessionType(SessionType.IPOB.getKey());
newSession.setSessionStatus(SessionStatus.CLRN.getKey());
newSession.setSessionStatus(startStatus.getKey());
newSession.setWorkflowStatus(SessionStatus.ACTV.getKey());
newSession.setClearingDate(LocalDate.now());
//todo companyId/securityId/userId передается из сообщения очереди
sessionImdg.insert(newSession);
currSession = newSession;
log.info("started new session.id={}", this.currSession.getId());
currStage.set(TaskType.StartRevise);
currStage.set(startStatus);
return true;
}
}

View file

@ -1,56 +1,68 @@
package ru.spcex.clearing.session.stage;
public enum TaskType {
import ru.spcex.platform.utils.enumeration.IEnumKey;
public enum TaskType implements IEnumKey {
/**
* step 0
*/
StartRevise,
ContinueRevise,
StartRevise("rev"),
ContinueRevise("s-1"),
/**
* step 1
*/
DealsPrepare,
DealsPrepare("s-2"),
/**
* step 2
*/
RequirementsAndObligationsCreate,
RequirementsAndObligationsCreate("s-3"),
/**
* step 3
*/
ObligationsAdmission,
ObligationsAdmission("s-4"),
/**
* step 4
*/
InclusionToPool,
InclusionToPool("s-5"),
/**
* step 5
*/
InspectionObligations,
InspectionObligations("S-6"),
/**
* Step 6: forming Registry on Obligations and Settlement requirements
*/
FormingRegistersOnOS,
FormingRegistersOnOS("s-7"),
/**
* step 7
*/
FormingPaymentInstruction,
FormingPaymentInstruction("s-8"),
/**
* step 8
*/
UnlockResources,
UnlockResources("unlc"),
/**
* Step 10
*/
FinishingSession,
FinishingSession("s-10"),
/**
* Step 11
*/
EndStageNotification;
EndStageNotification("s-11");
private String key;
TaskType(String key) {
this.key = key;
}
@Override
public String getKey() {
return key;
}
}

View file

@ -30,7 +30,8 @@ public class SessionMapStore extends TemplateMapStore<Session> {
@Override
public String[] getFields() {
return new String[]{
"id", "created_at", "updated_at", "clearing_date", "session_status", "company_id", "security_id", "user_id", "section", "session_type"
"id", "created_at", "updated_at", "clearing_date", "session_status", "company_id", "security_id",
"user_id", "section", "session_type", "workflow_status"
};
}
@ -47,6 +48,7 @@ public class SessionMapStore extends TemplateMapStore<Session> {
session.setUserId(resultSet.getObject("USER_ID", Long.class));
session.setSection(resultSet.getObject("SECTION", String.class));
session.setSessionType(resultSet.getObject("SESSION_TYPE", String.class));
session.setWorkflowStatus(resultSet.getObject("WORKFLOW_STATUS", String.class));
return session;
}
@ -62,7 +64,8 @@ public class SessionMapStore extends TemplateMapStore<Session> {
session.getSecurityId(),
session.getUserId(),
session.getSection(),
session.getSessionType()
session.getSessionType(),
session.getWorkflowStatus()
};
return args;
}