fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nazeer1100...@apache.org
Subject [1/2] incubator-fineract git commit: FINERACT-412 - Add Share account in Global Search
Date Tue, 07 Mar 2017 08:19:09 GMT
Repository: incubator-fineract
Updated Branches:
  refs/heads/develop 8c080fc75 -> 34b988195


FINERACT-412 - Add Share account in Global Search


Project: http://git-wip-us.apache.org/repos/asf/incubator-fineract/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-fineract/commit/9b8d2532
Tree: http://git-wip-us.apache.org/repos/asf/incubator-fineract/tree/9b8d2532
Diff: http://git-wip-us.apache.org/repos/asf/incubator-fineract/diff/9b8d2532

Branch: refs/heads/develop
Commit: 9b8d25321763ebebc2f38de27467c6b12724c514
Parents: c1af6d6
Author: Ippez Robert <ippezrobert@gmail.com>
Authored: Fri Mar 3 13:13:31 2017 +0300
Committer: Ippez Robert <ippezrobert@gmail.com>
Committed: Fri Mar 3 13:13:31 2017 +0300

----------------------------------------------------------------------
 .../apache/fineract/portfolio/search/SearchConstants.java |  2 +-
 .../fineract/portfolio/search/data/SearchConditions.java  | 10 +++++++++-
 .../search/service/SearchReadPlatformServiceImpl.java     |  9 +++++++++
 3 files changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/9b8d2532/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/SearchConstants.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/SearchConstants.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/SearchConstants.java
index ed47f32..ec607b3 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/SearchConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/SearchConstants.java
@@ -85,7 +85,7 @@ public class SearchConstants {
     }
 
     public static enum SEARCH_SUPPORTED_RESOURCES {
-        CLIENTS("clients"), GROUPS("groups"), LOANS("loans"), SAVINGS("savings"), CLIENTIDENTIFIERS("clientIdentifiers");
+        CLIENTS("clients"), GROUPS("groups"), LOANS("loans"), SAVINGS("savings"), SHARES("shares"),
CLIENTIDENTIFIERS("clientIdentifiers");
 
         private final String value;
 

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/9b8d2532/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/data/SearchConditions.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/data/SearchConditions.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/data/SearchConditions.java
index 52558e0..a0be777 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/data/SearchConditions.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/data/SearchConditions.java
@@ -28,6 +28,7 @@ public class SearchConditions {
     private final Boolean groupSearch;
     private final Boolean loanSeach;
 	private final Boolean savingSeach;
+	private final Boolean shareSeach;
     private final Boolean clientIdentifierSearch;
     private  Boolean exactMatch;
 
@@ -43,18 +44,21 @@ public class SearchConditions {
                 SEARCH_SUPPORTED_RESOURCES.LOANS.name().toLowerCase())) ? true : false;
         this.savingSeach = (null == searchResource || searchResource.toLowerCase().contains(
                 SEARCH_SUPPORTED_RESOURCES.SAVINGS.name().toLowerCase())) ? true : false;
+		this.shareSeach = (null == searchResource || searchResource.toLowerCase().contains(
+                SEARCH_SUPPORTED_RESOURCES.SHARES.name().toLowerCase())) ? true : false;
   		this.clientIdentifierSearch = (null == searchResource || searchResource.toLowerCase().contains(
                 SEARCH_SUPPORTED_RESOURCES.CLIENTIDENTIFIERS.name().toLowerCase())) ? true
: false;
     }
 
     public SearchConditions(final String searchQueryParam, final String searchResource, final
Boolean clientSearch,
-            final Boolean groupSearch, final Boolean loanSeach, final Boolean savingSeach,
final Boolean clientIdentifierSearch, Boolean exactMatch) {
+            final Boolean groupSearch, final Boolean loanSeach, final Boolean savingSeach,
final Boolean shareSeach, final Boolean clientIdentifierSearch, Boolean exactMatch) {
         this.searchQuery = searchQueryParam;
         this.searchResource = searchResource;
         this.clientSearch = clientSearch;
         this.groupSearch = groupSearch;
         this.loanSeach = loanSeach;
 		this.savingSeach = savingSeach;
+		this.shareSeach = shareSeach;
         this.clientIdentifierSearch = clientIdentifierSearch;
         this.exactMatch=exactMatch;
     }
@@ -84,6 +88,10 @@ public class SearchConditions {
     public Boolean isSavingSeach() {
         return this.savingSeach;
     }
+	
+	public Boolean isShareSeach() {
+        return this.shareSeach;
+    }
 
 	public Boolean isClientIdentifierSearch() {
         return this.clientIdentifierSearch;

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/9b8d2532/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/service/SearchReadPlatformServiceImpl.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/service/SearchReadPlatformServiceImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/service/SearchReadPlatformServiceImpl.java
index f51dada..649fd3b 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/service/SearchReadPlatformServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/service/SearchReadPlatformServiceImpl.java
@@ -101,6 +101,11 @@ public class SearchReadPlatformServiceImpl implements SearchReadPlatformService
                     + " , IFNULL(c.id,g.id) as parentId, IFNULL(c.display_name,g.display_name)
as parentName, null as entityMobileNo, s.status_enum as entityStatusEnum, IF(g.id is null,
'client', 'group') as parentType "
                     + " from m_savings_account s left join m_client c on s.client_id = c.id
left join m_group g ON s.group_id = g.id left join m_office o on o.id = c.office_id left join
m_savings_product sp on sp.id=s.product_id "
                     + " where (o.hierarchy IS NULL OR o.hierarchy like :hierarchy) and (s.account_no
like :search or s.external_id like :search)) ";
+					
+			final String shareMatchSql = " (select 'SHARE' as entityType, s.id as entityId, sp.name
as entityName, s.external_id as entityExternalId, s.account_no as entityAccountNo "
+                    + " , c.id as parentId, c.display_name as parentName, null as entityMobileNo,
s.status_enum as entityStatusEnum, 'client' as parentType "
+                    + " from m_share_account s left join m_client c on s.client_id = c.id
left join m_office o on o.id = c.office_id left join m_share_product sp on sp.id=s.product_id
"
+                    + " where (o.hierarchy IS NULL OR o.hierarchy like :hierarchy) and (s.account_no
like :search or s.external_id like :search)) ";
             
             final String clientIdentifierMatchSql = " (select 'CLIENTIDENTIFIER' as entityType,
ci.id as entityId, ci.document_key as entityName, "
                     + " null as entityExternalId, null as entityAccountNo, c.id as parentId,
c.display_name as parentName,null as entityMobileNo, c.status_enum as entityStatusEnum, null
as parentType "
@@ -122,6 +127,10 @@ public class SearchReadPlatformServiceImpl implements SearchReadPlatformService
             if (searchConditions.isSavingSeach()) {
                 sql.append(savingMatchSql).append(union);
             }
+			
+			if (searchConditions.isShareSeach()) {
+                sql.append(shareMatchSql).append(union);
+            }
 
             if (searchConditions.isClientIdentifierSearch()) {
                 sql.append(clientIdentifierMatchSql).append(union);


Mime
View raw message