Merge branch 'dev' into plan_balance_dmx_dmt
This commit is contained in:
commit
90a2b858bb
12 changed files with 128 additions and 29 deletions
|
|
@ -246,6 +246,8 @@
|
||||||
<task id="23" code="GRET" name="Формирование отчетности по сделкам"/>
|
<task id="23" code="GRET" name="Формирование отчетности по сделкам"/>
|
||||||
<task id="24" code="GREF" name="Формирование итоговой отчетности"/>
|
<task id="24" code="GREF" name="Формирование итоговой отчетности"/>
|
||||||
<task id="25" code="FDFF" name="Формирование ДФ-05 с кодом 9 (финальный)"/>
|
<task id="25" code="FDFF" name="Формирование ДФ-05 с кодом 9 (финальный)"/>
|
||||||
|
<task id="26" code="SDEP" name="Время начала возврата депозитов"/>
|
||||||
|
<task id="27" code="EDEP" name="Время завершения возврата депозитов"/>
|
||||||
<taskStatus id="1" code="ACTV" name="Активна"/>
|
<taskStatus id="1" code="ACTV" name="Активна"/>
|
||||||
<taskStatus id="2" code="BLKD" name="Не активна"/>
|
<taskStatus id="2" code="BLKD" name="Не активна"/>
|
||||||
<taskStatus id="3" code="CNCL" name="Отмена расписания"/>
|
<taskStatus id="3" code="CNCL" name="Отмена расписания"/>
|
||||||
|
|
@ -473,6 +475,7 @@
|
||||||
<errorCode id="5430" code="CLRN" name="Неверный код регистра: %s"/>
|
<errorCode id="5430" code="CLRN" name="Неверный код регистра: %s"/>
|
||||||
<errorCode id="5431" code="CLRN" name="Дата возврата для депозита с разделением не может быть изменена"/>
|
<errorCode id="5431" code="CLRN" name="Дата возврата для депозита с разделением не может быть изменена"/>
|
||||||
<errorCode id="5432" code="CLRN" name="После сверки обнаружена разница между плановым и фактическим балансом"/>
|
<errorCode id="5432" code="CLRN" name="После сверки обнаружена разница между плановым и фактическим балансом"/>
|
||||||
|
<errorCode id="5433" code="CLRN" name="Сессия по возврату депозита не может исполняться вне временного интервала, установленного в системе"/>
|
||||||
<!-- error code for dbf-importer -->
|
<!-- error code for dbf-importer -->
|
||||||
<errorCode id="5600" code="DBFI" name="Общая ошибка модуля dbf-importer."/>
|
<errorCode id="5600" code="DBFI" name="Общая ошибка модуля dbf-importer."/>
|
||||||
<!-- error code for dbf-exporter -->
|
<!-- error code for dbf-exporter -->
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ public enum ClearingError implements IErrorEnumId {
|
||||||
RgsWrongCode(5430L),
|
RgsWrongCode(5430L),
|
||||||
RefundDateCannotBeChanged(5431L),
|
RefundDateCannotBeChanged(5431L),
|
||||||
PlanBalanceReviseError(5432L),
|
PlanBalanceReviseError(5432L),
|
||||||
|
XdepTimeIntervalNotMatch(5433L),
|
||||||
//ошибки "перенесенные" из balance-service,
|
//ошибки "перенесенные" из balance-service,
|
||||||
CompanyNotFoundB(5211L),
|
CompanyNotFoundB(5211L),
|
||||||
CurrencyNotFound(5213L),
|
CurrencyNotFound(5213L),
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ public class TradingTimeService {
|
||||||
this.plannerAllTodayImdg = imdgProvider.getImdg(IMDGDistributedNames.Map_PlannerAllToday, PlannerAllToday.class);
|
this.plannerAllTodayImdg = imdgProvider.getImdg(IMDGDistributedNames.Map_PlannerAllToday, PlannerAllToday.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isTradingTime() {
|
private boolean isTradingTime(Task startTime, Task endTime) {
|
||||||
ImdgPredicateBuilder pb = plannerAllTodayImdg.predicateBuilder();
|
ImdgPredicateBuilder pb = plannerAllTodayImdg.predicateBuilder();
|
||||||
Function<Task, Optional<PlannerAllToday>> plannerByTask = task -> {
|
Function<Task, Optional<PlannerAllToday>> plannerByTask = task -> {
|
||||||
ImdgPredicate plannerPrdct = pb.and(
|
ImdgPredicate plannerPrdct = pb.and(
|
||||||
|
|
@ -34,19 +34,28 @@ public class TradingTimeService {
|
||||||
);
|
);
|
||||||
return Optional.ofNullable(plannerAllTodayImdg.getFirstObjectByPredicate(plannerPrdct));
|
return Optional.ofNullable(plannerAllTodayImdg.getFirstObjectByPredicate(plannerPrdct));
|
||||||
};
|
};
|
||||||
LocalTime startTradingTime = plannerByTask.apply(Task.createRegistry_STRS)
|
LocalTime startTradingTime = plannerByTask.apply(startTime)
|
||||||
.map(PlannerAllToday::getTaskTime)
|
.map(PlannerAllToday::getTaskTime)
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
LocalTime endTradingTime = plannerByTask.apply(Task.createRegistry_ETRS)
|
LocalTime endTradingTime = plannerByTask.apply(endTime)
|
||||||
.map(PlannerAllToday::getTaskTime)
|
.map(PlannerAllToday::getTaskTime)
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
if (startTradingTime == null || endTradingTime == null) {
|
if (startTradingTime == null || endTradingTime == null) {
|
||||||
log.warn("startTradingTime or endTradingTime is null");
|
log.warn("{} or {} not found in planner all today", startTime.getKey(), endTime.getKey());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
LocalTime now = LocalTime.now();
|
LocalTime now = LocalTime.now();
|
||||||
boolean isTradingTime = !now.isBefore(startTradingTime) && !now.isAfter(endTradingTime);
|
boolean isTradingTime = !now.isBefore(startTradingTime) && !now.isAfter(endTradingTime);
|
||||||
log.debug("now: {}, startTradingTime: {}, endTradingTime: {}. trading time: {}", now, startTradingTime, endTradingTime, isTradingTime);
|
log.debug("now: {}, {}: {}, {}: {}. period check in: {}",
|
||||||
|
now, startTime.getKey(), startTradingTime, endTime.getKey(), endTradingTime, isTradingTime);
|
||||||
return isTradingTime;
|
return isTradingTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isTradingTime() {
|
||||||
|
return isTradingTime(Task.createRegistry_STRS, Task.createRegistry_ETRS);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean timeForXdep() {
|
||||||
|
return isTradingTime(Task.startTime_SDEP, Task.endTime_EDEP);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||||
import ru.spcex.clearing.notification.NotificationSender;
|
import ru.spcex.clearing.notification.NotificationSender;
|
||||||
import ru.spcex.clearing.platform.messaging.domain.BaseRequest;
|
import ru.spcex.clearing.platform.messaging.domain.BaseRequest;
|
||||||
import ru.spcex.clearing.platform.messaging.domain.cud.schedule.LauncherCommandRequest;
|
import ru.spcex.clearing.platform.messaging.domain.cud.schedule.LauncherCommandRequest;
|
||||||
|
import ru.spcex.clearing.service.schedule.TradingTimeService;
|
||||||
import ru.spcex.platform.enumeration.*;
|
import ru.spcex.platform.enumeration.*;
|
||||||
import ru.spcex.platform.imdg.api.Imdg;
|
import ru.spcex.platform.imdg.api.Imdg;
|
||||||
import ru.spcex.platform.imdg.api.ImdgProvider;
|
import ru.spcex.platform.imdg.api.ImdgProvider;
|
||||||
|
|
@ -33,13 +34,14 @@ public class SessionManager {
|
||||||
private final IntermediateMkrSession intermediateMkrSession;
|
private final IntermediateMkrSession intermediateMkrSession;
|
||||||
private final FinalMkrSession finalMkrSession;
|
private final FinalMkrSession finalMkrSession;
|
||||||
private final ReturnDepositSession returnDepositSession;
|
private final ReturnDepositSession returnDepositSession;
|
||||||
|
private final TradingTimeService time;
|
||||||
|
|
||||||
public SessionManager(ImdgProvider imdgProvider,
|
public SessionManager(ImdgProvider imdgProvider,
|
||||||
NotificationSender notification, IMessageResolver msgs, PrimaryAuctionT0Session primaryAuctionT0Session,
|
NotificationSender notification, IMessageResolver msgs, PrimaryAuctionT0Session primaryAuctionT0Session,
|
||||||
PrimaryAuctionBnSession primaryAuctionBnSession,
|
PrimaryAuctionBnSession primaryAuctionBnSession,
|
||||||
PrimaryAuctionB0Session primaryAuctionB0Session,
|
PrimaryAuctionB0Session primaryAuctionB0Session,
|
||||||
SecondaryAuctionT0Session secondaryAuctionT0Session,
|
SecondaryAuctionT0Session secondaryAuctionT0Session,
|
||||||
IntermediateMkrSession intermediateMkrSession, FinalMkrSession finalMkrSession, ReturnDepositSession returnDepositSession) {
|
IntermediateMkrSession intermediateMkrSession, FinalMkrSession finalMkrSession, ReturnDepositSession returnDepositSession, TradingTimeService time) {
|
||||||
this.notification = notification;
|
this.notification = notification;
|
||||||
this.msgs = msgs;
|
this.msgs = msgs;
|
||||||
this.primaryAuctionT0Session = primaryAuctionT0Session;
|
this.primaryAuctionT0Session = primaryAuctionT0Session;
|
||||||
|
|
@ -51,6 +53,7 @@ public class SessionManager {
|
||||||
this.returnDepositSession = returnDepositSession;
|
this.returnDepositSession = returnDepositSession;
|
||||||
|
|
||||||
sessionImdg = imdgProvider.getImdg(IMDGDistributedNames.Map_Session, Session.class);
|
sessionImdg = imdgProvider.getImdg(IMDGDistributedNames.Map_Session, Session.class);
|
||||||
|
this.time = time;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void defineAndStartSession(BaseRequest<LauncherCommandRequest> r) throws ValidationException { //task sclr section fond sessiontype trdt
|
public void defineAndStartSession(BaseRequest<LauncherCommandRequest> r) throws ValidationException { //task sclr section fond sessiontype trdt
|
||||||
|
|
@ -76,19 +79,27 @@ public class SessionManager {
|
||||||
|
|
||||||
if (session != null) {
|
if (session != null) {
|
||||||
//checkActive
|
//checkActive
|
||||||
checkActiveSession();
|
checkAllowSessionStart(sessionType);
|
||||||
|
|
||||||
session.runSession(baseRequest);
|
session.runSession(baseRequest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void checkActiveSession() throws ValidationException {
|
protected void checkAllowSessionStart(SessionType sessionType) throws ValidationException {
|
||||||
Session existActiveSession = sessionImdg.getFirstObjectByFieldValues(Map.of(
|
EnumMessage err = null;
|
||||||
"workflowStatus", SessionStatus.ACTV.getKey()
|
if (sessionType.equals(SessionType.XDEP) && !time.timeForXdep()) {
|
||||||
));
|
log.warn("cannot launch {} reason: time interval not matched", sessionType);
|
||||||
if (existActiveSession != null) {
|
err = new EnumMessage(ClearingError.XdepTimeIntervalNotMatch);
|
||||||
log.warn("Can not start new session, cause exist active session.id={}", existActiveSession.getId());
|
} else {
|
||||||
EnumMessage err = new EnumMessage(ClearingError.ActiveSessionIsPresent, String.valueOf(existActiveSession.getId()));
|
Session existActiveSession = sessionImdg.getFirstObjectByFieldValues(Map.of(
|
||||||
|
"workflowStatus", SessionStatus.ACTV.getKey()
|
||||||
|
));
|
||||||
|
if (existActiveSession != null) {
|
||||||
|
log.warn("Can not start new session, cause exist active session.id={}", existActiveSession.getId());
|
||||||
|
err = new EnumMessage(ClearingError.ActiveSessionIsPresent, String.valueOf(existActiveSession.getId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (err != null) {
|
||||||
notification.sendNotification(ObjectType.session, msgs.resolve(err), Priority.HIGH);
|
notification.sendNotification(ObjectType.session, msgs.resolve(err), Priority.HIGH);
|
||||||
throw new ValidationException(err);
|
throw new ValidationException(err);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -230,6 +230,7 @@ public class RequirementsAndObligationCreation implements ISessionStage {
|
||||||
}
|
}
|
||||||
if (invalid != null) {
|
if (invalid != null) {
|
||||||
log.error("FATAL couldn't match Execution#id({}) with Execution#id({}) error: {}", exec1.getId(), exec2.getId(), invalid);
|
log.error("FATAL couldn't match Execution#id({}) with Execution#id({}) error: {}", exec1.getId(), exec2.getId(), invalid);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
return new Pair<>(exec1, exec2);
|
return new Pair<>(exec1, exec2);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,11 @@ public class ClearingMemberCategoryService extends QueueConsumer implements Init
|
||||||
try {
|
try {
|
||||||
Imdg<ClearingMemberCategory> txClearingMemberCategoryMap = transaction.getImdg(IMDGDistributedNames.Map_ClearingMemberCategory, ClearingMemberCategory.class);
|
Imdg<ClearingMemberCategory> txClearingMemberCategoryMap = transaction.getImdg(IMDGDistributedNames.Map_ClearingMemberCategory, ClearingMemberCategory.class);
|
||||||
txClearingMemberCategoryMap.delete(clearingMemberCategory); // далить до cancelRelation внутри транзакции
|
txClearingMemberCategoryMap.delete(clearingMemberCategory); // далить до cancelRelation внутри транзакции
|
||||||
companyService.relationService.cancelRelation(transaction, clearingMemberCategory.getCompanyId(), clearingMemberCategory);
|
if (clearingMemberCategory.getCompanyId() == null) { // never, только тестовые данные
|
||||||
|
log.warn("Deleted clearingMemberCategory[{}] has not companyId", clearingMemberCategory.getId());
|
||||||
|
} else {
|
||||||
|
companyService.relationService.cancelRelation(transaction, clearingMemberCategory.getCompanyId(), clearingMemberCategory);
|
||||||
|
}
|
||||||
txOk = true;
|
txOk = true;
|
||||||
} finally {
|
} finally {
|
||||||
if (txOk)
|
if (txOk)
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ import ru.spcex.clearing.validation.common.ValidationHelper;
|
||||||
import ru.spcex.platform.enumeration.CompanySymbol;
|
import ru.spcex.platform.enumeration.CompanySymbol;
|
||||||
import ru.spcex.platform.imdg.api.Imdg;
|
import ru.spcex.platform.imdg.api.Imdg;
|
||||||
import ru.spcex.platform.imdg.api.ImdgProvider;
|
import ru.spcex.platform.imdg.api.ImdgProvider;
|
||||||
|
import ru.spcex.platform.utils.enumeration.IEnumKey;
|
||||||
import ru.spcex.platform.utils.enumeration.IMessageResolver;
|
import ru.spcex.platform.utils.enumeration.IMessageResolver;
|
||||||
import ru.spcex.platform.utils.error.ValidationException;
|
import ru.spcex.platform.utils.error.ValidationException;
|
||||||
import ru.spcex.platform.utils.log.ExceptionUtils;
|
import ru.spcex.platform.utils.log.ExceptionUtils;
|
||||||
|
|
@ -48,7 +49,7 @@ public class MultiCompanyService
|
||||||
private final RequestHelper requestHelper;
|
private final RequestHelper requestHelper;
|
||||||
|
|
||||||
protected UserRoleVerification userRoleVerification;
|
protected UserRoleVerification userRoleVerification;
|
||||||
// private final ValidationHelper validationHelper;
|
// private final ValidationHelper validationHelper;
|
||||||
protected IMessageResolver messageResolver;
|
protected IMessageResolver messageResolver;
|
||||||
|
|
||||||
final CompanyService companyService;
|
final CompanyService companyService;
|
||||||
|
|
@ -128,7 +129,7 @@ public class MultiCompanyService
|
||||||
req.setCompanySymbols(
|
req.setCompanySymbols(
|
||||||
Stream.concat(req.getCompanySymbols().stream(), additionalSymbols(req.getCompany())).collect(Collectors.toList())
|
Stream.concat(req.getCompanySymbols().stream(), additionalSymbols(req.getCompany())).collect(Collectors.toList())
|
||||||
);
|
);
|
||||||
companyId = getCompanyIdForCompanySymbols(req.getUuid(), req.getCompany());
|
companyId = getCompanyIdForCompanySymbols(req.getUuid(), req.getCompany(), req.getCompanySymbols());
|
||||||
log.debug("For request {} (uuid {}) company {}.", baseRequest.getId(), req.getUuid(), companyId == null ? "not found" : ("found, id=" + companyId));
|
log.debug("For request {} (uuid {}) company {}.", baseRequest.getId(), req.getUuid(), companyId == null ? "not found" : ("found, id=" + companyId));
|
||||||
if (companyId == null) {
|
if (companyId == null) {
|
||||||
log.debug("For request {} (uuid {}) company not found. Try find by other symbols.", baseRequest.getId(), req.getUuid());
|
log.debug("For request {} (uuid {}) company not found. Try find by other symbols.", baseRequest.getId(), req.getUuid());
|
||||||
|
|
@ -334,7 +335,7 @@ public class MultiCompanyService
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
Long getCompanyIdForCompanySymbols(String uuid, CompanyNewRequest cnr) {
|
Long getCompanyIdForCompanySymbols(String uuid, CompanyNewRequest cnr, Collection<CompanySymbolNewRequest> companySymbols) {
|
||||||
CompanySymbols companySymbol = null;
|
CompanySymbols companySymbol = null;
|
||||||
if (StringUtils.isNotEmpty(uuid)) {
|
if (StringUtils.isNotEmpty(uuid)) {
|
||||||
log.trace("Search company by companySymbol uuid={}", uuid);
|
log.trace("Search company by companySymbol uuid={}", uuid);
|
||||||
|
|
@ -351,10 +352,10 @@ public class MultiCompanyService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (companySymbol == null && StringUtils.isNotEmpty(cnr.getCompanySymbolValue())) {
|
if (companySymbol == null && StringUtils.isNotEmpty(cnr.getCompanySymbolValue())
|
||||||
for (String companySymbolType : Arrays.asList(
|
&& IEnumKey.contains(cnr.getCompanySymbol(), CompanySymbol.INN, CompanySymbol.CIO)) { // вероятно там будет только UUID
|
||||||
cnr.getCompanySymbol(), CompanySymbol.INN.getKey(), CompanySymbol.CIO.getKey()
|
{
|
||||||
)) {
|
String companySymbolType = cnr.getCompanySymbol();
|
||||||
log.trace("Search company by companySymbol {}={}", companySymbolType, cnr.getCompanySymbolValue());
|
log.trace("Search company by companySymbol {}={}", companySymbolType, cnr.getCompanySymbolValue());
|
||||||
Collection<CompanySymbols> companySymbolsFromImdg = companySymbolsImdg.getCollectionObjectsByFieldValues(
|
Collection<CompanySymbols> companySymbolsFromImdg = companySymbolsImdg.getCollectionObjectsByFieldValues(
|
||||||
Map.of(
|
Map.of(
|
||||||
|
|
@ -367,10 +368,31 @@ public class MultiCompanyService
|
||||||
if (companySymbolsFromImdg.size() > 1) {
|
if (companySymbolsFromImdg.size() > 1) {
|
||||||
log.warn("For {} found > 1 company_symbols, use first (id = {})", companySymbolType, cnr.getCompanySymbolValue());
|
log.warn("For {} found > 1 company_symbols, use first (id = {})", companySymbolType, cnr.getCompanySymbolValue());
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (companySymbol == null && companySymbols != null) {
|
||||||
|
for (CompanySymbolNewRequest cSymbolReq : companySymbols) {
|
||||||
|
if (IEnumKey.contains(cSymbolReq.getCompanySymbol(), CompanySymbol.INN, CompanySymbol.CIO)) {
|
||||||
|
String companySymbolType = cSymbolReq.getCompanySymbol();
|
||||||
|
log.trace("Search company by companySymbol {}={}", companySymbolType, cSymbolReq.getCompanySymbolValue());
|
||||||
|
Collection<CompanySymbols> companySymbolsFromImdg = companySymbolsImdg.getCollectionObjectsByFieldValues(
|
||||||
|
Map.of(
|
||||||
|
"companySymbol", companySymbolType,
|
||||||
|
"companySymbolValue", cSymbolReq.getCompanySymbolValue()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
if (!companySymbolsFromImdg.isEmpty()) {
|
||||||
|
companySymbol = companySymbolsFromImdg.iterator().next();
|
||||||
|
if (companySymbolsFromImdg.size() > 1) {
|
||||||
|
log.warn("For {} found > 1 company_symbols, use first (id = {})", companySymbolType, cSymbolReq.getCompanySymbolValue());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (companySymbol != null)
|
if (companySymbol != null)
|
||||||
return companySymbol.getCompanyId();
|
return companySymbol.getCompanyId();
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -168,6 +168,7 @@ class ClearingMemberCategoryServiceTest {
|
||||||
String clearingMemberCategory = "0000";
|
String clearingMemberCategory = "0000";
|
||||||
ClearingMemberCategory existsClearingMemberCategory = new ClearingMemberCategory();
|
ClearingMemberCategory existsClearingMemberCategory = new ClearingMemberCategory();
|
||||||
existsClearingMemberCategory.setClearingMemberCategory(clearingMemberCategory);
|
existsClearingMemberCategory.setClearingMemberCategory(clearingMemberCategory);
|
||||||
|
existsClearingMemberCategory.setCompanyId(COMPANY_ID);
|
||||||
Long id = memberCategoryImdg.insert(existsClearingMemberCategory);
|
Long id = memberCategoryImdg.insert(existsClearingMemberCategory);
|
||||||
|
|
||||||
CommonDeleteRequest memberCategoryDeleteRequest = new CommonDeleteRequest();
|
CommonDeleteRequest memberCategoryDeleteRequest = new CommonDeleteRequest();
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ import ru.spcex.platform.imdg.api.ImdgProvider;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
import static ru.spcex.clearing.test.config.ImdgTestConfig.waitAvailableImdgProviderAndAddAdminWithDefaultId;
|
import static ru.spcex.clearing.test.config.ImdgTestConfig.waitAvailableImdgProviderAndAddAdminWithDefaultId;
|
||||||
|
|
@ -48,6 +50,8 @@ import static ru.spcex.clearing.test.config.ImdgTestConfig.waitAvailableImdgProv
|
||||||
ProfileDocumentValidationConfig.class,
|
ProfileDocumentValidationConfig.class,
|
||||||
ContactService.class,
|
ContactService.class,
|
||||||
ContactValidationConfig.class,
|
ContactValidationConfig.class,
|
||||||
|
ClearingMemberCategoryService.class,
|
||||||
|
ClearingMemberCategoryValidationConfig.class,
|
||||||
|
|
||||||
KafkaTestConfig.class,
|
KafkaTestConfig.class,
|
||||||
ImdgTestConfig.class,
|
ImdgTestConfig.class,
|
||||||
|
|
@ -101,8 +105,8 @@ class MultiCompanyServiceTest {
|
||||||
CompanySymbols companySymbol = new CompanySymbols();
|
CompanySymbols companySymbol = new CompanySymbols();
|
||||||
companySymbol.setId(222L);
|
companySymbol.setId(222L);
|
||||||
companySymbol.setCompanyId(company.getId());
|
companySymbol.setCompanyId(company.getId());
|
||||||
companySymbol.setCompanySymbol(CompanySymbol.CLRC.getKey());
|
companySymbol.setCompanySymbol(CompanySymbol.INN.getKey());
|
||||||
companySymbol.setCompanySymbolValue("CL-VALUE");
|
companySymbol.setCompanySymbolValue("INN-VALUE");
|
||||||
companySymbolsImdg.insert(companySymbol);
|
companySymbolsImdg.insert(companySymbol);
|
||||||
|
|
||||||
Imdg<ProfileDocument> profileDocumentImdg = hazelcastServiceTest.getImdg(IMDGDistributedNames.Map_ProfileDocument, ProfileDocument.class);
|
Imdg<ProfileDocument> profileDocumentImdg = hazelcastServiceTest.getImdg(IMDGDistributedNames.Map_ProfileDocument, ProfileDocument.class);
|
||||||
|
|
@ -130,9 +134,13 @@ class MultiCompanyServiceTest {
|
||||||
req.setCompanyId(COMPANY_ID);
|
req.setCompanyId(COMPANY_ID);
|
||||||
req.setCompanySymbol(CompanySymbol.CLRC.getKey());
|
req.setCompanySymbol(CompanySymbol.CLRC.getKey());
|
||||||
req.setCompanySymbolValue("CL-VALUE-2");
|
req.setCompanySymbolValue("CL-VALUE-2");
|
||||||
|
assertNull(multiCompanyService.findCompanySymbols(req));
|
||||||
|
|
||||||
|
req.setCompanySymbol(CompanySymbol.INN.getKey());
|
||||||
|
req.setCompanySymbolValue("INN-VALUE");
|
||||||
CompanySymbols symbol = multiCompanyService.findCompanySymbols(req);
|
CompanySymbols symbol = multiCompanyService.findCompanySymbols(req);
|
||||||
assertNotNull(symbol);
|
assertNotNull(symbol);
|
||||||
assertEquals("CL-VALUE", symbol.getCompanySymbolValue());
|
assertEquals("INN-VALUE", symbol.getCompanySymbolValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -151,8 +159,32 @@ class MultiCompanyServiceTest {
|
||||||
CompanyNewRequest req = new CompanyNewRequest();
|
CompanyNewRequest req = new CompanyNewRequest();
|
||||||
req.setCompanySymbol(CompanySymbol.CLRC.getKey());
|
req.setCompanySymbol(CompanySymbol.CLRC.getKey());
|
||||||
req.setCompanySymbolValue("CL-VALUE");
|
req.setCompanySymbolValue("CL-VALUE");
|
||||||
Long theId = multiCompanyService.getCompanyIdForCompanySymbols("SAMPLE-NO-uuid", req);
|
assertNull(multiCompanyService.getCompanyIdForCompanySymbols("SAMPLE-NO-uuid", req, null));
|
||||||
assertEquals(COMPANY_ID, theId);
|
|
||||||
|
req.setCompanySymbolValue("INN-VALUE");
|
||||||
|
assertNull(multiCompanyService.getCompanyIdForCompanySymbols("SAMPLE-NO-uuid", req, null));
|
||||||
|
req.setCompanySymbol(CompanySymbol.INN.getKey());
|
||||||
|
assertEquals(COMPANY_ID, multiCompanyService.getCompanyIdForCompanySymbols("SAMPLE-NO-uuid", req, null));
|
||||||
|
req.setCompanySymbol(null);
|
||||||
|
req.setCompanySymbolValue(null);
|
||||||
|
assertNull(multiCompanyService.getCompanyIdForCompanySymbols(null, req, null));
|
||||||
|
List<CompanySymbolNewRequest> csReq=new ArrayList<>();
|
||||||
|
assertNull(multiCompanyService.getCompanyIdForCompanySymbols(null, req, null));
|
||||||
|
assertNull(multiCompanyService.getCompanyIdForCompanySymbols(null, req, csReq));
|
||||||
|
{
|
||||||
|
CompanySymbolNewRequest cs=new CompanySymbolNewRequest();
|
||||||
|
cs.setCompanySymbol(CompanySymbol.CLRC.getKey());
|
||||||
|
cs.setCompanySymbolValue("INN-VALUE");
|
||||||
|
csReq.add(cs);
|
||||||
|
}
|
||||||
|
assertNull(multiCompanyService.getCompanyIdForCompanySymbols(null, req, csReq));
|
||||||
|
{
|
||||||
|
CompanySymbolNewRequest cs=new CompanySymbolNewRequest();
|
||||||
|
cs.setCompanySymbol(CompanySymbol.INN.getKey());
|
||||||
|
cs.setCompanySymbolValue("INN-VALUE");
|
||||||
|
csReq.add(cs);
|
||||||
|
}
|
||||||
|
assertEquals(COMPANY_ID, multiCompanyService.getCompanyIdForCompanySymbols(null, req, csReq));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||||
import ru.clearing.classes.statics.data.company.Company;
|
import ru.clearing.classes.statics.data.company.Company;
|
||||||
import ru.clearing.classes.statics.data.company.relation.Relation;
|
import ru.clearing.classes.statics.data.company.relation.Relation;
|
||||||
import ru.clearing.platform.dictionary.ClearingCategoryDictionary;
|
import ru.clearing.platform.dictionary.ClearingCategoryDictionary;
|
||||||
|
import ru.clearing.platform.dictionary.ServiceStatusDictionary;
|
||||||
import ru.clearing.platform.dictionary.WorkflowStatusDictionary;
|
import ru.clearing.platform.dictionary.WorkflowStatusDictionary;
|
||||||
import ru.spcex.clearing.company.config.BeanConfiguration;
|
import ru.spcex.clearing.company.config.BeanConfiguration;
|
||||||
import ru.spcex.clearing.company.config.validation.RelationValidationConfig;
|
import ru.spcex.clearing.company.config.validation.RelationValidationConfig;
|
||||||
|
|
@ -92,6 +93,18 @@ class RelationServiceTest {
|
||||||
workflowStatusDictionary.setName("not active");
|
workflowStatusDictionary.setName("not active");
|
||||||
workflowStatusDictionaryImdg.insert(workflowStatusDictionary);
|
workflowStatusDictionaryImdg.insert(workflowStatusDictionary);
|
||||||
|
|
||||||
|
{
|
||||||
|
Imdg<ServiceStatusDictionary> serviceStatusDictionaryImdg = hazelcastServiceTest.getImdg(
|
||||||
|
IMDGDistributedNames.Map_ServiceStatusDictionary,
|
||||||
|
ServiceStatusDictionary.class
|
||||||
|
);
|
||||||
|
ServiceStatusDictionary status=new ServiceStatusDictionary();
|
||||||
|
status.setId(1L);
|
||||||
|
status.setCode("ACTV");
|
||||||
|
status.setName("\"ACTV\"");
|
||||||
|
serviceStatusDictionaryImdg.insert(status);
|
||||||
|
}
|
||||||
|
|
||||||
Imdg<ClearingCategoryDictionary> clearingCategoryDictionaryImdg = hazelcastServiceTest.getImdg(
|
Imdg<ClearingCategoryDictionary> clearingCategoryDictionaryImdg = hazelcastServiceTest.getImdg(
|
||||||
IMDGDistributedNames.Map_ClearingCategoryDictionary,
|
IMDGDistributedNames.Map_ClearingCategoryDictionary,
|
||||||
ClearingCategoryDictionary.class
|
ClearingCategoryDictionary.class
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ public class CompanyRequestAdapter {
|
||||||
log.warn("Money account \"{}\" not found", client.getMoneyAccount());
|
log.warn("Money account \"{}\" not found", client.getMoneyAccount());
|
||||||
} else {
|
} else {
|
||||||
log.debug("Money account \"{}\" found with id={}", client.getMoneyAccount(), mAccount.getId());
|
log.debug("Money account \"{}\" found with id={}", client.getMoneyAccount(), mAccount.getId());
|
||||||
client.setDepoAccountId(mAccount.getId());
|
client.setMoneyAccountId(mAccount.getId());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warn("Error happened when search money account \"{}\": {}", client.getMoneyAccount(), ExceptionUtils.getStackTrace(e));
|
log.warn("Error happened when search money account \"{}\": {}", client.getMoneyAccount(), ExceptionUtils.getStackTrace(e));
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ public enum Task implements IEnumKey {
|
||||||
liquidationSession_LIQU("LIQU"),//Ликвидационная сессия по обязательтсвам участника
|
liquidationSession_LIQU("LIQU"),//Ликвидационная сессия по обязательтсвам участника
|
||||||
startSession_STRM("STRM"),//Начало торговой сессии секции МКР
|
startSession_STRM("STRM"),//Начало торговой сессии секции МКР
|
||||||
terminationSession_ETRM("ETRM"),//Завершение торговой сессии секции МКР
|
terminationSession_ETRM("ETRM"),//Завершение торговой сессии секции МКР
|
||||||
|
startTime_SDEP("SDEP"),
|
||||||
|
endTime_EDEP("EDEP"),
|
||||||
startSession_SIPO("SIPO"),//Начало торговой сессии по первичным торгам
|
startSession_SIPO("SIPO"),//Начало торговой сессии по первичным торгам
|
||||||
terminationSession_EIPO("EIPO"),//Завершение торговой сессии по первичным торгам
|
terminationSession_EIPO("EIPO"),//Завершение торговой сессии по первичным торгам
|
||||||
startSession_STRF("STRF"),//Начало торговой сессии по вторичным торгам
|
startSession_STRF("STRF"),//Начало торговой сессии по вторичным торгам
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue