diff --git a/src/main/java/com/chint/infrastructure/repository/JTCompanyRepositoryImpl.java b/src/main/java/com/chint/infrastructure/repository/JTCompanyRepositoryImpl.java index 6dcaa0fe..53952109 100644 --- a/src/main/java/com/chint/infrastructure/repository/JTCompanyRepositoryImpl.java +++ b/src/main/java/com/chint/infrastructure/repository/JTCompanyRepositoryImpl.java @@ -17,11 +17,7 @@ public class JTCompanyRepositoryImpl implements JTCompanyRepository { @Override public List findAll() { - List all = new ArrayList<>(); - jdbcJTCompanyRepository.findAll().forEach( - all::add - ); - return all; + return jdbcJTCompanyRepository.findBySystemCodeId(1L); } @Cacheable(value = "JTCompanyByCompanyCode" , key = "#companyCode") diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcJTCompanyRepositoryImpl.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcJTCompanyRepositoryImpl.java index 9e796893..47f0ca96 100644 --- a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcJTCompanyRepositoryImpl.java +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcJTCompanyRepositoryImpl.java @@ -4,9 +4,13 @@ import com.chint.domain.aggregates.system.CompanyBlackList; import com.chint.domain.aggregates.system.JTCompany; import org.springframework.data.repository.CrudRepository; +import java.util.List; + public interface JdbcJTCompanyRepositoryImpl extends CrudRepository { CompanyBlackList findByCompanyName(String companyName); JTCompany findByCompanyCode(String companyCode); + + List findBySystemCodeId(Long systemCodeId); } diff --git a/src/main/java/com/chint/interfaces/rest/user/UserHttpRequestImpl.java b/src/main/java/com/chint/interfaces/rest/user/UserHttpRequestImpl.java index 1a61eaf9..241ed3fe 100644 --- a/src/main/java/com/chint/interfaces/rest/user/UserHttpRequestImpl.java +++ b/src/main/java/com/chint/interfaces/rest/user/UserHttpRequestImpl.java @@ -67,7 +67,7 @@ public class UserHttpRequestImpl implements UserHttpRequest { @Override public User loadUserInfo(User user) { - loadSFInfo(user); + user = loadSFInfo(user); if (user == null) { return null; }