SUPPORT-9099: Fix
This commit is contained in:
parent
86fdbb73dc
commit
461ffd320f
7 changed files with 414 additions and 4 deletions
|
|
@ -6,7 +6,9 @@ import java.util.List;
|
|||
import org.jooq.DSLContext;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
||||
import static ru.micord.ervu.account_applications.db_beans.public_.tables.UserApplicationList.USER_APPLICATION_LIST;
|
||||
import static ru.micord.ervu.account_applications.db_beans.public_.tables.UserApplicationListAudit.USER_APPLICATION_LIST_AUDIT;
|
||||
|
||||
/**
|
||||
* @author Eduard Tihomirov
|
||||
|
|
@ -20,7 +22,15 @@ public class AuditDao {
|
|||
this.dslContext = dslContext;
|
||||
}
|
||||
|
||||
public void insert(Long listId, String fio, String login, String status, Timestamp timestamp) {}
|
||||
public void insert(Long listId, String fio, String login, String status, Timestamp timestamp) {
|
||||
dslContext.insertInto(USER_APPLICATION_LIST_AUDIT)
|
||||
.set(USER_APPLICATION_LIST_AUDIT.USER_APPLICATION_LIST_ID, listId)
|
||||
.set(USER_APPLICATION_LIST_AUDIT.FIO, fio)
|
||||
.set(USER_APPLICATION_LIST_AUDIT.STATUS, status)
|
||||
.set(USER_APPLICATION_LIST_AUDIT.DATE, timestamp)
|
||||
.set(USER_APPLICATION_LIST_AUDIT.LOGIN, login)
|
||||
.execute();
|
||||
}
|
||||
|
||||
public List<Long> selectAppListIdsByTraceId(String traceId) {
|
||||
return dslContext.select(USER_APPLICATION_LIST.USER_APPLICATION_LIST_ID)
|
||||
|
|
|
|||
|
|
@ -36,11 +36,13 @@ public class AuditFormDaoImpl extends FormDaoImpl {
|
|||
AtomicReference<String> status = new AtomicReference<>();
|
||||
AtomicReference<Long> appListId = new AtomicReference<>();
|
||||
map.forEach((entityColumn, o) -> {
|
||||
if (entityColumn.getName().equals("status")) {
|
||||
if (entityColumn.getName().equals("application_status")) {
|
||||
status.set(o.toString());
|
||||
}
|
||||
else if (entityColumn.getName().equals("id")) {
|
||||
appListId.set((Long) o);
|
||||
});
|
||||
tableFieldData.forEach(data -> {
|
||||
if (data.getField().getName().equals("user_application_list_id")) {
|
||||
appListId.set((Long) data.getData());
|
||||
}
|
||||
});
|
||||
if (status.get() != null && appListId.get() != null && !status.get().equals(SENT.name())) {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import ru.micord.ervu.account_applications.db_beans.public_.tables.Recruitment;
|
|||
import ru.micord.ervu.account_applications.db_beans.public_.tables.Shedlock;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.UserApplicationDocument;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.UserApplicationList;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.UserApplicationListAudit;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.UserApplicationRole;
|
||||
|
||||
|
||||
|
|
@ -97,6 +98,11 @@ public class Public extends SchemaImpl {
|
|||
*/
|
||||
public final UserApplicationList USER_APPLICATION_LIST = UserApplicationList.USER_APPLICATION_LIST;
|
||||
|
||||
/**
|
||||
* The table <code>public.user_application_list_audit</code>.
|
||||
*/
|
||||
public final UserApplicationListAudit USER_APPLICATION_LIST_AUDIT = UserApplicationListAudit.USER_APPLICATION_LIST_AUDIT;
|
||||
|
||||
/**
|
||||
* The table <code>public.user_application_role</code>.
|
||||
*/
|
||||
|
|
@ -139,6 +145,7 @@ public class Public extends SchemaImpl {
|
|||
Shedlock.SHEDLOCK,
|
||||
UserApplicationDocument.USER_APPLICATION_DOCUMENT,
|
||||
UserApplicationList.USER_APPLICATION_LIST,
|
||||
UserApplicationListAudit.USER_APPLICATION_LIST_AUDIT,
|
||||
UserApplicationRole.USER_APPLICATION_ROLE
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import ru.micord.ervu.account_applications.db_beans.public_.tables.Recruitment;
|
|||
import ru.micord.ervu.account_applications.db_beans.public_.tables.Shedlock;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.UserApplicationDocument;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.UserApplicationList;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.UserApplicationListAudit;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.UserApplicationRole;
|
||||
|
||||
|
||||
|
|
@ -81,6 +82,11 @@ public class Tables {
|
|||
*/
|
||||
public static final UserApplicationList USER_APPLICATION_LIST = UserApplicationList.USER_APPLICATION_LIST;
|
||||
|
||||
/**
|
||||
* The table <code>public.user_application_list_audit</code>.
|
||||
*/
|
||||
public static final UserApplicationListAudit USER_APPLICATION_LIST_AUDIT = UserApplicationListAudit.USER_APPLICATION_LIST_AUDIT;
|
||||
|
||||
/**
|
||||
* The table <code>public.user_application_role</code>.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,247 @@
|
|||
/*
|
||||
* This file is generated by jOOQ.
|
||||
*/
|
||||
package ru.micord.ervu.account_applications.db_beans.public_.tables;
|
||||
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Collection;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.jooq.Condition;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.Identity;
|
||||
import org.jooq.Name;
|
||||
import org.jooq.PlainSQL;
|
||||
import org.jooq.QueryPart;
|
||||
import org.jooq.SQL;
|
||||
import org.jooq.Schema;
|
||||
import org.jooq.Select;
|
||||
import org.jooq.Stringly;
|
||||
import org.jooq.Table;
|
||||
import org.jooq.TableField;
|
||||
import org.jooq.TableOptions;
|
||||
import org.jooq.impl.DSL;
|
||||
import org.jooq.impl.SQLDataType;
|
||||
import org.jooq.impl.TableImpl;
|
||||
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.Public;
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.UserApplicationListAuditRecord;
|
||||
|
||||
|
||||
/**
|
||||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class UserApplicationListAudit extends TableImpl<UserApplicationListAuditRecord> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>public.user_application_list_audit</code>
|
||||
*/
|
||||
public static final UserApplicationListAudit USER_APPLICATION_LIST_AUDIT = new UserApplicationListAudit();
|
||||
|
||||
/**
|
||||
* The class holding records for this type
|
||||
*/
|
||||
@Override
|
||||
public Class<UserApplicationListAuditRecord> getRecordType() {
|
||||
return UserApplicationListAuditRecord.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* The column <code>public.user_application_list_audit.id</code>.
|
||||
*/
|
||||
public final TableField<UserApplicationListAuditRecord, UUID> ID = createField(DSL.name("id"), SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("uuid_generate_v4()"), SQLDataType.UUID)), this, "");
|
||||
|
||||
/**
|
||||
* The column
|
||||
* <code>public.user_application_list_audit.user_application_list_id</code>.
|
||||
*/
|
||||
public final TableField<UserApplicationListAuditRecord, Long> USER_APPLICATION_LIST_ID = createField(DSL.name("user_application_list_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>public.user_application_list_audit.date</code>.
|
||||
*/
|
||||
public final TableField<UserApplicationListAuditRecord, Timestamp> DATE = createField(DSL.name("date"), SQLDataType.TIMESTAMP(0).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.TIMESTAMP)), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>public.user_application_list_audit.status</code>.
|
||||
*/
|
||||
public final TableField<UserApplicationListAuditRecord, String> STATUS = createField(DSL.name("status"), SQLDataType.VARCHAR(100), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>public.user_application_list_audit.fio</code>.
|
||||
*/
|
||||
public final TableField<UserApplicationListAuditRecord, String> FIO = createField(DSL.name("fio"), SQLDataType.VARCHAR(1000), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>public.user_application_list_audit.login</code>.
|
||||
*/
|
||||
public final TableField<UserApplicationListAuditRecord, String> LOGIN = createField(DSL.name("login"), SQLDataType.VARCHAR(1000), this, "");
|
||||
|
||||
private UserApplicationListAudit(Name alias, Table<UserApplicationListAuditRecord> aliased) {
|
||||
this(alias, aliased, (Field<?>[]) null, null);
|
||||
}
|
||||
|
||||
private UserApplicationListAudit(Name alias, Table<UserApplicationListAuditRecord> aliased, Field<?>[] parameters, Condition where) {
|
||||
super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>public.user_application_list_audit</code> table
|
||||
* reference
|
||||
*/
|
||||
public UserApplicationListAudit(String alias) {
|
||||
this(DSL.name(alias), USER_APPLICATION_LIST_AUDIT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>public.user_application_list_audit</code> table
|
||||
* reference
|
||||
*/
|
||||
public UserApplicationListAudit(Name alias) {
|
||||
this(alias, USER_APPLICATION_LIST_AUDIT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a <code>public.user_application_list_audit</code> table reference
|
||||
*/
|
||||
public UserApplicationListAudit() {
|
||||
this(DSL.name("user_application_list_audit"), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Schema getSchema() {
|
||||
return aliased() ? null : Public.PUBLIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identity<UserApplicationListAuditRecord, Long> getIdentity() {
|
||||
return (Identity<UserApplicationListAuditRecord, Long>) super.getIdentity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserApplicationListAudit as(String alias) {
|
||||
return new UserApplicationListAudit(DSL.name(alias), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserApplicationListAudit as(Name alias) {
|
||||
return new UserApplicationListAudit(alias, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserApplicationListAudit as(Table<?> alias) {
|
||||
return new UserApplicationListAudit(alias.getQualifiedName(), this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public UserApplicationListAudit rename(String name) {
|
||||
return new UserApplicationListAudit(DSL.name(name), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public UserApplicationListAudit rename(Name name) {
|
||||
return new UserApplicationListAudit(name, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public UserApplicationListAudit rename(Table<?> name) {
|
||||
return new UserApplicationListAudit(name.getQualifiedName(), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an inline derived table from this table
|
||||
*/
|
||||
@Override
|
||||
public UserApplicationListAudit where(Condition condition) {
|
||||
return new UserApplicationListAudit(getQualifiedName(), aliased() ? this : null, null, condition);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an inline derived table from this table
|
||||
*/
|
||||
@Override
|
||||
public UserApplicationListAudit where(Collection<? extends Condition> conditions) {
|
||||
return where(DSL.and(conditions));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an inline derived table from this table
|
||||
*/
|
||||
@Override
|
||||
public UserApplicationListAudit where(Condition... conditions) {
|
||||
return where(DSL.and(conditions));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an inline derived table from this table
|
||||
*/
|
||||
@Override
|
||||
public UserApplicationListAudit where(Field<Boolean> condition) {
|
||||
return where(DSL.condition(condition));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an inline derived table from this table
|
||||
*/
|
||||
@Override
|
||||
@PlainSQL
|
||||
public UserApplicationListAudit where(SQL condition) {
|
||||
return where(DSL.condition(condition));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an inline derived table from this table
|
||||
*/
|
||||
@Override
|
||||
@PlainSQL
|
||||
public UserApplicationListAudit where(@Stringly.SQL String condition) {
|
||||
return where(DSL.condition(condition));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an inline derived table from this table
|
||||
*/
|
||||
@Override
|
||||
@PlainSQL
|
||||
public UserApplicationListAudit where(@Stringly.SQL String condition, Object... binds) {
|
||||
return where(DSL.condition(condition, binds));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an inline derived table from this table
|
||||
*/
|
||||
@Override
|
||||
@PlainSQL
|
||||
public UserApplicationListAudit where(@Stringly.SQL String condition, QueryPart... parts) {
|
||||
return where(DSL.condition(condition, parts));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an inline derived table from this table
|
||||
*/
|
||||
@Override
|
||||
public UserApplicationListAudit whereExists(Select<?> select) {
|
||||
return where(DSL.exists(select));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an inline derived table from this table
|
||||
*/
|
||||
@Override
|
||||
public UserApplicationListAudit whereNotExists(Select<?> select) {
|
||||
return where(DSL.notExists(select));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
/*
|
||||
* This file is generated by jOOQ.
|
||||
*/
|
||||
package ru.micord.ervu.account_applications.db_beans.public_.tables.records;
|
||||
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.jooq.impl.TableRecordImpl;
|
||||
|
||||
import ru.micord.ervu.account_applications.db_beans.public_.tables.UserApplicationListAudit;
|
||||
|
||||
|
||||
/**
|
||||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class UserApplicationListAuditRecord extends TableRecordImpl<UserApplicationListAuditRecord> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Setter for <code>public.user_application_list_audit.id</code>.
|
||||
*/
|
||||
public void setId(UUID value) {
|
||||
set(0, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.user_application_list_audit.id</code>.
|
||||
*/
|
||||
public UUID getId() {
|
||||
return (UUID) get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for
|
||||
* <code>public.user_application_list_audit.user_application_list_id</code>.
|
||||
*/
|
||||
public void setUserApplicationListId(Long value) {
|
||||
set(1, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for
|
||||
* <code>public.user_application_list_audit.user_application_list_id</code>.
|
||||
*/
|
||||
public Long getUserApplicationListId() {
|
||||
return (Long) get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.user_application_list_audit.date</code>.
|
||||
*/
|
||||
public void setDate(Timestamp value) {
|
||||
set(2, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.user_application_list_audit.date</code>.
|
||||
*/
|
||||
public Timestamp getDate() {
|
||||
return (Timestamp) get(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.user_application_list_audit.status</code>.
|
||||
*/
|
||||
public void setStatus(String value) {
|
||||
set(3, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.user_application_list_audit.status</code>.
|
||||
*/
|
||||
public String getStatus() {
|
||||
return (String) get(3);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.user_application_list_audit.fio</code>.
|
||||
*/
|
||||
public void setFio(String value) {
|
||||
set(4, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.user_application_list_audit.fio</code>.
|
||||
*/
|
||||
public String getFio() {
|
||||
return (String) get(4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>public.user_application_list_audit.login</code>.
|
||||
*/
|
||||
public void setLogin(String value) {
|
||||
set(5, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>public.user_application_list_audit.login</code>.
|
||||
*/
|
||||
public String getLogin() {
|
||||
return (String) get(5);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Constructors
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Create a detached UserApplicationListAuditRecord
|
||||
*/
|
||||
public UserApplicationListAuditRecord() {
|
||||
super(UserApplicationListAudit.USER_APPLICATION_LIST_AUDIT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a detached, initialised UserApplicationListAuditRecord
|
||||
*/
|
||||
public UserApplicationListAuditRecord(UUID id, Long userApplicationListId, Timestamp date, String status, String fio, String login) {
|
||||
super(UserApplicationListAudit.USER_APPLICATION_LIST_AUDIT);
|
||||
|
||||
setId(id);
|
||||
setUserApplicationListId(userApplicationListId);
|
||||
setDate(date);
|
||||
setStatus(status);
|
||||
setFio(fio);
|
||||
setLogin(login);
|
||||
resetChangedOnNotNull();
|
||||
}
|
||||
}
|
||||
|
|
@ -799,6 +799,10 @@
|
|||
<entry>
|
||||
<key>formDao</key>
|
||||
<value>
|
||||
<implRef type="JAVA">
|
||||
<className>AuditFormDaoImpl</className>
|
||||
<packageName>ru.micord.ervu.account_applications.component.service</packageName>
|
||||
</implRef>
|
||||
<complex>
|
||||
<entry>
|
||||
<key>graph</key>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue