diff --git a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java index 95515759..e95c04f3 100644 --- a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java +++ b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java @@ -377,11 +377,11 @@ public class GepafinConstant { public static final String MESSAGE_STRING = "message"; public static final String AMOUNT_ACCEPTED_REQUIRED_WHILE_APPROVING_APPLICATION="amount.accepted.required"; public static final String CALL_NAME="callName"; - public static final String NUMBER_OF_APPLICATIONS="numberOfApplications"; + public static final String NUMBER_OF_APPLICATIONS="numberOfSubmitedApplications"; + public static final String NUMBER_OF_DRAFT_APPLICATIONS="numberOfDraftApplications"; public static final String COUNT="count"; public static final String APPLICATION_PER_CALL="applicationPerCall"; public static final String APPLICATION_PER_STATUS="applicationPerStatus"; - } diff --git a/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java b/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java index 8f3a55f1..589d7a67 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java @@ -179,7 +179,8 @@ public class DashboardDao { stats.put(GepafinConstant.APPLICATION_PER_CALL, applicationsPerCall.stream().map(result -> { Map callData = new HashMap<>(); callData.put(GepafinConstant.CALL_NAME, result[0]); // Call name - callData.put(GepafinConstant.NUMBER_OF_APPLICATIONS, result[1]); // Application count + callData.put(GepafinConstant.NUMBER_OF_APPLICATIONS, result[1]);// Application count + callData.put(GepafinConstant.NUMBER_OF_DRAFT_APPLICATIONS, result[2]);// Application count return callData; }).toList()); diff --git a/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationRepository.java b/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationRepository.java index c46c52c7..5bac8a89 100644 --- a/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationRepository.java +++ b/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationRepository.java @@ -45,9 +45,17 @@ public interface ApplicationRepository extends JpaRepository findApplicationsPerCallWithName(@Param("hubId") Long hubId); + + // Count Applications by Status by Hub ID @Query("SELECT a.status, COUNT(a.id) FROM ApplicationEntity a WHERE a.isDeleted = false AND a.call.hub.id = :hubId GROUP BY a.status") List findApplicationsByStatus(@Param("hubId") Long hubId);