company-service http://jira.mfd.msk:8088/browse/CLS-259 часть правок (доделать relation)
This commit is contained in:
parent
3db1ef31b8
commit
e99d83fb4f
4 changed files with 15 additions and 11 deletions
|
|
@ -42,8 +42,8 @@ public class ProfileDocumentValidationConfig {
|
||||||
IMDGDistributedNames.Map_Company,
|
IMDGDistributedNames.Map_Company,
|
||||||
Company.class,
|
Company.class,
|
||||||
CompanyErrors.RequiredFieldEmpty,
|
CompanyErrors.RequiredFieldEmpty,
|
||||||
CompanyErrors.CompanyNotFound,
|
CompanyErrors.CompanyNotFound
|
||||||
company -> WorkflowStatus.Active.equalsByKey(company.getWorkflowStatus()) ? null : CompanyErrors.CompanyDisabled),
|
),
|
||||||
DictionaryPresentRule.instance("documentType",
|
DictionaryPresentRule.instance("documentType",
|
||||||
ProfileDocumentNewRequest::getDocumentType,
|
ProfileDocumentNewRequest::getDocumentType,
|
||||||
IMDGDistributedNames.Map_DocumentTypeDictionary,
|
IMDGDistributedNames.Map_DocumentTypeDictionary,
|
||||||
|
|
|
||||||
|
|
@ -154,9 +154,9 @@ public class CompanySymbolService extends QueueConsumer implements InitializingB
|
||||||
if (companySymbols == null) {
|
if (companySymbols == null) {
|
||||||
throw new ClearingBaseException(new EnumMessage(CompanyErrors.CompanyInfoNotFound, req.getId()));
|
throw new ClearingBaseException(new EnumMessage(CompanyErrors.CompanyInfoNotFound, req.getId()));
|
||||||
}
|
}
|
||||||
if (!companySymbols.getCompanySymbol().equalsIgnoreCase(req.getCompanySymbolValue())) {
|
// if (!companySymbols.getCompanySymbol().equalsIgnoreCase(req.getCompanySymbolValue())) {
|
||||||
throw new ClearingBaseException(new EnumMessage(CompanyErrors.EditCompanySymbols, req.getId()));
|
// throw new ClearingBaseException(new EnumMessage(CompanyErrors.EditCompanySymbols, req.getId()));
|
||||||
}
|
// }
|
||||||
companySymbols.setCompanySymbolValue(req.getCompanySymbolValue());
|
companySymbols.setCompanySymbolValue(req.getCompanySymbolValue());
|
||||||
companySymbolsTMap.update(companySymbols);
|
companySymbolsTMap.update(companySymbols);
|
||||||
companyService.updateCompanyBySymbol(transaction, companySymbols, false);
|
companyService.updateCompanyBySymbol(transaction, companySymbols, false);
|
||||||
|
|
|
||||||
|
|
@ -146,10 +146,6 @@ public class ProfileDocumentService extends QueueConsumer implements Initializin
|
||||||
log.warn("Company {} not found by profileDocument {}", profileDocument.getCompanyId(), profileDocument.getId());
|
log.warn("Company {} not found by profileDocument {}", profileDocument.getCompanyId(), profileDocument.getId());
|
||||||
return requestHelper.makeErrorResponse(deleteRequest, CompanyErrors.CompanyNotFound, profileDocument.getCompanyId());
|
return requestHelper.makeErrorResponse(deleteRequest, CompanyErrors.CompanyNotFound, profileDocument.getCompanyId());
|
||||||
}
|
}
|
||||||
if (!WorkflowStatus.Active.equalsByKey(existCompany.getWorkflowStatus())) {
|
|
||||||
log.debug("Company {} not active", profileDocument.getCompanyId());
|
|
||||||
return requestHelper.makeErrorResponse(deleteRequest, CompanyErrors.CompanyNotFound, profileDocument.getCompanyId());
|
|
||||||
}
|
|
||||||
|
|
||||||
ImdgTransaction transaction = imdgProvider.newTransaction();
|
ImdgTransaction transaction = imdgProvider.newTransaction();
|
||||||
transaction.beginTransaction();
|
transaction.beginTransaction();
|
||||||
|
|
|
||||||
|
|
@ -335,7 +335,7 @@ public class RelationService extends QueueConsumer implements InitializingBean {
|
||||||
boolean txOk = false;
|
boolean txOk = false;
|
||||||
try {
|
try {
|
||||||
tx.beginTransaction();
|
tx.beginTransaction();
|
||||||
relationUpdate0(tx, req, relation); // первоначальное ТЗ.
|
//relationUpdate0(tx, req, relation); // первоначальное ТЗ.
|
||||||
|
|
||||||
boolean needAddNewRelation = false; // call relationNew0(req, companyId, firstCMC);
|
boolean needAddNewRelation = false; // call relationNew0(req, companyId, firstCMC);
|
||||||
if (ru.spcex.platform.enumeration.Service.MKR.equalsByKey(relation.getService())) { // relation B or I or V
|
if (ru.spcex.platform.enumeration.Service.MKR.equalsByKey(relation.getService())) { // relation B or I or V
|
||||||
|
|
@ -467,6 +467,9 @@ public class RelationService extends QueueConsumer implements InitializingBean {
|
||||||
log.debug("Relation {} already reopened(resumed)", relation.getId());
|
log.debug("Relation {} already reopened(resumed)", relation.getId());
|
||||||
return relation;
|
return relation;
|
||||||
}
|
}
|
||||||
|
if (req.getComment() != null) {
|
||||||
|
relation.setComment(req.getComment());
|
||||||
|
}
|
||||||
relation.setServiceStatus(ServiceStatus.Reopened.getKey());
|
relation.setServiceStatus(ServiceStatus.Reopened.getKey());
|
||||||
relation.setUpdated(Instant.now());
|
relation.setUpdated(Instant.now());
|
||||||
|
|
||||||
|
|
@ -504,7 +507,7 @@ public class RelationService extends QueueConsumer implements InitializingBean {
|
||||||
|
|
||||||
Relation relation = relationMap.getSingleObjectByID(req.getId());
|
Relation relation = relationMap.getSingleObjectByID(req.getId());
|
||||||
Long companyId = relation.getConsumerId();
|
Long companyId = relation.getConsumerId();
|
||||||
|
//fixme relation.getService() // mkr/fond - это с учётом сервиса - на какой он удаляется и какие буквы остаются. Если ни одного CMC нету по этим буквам то удалить.
|
||||||
Collection<String> companyCMC = selectCompanyClearingMemberCategory(companyId);
|
Collection<String> companyCMC = selectCompanyClearingMemberCategory(companyId);
|
||||||
boolean companyCMCisBIV = companyCMC.contains(ClearingCategory.B.getKey()) || companyCMC.contains(ClearingCategory.I.getKey())
|
boolean companyCMCisBIV = companyCMC.contains(ClearingCategory.B.getKey()) || companyCMC.contains(ClearingCategory.I.getKey())
|
||||||
|| companyCMC.contains(ClearingCategory.V.getKey());
|
|| companyCMC.contains(ClearingCategory.V.getKey());
|
||||||
|
|
@ -598,7 +601,12 @@ public class RelationService extends QueueConsumer implements InitializingBean {
|
||||||
ClearingCategory clearingCategory = getEnumByKey(ClearingCategory.class, clearingMemberCategory.getClearingMemberCategory());
|
ClearingCategory clearingCategory = getEnumByKey(ClearingCategory.class, clearingMemberCategory.getClearingMemberCategory());
|
||||||
serviceStatus = serviceForCMC(clearingCategory).getKey();
|
serviceStatus = serviceForCMC(clearingCategory).getKey();
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
//todo here...
|
||||||
|
|
||||||
|
1) коммент обновить. сейчас не обязательно.
|
||||||
|
2)это от КМК приходит.
|
||||||
|
*/
|
||||||
Relation relation = searchRelation(transaction, clearingMemberCategory.getClearingMemberCategory(), companyId);
|
Relation relation = searchRelation(transaction, clearingMemberCategory.getClearingMemberCategory(), companyId);
|
||||||
if (relation == null) {
|
if (relation == null) {
|
||||||
log.debug("Relation for clearingMemberCategory.id={} {} not found", clearingMemberCategory.getId(), clearingMemberCategory.getClearingMemberCategory());
|
log.debug("Relation for clearingMemberCategory.id={} {} not found", clearingMemberCategory.getId(), clearingMemberCategory.getClearingMemberCategory());
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue