SUPPORT-9212: реконсиляция
This commit is contained in:
parent
5322bcc41d
commit
e8e6de4334
47 changed files with 2483 additions and 1164 deletions
|
|
@ -13,6 +13,7 @@ import com.fasterxml.jackson.core.StreamReadConstraints;
|
|||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import liquibase.integration.spring.SpringLiquibase;
|
||||
import net.javacrumbs.shedlock.core.LockProvider;
|
||||
|
|
@ -37,6 +38,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
|||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
import ru.micord.ervu.account_applications.deserializer.ReferenceEntityDeserializer;
|
||||
import ru.micord.ervu.account_applications.model.ReferenceEntity;
|
||||
|
||||
/**
|
||||
* Root application context
|
||||
|
|
@ -142,11 +145,14 @@ public class AppConfig {
|
|||
.build())
|
||||
.build();
|
||||
|
||||
SimpleModule module = new SimpleModule();
|
||||
module.addDeserializer(ReferenceEntity.class, new ReferenceEntityDeserializer());
|
||||
|
||||
return new ObjectMapper(factory)
|
||||
.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
|
||||
.configure(SerializationFeature.WRITE_ENUMS_USING_TO_STRING, true)
|
||||
.configure(DeserializationFeature.READ_ENUMS_USING_TO_STRING, true)
|
||||
.configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE, true)
|
||||
.registerModule(new JavaTimeModule());
|
||||
.registerModules(new JavaTimeModule(), module);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import model.AutocompleteModel;
|
|||
import org.springframework.stereotype.Service;
|
||||
import property.enums.DisplayType;
|
||||
import property.grid.ColumnSort;
|
||||
import ru.micord.ervu.account_applications.component.dao.RecruitmentDao;
|
||||
import ru.micord.ervu.account_applications.dao.RecruitmentDao;
|
||||
import service.field.AbstractAutocompleteService;
|
||||
import utils.QueryUtils;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import model.ComboBoxModel;
|
|||
import org.springframework.stereotype.Service;
|
||||
import property.enums.DisplayType;
|
||||
import property.grid.ColumnSort;
|
||||
import ru.micord.ervu.account_applications.component.dao.RecruitmentDao;
|
||||
import ru.micord.ervu.account_applications.dao.RecruitmentDao;
|
||||
import ru.micord.ervu.account_applications.security.context.SecurityContext;
|
||||
import service.field.ComboBoxServiceImpl;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import model.grid.GridRows;
|
|||
import model.grid.SortInfo;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import ru.micord.ervu.account_applications.component.dao.RecruitmentDao;
|
||||
import ru.micord.ervu.account_applications.dao.RecruitmentDao;
|
||||
import ru.micord.ervu.account_applications.security.model.jwt.UserSession;
|
||||
import ru.micord.ervu.account_applications.security.model.role.ErvuRoleAuthority;
|
||||
import service.GridV2ServiceImpl;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,93 @@
|
|||
package ru.micord.ervu.account_applications.dao;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
import org.jooq.*;
|
||||
import org.jooq.impl.DSL;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
public abstract class AbstractDataDao<T extends UpdatableRecord<T>> {
|
||||
protected final DSLContext dsl;
|
||||
|
||||
protected AbstractDataDao(DSLContext dsl) {
|
||||
this.dsl = dsl;
|
||||
}
|
||||
|
||||
public T newRecord() {
|
||||
return dsl.newRecord(getTable());
|
||||
}
|
||||
|
||||
protected abstract Table<T> getTable();
|
||||
|
||||
public void upsertData(T record) {
|
||||
record.merge();
|
||||
}
|
||||
|
||||
public <F> Set<F> getExistingValuesByField(Field<F> field, List<F> values) {
|
||||
return dsl.select(field)
|
||||
.from(getTable())
|
||||
.where(field.in(values))
|
||||
.fetchSet(field);
|
||||
}
|
||||
|
||||
protected void deleteByFieldInValues(Field<String> field, List<String> values) {
|
||||
dsl.deleteFrom(getTable())
|
||||
.where(field.in(values))
|
||||
.execute();
|
||||
}
|
||||
|
||||
protected <V> void deleteByValues(Map<Field<V>, V> fieldValues) {
|
||||
Condition condition = DSL.trueCondition();
|
||||
|
||||
for (var entry : fieldValues.entrySet()) {
|
||||
Field<V> field = entry.getKey();
|
||||
V value = entry.getValue();
|
||||
condition = condition.and(field.eq(value));
|
||||
}
|
||||
|
||||
dsl.deleteFrom(getTable())
|
||||
.where(condition)
|
||||
.execute();
|
||||
}
|
||||
|
||||
protected <E, I> void deleteByFieldAndInValues(Field<E> equalField, E equalValue,
|
||||
Field<I> inField, List<I> inValues) {
|
||||
dsl.deleteFrom(getTable())
|
||||
.where(equalField.eq(equalValue))
|
||||
.and(inField.in(inValues))
|
||||
.execute();
|
||||
}
|
||||
|
||||
public <S, F> Optional<S> getValueByValue(Field<S> selectField, Field<F> filterField,
|
||||
F filterValue) {
|
||||
return dsl.select(selectField)
|
||||
.from(getTable())
|
||||
.where(filterField.eq(filterValue))
|
||||
.fetchOptional(selectField);
|
||||
}
|
||||
|
||||
protected <S, F> List<S> getValuesByField(Field<S> selectField, Field<F> filterField,
|
||||
F filterValue) {
|
||||
return dsl.select(selectField)
|
||||
.from(getTable())
|
||||
.where(filterField.eq(filterValue))
|
||||
.fetch(selectField);
|
||||
}
|
||||
|
||||
protected <V, F> void setFieldByField(Field<V> targetField, V value, Field<F> whereField,
|
||||
F whereValue) {
|
||||
dsl.update(getTable())
|
||||
.set(targetField, value)
|
||||
.where(whereField.eq(whereValue))
|
||||
.execute();
|
||||
}
|
||||
|
||||
public void mergeRecords(List<T> records) {
|
||||
dsl.batchMerge(records).execute();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package ru.micord.ervu.account_applications.dao;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.Table;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.Tables;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.IpDirectoryRecord;
|
||||
|
||||
import static ru.micord.ervu.account_applications.db_beans.public_.Tables.IP_DIRECTORY;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@Repository
|
||||
public class IpDirectoryDao extends AbstractDataDao<IpDirectoryRecord> {
|
||||
protected IpDirectoryDao(DSLContext dsl) {
|
||||
super(dsl);
|
||||
}
|
||||
|
||||
public Set<String> getExistingIpAddresses(List<String> ips) {
|
||||
return getExistingValuesByField(Tables.IP_DIRECTORY.IP_ADDRESS, ips);
|
||||
}
|
||||
|
||||
public void deleteByIpAddresses(List<String> ips) {
|
||||
deleteByFieldInValues(Tables.IP_DIRECTORY.IP_ADDRESS, ips);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Table<IpDirectoryRecord> getTable() {
|
||||
return IP_DIRECTORY;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,22 +1,25 @@
|
|||
package ru.micord.ervu.account_applications.component.dao;
|
||||
package ru.micord.ervu.account_applications.dao;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.Table;
|
||||
import org.jooq.TableField;
|
||||
import org.jooq.impl.DSL;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.Tables;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.Recruitment;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.RecruitmentRecord;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@Repository
|
||||
public class RecruitmentDao {
|
||||
private final DSLContext dslContext;
|
||||
|
||||
public RecruitmentDao(DSLContext dslContext) {
|
||||
this.dslContext = dslContext;
|
||||
public class RecruitmentDao extends AbstractDataDao<RecruitmentRecord> {
|
||||
protected RecruitmentDao(DSLContext dsl) {
|
||||
super(dsl);
|
||||
}
|
||||
|
||||
public List<String> getRecruitmentIdsWithParentByDomainId(String domainId) {
|
||||
|
|
@ -30,19 +33,19 @@ public class RecruitmentDao {
|
|||
private List<String> getRecruitmentIdmIdsByParentId(String value, TableField field) {
|
||||
var recruitmentHierarchy = DSL.name("recruitment_hierarchy");
|
||||
|
||||
var cte = dslContext.withRecursive(recruitmentHierarchy).as(
|
||||
dslContext.select(
|
||||
var cte = dsl.withRecursive(recruitmentHierarchy).as(
|
||||
dsl.select(
|
||||
Recruitment.RECRUITMENT.IDM_ID,
|
||||
DSL.inline(1).as("depth")
|
||||
)
|
||||
.from(Recruitment.RECRUITMENT)
|
||||
.from(getTable())
|
||||
.where(DSL.field(field).eq(value))
|
||||
.unionAll(
|
||||
dslContext.select(
|
||||
dsl.select(
|
||||
Recruitment.RECRUITMENT.IDM_ID,
|
||||
DSL.field(DSL.name("recruitment_hierarchy", "depth"), Integer.class).add(1)
|
||||
)
|
||||
.from(Recruitment.RECRUITMENT)
|
||||
.from(getTable())
|
||||
.join(DSL.table(recruitmentHierarchy))
|
||||
.on(Recruitment.RECRUITMENT.PARENT_ID.eq(
|
||||
DSL.field(DSL.name("recruitment_hierarchy", "idm_id"), String.class)
|
||||
|
|
@ -59,10 +62,23 @@ public class RecruitmentDao {
|
|||
}
|
||||
|
||||
public List<String> getAllRecruitmentIds() {
|
||||
return dslContext.select(Recruitment.RECRUITMENT.IDM_ID)
|
||||
return dsl.select(Recruitment.RECRUITMENT.IDM_ID)
|
||||
.from(Recruitment.RECRUITMENT)
|
||||
.fetch(Recruitment.RECRUITMENT.IDM_ID);
|
||||
}
|
||||
|
||||
public Optional<UUID> getIdByIdmId(String idmId) {
|
||||
return getValueByValue(Recruitment.RECRUITMENT.ID, Recruitment.RECRUITMENT.IDM_ID, idmId);
|
||||
}
|
||||
|
||||
public void setActiveStatus(String id, boolean active) {
|
||||
setFieldByField(Recruitment.RECRUITMENT.ACTIVE, active, Recruitment.RECRUITMENT.IDM_ID, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Table<RecruitmentRecord> getTable() {
|
||||
return Tables.RECRUITMENT;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package ru.micord.ervu.account_applications.dao;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.Table;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.Tables;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.RecruitmentIpRecord;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@Repository
|
||||
public class RecruitmentIpDao extends AbstractDataDao<RecruitmentIpRecord> {
|
||||
protected RecruitmentIpDao(DSLContext dsl) {
|
||||
super(dsl);
|
||||
}
|
||||
|
||||
public Set<String> getExistingIpAddresses(List<String> ips) {
|
||||
return getExistingValuesByField(Tables.RECRUITMENT_IP.IP_ADDRESS, ips);
|
||||
}
|
||||
|
||||
public void deleteRecruitmentIpsByRecruitmentIdAndIps(String recruitmentId, List<String> ips) {
|
||||
deleteByFieldAndInValues(
|
||||
Tables.RECRUITMENT_IP.RECRUITMENT_ID, recruitmentId,
|
||||
Tables.RECRUITMENT_IP.IP_ADDRESS, ips
|
||||
);
|
||||
}
|
||||
|
||||
public Set<String> getIpAddressesByRecruitmentId(String recruitmentId) {
|
||||
List<String> valuesByField = getValuesByField(
|
||||
Tables.RECRUITMENT_IP.IP_ADDRESS,
|
||||
Tables.RECRUITMENT_IP.RECRUITMENT_ID, recruitmentId
|
||||
);
|
||||
return new HashSet<>(valuesByField);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Table<RecruitmentIpRecord> getTable() {
|
||||
return Tables.RECRUITMENT_IP;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package ru.micord.ervu.account_applications.dao;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.Table;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.Tables;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.RecruitmentSolutionRecord;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@Repository
|
||||
public class RecruitmentSolutionDao extends AbstractDataDao<RecruitmentSolutionRecord> {
|
||||
protected RecruitmentSolutionDao(DSLContext dsl) {
|
||||
super(dsl);
|
||||
}
|
||||
|
||||
public List<String> getSolutionIdsByRecruitmentId(String recruitmentId) {
|
||||
return getValuesByField(
|
||||
Tables.RECRUITMENT_SOLUTION.SOLUTION_ID,
|
||||
Tables.RECRUITMENT_SOLUTION.RECRUITMENT_ID, recruitmentId
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteRecruitmentSolutionsByRecruitmentIdAndSolutionIds(String recruitmentId,
|
||||
List<String> solutionIds) {
|
||||
deleteByFieldAndInValues(
|
||||
Tables.RECRUITMENT_SOLUTION.RECRUITMENT_ID, recruitmentId,
|
||||
Tables.RECRUITMENT_SOLUTION.SOLUTION_ID, solutionIds
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public void deleteRecruitmentSolution(RecruitmentSolutionRecord record) {
|
||||
Map<Field<String>, String> conditions = Map.of(
|
||||
Tables.RECRUITMENT_SOLUTION.RECRUITMENT_ID, record.getRecruitmentId(),
|
||||
Tables.RECRUITMENT_SOLUTION.SOLUTION_ID, record.getSolutionId()
|
||||
);
|
||||
|
||||
deleteByValues(conditions);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Table<RecruitmentSolutionRecord> getTable() {
|
||||
return Tables.RECRUITMENT_SOLUTION;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package ru.micord.ervu.account_applications.dao;
|
||||
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.Table;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.Tables;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.UserApplicationRoleRecord;
|
||||
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@Repository
|
||||
public class RoleDao extends AbstractDataDao<UserApplicationRoleRecord> {
|
||||
protected RoleDao(DSLContext dsl) {
|
||||
super(dsl);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Table<UserApplicationRoleRecord> getTable() {
|
||||
return Tables.USER_APPLICATION_ROLE;
|
||||
}
|
||||
|
||||
public void setActiveStatus(String id, boolean active) {
|
||||
setFieldByField(
|
||||
Tables.USER_APPLICATION_ROLE.ACTIVE, active,
|
||||
Tables.USER_APPLICATION_ROLE.USER_ROLE_ID, id
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package ru.micord.ervu.account_applications.dao;
|
||||
|
||||
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.Table;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.Tables;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.SolutionRecord;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@Repository
|
||||
public class SolutionDao extends AbstractDataDao<SolutionRecord> {
|
||||
protected SolutionDao(DSLContext dsl) {
|
||||
super(dsl);
|
||||
}
|
||||
|
||||
public void setActiveStatus(String id, boolean active) {
|
||||
setFieldByField(Tables.SOLUTION.ACTIVE, active, Tables.SOLUTION.ID, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Table<SolutionRecord> getTable() {
|
||||
return Tables.SOLUTION;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package ru.micord.ervu.account_applications.dao;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.Table;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.Tables;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.SolutionRoleRecord;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@Repository
|
||||
public class SolutionRoleDao extends AbstractDataDao<SolutionRoleRecord> {
|
||||
protected SolutionRoleDao(DSLContext dsl) {
|
||||
super(dsl);
|
||||
}
|
||||
|
||||
public void deleteSolutionRole(SolutionRoleRecord record) {
|
||||
Map<Field<String>, String> conditions = Map.of(
|
||||
Tables.SOLUTION_ROLE.SOLUTION_ID, record.getSolutionId(),
|
||||
Tables.SOLUTION_ROLE.ROLE_ID, record.getRoleId()
|
||||
);
|
||||
|
||||
deleteByValues(conditions);
|
||||
}
|
||||
|
||||
public List<String> getRoleIdsBySolutionId(String solutionId) {
|
||||
return getValuesByField(
|
||||
Tables.SOLUTION_ROLE.ROLE_ID,
|
||||
Tables.SOLUTION_ROLE.SOLUTION_ID, solutionId
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteSolutionRolesBySolutionIdAndRoleIds(String solutionId,
|
||||
List<String> roleIds) {
|
||||
deleteByFieldAndInValues(
|
||||
Tables.SOLUTION_ROLE.SOLUTION_ID, solutionId,
|
||||
Tables.SOLUTION_ROLE.ROLE_ID, roleIds
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Table<SolutionRoleRecord> getTable() {
|
||||
return Tables.SOLUTION_ROLE;
|
||||
}
|
||||
}
|
||||
|
|
@ -107,38 +107,12 @@ public class Recruitment extends TableImpl<RecruitmentRecord> {
|
|||
*/
|
||||
public final TableField<RecruitmentRecord, String> FULLNAME = createField(DSL.name("fullname"), SQLDataType.VARCHAR.nullable(false), this, "Полное наименование организации");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.dns</code>. ДНС организации
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, String> DNS = createField(DSL.name("dns"), SQLDataType.VARCHAR(64), this, "ДНС организации");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.email</code>. Е-mail организации
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, String> EMAIL = createField(DSL.name("email"), SQLDataType.VARCHAR(255), this, "Е-mail организации");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.phone</code>. Телефон организации
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, String> PHONE = createField(DSL.name("phone"), SQLDataType.VARCHAR(24), this, "Телефон организации");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.address</code>. Адрес организации
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, String> ADDRESS = createField(DSL.name("address"), SQLDataType.VARCHAR, this, "Адрес организации");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.address_id</code>. Идентификатор
|
||||
* адреса организации
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, String> ADDRESS_ID = createField(DSL.name("address_id"), SQLDataType.VARCHAR, this, "Идентификатор адреса организации");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.postal_address</code>. Почтовый адрес
|
||||
* организации
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, String> POSTAL_ADDRESS = createField(DSL.name("postal_address"), SQLDataType.VARCHAR, this, "Почтовый адрес организации");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.postal_address_id</code>.
|
||||
* Идентификатор почтового адреса организации
|
||||
|
|
@ -146,67 +120,9 @@ public class Recruitment extends TableImpl<RecruitmentRecord> {
|
|||
public final TableField<RecruitmentRecord, String> POSTAL_ADDRESS_ID = createField(DSL.name("postal_address_id"), SQLDataType.VARCHAR, this, "Идентификатор почтового адреса организации");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.nsi_department_id</code>.
|
||||
* Идентификатор департамента из НСИ
|
||||
* The column <code>public.recruitment.active</code>. Признак актуальности
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, String> NSI_DEPARTMENT_ID = createField(DSL.name("nsi_department_id"), SQLDataType.VARCHAR, this, "Идентификатор департамента из НСИ");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.nsi_organization_id</code>.
|
||||
* Идентификатор организации из НСИ
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, String> NSI_ORGANIZATION_ID = createField(DSL.name("nsi_organization_id"), SQLDataType.VARCHAR, this, "Идентификатор организации из НСИ");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.oktmo</code>. ОКТМО
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, String> OKTMO = createField(DSL.name("oktmo"), SQLDataType.VARCHAR, this, "ОКТМО");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.org_ogrn</code>. ОГРН организации
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, String> ORG_OGRN = createField(DSL.name("org_ogrn"), SQLDataType.VARCHAR, this, "ОГРН организации");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.dep_ogrn</code>. ОГРН департамента
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, String> DEP_OGRN = createField(DSL.name("dep_ogrn"), SQLDataType.VARCHAR, this, "ОГРН департамента");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.epgu_id</code>. Идентификатор ЕПГУ
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, String> EPGU_ID = createField(DSL.name("epgu_id"), SQLDataType.VARCHAR, this, "Идентификатор ЕПГУ");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.kpp</code>. КПП
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, String> KPP = createField(DSL.name("kpp"), SQLDataType.VARCHAR(64), this, "КПП");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.inn</code>. ИНН
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, String> INN = createField(DSL.name("inn"), SQLDataType.VARCHAR(64), this, "ИНН");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.okato</code>. ОКАТО
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, String> OKATO = createField(DSL.name("okato"), SQLDataType.VARCHAR(64), this, "ОКАТО");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.division_type</code>. Тип дивизиона
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, String> DIVISION_TYPE = createField(DSL.name("division_type"), SQLDataType.VARCHAR(64), this, "Тип дивизиона");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.tns_department_id</code>.
|
||||
* Идентификатор департамента из ТНС
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, String> TNS_DEPARTMENT_ID = createField(DSL.name("tns_department_id"), SQLDataType.VARCHAR, this, "Идентификатор департамента из ТНС");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.enabled</code>. Признак актуальности
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, Boolean> ENABLED = createField(DSL.name("enabled"), SQLDataType.BOOLEAN.nullable(false).defaultValue(DSL.field(DSL.raw("true"), SQLDataType.BOOLEAN)), this, "Признак актуальности");
|
||||
public final TableField<RecruitmentRecord, Boolean> ACTIVE = createField(DSL.name("active"), SQLDataType.BOOLEAN.nullable(false).defaultValue(DSL.field(DSL.raw("true"), SQLDataType.BOOLEAN)), this, "Признак актуальности");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.timezone</code>. Часовой пояс
|
||||
|
|
@ -219,22 +135,11 @@ public class Recruitment extends TableImpl<RecruitmentRecord> {
|
|||
*/
|
||||
public final TableField<RecruitmentRecord, Boolean> REPORTS_ENABLED = createField(DSL.name("reports_enabled"), SQLDataType.BOOLEAN, this, "Признак актуальности для отчета");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.region_id</code>. Идентификатор
|
||||
* региона
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, String> REGION_ID = createField(DSL.name("region_id"), SQLDataType.VARCHAR, this, "Идентификатор региона");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.subpoena_series_code</code>. Серия
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, String> SUBPOENA_SERIES_CODE = createField(DSL.name("subpoena_series_code"), SQLDataType.VARCHAR(64), this, "Серия");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.hidden</code>. Признак скрытого
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, Boolean> HIDDEN = createField(DSL.name("hidden"), SQLDataType.BOOLEAN.nullable(false).defaultValue(DSL.field(DSL.raw("false"), SQLDataType.BOOLEAN)), this, "Признак скрытого");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.region_code</code>. Код региона
|
||||
*/
|
||||
|
|
@ -245,6 +150,11 @@ public class Recruitment extends TableImpl<RecruitmentRecord> {
|
|||
*/
|
||||
public final TableField<RecruitmentRecord, Timestamp> TS = createField(DSL.name("ts"), SQLDataType.TIMESTAMP(0).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.TIMESTAMP)), this, "Отметка времени");
|
||||
|
||||
/**
|
||||
* The column <code>public.recruitment.name</code>.
|
||||
*/
|
||||
public final TableField<RecruitmentRecord, String> NAME = createField(DSL.name("name"), SQLDataType.VARCHAR(255).nullable(false).defaultValue(DSL.field(DSL.raw("''::character varying"), SQLDataType.VARCHAR)), this, "");
|
||||
|
||||
private Recruitment(Name alias, Table<RecruitmentRecord> aliased) {
|
||||
this(alias, aliased, (Field<?>[]) null, null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
package ru.micord.ervu.account_applications.db_beans.public_.tables;
|
||||
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.jooq.Condition;
|
||||
|
|
@ -77,17 +78,17 @@ public class Solution extends TableImpl<SolutionRecord> {
|
|||
/**
|
||||
* The column <code>public.solution.created</code>.
|
||||
*/
|
||||
public final TableField<SolutionRecord, Long> CREATED = createField(DSL.name("created"), SQLDataType.BIGINT.nullable(false), this, "");
|
||||
public final TableField<SolutionRecord, Timestamp> CREATED = createField(DSL.name("created"), SQLDataType.TIMESTAMP(0).nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>public.solution.modified</code>.
|
||||
*/
|
||||
public final TableField<SolutionRecord, Long> MODIFIED = createField(DSL.name("modified"), SQLDataType.BIGINT, this, "");
|
||||
public final TableField<SolutionRecord, Timestamp> MODIFIED = createField(DSL.name("modified"), SQLDataType.TIMESTAMP(0), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>public.solution.deleted</code>.
|
||||
*/
|
||||
public final TableField<SolutionRecord, Long> DELETED = createField(DSL.name("deleted"), SQLDataType.BIGINT, this, "");
|
||||
public final TableField<SolutionRecord, Timestamp> DELETED = createField(DSL.name("deleted"), SQLDataType.TIMESTAMP(0), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>public.solution.version</code>.
|
||||
|
|
|
|||
|
|
@ -83,12 +83,6 @@ public class UserApplicationRole extends TableImpl<UserApplicationRoleRecord> {
|
|||
*/
|
||||
public final TableField<UserApplicationRoleRecord, Timestamp> UPDATED = createField(DSL.name("updated"), SQLDataType.TIMESTAMP(0).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.TIMESTAMP)), this, "Дата и время последнего обновления записи");
|
||||
|
||||
/**
|
||||
* The column <code>public.user_application_role.finished</code>. Дата и
|
||||
* время окончания действия роли
|
||||
*/
|
||||
public final TableField<UserApplicationRoleRecord, Timestamp> FINISHED = createField(DSL.name("finished"), SQLDataType.TIMESTAMP(0), this, "Дата и время окончания действия роли");
|
||||
|
||||
/**
|
||||
* The column <code>public.user_application_role.role_code</code>. Код роли
|
||||
*/
|
||||
|
|
@ -100,6 +94,22 @@ public class UserApplicationRole extends TableImpl<UserApplicationRoleRecord> {
|
|||
*/
|
||||
public final TableField<UserApplicationRoleRecord, Boolean> ADMIN_ROLE = createField(DSL.name("admin_role"), SQLDataType.BOOLEAN, this, "Признак роли администратора");
|
||||
|
||||
/**
|
||||
* The column <code>public.user_application_role.active</code>.
|
||||
*/
|
||||
public final TableField<UserApplicationRoleRecord, Boolean> ACTIVE = createField(DSL.name("active"), SQLDataType.BOOLEAN.nullable(false).defaultValue(DSL.field(DSL.raw("true"), SQLDataType.BOOLEAN)), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>public.user_application_role.version</code>.
|
||||
*/
|
||||
public final TableField<UserApplicationRoleRecord, Integer> VERSION = createField(DSL.name("version"), SQLDataType.INTEGER.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.INTEGER)), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>public.user_application_role.deleted</code>. Дата и
|
||||
* время окончания действия роли
|
||||
*/
|
||||
public final TableField<UserApplicationRoleRecord, Timestamp> DELETED = createField(DSL.name("deleted"), SQLDataType.TIMESTAMP(0), this, "Дата и время окончания действия роли");
|
||||
|
||||
private UserApplicationRole(Name alias, Table<UserApplicationRoleRecord> aliased) {
|
||||
this(alias, aliased, (Field<?>[]) null, null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -169,68 +169,12 @@ public class RecruitmentRecord extends UpdatableRecordImpl<RecruitmentRecord> {
|
|||
return (String) get(9);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.dns</code>. ДНС организации
|
||||
*/
|
||||
public void setDns(String value) {
|
||||
set(10, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.dns</code>. ДНС организации
|
||||
*/
|
||||
public String getDns() {
|
||||
return (String) get(10);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.email</code>. Е-mail организации
|
||||
*/
|
||||
public void setEmail(String value) {
|
||||
set(11, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.email</code>. Е-mail организации
|
||||
*/
|
||||
public String getEmail() {
|
||||
return (String) get(11);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.phone</code>. Телефон организации
|
||||
*/
|
||||
public void setPhone(String value) {
|
||||
set(12, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.phone</code>. Телефон организации
|
||||
*/
|
||||
public String getPhone() {
|
||||
return (String) get(12);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.address</code>. Адрес организации
|
||||
*/
|
||||
public void setAddress(String value) {
|
||||
set(13, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.address</code>. Адрес организации
|
||||
*/
|
||||
public String getAddress() {
|
||||
return (String) get(13);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.address_id</code>. Идентификатор
|
||||
* адреса организации
|
||||
*/
|
||||
public void setAddressId(String value) {
|
||||
set(14, value);
|
||||
set(10, value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -238,23 +182,7 @@ public class RecruitmentRecord extends UpdatableRecordImpl<RecruitmentRecord> {
|
|||
* адреса организации
|
||||
*/
|
||||
public String getAddressId() {
|
||||
return (String) get(14);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.postal_address</code>. Почтовый адрес
|
||||
* организации
|
||||
*/
|
||||
public void setPostalAddress(String value) {
|
||||
set(15, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.postal_address</code>. Почтовый адрес
|
||||
* организации
|
||||
*/
|
||||
public String getPostalAddress() {
|
||||
return (String) get(15);
|
||||
return (String) get(10);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -262,7 +190,7 @@ public class RecruitmentRecord extends UpdatableRecordImpl<RecruitmentRecord> {
|
|||
* Идентификатор почтового адреса организации
|
||||
*/
|
||||
public void setPostalAddressId(String value) {
|
||||
set(16, value);
|
||||
set(11, value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -270,195 +198,35 @@ public class RecruitmentRecord extends UpdatableRecordImpl<RecruitmentRecord> {
|
|||
* Идентификатор почтового адреса организации
|
||||
*/
|
||||
public String getPostalAddressId() {
|
||||
return (String) get(16);
|
||||
return (String) get(11);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.nsi_department_id</code>.
|
||||
* Идентификатор департамента из НСИ
|
||||
* Setter for <code>public.recruitment.active</code>. Признак актуальности
|
||||
*/
|
||||
public void setNsiDepartmentId(String value) {
|
||||
set(17, value);
|
||||
public void setActive(Boolean value) {
|
||||
set(12, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.nsi_department_id</code>.
|
||||
* Идентификатор департамента из НСИ
|
||||
* Getter for <code>public.recruitment.active</code>. Признак актуальности
|
||||
*/
|
||||
public String getNsiDepartmentId() {
|
||||
return (String) get(17);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.nsi_organization_id</code>.
|
||||
* Идентификатор организации из НСИ
|
||||
*/
|
||||
public void setNsiOrganizationId(String value) {
|
||||
set(18, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.nsi_organization_id</code>.
|
||||
* Идентификатор организации из НСИ
|
||||
*/
|
||||
public String getNsiOrganizationId() {
|
||||
return (String) get(18);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.oktmo</code>. ОКТМО
|
||||
*/
|
||||
public void setOktmo(String value) {
|
||||
set(19, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.oktmo</code>. ОКТМО
|
||||
*/
|
||||
public String getOktmo() {
|
||||
return (String) get(19);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.org_ogrn</code>. ОГРН организации
|
||||
*/
|
||||
public void setOrgOgrn(String value) {
|
||||
set(20, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.org_ogrn</code>. ОГРН организации
|
||||
*/
|
||||
public String getOrgOgrn() {
|
||||
return (String) get(20);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.dep_ogrn</code>. ОГРН департамента
|
||||
*/
|
||||
public void setDepOgrn(String value) {
|
||||
set(21, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.dep_ogrn</code>. ОГРН департамента
|
||||
*/
|
||||
public String getDepOgrn() {
|
||||
return (String) get(21);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.epgu_id</code>. Идентификатор ЕПГУ
|
||||
*/
|
||||
public void setEpguId(String value) {
|
||||
set(22, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.epgu_id</code>. Идентификатор ЕПГУ
|
||||
*/
|
||||
public String getEpguId() {
|
||||
return (String) get(22);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.kpp</code>. КПП
|
||||
*/
|
||||
public void setKpp(String value) {
|
||||
set(23, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.kpp</code>. КПП
|
||||
*/
|
||||
public String getKpp() {
|
||||
return (String) get(23);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.inn</code>. ИНН
|
||||
*/
|
||||
public void setInn(String value) {
|
||||
set(24, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.inn</code>. ИНН
|
||||
*/
|
||||
public String getInn() {
|
||||
return (String) get(24);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.okato</code>. ОКАТО
|
||||
*/
|
||||
public void setOkato(String value) {
|
||||
set(25, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.okato</code>. ОКАТО
|
||||
*/
|
||||
public String getOkato() {
|
||||
return (String) get(25);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.division_type</code>. Тип дивизиона
|
||||
*/
|
||||
public void setDivisionType(String value) {
|
||||
set(26, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.division_type</code>. Тип дивизиона
|
||||
*/
|
||||
public String getDivisionType() {
|
||||
return (String) get(26);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.tns_department_id</code>.
|
||||
* Идентификатор департамента из ТНС
|
||||
*/
|
||||
public void setTnsDepartmentId(String value) {
|
||||
set(27, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.tns_department_id</code>.
|
||||
* Идентификатор департамента из ТНС
|
||||
*/
|
||||
public String getTnsDepartmentId() {
|
||||
return (String) get(27);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.enabled</code>. Признак актуальности
|
||||
*/
|
||||
public void setEnabled(Boolean value) {
|
||||
set(28, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.enabled</code>. Признак актуальности
|
||||
*/
|
||||
public Boolean getEnabled() {
|
||||
return (Boolean) get(28);
|
||||
public Boolean getActive() {
|
||||
return (Boolean) get(12);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.timezone</code>. Часовой пояс
|
||||
*/
|
||||
public void setTimezone(String value) {
|
||||
set(29, value);
|
||||
set(13, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.timezone</code>. Часовой пояс
|
||||
*/
|
||||
public String getTimezone() {
|
||||
return (String) get(29);
|
||||
return (String) get(13);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -466,7 +234,7 @@ public class RecruitmentRecord extends UpdatableRecordImpl<RecruitmentRecord> {
|
|||
* актуальности для отчета
|
||||
*/
|
||||
public void setReportsEnabled(Boolean value) {
|
||||
set(30, value);
|
||||
set(14, value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -474,79 +242,63 @@ public class RecruitmentRecord extends UpdatableRecordImpl<RecruitmentRecord> {
|
|||
* актуальности для отчета
|
||||
*/
|
||||
public Boolean getReportsEnabled() {
|
||||
return (Boolean) get(30);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.region_id</code>. Идентификатор
|
||||
* региона
|
||||
*/
|
||||
public void setRegionId(String value) {
|
||||
set(31, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.region_id</code>. Идентификатор
|
||||
* региона
|
||||
*/
|
||||
public String getRegionId() {
|
||||
return (String) get(31);
|
||||
return (Boolean) get(14);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.subpoena_series_code</code>. Серия
|
||||
*/
|
||||
public void setSubpoenaSeriesCode(String value) {
|
||||
set(32, value);
|
||||
set(15, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.subpoena_series_code</code>. Серия
|
||||
*/
|
||||
public String getSubpoenaSeriesCode() {
|
||||
return (String) get(32);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.hidden</code>. Признак скрытого
|
||||
*/
|
||||
public void setHidden(Boolean value) {
|
||||
set(33, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.hidden</code>. Признак скрытого
|
||||
*/
|
||||
public Boolean getHidden() {
|
||||
return (Boolean) get(33);
|
||||
return (String) get(15);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.region_code</code>. Код региона
|
||||
*/
|
||||
public void setRegionCode(String value) {
|
||||
set(34, value);
|
||||
set(16, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.region_code</code>. Код региона
|
||||
*/
|
||||
public String getRegionCode() {
|
||||
return (String) get(34);
|
||||
return (String) get(16);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.ts</code>. Отметка времени
|
||||
*/
|
||||
public void setTs(Timestamp value) {
|
||||
set(35, value);
|
||||
set(17, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.ts</code>. Отметка времени
|
||||
*/
|
||||
public Timestamp getTs() {
|
||||
return (Timestamp) get(35);
|
||||
return (Timestamp) get(17);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.recruitment.name</code>.
|
||||
*/
|
||||
public void setName(String value) {
|
||||
set(18, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.recruitment.name</code>.
|
||||
*/
|
||||
public String getName() {
|
||||
return (String) get(18);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
|
@ -572,7 +324,7 @@ public class RecruitmentRecord extends UpdatableRecordImpl<RecruitmentRecord> {
|
|||
/**
|
||||
* Create a detached, initialised RecruitmentRecord
|
||||
*/
|
||||
public RecruitmentRecord(UUID id, String idmId, String parentId, Integer version, Timestamp createdAt, Timestamp updatedAt, String schema, String militaryCode, String shortname, String fullname, String dns, String email, String phone, String address, String addressId, String postalAddress, String postalAddressId, String nsiDepartmentId, String nsiOrganizationId, String oktmo, String orgOgrn, String depOgrn, String epguId, String kpp, String inn, String okato, String divisionType, String tnsDepartmentId, Boolean enabled, String timezone, Boolean reportsEnabled, String regionId, String subpoenaSeriesCode, Boolean hidden, String regionCode, Timestamp ts) {
|
||||
public RecruitmentRecord(UUID id, String idmId, String parentId, Integer version, Timestamp createdAt, Timestamp updatedAt, String schema, String militaryCode, String shortname, String fullname, String addressId, String postalAddressId, Boolean active, String timezone, Boolean reportsEnabled, String subpoenaSeriesCode, String regionCode, Timestamp ts, String name) {
|
||||
super(Recruitment.RECRUITMENT);
|
||||
|
||||
setId(id);
|
||||
|
|
@ -585,32 +337,15 @@ public class RecruitmentRecord extends UpdatableRecordImpl<RecruitmentRecord> {
|
|||
setMilitaryCode(militaryCode);
|
||||
setShortname(shortname);
|
||||
setFullname(fullname);
|
||||
setDns(dns);
|
||||
setEmail(email);
|
||||
setPhone(phone);
|
||||
setAddress(address);
|
||||
setAddressId(addressId);
|
||||
setPostalAddress(postalAddress);
|
||||
setPostalAddressId(postalAddressId);
|
||||
setNsiDepartmentId(nsiDepartmentId);
|
||||
setNsiOrganizationId(nsiOrganizationId);
|
||||
setOktmo(oktmo);
|
||||
setOrgOgrn(orgOgrn);
|
||||
setDepOgrn(depOgrn);
|
||||
setEpguId(epguId);
|
||||
setKpp(kpp);
|
||||
setInn(inn);
|
||||
setOkato(okato);
|
||||
setDivisionType(divisionType);
|
||||
setTnsDepartmentId(tnsDepartmentId);
|
||||
setEnabled(enabled);
|
||||
setActive(active);
|
||||
setTimezone(timezone);
|
||||
setReportsEnabled(reportsEnabled);
|
||||
setRegionId(regionId);
|
||||
setSubpoenaSeriesCode(subpoenaSeriesCode);
|
||||
setHidden(hidden);
|
||||
setRegionCode(regionCode);
|
||||
setTs(ts);
|
||||
setName(name);
|
||||
resetChangedOnNotNull();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
package ru.micord.ervu.account_applications.db_beans.public_.tables.records;
|
||||
|
||||
|
||||
import java.sql.Timestamp;
|
||||
|
||||
import org.jooq.Record1;
|
||||
import org.jooq.impl.UpdatableRecordImpl;
|
||||
|
||||
|
|
@ -91,43 +93,43 @@ public class SolutionRecord extends UpdatableRecordImpl<SolutionRecord> {
|
|||
/**
|
||||
* Setter for <code>public.solution.created</code>.
|
||||
*/
|
||||
public void setCreated(Long value) {
|
||||
public void setCreated(Timestamp value) {
|
||||
set(5, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.solution.created</code>.
|
||||
*/
|
||||
public Long getCreated() {
|
||||
return (Long) get(5);
|
||||
public Timestamp getCreated() {
|
||||
return (Timestamp) get(5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.solution.modified</code>.
|
||||
*/
|
||||
public void setModified(Long value) {
|
||||
public void setModified(Timestamp value) {
|
||||
set(6, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.solution.modified</code>.
|
||||
*/
|
||||
public Long getModified() {
|
||||
return (Long) get(6);
|
||||
public Timestamp getModified() {
|
||||
return (Timestamp) get(6);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.solution.deleted</code>.
|
||||
*/
|
||||
public void setDeleted(Long value) {
|
||||
public void setDeleted(Timestamp value) {
|
||||
set(7, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.solution.deleted</code>.
|
||||
*/
|
||||
public Long getDeleted() {
|
||||
return (Long) get(7);
|
||||
public Timestamp getDeleted() {
|
||||
return (Timestamp) get(7);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -167,7 +169,7 @@ public class SolutionRecord extends UpdatableRecordImpl<SolutionRecord> {
|
|||
/**
|
||||
* Create a detached, initialised SolutionRecord
|
||||
*/
|
||||
public SolutionRecord(String id, String name, String description, String displayName, Boolean active, Long created, Long modified, Long deleted, Integer version) {
|
||||
public SolutionRecord(String id, String name, String description, String displayName, Boolean active, Timestamp created, Timestamp modified, Timestamp deleted, Integer version) {
|
||||
super(Solution.SOLUTION);
|
||||
|
||||
setId(id);
|
||||
|
|
|
|||
|
|
@ -84,34 +84,18 @@ public class UserApplicationRoleRecord extends UpdatableRecordImpl<UserApplicati
|
|||
return (Timestamp) get(3);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.user_application_role.finished</code>. Дата и
|
||||
* время окончания действия роли
|
||||
*/
|
||||
public void setFinished(Timestamp value) {
|
||||
set(4, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.user_application_role.finished</code>. Дата и
|
||||
* время окончания действия роли
|
||||
*/
|
||||
public Timestamp getFinished() {
|
||||
return (Timestamp) get(4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.user_application_role.role_code</code>. Код роли
|
||||
*/
|
||||
public void setRoleCode(String value) {
|
||||
set(5, value);
|
||||
set(4, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.user_application_role.role_code</code>. Код роли
|
||||
*/
|
||||
public String getRoleCode() {
|
||||
return (String) get(5);
|
||||
return (String) get(4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -119,7 +103,7 @@ public class UserApplicationRoleRecord extends UpdatableRecordImpl<UserApplicati
|
|||
* роли администратора
|
||||
*/
|
||||
public void setAdminRole(Boolean value) {
|
||||
set(6, value);
|
||||
set(5, value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -127,9 +111,53 @@ public class UserApplicationRoleRecord extends UpdatableRecordImpl<UserApplicati
|
|||
* роли администратора
|
||||
*/
|
||||
public Boolean getAdminRole() {
|
||||
return (Boolean) get(5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.user_application_role.active</code>.
|
||||
*/
|
||||
public void setActive(Boolean value) {
|
||||
set(6, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.user_application_role.active</code>.
|
||||
*/
|
||||
public Boolean getActive() {
|
||||
return (Boolean) get(6);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.user_application_role.version</code>.
|
||||
*/
|
||||
public void setVersion(Integer value) {
|
||||
set(7, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.user_application_role.version</code>.
|
||||
*/
|
||||
public Integer getVersion() {
|
||||
return (Integer) get(7);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.user_application_role.deleted</code>. Дата и
|
||||
* время окончания действия роли
|
||||
*/
|
||||
public void setDeleted(Timestamp value) {
|
||||
set(8, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.user_application_role.deleted</code>. Дата и
|
||||
* время окончания действия роли
|
||||
*/
|
||||
public Timestamp getDeleted() {
|
||||
return (Timestamp) get(8);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Primary key information
|
||||
// -------------------------------------------------------------------------
|
||||
|
|
@ -153,16 +181,18 @@ public class UserApplicationRoleRecord extends UpdatableRecordImpl<UserApplicati
|
|||
/**
|
||||
* Create a detached, initialised UserApplicationRoleRecord
|
||||
*/
|
||||
public UserApplicationRoleRecord(String userRoleId, String roleName, Timestamp created, Timestamp updated, Timestamp finished, String roleCode, Boolean adminRole) {
|
||||
public UserApplicationRoleRecord(String userRoleId, String roleName, Timestamp created, Timestamp updated, String roleCode, Boolean adminRole, Boolean active, Integer version, Timestamp deleted) {
|
||||
super(UserApplicationRole.USER_APPLICATION_ROLE);
|
||||
|
||||
setUserRoleId(userRoleId);
|
||||
setRoleName(roleName);
|
||||
setCreated(created);
|
||||
setUpdated(updated);
|
||||
setFinished(finished);
|
||||
setRoleCode(roleCode);
|
||||
setAdminRole(adminRole);
|
||||
setActive(active);
|
||||
setVersion(version);
|
||||
setDeleted(deleted);
|
||||
resetChangedOnNotNull();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
package ru.micord.ervu.account_applications.deserializer;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.fasterxml.jackson.core.JacksonException;
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import ru.micord.ervu.account_applications.model.ReferenceEntity;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
public class ReferenceEntityDeserializer extends JsonDeserializer<ReferenceEntity> {
|
||||
|
||||
@Override
|
||||
public ReferenceEntity deserialize(JsonParser jsonParser,
|
||||
DeserializationContext deserializationContext) throws IOException, JacksonException {
|
||||
JsonNode node = jsonParser.readValueAsTree();
|
||||
|
||||
if (node.isTextual()) {
|
||||
return new ReferenceEntity(node.asText());
|
||||
}
|
||||
else if (node.isObject()) {
|
||||
JsonNode idNode = node.get("id");
|
||||
if (idNode != null && idNode.isTextual()) {
|
||||
return new ReferenceEntity(idNode.asText());
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package ru.micord.ervu.account_applications.exception;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
public class IdmDirectoriesException extends RuntimeException {
|
||||
public IdmDirectoriesException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public IdmDirectoriesException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public IdmDirectoriesException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
}
|
||||
|
|
@ -3,6 +3,8 @@ package ru.micord.ervu.account_applications.kafka;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.kafka.annotation.KafkaListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.Solution;
|
||||
import ru.micord.ervu.account_applications.model.*;
|
||||
import ru.micord.ervu.account_applications.service.ErvuDirectoriesService;
|
||||
|
||||
/**
|
||||
|
|
@ -16,31 +18,96 @@ public class ErvuDirectoriesListener {
|
|||
|
||||
@KafkaListener(id = "${kafka.domain.group.id}", topics = "${kafka.domain.reconciliation}")
|
||||
public void listenKafkaDomain(String kafkaMessage) {
|
||||
ervuDirectoriesService.upsertKafkaDomainMessage(kafkaMessage);
|
||||
ervuDirectoriesService.processUpsertMessage(kafkaMessage, RecruitmentData.class);
|
||||
}
|
||||
|
||||
@KafkaListener(id = "${kafka.role.group.id}", topics = "${kafka.role.reconciliation}")
|
||||
public void listenKafkaRole(String kafkaMessage) {
|
||||
ervuDirectoriesService.upsertKafkaRoleMessage(kafkaMessage);
|
||||
ervuDirectoriesService.processUpsertMessage(kafkaMessage, RoleData.class);
|
||||
}
|
||||
// Пока не заведены, обещают в будущих апдейтах создать
|
||||
// @KafkaListener(id = "${kafka.role.updated.group.id}", topics = "${kafka.role.updated}")
|
||||
// public void listenKafkaRoleUpdated(String kafkaMessage) {
|
||||
// ervuDirectoriesService.upsertKafkaRoleMessage(kafkaMessage);
|
||||
// }
|
||||
|
||||
// @KafkaListener(id = "${kafka.role.created.group.id}", topics = "${kafka.role.created}")
|
||||
// public void listenKafkaRoleUpdated(String kafkaMessage) {
|
||||
// ervuDirectoriesService.upsertKafkaRoleMessage(kafkaMessage);
|
||||
// }
|
||||
@KafkaListener(id = "${kafka.solution.group.id}", topics = "${kafka.solution.reconciliation}")
|
||||
public void listenKafkaSolution(String kafkaMessage) {
|
||||
ervuDirectoriesService.processUpsertMessage(kafkaMessage, Solution.class);
|
||||
}
|
||||
|
||||
@KafkaListener(id = "${kafka.domain.updated.group.id}", topics = "${kafka.domain.updated}")
|
||||
public void listenKafkaDomainUpdated(String kafkaMessage) {
|
||||
ervuDirectoriesService.upsertKafkaDomainMessage(kafkaMessage);
|
||||
ervuDirectoriesService.processUpsertMessage(kafkaMessage, RecruitmentData.class);
|
||||
}
|
||||
|
||||
@KafkaListener(id = "${kafka.domain.created.group.id}", topics = "${kafka.domain.created}")
|
||||
public void listenKafkaDomainCreated(String kafkaMessage) {
|
||||
ervuDirectoriesService.upsertKafkaDomainMessage(kafkaMessage);
|
||||
ervuDirectoriesService.processUpsertMessage(kafkaMessage, RecruitmentData.class);
|
||||
}
|
||||
|
||||
@KafkaListener(id = "${kafka.domain.deactivated.group.id}", topics = "${kafka.domain.deactivated}")
|
||||
public void listenKafkaDomainDeactivated(String kafkaMessage) {
|
||||
ervuDirectoriesService.processStatusChange(kafkaMessage, RecruitmentData.class, false);
|
||||
}
|
||||
|
||||
@KafkaListener(id = "${kafka.domain.activated.group.id}", topics = "${kafka.domain.activated}")
|
||||
public void listenKafkaDomainActivated(String kafkaMessage) {
|
||||
ervuDirectoriesService.processStatusChange(kafkaMessage, RecruitmentData.class, true);
|
||||
}
|
||||
|
||||
@KafkaListener(id = "${kafka.role.updated.group.id}", topics = "${kafka.role.updated}")
|
||||
public void listenKafkaRoleUpdated(String kafkaMessage) {
|
||||
ervuDirectoriesService.processUpsertMessage(kafkaMessage, RoleData.class);
|
||||
}
|
||||
|
||||
@KafkaListener(id = "${kafka.role.created.group.id}", topics = "${kafka.role.created}")
|
||||
public void listenKafkaRoleCreated(String kafkaMessage) {
|
||||
ervuDirectoriesService.processUpsertMessage(kafkaMessage, RoleData.class);
|
||||
}
|
||||
|
||||
@KafkaListener(id = "${kafka.role.deactivated.group.id}", topics = "${kafka.role.deactivated}")
|
||||
public void listenKafkaRoleDeactivated(String kafkaMessage) {
|
||||
ervuDirectoriesService.processStatusChange(kafkaMessage, RoleData.class, false);
|
||||
}
|
||||
|
||||
@KafkaListener(id = "${kafka.role.activated.group.id}", topics = "${kafka.role.activated}")
|
||||
public void listenKafkaRoleActivated(String kafkaMessage) {
|
||||
ervuDirectoriesService.processStatusChange(kafkaMessage, RoleData.class, true);
|
||||
}
|
||||
|
||||
@KafkaListener(id = "${kafka.solution.updated.group.id}", topics = "${kafka.solution.updated}")
|
||||
public void listenKafkaSolutionUpdated(String kafkaMessage) {
|
||||
ervuDirectoriesService.processUpsertMessage(kafkaMessage, SolutionData.class);
|
||||
}
|
||||
|
||||
@KafkaListener(id = "${kafka.solution.created.group.id}", topics = "${kafka.solution.created}")
|
||||
public void listenKafkaSolutionCreated(String kafkaMessage) {
|
||||
ervuDirectoriesService.processUpsertMessage(kafkaMessage, SolutionData.class);
|
||||
}
|
||||
|
||||
@KafkaListener(id = "${kafka.solution.deactivated.group.id}", topics = "${kafka.solution.deactivated}")
|
||||
public void listenKafkaSolutionDeactivated(String kafkaMessage) {
|
||||
ervuDirectoriesService.processStatusChange(kafkaMessage, SolutionData.class, false);
|
||||
}
|
||||
|
||||
@KafkaListener(id = "${kafka.solution.activated.group.id}", topics = "${kafka.solution.activated}")
|
||||
public void listenKafkaSolutionActivated(String kafkaMessage) {
|
||||
ervuDirectoriesService.processStatusChange(kafkaMessage, SolutionData.class, true);
|
||||
}
|
||||
|
||||
@KafkaListener(id = "${kafka.solution_role.created.group.id}", topics = "${kafka.solution_role.created}")
|
||||
public void listenKafkaSolutionRoleCreated(String kafkaMessage) {
|
||||
ervuDirectoriesService.processUpsertMessage(kafkaMessage, SolutionRoleData.class);
|
||||
}
|
||||
|
||||
@KafkaListener(id = "${kafka.solution_role.deleted.group.id}", topics = "${kafka.solution_role.deleted}")
|
||||
public void listenKafkaSolutionRoleDeleted(String kafkaMessage) {
|
||||
ervuDirectoriesService.processDeleteLink(kafkaMessage, SolutionRoleData.class);
|
||||
}
|
||||
|
||||
@KafkaListener(id = "${kafka.domain_solution.created.group.id}", topics = "${kafka.domain_solution.created}")
|
||||
public void listenKafkaDomainSolutionCreated(String kafkaMessage) {
|
||||
ervuDirectoriesService.processUpsertMessage(kafkaMessage, RecruitmentSolutionData.class);
|
||||
}
|
||||
|
||||
@KafkaListener(id = "${kafka.domain_solution.deleted.group.id}", topics = "${kafka.domain_solution.deleted}")
|
||||
public void listenKafkaDomainSolutionDeleted(String kafkaMessage) {
|
||||
ervuDirectoriesService.processDeleteLink(kafkaMessage, RecruitmentSolutionData.class);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
package ru.micord.ervu.account_applications.kafka.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import ru.micord.ervu.account_applications.model.ReferenceEntity;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class ChangeActiveMessage {
|
||||
private boolean success;
|
||||
private ReferenceEntity data;
|
||||
|
||||
public ReferenceEntity getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(ReferenceEntity data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package ru.micord.ervu.account_applications.kafka.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class DeleteLinkMessage<T>{
|
||||
private T data;
|
||||
private boolean success;
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package ru.micord.ervu.account_applications.kafka.model;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class UpsertMessage<T>{
|
||||
private T data;
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,188 @@
|
|||
package ru.micord.ervu.account_applications.model;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class RecruitmentData {
|
||||
@JsonProperty("id")
|
||||
private String id;
|
||||
@JsonProperty("codeDomainType")
|
||||
private String type;
|
||||
private RegionInfo region;
|
||||
private String name;
|
||||
private String fullName;
|
||||
private String shortName;
|
||||
private boolean reportsEnabled;
|
||||
private boolean active;
|
||||
private long created;
|
||||
private long modified;
|
||||
private String postalAddressId;
|
||||
private String addressId;
|
||||
private String militaryCode;
|
||||
private String timeZone;
|
||||
private String subpoenaSeriesCode;
|
||||
private int version;
|
||||
private ReferenceEntity parent;
|
||||
private List<ReferenceEntity> solutions;
|
||||
private Set<String> ipAddresses;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public RegionInfo getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
public void setRegion(RegionInfo region) {
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getFullName() {
|
||||
return fullName;
|
||||
}
|
||||
|
||||
public void setFullName(String fullName) {
|
||||
this.fullName = fullName;
|
||||
}
|
||||
|
||||
public String getShortName() {
|
||||
return shortName;
|
||||
}
|
||||
|
||||
public void setShortName(String shortName) {
|
||||
this.shortName = shortName;
|
||||
}
|
||||
|
||||
public boolean isReportsEnabled() {
|
||||
return reportsEnabled;
|
||||
}
|
||||
|
||||
public void setReportsEnabled(boolean reportsEnabled) {
|
||||
this.reportsEnabled = reportsEnabled;
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
return active;
|
||||
}
|
||||
|
||||
public void setActive(boolean active) {
|
||||
this.active = active;
|
||||
}
|
||||
|
||||
public long getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setCreated(long created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
public long getModified() {
|
||||
return modified;
|
||||
}
|
||||
|
||||
public void setModified(long modified) {
|
||||
this.modified = modified;
|
||||
}
|
||||
|
||||
public String getPostalAddressId() {
|
||||
return postalAddressId;
|
||||
}
|
||||
|
||||
public void setPostalAddressId(String postalAddressId) {
|
||||
this.postalAddressId = postalAddressId;
|
||||
}
|
||||
|
||||
public String getAddressId() {
|
||||
return addressId;
|
||||
}
|
||||
|
||||
public void setAddressId(String addressId) {
|
||||
this.addressId = addressId;
|
||||
}
|
||||
|
||||
public String getMilitaryCode() {
|
||||
return militaryCode;
|
||||
}
|
||||
|
||||
public void setMilitaryCode(String militaryCode) {
|
||||
this.militaryCode = militaryCode;
|
||||
}
|
||||
|
||||
public String getTimeZone() {
|
||||
return timeZone;
|
||||
}
|
||||
|
||||
public void setTimeZone(String timeZone) {
|
||||
this.timeZone = timeZone;
|
||||
}
|
||||
|
||||
public String getSubpoenaSeriesCode() {
|
||||
return subpoenaSeriesCode;
|
||||
}
|
||||
|
||||
public void setSubpoenaSeriesCode(String subpoenaSeriesCode) {
|
||||
this.subpoenaSeriesCode = subpoenaSeriesCode;
|
||||
}
|
||||
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(int version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public ReferenceEntity getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
public void setParent(ReferenceEntity parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public List<ReferenceEntity> getSolutions() {
|
||||
return solutions;
|
||||
}
|
||||
|
||||
public void setSolutions(
|
||||
List<ReferenceEntity> solutions) {
|
||||
this.solutions = solutions;
|
||||
}
|
||||
|
||||
public Set<String> getIpAddresses() {
|
||||
return ipAddresses;
|
||||
}
|
||||
|
||||
public void setIpAddresses(Set<String> ipAddresses) {
|
||||
this.ipAddresses = ipAddresses;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,323 +0,0 @@
|
|||
package ru.micord.ervu.account_applications.model;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
/**
|
||||
* @author Eduard Tihomirov
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class RecruitmentResponse {
|
||||
private List<Data> data;
|
||||
|
||||
public List<Data> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(
|
||||
List<Data> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public static class Data {
|
||||
private String id;
|
||||
private int version;
|
||||
private String schema;
|
||||
private String shortname;
|
||||
private String fullname;
|
||||
private String dns;
|
||||
private String email;
|
||||
private String phone;
|
||||
private String address;
|
||||
private String postalAddress;
|
||||
private String nsiDepartmentId;
|
||||
private String nsiOrganizationId;
|
||||
private String oktmo;
|
||||
private String orgOgrn;
|
||||
private String depOgrn;
|
||||
private String epguId;
|
||||
private String kpp;
|
||||
private String inn;
|
||||
private String okato;
|
||||
private String divisionType;
|
||||
private String tnsDepartmentId;
|
||||
private Boolean enabled;
|
||||
private String timezone;
|
||||
private Boolean reportsEnabled;
|
||||
private String subpoenaSeriesCode;
|
||||
private String addressId;
|
||||
private String postalAddressId;
|
||||
private String militaryCode;
|
||||
private Long createDate;
|
||||
private Long modified;
|
||||
private String parent;
|
||||
private String regionId;
|
||||
private String regionCode;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(int version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getSchema() {
|
||||
return schema;
|
||||
}
|
||||
|
||||
public void setSchema(String schema) {
|
||||
this.schema = schema;
|
||||
}
|
||||
|
||||
public String getShortname() {
|
||||
return shortname;
|
||||
}
|
||||
|
||||
public void setShortname(String shortname) {
|
||||
this.shortname = shortname;
|
||||
}
|
||||
|
||||
public String getFullname() {
|
||||
return fullname;
|
||||
}
|
||||
|
||||
public void setFullname(String fullname) {
|
||||
this.fullname = fullname;
|
||||
}
|
||||
|
||||
public String getDns() {
|
||||
return dns;
|
||||
}
|
||||
|
||||
public void setDns(String dns) {
|
||||
this.dns = dns;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getPostalAddress() {
|
||||
return postalAddress;
|
||||
}
|
||||
|
||||
public void setPostalAddress(String postalAddress) {
|
||||
this.postalAddress = postalAddress;
|
||||
}
|
||||
|
||||
public String getNsiDepartmentId() {
|
||||
return nsiDepartmentId;
|
||||
}
|
||||
|
||||
public void setNsiDepartmentId(String nsiDepartmentId) {
|
||||
this.nsiDepartmentId = nsiDepartmentId;
|
||||
}
|
||||
|
||||
public String getNsiOrganizationId() {
|
||||
return nsiOrganizationId;
|
||||
}
|
||||
|
||||
public void setNsiOrganizationId(String nsiOrganizationId) {
|
||||
this.nsiOrganizationId = nsiOrganizationId;
|
||||
}
|
||||
|
||||
public String getOktmo() {
|
||||
return oktmo;
|
||||
}
|
||||
|
||||
public void setOktmo(String oktmo) {
|
||||
this.oktmo = oktmo;
|
||||
}
|
||||
|
||||
public String getOrgOgrn() {
|
||||
return orgOgrn;
|
||||
}
|
||||
|
||||
public void setOrgOgrn(String orgOgrn) {
|
||||
this.orgOgrn = orgOgrn;
|
||||
}
|
||||
|
||||
public String getDepOgrn() {
|
||||
return depOgrn;
|
||||
}
|
||||
|
||||
public void setDepOgrn(String depOgrn) {
|
||||
this.depOgrn = depOgrn;
|
||||
}
|
||||
|
||||
public String getEpguId() {
|
||||
return epguId;
|
||||
}
|
||||
|
||||
public void setEpguId(String epguId) {
|
||||
this.epguId = epguId;
|
||||
}
|
||||
|
||||
public String getKpp() {
|
||||
return kpp;
|
||||
}
|
||||
|
||||
public void setKpp(String kpp) {
|
||||
this.kpp = kpp;
|
||||
}
|
||||
|
||||
public String getInn() {
|
||||
return inn;
|
||||
}
|
||||
|
||||
public void setInn(String inn) {
|
||||
this.inn = inn;
|
||||
}
|
||||
|
||||
public String getOkato() {
|
||||
return okato;
|
||||
}
|
||||
|
||||
public void setOkato(String okato) {
|
||||
this.okato = okato;
|
||||
}
|
||||
|
||||
public String getDivisionType() {
|
||||
return divisionType;
|
||||
}
|
||||
|
||||
public void setDivisionType(String divisionType) {
|
||||
this.divisionType = divisionType;
|
||||
}
|
||||
|
||||
public String getTnsDepartmentId() {
|
||||
return tnsDepartmentId;
|
||||
}
|
||||
|
||||
public void setTnsDepartmentId(String tnsDepartmentId) {
|
||||
this.tnsDepartmentId = tnsDepartmentId;
|
||||
}
|
||||
|
||||
public Boolean getEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(Boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public String getTimezone() {
|
||||
return timezone;
|
||||
}
|
||||
|
||||
public void setTimezone(String timezone) {
|
||||
this.timezone = timezone;
|
||||
}
|
||||
|
||||
public Boolean getReportsEnabled() {
|
||||
return reportsEnabled;
|
||||
}
|
||||
|
||||
public void setReportsEnabled(Boolean reportsEnabled) {
|
||||
this.reportsEnabled = reportsEnabled;
|
||||
}
|
||||
|
||||
public String getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
public void setParent(String parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String getRegionId() {
|
||||
return regionId;
|
||||
}
|
||||
|
||||
public void setRegionId(
|
||||
String regionId) {
|
||||
this.regionId = regionId;
|
||||
}
|
||||
|
||||
public String getSubpoenaSeriesCode() {
|
||||
return subpoenaSeriesCode;
|
||||
}
|
||||
|
||||
public void setSubpoenaSeriesCode(String subpoenaSeriesCode) {
|
||||
this.subpoenaSeriesCode = subpoenaSeriesCode;
|
||||
}
|
||||
|
||||
public String getAddressId() {
|
||||
return addressId;
|
||||
}
|
||||
|
||||
public void setAddressId(String addressId) {
|
||||
this.addressId = addressId;
|
||||
}
|
||||
|
||||
public String getPostalAddressId() {
|
||||
return postalAddressId;
|
||||
}
|
||||
|
||||
public void setPostalAddressId(String postalAddressId) {
|
||||
this.postalAddressId = postalAddressId;
|
||||
}
|
||||
|
||||
public String getMilitaryCode() {
|
||||
return militaryCode;
|
||||
}
|
||||
|
||||
public void setMilitaryCode(String militaryCode) {
|
||||
this.militaryCode = militaryCode;
|
||||
}
|
||||
|
||||
public Long getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
||||
public void setCreateDate(Long createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
public Long getModified() {
|
||||
return modified;
|
||||
}
|
||||
|
||||
public void setModified(Long modified) {
|
||||
this.modified = modified;
|
||||
}
|
||||
|
||||
public String getRegionCode() {
|
||||
return regionCode;
|
||||
}
|
||||
|
||||
public void setRegionCode(String regionCode) {
|
||||
this.regionCode = regionCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package ru.micord.ervu.account_applications.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class RecruitmentSolutionData {
|
||||
@JsonProperty("id_domain")
|
||||
private String id;
|
||||
@JsonProperty("id_solution")
|
||||
private String solutionId;
|
||||
|
||||
public RecruitmentSolutionData(String id, String solutionId) {
|
||||
this.id = id;
|
||||
this.solutionId = solutionId;
|
||||
}
|
||||
|
||||
public RecruitmentSolutionData() {
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSolutionId() {
|
||||
return solutionId;
|
||||
}
|
||||
|
||||
public void setSolutionId(String solutionId) {
|
||||
this.solutionId = solutionId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package ru.micord.ervu.account_applications.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class ReferenceEntity {
|
||||
private String id;
|
||||
|
||||
public ReferenceEntity(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package ru.micord.ervu.account_applications.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class RegionInfo {
|
||||
private String code;
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
package ru.micord.ervu.account_applications.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class RoleData {
|
||||
private String id;
|
||||
private String name;
|
||||
private String description;
|
||||
private String displayName;
|
||||
private Boolean active;
|
||||
private long created;
|
||||
private long modified;
|
||||
private long deleted;
|
||||
private int version;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public void setDisplayName(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public Boolean getActive() {
|
||||
return active;
|
||||
}
|
||||
|
||||
public void setActive(Boolean active) {
|
||||
this.active = active;
|
||||
}
|
||||
|
||||
public long getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setCreated(long created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
public long getModified() {
|
||||
return modified;
|
||||
}
|
||||
|
||||
public void setModified(long modified) {
|
||||
this.modified = modified;
|
||||
}
|
||||
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(int version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public long getDeleted() {
|
||||
return deleted;
|
||||
}
|
||||
|
||||
public void setDeleted(long deleted) {
|
||||
this.deleted = deleted;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
package ru.micord.ervu.account_applications.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
/**
|
||||
* @author Eduard Tihomirov
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class RoleResponse {
|
||||
private List<Data> data;
|
||||
|
||||
public List<Data> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(
|
||||
List<Data> data) {
|
||||
this.data = data;
|
||||
}
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public static class Data {
|
||||
private String id;
|
||||
private String displayName;
|
||||
private Long createDate;
|
||||
private Long modified;
|
||||
private Long finish;
|
||||
private String name;
|
||||
private Boolean ervuRole;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public void setDisplayName(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public Long getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
||||
public void setCreateDate(Long createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
public Long getModified() {
|
||||
return modified;
|
||||
}
|
||||
|
||||
public void setModified(Long modified) {
|
||||
this.modified = modified;
|
||||
}
|
||||
|
||||
public Long getFinish() {
|
||||
return finish;
|
||||
}
|
||||
|
||||
public void setFinish(Long finish) {
|
||||
this.finish = finish;
|
||||
}
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Boolean getErvuRole() {
|
||||
return ervuRole;
|
||||
}
|
||||
|
||||
public void setErvuRole(Boolean ervuRole) {
|
||||
this.ervuRole = ervuRole;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
package ru.micord.ervu.account_applications.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class SolutionData {
|
||||
private String id;
|
||||
private String name;
|
||||
private String description;
|
||||
private String displayName;
|
||||
private Boolean active;
|
||||
private long created;
|
||||
private long modified;
|
||||
private long deleted;
|
||||
private int version;
|
||||
private List<ReferenceEntity> roles;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public void setDisplayName(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public Boolean getActive() {
|
||||
return active;
|
||||
}
|
||||
|
||||
public void setActive(Boolean active) {
|
||||
this.active = active;
|
||||
}
|
||||
|
||||
public long getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setCreated(long created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
public long getModified() {
|
||||
return modified;
|
||||
}
|
||||
|
||||
public void setModified(long modified) {
|
||||
this.modified = modified;
|
||||
}
|
||||
|
||||
public long getDeleted() {
|
||||
return deleted;
|
||||
}
|
||||
|
||||
public void setDeleted(long deleted) {
|
||||
this.deleted = deleted;
|
||||
}
|
||||
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(int version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public List<ReferenceEntity> getRoles() {
|
||||
return roles;
|
||||
}
|
||||
|
||||
public void setRoles(List<ReferenceEntity> roles) {
|
||||
this.roles = roles;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package ru.micord.ervu.account_applications.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class SolutionRoleData {
|
||||
@JsonProperty("id_solution")
|
||||
private String id;
|
||||
@JsonProperty("id_role")
|
||||
private String roleId;
|
||||
|
||||
public SolutionRoleData(String id, String roleId) {
|
||||
this.id = id;
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public SolutionRoleData() {
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(String roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
package ru.micord.ervu.account_applications.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.jooq.Record2;
|
||||
import org.jooq.Result;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import ru.micord.ervu.account_applications.dao.ErvuDirectoriesDao;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.RecruitmentRecord;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.UserApplicationRoleRecord;
|
||||
|
||||
/**
|
||||
* @author Eduard Tihomirov
|
||||
*/
|
||||
@Service
|
||||
public class ErvuDirectoriesDaoService {
|
||||
|
||||
@Autowired
|
||||
private ErvuDirectoriesDao ervuDirectoriesDao;
|
||||
|
||||
@Cacheable(value = "role-ids", unless = "#result == null")
|
||||
public List<String> getRoleIds() {
|
||||
return ervuDirectoriesDao.getRoleIds();
|
||||
}
|
||||
|
||||
@Cacheable(value = "domain-ids", unless = "#result == null")
|
||||
public Map<String, UUID> getDomainIds() {
|
||||
return ervuDirectoriesDao.getDomainIds().intoMap(Record2::value2, Record2::value1);
|
||||
}
|
||||
|
||||
public UserApplicationRoleRecord getRoleRecord() {
|
||||
return ervuDirectoriesDao.getRoleRecord();
|
||||
}
|
||||
|
||||
public RecruitmentRecord getRecruitmentRecord() {
|
||||
return ervuDirectoriesDao.getRecruitmentRecord();
|
||||
}
|
||||
|
||||
@CacheEvict(value = "domain-ids", allEntries = true)
|
||||
public void insertRecruitmentRecords(List<RecruitmentRecord> newRecruitmentRecords) {
|
||||
ervuDirectoriesDao.insertRecruitmentRecords(newRecruitmentRecords);
|
||||
}
|
||||
|
||||
public void updateRecruitmentRecords(List<RecruitmentRecord> recruitmentRecords) {
|
||||
ervuDirectoriesDao.updateRecruitmentRecords(recruitmentRecords);
|
||||
}
|
||||
|
||||
@CacheEvict(value = "role-ids", allEntries = true)
|
||||
public void insertRoleRecords(List<UserApplicationRoleRecord> newRoleRecords) {
|
||||
ervuDirectoriesDao.insertRoleRecords(newRoleRecords);
|
||||
}
|
||||
|
||||
public void updateRoleRecords(List<UserApplicationRoleRecord> roleRecords ) {
|
||||
ervuDirectoriesDao.updateRoleRecords(roleRecords);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,35 +1,28 @@
|
|||
package ru.micord.ervu.account_applications.service;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JavaType;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Caching;
|
||||
import org.springframework.context.annotation.DependsOn;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.RecruitmentRecord;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.UserApplicationRoleRecord;
|
||||
import ru.micord.ervu.account_applications.model.RecruitmentResponse;
|
||||
import ru.micord.ervu.account_applications.model.RoleResponse;
|
||||
import org.springframework.web.util.UriComponentsBuilder;
|
||||
import ru.micord.ervu.account_applications.exception.IdmDirectoriesException;
|
||||
import ru.micord.ervu.account_applications.kafka.model.ChangeActiveMessage;
|
||||
import ru.micord.ervu.account_applications.kafka.model.DeleteLinkMessage;
|
||||
import ru.micord.ervu.account_applications.kafka.model.UpsertMessage;
|
||||
import ru.micord.ervu.account_applications.service.processor.DataProcessor;
|
||||
import ru.micord.ervu.account_applications.service.processor.LinkDataProcessor;
|
||||
|
||||
/**
|
||||
* @author Eduard Tihomirov
|
||||
|
|
@ -39,168 +32,111 @@ import ru.micord.ervu.account_applications.model.RoleResponse;
|
|||
public class ErvuDirectoriesService {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(
|
||||
MethodHandles.lookup().lookupClass());
|
||||
private final RestTemplate restTemplate;
|
||||
private final ObjectMapper objectMapper;
|
||||
private final Map<Class<?>, DataProcessor<?, ?>> dataProcessors;
|
||||
@Value("${idm.url}")
|
||||
private String idmUrl;
|
||||
@Value("${ervu.directories:domain, role}")
|
||||
@Value("${ervu.directories:domain, role, solution}")
|
||||
private String ervuDirectories;
|
||||
@Value("${ervu.admin.role:gomu_supervisor, system_administrator, security_administrator, Responsible_for_internal_control}")
|
||||
private String ervuAdminRole;
|
||||
@Autowired
|
||||
private RestTemplate restTemplate;
|
||||
@Autowired
|
||||
private ErvuDirectoriesDaoService ervuDirectoriesDaoService;
|
||||
@Autowired
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
public ErvuDirectoriesService(RestTemplate restTemplate, ObjectMapper objectMapper,
|
||||
List<DataProcessor<?, ?>> processors) {
|
||||
this.restTemplate = restTemplate;
|
||||
this.objectMapper = objectMapper;
|
||||
this.dataProcessors = processors.stream()
|
||||
.collect(Collectors.toMap(DataProcessor::getType, p -> p));
|
||||
}
|
||||
|
||||
|
||||
@Caching(evict = {
|
||||
@CacheEvict(value = "domain-ids", allEntries = true),
|
||||
@CacheEvict(value = "role-ids", allEntries = true)
|
||||
})
|
||||
public void updateDirectories() {
|
||||
try {
|
||||
String[] ervuDirectoriesArray = ervuDirectories.split(",");
|
||||
Arrays.stream(ervuDirectoriesArray).forEach(ervuCollection -> {
|
||||
String targetUrl = idmUrl + "/reconcile/"+ ervuCollection.trim() + "/to/kafka/v1";
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
String emptyJson = "{}";
|
||||
HttpEntity<String> requestEntity = new HttpEntity<>(emptyJson, headers);
|
||||
ResponseEntity<String> response = restTemplate.postForEntity(targetUrl, requestEntity, String.class);
|
||||
Arrays.stream(ervuDirectoriesArray).forEach(ervuDirectory -> {
|
||||
String targetUrl = UriComponentsBuilder.fromHttpUrl(idmUrl)
|
||||
.pathSegment("reconcile", ervuDirectory.trim(), "to", "kafka", "v1")
|
||||
.toUriString();
|
||||
ResponseEntity<String> response = restTemplate.getForEntity(targetUrl, String.class);
|
||||
if (!response.getStatusCode().is2xxSuccessful()) {
|
||||
LOGGER.error(
|
||||
"Error in " + ervuCollection + " request. Status code: " + response.getStatusCode()
|
||||
+ "; Body: " + response.getBody());
|
||||
LOGGER.error("Error in {} request. Status code: {}; Body: {}",
|
||||
ervuDirectory, response.getStatusCode(), response.getBody()
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (Exception e) {
|
||||
LOGGER.error(e.getMessage());
|
||||
//trow error for not clean cache
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void upsertKafkaDomainMessage(String kafkaMessage) {
|
||||
RecruitmentResponse[] recruitmentResponses;
|
||||
try {
|
||||
recruitmentResponses = objectMapper.readValue(kafkaMessage, RecruitmentResponse[].class);
|
||||
}
|
||||
catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if (recruitmentResponses.length > 0 && recruitmentResponses[0].getData() != null && !recruitmentResponses[0].getData().isEmpty()) {
|
||||
upsertRecruitmentData(recruitmentResponses[0].getData());
|
||||
throw new IdmDirectoriesException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void upsertKafkaRoleMessage(String kafkaMessage) {
|
||||
RoleResponse[] roleResponses;
|
||||
public <T> void processUpsertMessage(String kafkaMessage, Class<T> entityClass) {
|
||||
try {
|
||||
roleResponses = objectMapper.readValue(kafkaMessage, RoleResponse[].class);
|
||||
JavaType messageType = objectMapper.getTypeFactory()
|
||||
.constructParametricType(UpsertMessage.class, entityClass);
|
||||
|
||||
UpsertMessage<T> message = objectMapper.readValue(kafkaMessage, messageType);
|
||||
|
||||
if (message.getData() != null) {
|
||||
DataProcessor<T, ?> processor = (DataProcessor<T, ?>) dataProcessors.get(entityClass);
|
||||
if (processor == null) {
|
||||
throw new IllegalStateException("No processor found for " + entityClass.getSimpleName());
|
||||
}
|
||||
|
||||
processor.upsertData(message.getData());
|
||||
}
|
||||
}
|
||||
catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if (roleResponses.length > 0 && roleResponses[0].getData() != null && !roleResponses[0].getData().isEmpty()) {
|
||||
upsertRoleData(roleResponses[0].getData());
|
||||
catch (Exception e) {
|
||||
throw new IdmDirectoriesException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void upsertRecruitmentData(List<RecruitmentResponse.Data> dataList) {
|
||||
List<RecruitmentRecord> newRecruitmentRecords = new ArrayList<>();
|
||||
List<RecruitmentRecord> recruitmentRecords = new ArrayList<>();
|
||||
Map<String, UUID> ids = ervuDirectoriesDaoService.getDomainIds();
|
||||
dataList.forEach(data -> {
|
||||
Timestamp updatedAt = Timestamp.from(Instant.ofEpochSecond(data.getModified()));
|
||||
Timestamp createdAt = Timestamp.from(Instant.ofEpochSecond(data.getCreateDate()));
|
||||
RecruitmentRecord recruitmentRecord = ervuDirectoriesDaoService.getRecruitmentRecord();
|
||||
recruitmentRecord.setIdmId(data.getId());
|
||||
recruitmentRecord.setVersion(data.getVersion());
|
||||
recruitmentRecord.setSchema(data.getSchema());
|
||||
recruitmentRecord.setShortname(data.getShortname());
|
||||
recruitmentRecord.setFullname(data.getFullname());
|
||||
recruitmentRecord.setDns(data.getDns());
|
||||
recruitmentRecord.setEmail(data.getEmail());
|
||||
recruitmentRecord.setPhone(data.getPhone());
|
||||
recruitmentRecord.setAddress(data.getAddress());
|
||||
recruitmentRecord.setPostalAddress(data.getPostalAddress());
|
||||
recruitmentRecord.setNsiDepartmentId(data.getNsiDepartmentId());
|
||||
recruitmentRecord.setNsiOrganizationId(data.getNsiOrganizationId());
|
||||
recruitmentRecord.setOktmo(data.getOktmo());
|
||||
recruitmentRecord.setOrgOgrn(data.getOrgOgrn());
|
||||
recruitmentRecord.setDepOgrn(data.getDepOgrn());
|
||||
recruitmentRecord.setEpguId(data.getEpguId());
|
||||
recruitmentRecord.setKpp(data.getKpp());
|
||||
recruitmentRecord.setInn(data.getInn());
|
||||
recruitmentRecord.setOkato(data.getOkato());
|
||||
recruitmentRecord.setDivisionType(data.getDivisionType());
|
||||
recruitmentRecord.setTnsDepartmentId(data.getTnsDepartmentId());
|
||||
recruitmentRecord.setEnabled(data.getEnabled() != null ? data.getEnabled() : true);
|
||||
recruitmentRecord.setTimezone(data.getTimezone());
|
||||
recruitmentRecord.setReportsEnabled(data.getReportsEnabled());
|
||||
recruitmentRecord.setParentId(data.getParent());
|
||||
recruitmentRecord.setSubpoenaSeriesCode(data.getSubpoenaSeriesCode());
|
||||
recruitmentRecord.setAddressId(data.getAddressId());
|
||||
recruitmentRecord.setPostalAddressId(data.getPostalAddressId());
|
||||
recruitmentRecord.setRegionId(data.getRegionId());
|
||||
recruitmentRecord.setRegionCode(data.getRegionCode());
|
||||
recruitmentRecord.setMilitaryCode(data.getMilitaryCode());
|
||||
recruitmentRecord.setCreatedAt(createdAt);
|
||||
recruitmentRecord.setUpdatedAt(updatedAt);
|
||||
recruitmentRecord.setTs(new Timestamp(System.currentTimeMillis()));
|
||||
String idmId = recruitmentRecord.getIdmId();
|
||||
if (ids.containsKey(idmId)) {
|
||||
recruitmentRecord.setId(ids.get(idmId));
|
||||
recruitmentRecords.add(recruitmentRecord);
|
||||
@Transactional
|
||||
public <T> void processStatusChange(String kafkaMessage, Class<T> entityClass, boolean active) {
|
||||
try {
|
||||
ChangeActiveMessage changeActiveMessage = objectMapper.readValue(kafkaMessage,
|
||||
ChangeActiveMessage.class
|
||||
);
|
||||
|
||||
if (Boolean.TRUE.equals(changeActiveMessage.isSuccess())
|
||||
&& changeActiveMessage.getData() != null) {
|
||||
DataProcessor<T, ?> processor = (DataProcessor<T, ?>) dataProcessors.get(entityClass);
|
||||
if (processor == null) {
|
||||
throw new IllegalStateException("No processor found for " + entityClass.getSimpleName());
|
||||
}
|
||||
|
||||
processor.changeActiveStatus(changeActiveMessage.getData().getId(), active);
|
||||
}
|
||||
else {
|
||||
newRecruitmentRecords.add(recruitmentRecord);
|
||||
}
|
||||
});
|
||||
ervuDirectoriesDaoService.insertRecruitmentRecords(newRecruitmentRecords);
|
||||
ervuDirectoriesDaoService.updateRecruitmentRecords(recruitmentRecords);
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new IdmDirectoriesException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void upsertRoleData(List<RoleResponse.Data> dataList) {
|
||||
String[] adminRoles = ervuAdminRole.split(",");
|
||||
List<UserApplicationRoleRecord> newRoleRecords = new ArrayList<>();
|
||||
List<UserApplicationRoleRecord> roleRecords = new ArrayList<>();
|
||||
List<String> ids = ervuDirectoriesDaoService.getRoleIds();
|
||||
dataList.forEach(data -> {
|
||||
if (data.getErvuRole() == null || !data.getErvuRole()) {
|
||||
return;
|
||||
@Transactional
|
||||
public <T> void processDeleteLink(String kafkaMessage, Class<T> entityClass) {
|
||||
try {
|
||||
JavaType messageType = objectMapper.getTypeFactory()
|
||||
.constructParametricType(DeleteLinkMessage.class, entityClass);
|
||||
DeleteLinkMessage<T> message = objectMapper.readValue(kafkaMessage, messageType);
|
||||
|
||||
|
||||
if (Boolean.TRUE.equals(message.isSuccess()) && message.getData() != null) {
|
||||
DataProcessor<T, ?> processor = (DataProcessor<T, ?>) dataProcessors.get(entityClass);
|
||||
|
||||
if (processor instanceof LinkDataProcessor<T, ?> linkProcessor) {
|
||||
linkProcessor.deleteLink(message.getData());
|
||||
}
|
||||
else {
|
||||
LOGGER.warn("Processor {} does not support deleteLink operation",
|
||||
entityClass.getSimpleName()
|
||||
);
|
||||
}
|
||||
}
|
||||
Timestamp updatedAt = Timestamp.from(Instant.ofEpochSecond(data.getModified()));
|
||||
Timestamp createdAt = Timestamp.from(Instant.ofEpochSecond(data.getCreateDate()));
|
||||
Timestamp finishAt = null;
|
||||
if (data.getFinish() != null) {
|
||||
finishAt = Timestamp.from(Instant.ofEpochSecond(data.getFinish()));
|
||||
}
|
||||
UserApplicationRoleRecord roleRecord = ervuDirectoriesDaoService.getRoleRecord();
|
||||
roleRecord.setUserRoleId(data.getId());
|
||||
roleRecord.setRoleCode(data.getName());
|
||||
roleRecord.setRoleName(data.getDisplayName());
|
||||
roleRecord.setCreated(createdAt);
|
||||
roleRecord.setUpdated(updatedAt);
|
||||
roleRecord.setFinished(finishAt);
|
||||
Optional<String> adminRoleOptional = Arrays.stream(adminRoles)
|
||||
.filter(role -> role.trim().equals(data.getName()))
|
||||
.findAny();
|
||||
if (adminRoleOptional.isPresent()) {
|
||||
roleRecord.setAdminRole(true);
|
||||
}
|
||||
if (ids.contains(data.getId())) {
|
||||
roleRecords.add(roleRecord);
|
||||
}
|
||||
else {
|
||||
newRoleRecords.add(roleRecord);
|
||||
}
|
||||
});
|
||||
ervuDirectoriesDaoService.insertRoleRecords(newRoleRecords);
|
||||
ervuDirectoriesDaoService.updateRoleRecords(roleRecords);
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new IdmDirectoriesException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,88 @@
|
|||
package ru.micord.ervu.account_applications.service;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.micord.ervu.account_applications.dao.IpDirectoryDao;
|
||||
import ru.micord.ervu.account_applications.dao.RecruitmentIpDao;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.IpDirectoryRecord;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.RecruitmentIpRecord;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@Component
|
||||
public class RecruitmentIpService {
|
||||
private final RecruitmentIpDao dao;
|
||||
private final IpDirectoryDao ipDirectoryDao;
|
||||
|
||||
public RecruitmentIpService(RecruitmentIpDao dao, IpDirectoryDao ipDirectoryDao) {
|
||||
this.dao = dao;
|
||||
this.ipDirectoryDao = ipDirectoryDao;
|
||||
}
|
||||
|
||||
public void upsertRecruitmentIpAddresses(String recruitmentId, Set<String> incomingIps) {
|
||||
Set<String> existingIps = dao.getIpAddressesByRecruitmentId(recruitmentId);
|
||||
|
||||
Set<String> toAdd = new HashSet<>(incomingIps);
|
||||
toAdd.removeAll(existingIps);
|
||||
|
||||
Set<String> toDelete = new HashSet<>(existingIps);
|
||||
toDelete.removeAll(incomingIps);
|
||||
|
||||
handleDeletion(recruitmentId, toDelete);
|
||||
handleInsertion(recruitmentId, toAdd);
|
||||
}
|
||||
|
||||
private void handleDeletion(String recruitmentId, Set<String> toDelete) {
|
||||
if (toDelete.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
dao.deleteRecruitmentIpsByRecruitmentIdAndIps(recruitmentId, List.copyOf(toDelete));
|
||||
|
||||
Set<String> stillUsedIps = dao.getExistingIpAddresses(List.copyOf(toDelete));
|
||||
Set<String> toRemoveFromDirectory = toDelete.stream()
|
||||
.filter(ip -> !stillUsedIps.contains(ip))
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
if (!toRemoveFromDirectory.isEmpty()) {
|
||||
ipDirectoryDao.deleteByIpAddresses(List.copyOf(toRemoveFromDirectory));
|
||||
}
|
||||
}
|
||||
|
||||
private void handleInsertion(String recruitmentId, Set<String> toAdd) {
|
||||
if (toAdd.isEmpty()){
|
||||
return;
|
||||
}
|
||||
|
||||
List<RecruitmentIpRecord> recordsToAdd = toAdd.stream()
|
||||
.map(ip -> {
|
||||
RecruitmentIpRecord record = dao.newRecord();
|
||||
record.setRecruitmentId(recruitmentId);
|
||||
record.setIpAddress(ip);
|
||||
return record;
|
||||
})
|
||||
.toList();
|
||||
dao.mergeRecords(recordsToAdd);
|
||||
|
||||
Set<String> existingDirectoryIps = ipDirectoryDao.getExistingIpAddresses(List.copyOf(toAdd));
|
||||
Set<String> directoryToInsert = toAdd.stream()
|
||||
.filter(ip -> !existingDirectoryIps.contains(ip))
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
if (!directoryToInsert.isEmpty()) {
|
||||
List<IpDirectoryRecord> ipDirectoryRecords = directoryToInsert.stream()
|
||||
.map(ip -> {
|
||||
IpDirectoryRecord record = new IpDirectoryRecord();
|
||||
record.setIpAddress(ip);
|
||||
return record;
|
||||
})
|
||||
.toList();
|
||||
ipDirectoryDao.mergeRecords(ipDirectoryRecords);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package ru.micord.ervu.account_applications.service.processor;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
public interface DataProcessor<T, R> {
|
||||
void upsertData(T data);
|
||||
|
||||
void changeActiveStatus(String id, boolean active);
|
||||
|
||||
Class<T> getType();
|
||||
|
||||
R mapToRecord(T data);
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package ru.micord.ervu.account_applications.service.processor;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
public interface LinkDataProcessor<T,R> extends DataProcessor<T,R> {
|
||||
void deleteLink(T data);
|
||||
}
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
package ru.micord.ervu.account_applications.service.processor.impl;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import ru.micord.ervu.account_applications.dao.RecruitmentDao;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.RecruitmentRecord;
|
||||
import ru.micord.ervu.account_applications.model.RecruitmentData;
|
||||
import ru.micord.ervu.account_applications.model.ReferenceEntity;
|
||||
import ru.micord.ervu.account_applications.service.RecruitmentIpService;
|
||||
import ru.micord.ervu.account_applications.service.processor.DataProcessor;
|
||||
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@Component
|
||||
public class RecruitmentProcessor implements DataProcessor<RecruitmentData, RecruitmentRecord> {
|
||||
private final RecruitmentDao dao;
|
||||
private final RecruitmentSolutionProcessor recruitmentSolutionProcessor;
|
||||
private final RecruitmentIpService recruitmentIpService;
|
||||
|
||||
public RecruitmentProcessor(RecruitmentDao dao,
|
||||
RecruitmentSolutionProcessor recruitmentSolutionProcessor,
|
||||
RecruitmentIpService recruitmentIpService) {
|
||||
this.dao = dao;
|
||||
this.recruitmentSolutionProcessor = recruitmentSolutionProcessor;
|
||||
this.recruitmentIpService = recruitmentIpService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upsertData(RecruitmentData data) {
|
||||
RecruitmentRecord recruitmentRecord = mapToRecord(data);
|
||||
if (!CollectionUtils.isEmpty(data.getSolutions())) {
|
||||
Set<String> solutionsIds = data.getSolutions().stream()
|
||||
.map(ReferenceEntity::getId)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
recruitmentSolutionProcessor.upsertRecruitmentSolutions(data.getId(), solutionsIds);
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(data.getIpAddresses())) {
|
||||
recruitmentIpService.upsertRecruitmentIpAddresses(data.getId(), data.getIpAddresses());
|
||||
}
|
||||
|
||||
dao.upsertData(recruitmentRecord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeActiveStatus(String id, boolean active) {
|
||||
dao.setActiveStatus(id, active);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<RecruitmentData> getType() {
|
||||
return RecruitmentData.class;
|
||||
}
|
||||
|
||||
public RecruitmentRecord mapToRecord(RecruitmentData data) {
|
||||
Optional<UUID> idByIdmId = dao.getIdByIdmId(data.getId());
|
||||
Timestamp updatedAt = Timestamp.from(Instant.ofEpochMilli(data.getModified()));
|
||||
Timestamp createdAt = Timestamp.from(Instant.ofEpochMilli(data.getCreated()));
|
||||
RecruitmentRecord recruitmentRecord = dao.newRecord();
|
||||
recruitmentRecord.setIdmId(data.getId());
|
||||
recruitmentRecord.setVersion(data.getVersion());
|
||||
recruitmentRecord.setSchema(data.getType());
|
||||
recruitmentRecord.setShortname(data.getShortName());
|
||||
recruitmentRecord.setFullname(data.getFullName());
|
||||
recruitmentRecord.setName(data.getName());
|
||||
recruitmentRecord.setActive(data.isActive());
|
||||
recruitmentRecord.setTimezone(data.getTimeZone());
|
||||
recruitmentRecord.setReportsEnabled(data.isReportsEnabled());
|
||||
recruitmentRecord.setParentId(data.getParent() != null ? data.getParent().getId() : null);
|
||||
recruitmentRecord.setSubpoenaSeriesCode(data.getSubpoenaSeriesCode());
|
||||
recruitmentRecord.setAddressId(data.getAddressId());
|
||||
recruitmentRecord.setPostalAddressId(data.getPostalAddressId());
|
||||
recruitmentRecord.setRegionCode(data.getRegion().getCode());
|
||||
recruitmentRecord.setMilitaryCode(data.getMilitaryCode());
|
||||
recruitmentRecord.setCreatedAt(createdAt);
|
||||
recruitmentRecord.setUpdatedAt(updatedAt);
|
||||
recruitmentRecord.setTs(new Timestamp(System.currentTimeMillis()));
|
||||
idByIdmId.ifPresent(recruitmentRecord::setId);
|
||||
return recruitmentRecord;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package ru.micord.ervu.account_applications.service.processor.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.micord.ervu.account_applications.dao.RecruitmentSolutionDao;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.RecruitmentSolutionRecord;
|
||||
import ru.micord.ervu.account_applications.model.RecruitmentSolutionData;
|
||||
import ru.micord.ervu.account_applications.service.processor.LinkDataProcessor;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@Component
|
||||
public class RecruitmentSolutionProcessor
|
||||
implements LinkDataProcessor<RecruitmentSolutionData, RecruitmentSolutionRecord> {
|
||||
private final RecruitmentSolutionDao dao;
|
||||
|
||||
public RecruitmentSolutionProcessor(RecruitmentSolutionDao dao) {
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
public void upsertRecruitmentSolutions(String recruitmentId, Set<String> incomingIds) {
|
||||
List<String> existingIds = dao.getSolutionIdsByRecruitmentId(recruitmentId);
|
||||
List<String> toDelete = existingIds.stream()
|
||||
.filter(id -> !incomingIds.contains(id))
|
||||
.toList();
|
||||
|
||||
Set<String> toAdd = incomingIds.stream()
|
||||
.filter(id -> !existingIds.contains(id))
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
if (!toDelete.isEmpty()) {
|
||||
dao.deleteRecruitmentSolutionsByRecruitmentIdAndSolutionIds(recruitmentId, toDelete);
|
||||
}
|
||||
|
||||
if (!toAdd.isEmpty()) {
|
||||
List<RecruitmentSolutionRecord> recordsToAdd = toAdd.stream()
|
||||
.map(id -> mapToRecord(new RecruitmentSolutionData(recruitmentId, id)))
|
||||
.toList();
|
||||
dao.mergeRecords(recordsToAdd);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteLink(RecruitmentSolutionData data) {
|
||||
RecruitmentSolutionRecord recruitmentSolutionRecord = mapToRecord(data);
|
||||
dao.deleteRecruitmentSolution(recruitmentSolutionRecord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upsertData(RecruitmentSolutionData data) {
|
||||
RecruitmentSolutionRecord recruitmentSolutionRecord = mapToRecord(data);
|
||||
dao.upsertData(recruitmentSolutionRecord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeActiveStatus(String id, boolean active) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<RecruitmentSolutionData> getType() {
|
||||
return RecruitmentSolutionData.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RecruitmentSolutionRecord mapToRecord(RecruitmentSolutionData data) {
|
||||
RecruitmentSolutionRecord recruitmentSolutionRecord = dao.newRecord();
|
||||
recruitmentSolutionRecord.setRecruitmentId(data.getId());
|
||||
recruitmentSolutionRecord.setSolutionId(data.getSolutionId());
|
||||
return recruitmentSolutionRecord;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
package ru.micord.ervu.account_applications.service.processor.impl;
|
||||
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
import java.util.Arrays;
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.micord.ervu.account_applications.dao.RoleDao;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.UserApplicationRoleRecord;
|
||||
import ru.micord.ervu.account_applications.model.RoleData;
|
||||
import ru.micord.ervu.account_applications.service.processor.DataProcessor;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@Component
|
||||
public class RoleProcessor implements DataProcessor<RoleData, UserApplicationRoleRecord> {
|
||||
private final RoleDao dao;
|
||||
@Value("${ervu.admin.role:gomu_supervisor, system_administrator, security_administrator, Responsible_for_internal_control}")
|
||||
private String ervuAdminRole;
|
||||
private String[] adminRoles;
|
||||
|
||||
public RoleProcessor(RoleDao dao) {
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
private void init() {
|
||||
adminRoles = Arrays.stream(ervuAdminRole.split(","))
|
||||
.map(String::trim)
|
||||
.toArray(String[]::new);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upsertData(RoleData roleData) {
|
||||
UserApplicationRoleRecord roleRecord = mapToRecord(roleData);
|
||||
dao.upsertData(roleRecord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeActiveStatus(String id, boolean active) {
|
||||
dao.setActiveStatus(id, active);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<RoleData> getType() {
|
||||
return RoleData.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserApplicationRoleRecord mapToRecord(RoleData data) {
|
||||
Timestamp updatedAt = Timestamp.from(Instant.ofEpochMilli(data.getModified()));
|
||||
Timestamp createdAt = Timestamp.from(Instant.ofEpochMilli(data.getCreated()));
|
||||
Timestamp deletedAt = Timestamp.from(Instant.ofEpochMilli(data.getDeleted()));
|
||||
UserApplicationRoleRecord record = dao.newRecord();
|
||||
record.setUserRoleId(data.getId());
|
||||
record.setRoleName(data.getDisplayName());
|
||||
record.setRoleCode(data.getName());
|
||||
record.setActive(data.getActive());
|
||||
record.setCreated(createdAt);
|
||||
record.setDeleted(deletedAt);
|
||||
record.setUpdated(updatedAt);
|
||||
record.setVersion(data.getVersion());
|
||||
|
||||
boolean isAdminRole = Arrays.stream(adminRoles)
|
||||
.anyMatch(role -> role.equalsIgnoreCase(data.getName()));
|
||||
|
||||
record.setAdminRole(isAdminRole);
|
||||
|
||||
return record;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package ru.micord.ervu.account_applications.service.processor.impl;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import ru.micord.ervu.account_applications.dao.SolutionDao;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.SolutionRecord;
|
||||
import ru.micord.ervu.account_applications.model.ReferenceEntity;
|
||||
import ru.micord.ervu.account_applications.model.SolutionData;
|
||||
import ru.micord.ervu.account_applications.service.processor.DataProcessor;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@Component
|
||||
public class SolutionProcessor implements DataProcessor<SolutionData, SolutionRecord> {
|
||||
private final SolutionDao dao;
|
||||
private final SolutionRoleProcessor solutionRoleProcessor;
|
||||
|
||||
public SolutionProcessor(SolutionDao solutionDao, SolutionRoleProcessor solutionRoleProcessor) {
|
||||
this.dao = solutionDao;
|
||||
this.solutionRoleProcessor = solutionRoleProcessor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upsertData(SolutionData data) {
|
||||
SolutionRecord solutionRecord = mapToRecord(data);
|
||||
if (!CollectionUtils.isEmpty(data.getRoles())) {
|
||||
Set<String> rolesIds = data.getRoles().stream()
|
||||
.map(ReferenceEntity::getId)
|
||||
.collect(Collectors.toSet());
|
||||
solutionRoleProcessor.upsertSolutionRoles(data.getId(), rolesIds);
|
||||
}
|
||||
|
||||
dao.upsertData(solutionRecord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeActiveStatus(String id, boolean active) {
|
||||
dao.setActiveStatus(id, active);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<SolutionData> getType() {
|
||||
return SolutionData.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SolutionRecord mapToRecord(SolutionData data) {
|
||||
Timestamp updatedAt = Timestamp.from(Instant.ofEpochMilli(data.getModified()));
|
||||
Timestamp createdAt = Timestamp.from(Instant.ofEpochMilli(data.getCreated()));
|
||||
Timestamp deletedAt = Timestamp.from(Instant.ofEpochMilli(data.getDeleted()));
|
||||
SolutionRecord record = dao.newRecord();
|
||||
record.setId(data.getId());
|
||||
record.setDisplayName(data.getDisplayName());
|
||||
record.setActive(data.getActive());
|
||||
record.setDescription(data.getDescription());
|
||||
record.setName(data.getName());
|
||||
record.setCreated(createdAt);
|
||||
record.setDeleted(deletedAt);
|
||||
record.setModified(updatedAt);
|
||||
record.setVersion(data.getVersion());
|
||||
return record;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package ru.micord.ervu.account_applications.service.processor.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.micord.ervu.account_applications.dao.SolutionRoleDao;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.SolutionRoleRecord;
|
||||
import ru.micord.ervu.account_applications.model.SolutionRoleData;
|
||||
import ru.micord.ervu.account_applications.service.processor.LinkDataProcessor;
|
||||
|
||||
/**
|
||||
* @author Adel Kalimullin
|
||||
*/
|
||||
@Component
|
||||
public class SolutionRoleProcessor
|
||||
implements LinkDataProcessor<SolutionRoleData, SolutionRoleRecord> {
|
||||
private final SolutionRoleDao dao;
|
||||
|
||||
public SolutionRoleProcessor(SolutionRoleDao dao) {
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteLink(SolutionRoleData data) {
|
||||
SolutionRoleRecord solutionRoleRecord = mapToRecord(data);
|
||||
dao.deleteSolutionRole(solutionRoleRecord);
|
||||
}
|
||||
|
||||
public void upsertSolutionRoles(String solutionId, Set<String> incomingIds) {
|
||||
List<String> existingIds = dao.getRoleIdsBySolutionId(solutionId);
|
||||
List<String> toDelete = existingIds.stream()
|
||||
.filter(id -> !incomingIds.contains(id))
|
||||
.toList();
|
||||
|
||||
Set<String> toAdd = incomingIds.stream()
|
||||
.filter(id -> !existingIds.contains(id))
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
if (!toDelete.isEmpty()) {
|
||||
dao.deleteSolutionRolesBySolutionIdAndRoleIds(solutionId, toDelete);
|
||||
}
|
||||
|
||||
if (!toAdd.isEmpty()) {
|
||||
List<SolutionRoleRecord> recordsToAdd = toAdd.stream()
|
||||
.map(id -> mapToRecord(new SolutionRoleData(solutionId, id)))
|
||||
.toList();
|
||||
dao.mergeRecords(recordsToAdd);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upsertData(SolutionRoleData data) {
|
||||
SolutionRoleRecord solutionRoleRecord = mapToRecord(data);
|
||||
dao.upsertData(solutionRoleRecord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeActiveStatus(String id, boolean active) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<SolutionRoleData> getType() {
|
||||
return SolutionRoleData.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SolutionRoleRecord mapToRecord(SolutionRoleData data) {
|
||||
SolutionRoleRecord solutionRoleRecord = dao.newRecord();
|
||||
solutionRoleRecord.setRoleId(data.getRoleId());
|
||||
solutionRoleRecord.setSolutionId(data.getId());
|
||||
return solutionRoleRecord;
|
||||
}
|
||||
}
|
||||
|
|
@ -14,15 +14,23 @@
|
|||
description varchar(1024),
|
||||
display_name varchar(255),
|
||||
active boolean NOT NULL DEFAULT true,
|
||||
created bigint NOT NULL,
|
||||
modified bigint,
|
||||
deleted bigint,
|
||||
created TIMESTAMP WITHOUT TIME ZONE NOT NULL,
|
||||
modified TIMESTAMP WITHOUT TIME ZONE,
|
||||
deleted TIMESTAMP WITHOUT TIME ZONE,
|
||||
version int NOT NULL
|
||||
) TABLESPACE pg_default;
|
||||
|
||||
ALTER TABLE public.solution
|
||||
OWNER TO ervu_account_applications;
|
||||
COMMENT ON COLUMN public.solution.id IS 'Идентификатор группы ролей';
|
||||
COMMENT ON COLUMN public.solution.name IS 'Имя группы ролей';
|
||||
COMMENT ON COLUMN public.solution.description IS 'Описание группы ролей';
|
||||
COMMENT ON COLUMN public.solution.display_name IS 'Отображаемое имя группы ролей';
|
||||
COMMENT ON COLUMN public.solution.active IS 'Флаг активности';
|
||||
COMMENT ON COLUMN public.solution.created IS 'Дата создания';
|
||||
COMMENT ON COLUMN public.solution.modified IS 'Дата последнего изменения';
|
||||
COMMENT ON COLUMN public.solution.deleted IS 'Дата удаления';
|
||||
COMMENT ON COLUMN public.solution.version IS 'Версия записи';
|
||||
|
||||
ALTER TABLE public.solution OWNER TO ervu_account_applications;
|
||||
GRANT ALL ON TABLE public.solution TO ervu_account_applications;
|
||||
</sql>
|
||||
</changeSet>
|
||||
|
|
@ -36,6 +44,9 @@
|
|||
CONSTRAINT pk_recruitment_solution PRIMARY KEY (recruitment_id, solution_id)
|
||||
) TABLESPACE pg_default;
|
||||
|
||||
COMMENT ON COLUMN public.recruitment_solution.recruitment_id IS 'Идентификатор организации';
|
||||
COMMENT ON COLUMN public.recruitment_solution.solution_id IS 'Идентификатор группы ролей';
|
||||
|
||||
ALTER TABLE IF EXISTS public.recruitment_solution
|
||||
OWNER TO ervu_account_applications;
|
||||
|
||||
|
|
@ -52,8 +63,12 @@
|
|||
CONSTRAINT pk_solution_role PRIMARY KEY (role_id, solution_id)
|
||||
) TABLESPACE pg_default;
|
||||
|
||||
COMMENT ON COLUMN public.solution_role.role_id IS 'Идентификатор роли';
|
||||
COMMENT ON COLUMN public.solution_role.solution_id IS 'Идентификатор группы ролей';
|
||||
|
||||
ALTER TABLE IF EXISTS public.solution_role
|
||||
OWNER TO ervu_account_applications;
|
||||
|
||||
GRANT ALL ON TABLE public.solution_role TO ervu_account_applications;
|
||||
</sql>
|
||||
</changeSet>
|
||||
|
|
@ -67,8 +82,12 @@
|
|||
CONSTRAINT pk_recruitment_ip PRIMARY KEY (recruitment_id, ip_address)
|
||||
) TABLESPACE pg_default;
|
||||
|
||||
COMMENT ON COLUMN public.recruitment_ip.ip_address IS 'IP-адрес';
|
||||
COMMENT ON COLUMN public.recruitment_ip.recruitment_id IS 'Идентификатор организации';
|
||||
|
||||
ALTER TABLE IF EXISTS public.recruitment_ip
|
||||
OWNER TO ervu_account_applications;
|
||||
|
||||
GRANT ALL ON TABLE public.recruitment_ip TO ervu_account_applications;
|
||||
</sql>
|
||||
</changeSet>
|
||||
|
|
@ -81,9 +100,54 @@
|
|||
created TIMESTAMP DEFAULT now()
|
||||
) TABLESPACE pg_default;
|
||||
|
||||
COMMENT ON COLUMN public.ip_directory.ip_address IS 'Уникальный IP-адрес';
|
||||
COMMENT ON COLUMN public.ip_directory.created IS 'Дата добавления IP-адреса в справочник';
|
||||
|
||||
ALTER TABLE IF EXISTS public.ip_directory
|
||||
OWNER TO ervu_account_applications;
|
||||
|
||||
GRANT ALL ON TABLE public.ip_directory TO ervu_account_applications;
|
||||
</sql>
|
||||
</changeSet>
|
||||
|
||||
<changeSet id="0006" author="adel.ka">
|
||||
<comment>drop columns from recruitment</comment>
|
||||
<sql>
|
||||
ALTER TABLE public.recruitment
|
||||
ADD COLUMN IF NOT EXISTS name VARCHAR(255) NOT NULL DEFAULT '',
|
||||
DROP COLUMN IF EXISTS hidden,
|
||||
DROP COLUMN IF EXISTS dns,
|
||||
DROP COLUMN IF EXISTS email,
|
||||
DROP COLUMN IF EXISTS phone,
|
||||
DROP COLUMN IF EXISTS address,
|
||||
DROP COLUMN IF EXISTS postal_address,
|
||||
DROP COLUMN IF EXISTS nsi_department_id,
|
||||
DROP COLUMN IF EXISTS nsi_organization_id,
|
||||
DROP COLUMN IF EXISTS oktmo,
|
||||
DROP COLUMN IF EXISTS org_ogrn,
|
||||
DROP COLUMN IF EXISTS dep_ogrn,
|
||||
DROP COLUMN IF EXISTS epgu_id,
|
||||
DROP COLUMN IF EXISTS kpp,
|
||||
DROP COLUMN IF EXISTS inn,
|
||||
DROP COLUMN IF EXISTS okato,
|
||||
DROP COLUMN IF EXISTS division_type,
|
||||
DROP COLUMN IF EXISTS tns_department_id,
|
||||
DROP COLUMN IF EXISTS region_id;
|
||||
</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0007" author="adel.ka">
|
||||
<comment>alter table user_application_role</comment>
|
||||
<sql>
|
||||
ALTER TABLE public.user_application_role
|
||||
DROP COLUMN IF EXISTS finished;
|
||||
ALTER TABLE public.user_application_role
|
||||
ADD COLUMN IF NOT EXISTS deleted TIMESTAMP WITHOUT TIME ZONE;
|
||||
COMMENT ON COLUMN public.user_application_role.deleted IS 'Дата и время окончания действия роли';
|
||||
ALTER TABLE public.user_application_role
|
||||
ADD COLUMN IF NOT EXISTS active boolean NOT NULL DEFAULT true;
|
||||
ALTER TABLE public.user_application_role
|
||||
ADD COLUMN IF NOT EXISTS version int NOT NULL DEFAULT 0;
|
||||
</sql>
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
||||
|
|
@ -22,4 +22,5 @@
|
|||
<include file="20250410-SUPPORT-9098_admin_role.xml" relativeToChangelogFile="true"/>
|
||||
<include file="20250411_SUPPORT-9099_add_audit.xml" relativeToChangelogFile="true"/>
|
||||
<include file="20250415_SUPPORT-9099_add_pk.xml" relativeToChangelogFile="true"/>
|
||||
<include file="20250605_SUPPORT-9212_reconcile.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,13 @@
|
|||
import {AnalyticalScope, Behavior, LinkField, Visible} from "@webbpm/base-package";
|
||||
import {AnalyticalScope, Behavior, LinkField, NotNull, Visible} from "@webbpm/base-package";
|
||||
|
||||
@AnalyticalScope("LinkField")
|
||||
export class GridSetValuesScript extends Behavior {
|
||||
private linkField: LinkField;
|
||||
private userRemovedIps: Set<string> = new Set();
|
||||
private initialized = false;
|
||||
|
||||
@NotNull()
|
||||
public columnName: string;
|
||||
|
||||
initialize() {
|
||||
super.initialize();
|
||||
|
|
@ -10,16 +15,55 @@ export class GridSetValuesScript extends Behavior {
|
|||
}
|
||||
|
||||
@Visible()
|
||||
public setValues(values: string[]) {
|
||||
if (!values || !Array.isArray(values)) {
|
||||
public setValues(ipList: string) {
|
||||
if (!ipList) {
|
||||
return;
|
||||
}
|
||||
|
||||
const rows = values.map(ip => ({
|
||||
row_uid: ip,
|
||||
'ip_directory$ip_address': ip
|
||||
}));
|
||||
const incomingIps = ipList
|
||||
.split(';')
|
||||
.map(ip => ip.trim())
|
||||
.filter(ip => ip);
|
||||
|
||||
if (!this.initialized) {
|
||||
this.addRows(incomingIps);
|
||||
this.initialized = true;
|
||||
return;
|
||||
}
|
||||
|
||||
const existingRows = this.linkField.getAllRows();
|
||||
const existingIps = new Set(existingRows.map(row => row.row_uid));
|
||||
|
||||
incomingIps.forEach(ip => {
|
||||
if (!existingIps.has(ip)) {
|
||||
this.userRemovedIps.add(ip);
|
||||
}
|
||||
});
|
||||
|
||||
const toRemove = existingRows.filter(row =>
|
||||
!incomingIps.includes(row.row_uid) ||
|
||||
this.userRemovedIps.has(row.row_uid)
|
||||
);
|
||||
this.linkField.removeRows(toRemove);
|
||||
const toAdd = incomingIps
|
||||
.filter(ip =>
|
||||
!this.userRemovedIps.has(ip) &&
|
||||
!existingIps.has(ip)
|
||||
);
|
||||
this.addRows(toAdd);
|
||||
}
|
||||
|
||||
private addRows(ips: string[]) {
|
||||
const rows = ips.map(ip => ({
|
||||
row_uid: ip,
|
||||
[this.columnName]: ip
|
||||
}));
|
||||
this.linkField.addRows(rows);
|
||||
}
|
||||
|
||||
@Visible()
|
||||
public reset() {
|
||||
this.userRemovedIps.clear();
|
||||
this.initialized = false;
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue