do not display inactive clients for creating new JLG loans
This commit is contained in:
+2
@@ -32,6 +32,8 @@ public interface ClientReadPlatformService {
|
||||
ClientData retrieveClientByIdentifier(Long identifierTypeId, String identifierKey);
|
||||
|
||||
Collection<ClientData> retrieveClientMembersOfGroup(Long groupId);
|
||||
|
||||
Collection<ClientData> retrieveActiveClientMembersOfGroup(Long groupId);
|
||||
|
||||
ClientData retrieveAllClosureReasons(String clientClosureReason);
|
||||
}
|
||||
+14
@@ -242,6 +242,20 @@ public class ClientReadPlatformServiceImpl implements ClientReadPlatformService
|
||||
return this.jdbcTemplate.query(sql, this.membersOfGroupMapper, new Object[] { hierarchySearchString, groupId });
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<ClientData> retrieveActiveClientMembersOfGroup(final Long groupId) {
|
||||
|
||||
final AppUser currentUser = context.authenticatedUser();
|
||||
final String hierarchy = currentUser.getOffice().getHierarchy();
|
||||
final String hierarchySearchString = hierarchy + "%";
|
||||
|
||||
final String sql = "select " + this.membersOfGroupMapper.schema()
|
||||
+ " where o.hierarchy like ? and pgc.group_id = ? and c.status_enum = ? ";
|
||||
|
||||
return this.jdbcTemplate.query(sql, this.membersOfGroupMapper,
|
||||
new Object[] { hierarchySearchString, groupId, ClientStatus.ACTIVE.getValue() });
|
||||
}
|
||||
|
||||
private static final class ClientMembersOfGroupMapper implements RowMapper<ClientData> {
|
||||
|
||||
private final String schema;
|
||||
|
||||
+1
-1
@@ -944,7 +944,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
||||
final LocalDate expectedDisbursementDate = DateUtils.getLocalDateOfTenant();
|
||||
|
||||
// get group associations
|
||||
Collection<ClientData> membersOfGroup = this.clientReadPlatformService.retrieveClientMembersOfGroup(groupId);
|
||||
Collection<ClientData> membersOfGroup = this.clientReadPlatformService.retrieveActiveClientMembersOfGroup(groupId);
|
||||
if (!CollectionUtils.isEmpty(membersOfGroup)) {
|
||||
groupAccount = GroupGeneralData.withAssocations(groupAccount, membersOfGroup, null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user