SUPPORT-9497: fix

This commit is contained in:
adel.ka 2025-10-24 11:44:52 +03:00
parent 3d5e548b2b
commit 4bd2c7787e
5 changed files with 43 additions and 31 deletions

View file

@ -32,6 +32,7 @@ public class Keys {
public static final UniqueKey<DatabasechangeloglockRecord> DATABASECHANGELOGLOCK_PKEY = Internal.createUniqueKey(Databasechangeloglock.DATABASECHANGELOGLOCK, DSL.name("databasechangeloglock_pkey"), new TableField[] { Databasechangeloglock.DATABASECHANGELOGLOCK.ID }, true);
public static final UniqueKey<OkopfRecordsRecord> OKOPF_RECORDS_PKEY = Internal.createUniqueKey(OkopfRecords.OKOPF_RECORDS, DSL.name("okopf_records_pkey"), new TableField[] { OkopfRecords.OKOPF_RECORDS.OKOPF_RECORDS_ID }, true);
public static final UniqueKey<OrganizationAllowedRecord> ORGANIZATION_ALLOWED_PKEY = Internal.createUniqueKey(OrganizationAllowed.ORGANIZATION_ALLOWED, DSL.name("organization_allowed_pkey"), new TableField[] { OrganizationAllowed.ORGANIZATION_ALLOWED.OGRN }, true);
public static final UniqueKey<OrganizationAllowedRecord> ORGANIZATION_ALLOWED_OGRN_KEY = Internal.createUniqueKey(OrganizationAllowed.ORGANIZATION_ALLOWED, DSL.name("organization_allowed_ogrn_key"), new TableField[] { OrganizationAllowed.ORGANIZATION_ALLOWED.OGRN }, true);
public static final UniqueKey<OrganizationAllowedRecord> ORGANIZATION_ALLOWED_PKEY = Internal.createUniqueKey(OrganizationAllowed.ORGANIZATION_ALLOWED, DSL.name("organization_allowed_pkey"), new TableField[] { OrganizationAllowed.ORGANIZATION_ALLOWED.ID }, true);
public static final UniqueKey<ShedlockRecord> SHEDLOCK_PK = Internal.createUniqueKey(Shedlock.SHEDLOCK, DSL.name("shedlock_pk"), new TableField[] { Shedlock.SHEDLOCK.NAME }, true);
}

View file

@ -8,11 +8,13 @@ import ervu_lkrp_ul.ervu_lkrp_ul.db_beans.public_.Keys;
import ervu_lkrp_ul.ervu_lkrp_ul.db_beans.public_.Public;
import ervu_lkrp_ul.ervu_lkrp_ul.db_beans.public_.tables.records.OrganizationAllowedRecord;
import java.sql.Timestamp;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import org.jooq.Condition;
import org.jooq.Field;
import org.jooq.Identity;
import org.jooq.Name;
import org.jooq.PlainSQL;
import org.jooq.QueryPart;
@ -50,16 +52,16 @@ public class OrganizationAllowed extends TableImpl<OrganizationAllowedRecord> {
return OrganizationAllowedRecord.class;
}
/**
* The column <code>public.organization_allowed.id</code>.
*/
public final TableField<OrganizationAllowedRecord, Long> ID = createField(DSL.name("id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");
/**
* The column <code>public.organization_allowed.ogrn</code>.
*/
public final TableField<OrganizationAllowedRecord, String> OGRN = createField(DSL.name("ogrn"), SQLDataType.VARCHAR(15).nullable(false), this, "");
/**
* The column <code>public.organization_allowed.created_at</code>.
*/
public final TableField<OrganizationAllowedRecord, Timestamp> CREATED_AT = createField(DSL.name("created_at"), SQLDataType.TIMESTAMP(0).defaultValue(DSL.field(DSL.raw("CURRENT_TIMESTAMP"), SQLDataType.TIMESTAMP)), this, "");
private OrganizationAllowed(Name alias, Table<OrganizationAllowedRecord> aliased) {
this(alias, aliased, (Field<?>[]) null, null);
}
@ -96,11 +98,21 @@ public class OrganizationAllowed extends TableImpl<OrganizationAllowedRecord> {
return aliased() ? null : Public.PUBLIC;
}
@Override
public Identity<OrganizationAllowedRecord, Long> getIdentity() {
return (Identity<OrganizationAllowedRecord, Long>) super.getIdentity();
}
@Override
public UniqueKey<OrganizationAllowedRecord> getPrimaryKey() {
return Keys.ORGANIZATION_ALLOWED_PKEY;
}
@Override
public List<UniqueKey<OrganizationAllowedRecord>> getUniqueKeys() {
return Arrays.asList(Keys.ORGANIZATION_ALLOWED_OGRN_KEY);
}
@Override
public OrganizationAllowed as(String alias) {
return new OrganizationAllowed(DSL.name(alias), this);

View file

@ -6,8 +6,6 @@ package ervu_lkrp_ul.ervu_lkrp_ul.db_beans.public_.tables.records;
import ervu_lkrp_ul.ervu_lkrp_ul.db_beans.public_.tables.OrganizationAllowed;
import java.sql.Timestamp;
import org.jooq.Record1;
import org.jooq.impl.UpdatableRecordImpl;
@ -20,32 +18,32 @@ public class OrganizationAllowedRecord extends UpdatableRecordImpl<OrganizationA
private static final long serialVersionUID = 1L;
/**
* Setter for <code>public.organization_allowed.id</code>.
*/
public void setId(Long value) {
set(0, value);
}
/**
* Getter for <code>public.organization_allowed.id</code>.
*/
public Long getId() {
return (Long) get(0);
}
/**
* Setter for <code>public.organization_allowed.ogrn</code>.
*/
public void setOgrn(String value) {
set(0, value);
set(1, value);
}
/**
* Getter for <code>public.organization_allowed.ogrn</code>.
*/
public String getOgrn() {
return (String) get(0);
}
/**
* Setter for <code>public.organization_allowed.created_at</code>.
*/
public void setCreatedAt(Timestamp value) {
set(1, value);
}
/**
* Getter for <code>public.organization_allowed.created_at</code>.
*/
public Timestamp getCreatedAt() {
return (Timestamp) get(1);
return (String) get(1);
}
// -------------------------------------------------------------------------
@ -53,7 +51,7 @@ public class OrganizationAllowedRecord extends UpdatableRecordImpl<OrganizationA
// -------------------------------------------------------------------------
@Override
public Record1<String> key() {
public Record1<Long> key() {
return (Record1) super.key();
}
@ -71,11 +69,11 @@ public class OrganizationAllowedRecord extends UpdatableRecordImpl<OrganizationA
/**
* Create a detached, initialised OrganizationAllowedRecord
*/
public OrganizationAllowedRecord(String ogrn, Timestamp createdAt) {
public OrganizationAllowedRecord(Long id, String ogrn) {
super(OrganizationAllowed.ORGANIZATION_ALLOWED);
setId(id);
setOgrn(ogrn);
setCreatedAt(createdAt);
resetChangedOnNotNull();
}
}

View file

@ -16,7 +16,7 @@ public class UploadAccessService {
public UploadAccessService(
OrganizationAccessDao organizationAccessDao,
@Value("${file.upload.ogrn_check.enabled:false}") boolean ogrnCheckEnabled
@Value("${file.ogrn.check.enabled:false}") boolean ogrnCheckEnabled
) {
this.organizationAccessDao = organizationAccessDao;
this.ogrnCheckEnabled = ogrnCheckEnabled;

View file

@ -4,10 +4,11 @@
<changeSet id="create-table-organization_allowed" author="adel.ka">
<comment>Create table for organizations allowed to upload files</comment>
<createTable tableName="organization_allowed">
<column name="ogrn" type="varchar(15)">
<column name="id" type="bigint" autoIncrement="true">
<constraints primaryKey="true" primaryKeyName="organization_allowed_pk"/>
</column>
<column name="created_at" type="timestamp without time zone" defaultValueComputed="CURRENT_TIMESTAMP">
<column name="ogrn" type="varchar(15)">
<constraints nullable="false" unique="true" uniqueConstraintName="organization_allowed_ogrn_unique"/>
</column>
</createTable>
</changeSet>