SUPPORT-9212: fix

This commit is contained in:
adel.kalimullin 2025-06-09 15:06:03 +03:00
parent e0c6544e6c
commit f8360ebf77
5 changed files with 6 additions and 6 deletions

View file

@ -55,12 +55,12 @@ public abstract class AbstractDataDao<T extends UpdatableRecord<T>> {
.execute(); .execute();
} }
protected <S, F> Set<S> getValuesByField(Field<S> selectField, Field<F> filterField, protected <S, F> List<S> getValuesByField(Field<S> selectField, Field<F> filterField,
F filterValue) { F filterValue) {
return dsl.select(selectField) return dsl.select(selectField)
.from(getTable()) .from(getTable())
.where(filterField.eq(filterValue)) .where(filterField.eq(filterValue))
.fetchSet(selectField); .fetch(selectField);
} }
public void setActiveStatus(String id, boolean isActive) { public void setActiveStatus(String id, boolean isActive) {

View file

@ -20,7 +20,7 @@ public class AccountDataDao extends AbstractDataDao<AccountRecord> {
super(dsl); super(dsl);
} }
public Set<String> getAccountIdsByPersonId(String personId) { public List<String> getAccountIdsByPersonId(String personId) {
return getValuesByField(Tables.ACCOUNT.ID, Tables.ACCOUNT.PERSON_ID, personId); return getValuesByField(Tables.ACCOUNT.ID, Tables.ACCOUNT.PERSON_ID, personId);
} }

View file

@ -23,7 +23,7 @@ public class AccountRoleDataDao extends AbstractDataDao<AccountRoleRecord> {
super(dsl); super(dsl);
} }
public Set<String> getRoleIdsByAccountId(String accountId) { public List<String> getRoleIdsByAccountId(String accountId) {
return getValuesByField(Tables.ACCOUNT_ROLE.ROLE_ID, Tables.ACCOUNT_ROLE.ACCOUNT_ID, accountId); return getValuesByField(Tables.ACCOUNT_ROLE.ROLE_ID, Tables.ACCOUNT_ROLE.ACCOUNT_ID, accountId);
} }

View file

@ -84,7 +84,7 @@ public class AccountDataProcessor implements DataProcessor<AccountData, AccountR
} }
private void deleteAbsentAccounts(String personId, Set<String> incomingAccountIds) { private void deleteAbsentAccounts(String personId, Set<String> incomingAccountIds) {
Set<String> existingAccountIds = dao.getAccountIdsByPersonId(personId); List<String> existingAccountIds = dao.getAccountIdsByPersonId(personId);
List<String> toDelete = existingAccountIds.stream() List<String> toDelete = existingAccountIds.stream()
.filter(id -> !incomingAccountIds.contains(id)) .filter(id -> !incomingAccountIds.contains(id))

View file

@ -53,7 +53,7 @@ public class AccountRoleDataProcessor implements LinkDataProcessor<AccountRoleDa
for (AccountData account : accounts) { for (AccountData account : accounts) {
String accountId = account.getId(); String accountId = account.getId();
Set<String> existingRoleIds = dao.getRoleIdsByAccountId(accountId); List<String> existingRoleIds = dao.getRoleIdsByAccountId(accountId);
Set<String> incomingRoleIds = account.getRoles() == null Set<String> incomingRoleIds = account.getRoles() == null
? Set.of() ? Set.of()
: account.getRoles() : account.getRoles()