SUPPORT-9213: refactor

This commit is contained in:
adel.ka 2025-06-16 16:42:14 +03:00
parent 4f8cd4c895
commit 6289ac463b
3 changed files with 4 additions and 86 deletions

View file

@ -1,83 +0,0 @@
package ru.micord.ervu.account_applications.component.model;
import java.util.List;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
/**
* @author Adel Kalimullin
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class User {
private String accountId;
private String accountFullName;
private String domainName;
private boolean enabled;
private boolean blocked;
public String getAccountId() {
return accountId;
}
public void setAccountId(String accountId) {
this.accountId = accountId;
}
public String getAccountFullName() {
return accountFullName;
}
public void setAccountFullName(String accountFullName) {
this.accountFullName = accountFullName;
}
public String getDomainName() {
return domainName;
}
public void setDomainName(String domainName) {
this.domainName = domainName;
}
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public boolean isBlocked() {
return blocked;
}
public void setBlocked(boolean blocked) {
this.blocked = blocked;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
User user = (User) o;
return enabled == user.enabled && blocked == user.blocked && Objects.equals(
accountId, user.accountId) && Objects.equals(accountFullName,
user.accountFullName
) && Objects.equals(domainName, user.domainName);
}
@Override
public int hashCode() {
int result = Objects.hashCode(accountId);
result = 31 * result + Objects.hashCode(accountFullName);
result = 31 * result + Objects.hashCode(domainName);
result = 31 * result + Boolean.hashCode(enabled);
result = 31 * result + Boolean.hashCode(blocked);
return result;
}
}

View file

@ -76,12 +76,13 @@ public class AccountGridLoadService extends Behavior implements GridService {
for (Account account : accounts) {
GridRow gridRow = new GridRow();
gridRow.put("row_uid", account.getAccountId() != null ? account.getAccountId() : "");
gridRow.put("enabled", account.isActive());
if (account.getPerson() != null && account.getPerson().getFullName() != null) {
gridRow.putAll(StringUtils.splitFio(account.getPerson().getFullName()));
}
if (account.getDomain() != null && account.getDomain().getFullName() != null) {
gridRow.put("organizationName", account.getDomain().getFullName());
if (account.getDomain() != null && account.getDomain().getName() != null) {
gridRow.put("domainName", account.getDomain().getName());
}
gridRows.add(gridRow);

View file

@ -187,7 +187,7 @@ public class AccountFetchService implements EntityFetchService<Account> {
int i = 0;
for (Object ip : ipList) {
GridRow row = new GridRow();
row.put("row_uid", i++);
row.put("row_uid", ip);
row.put(
editableGridColumnRef != null ? editableGridColumnRef.getObjectId() : FIELD_IP_ADDRESSES,
ip