Updated changes for GEPAFINBE-127

This commit is contained in:
nisha
2025-01-13 15:53:28 +05:30
parent e7872728fb
commit aec6495649
2 changed files with 15 additions and 6 deletions

View File

@@ -361,5 +361,13 @@ public class GepafinConstant {
public static final String GET_STATUS_CODE_STRING = "status"; public static final String GET_STATUS_CODE_STRING = "status";
public static final String MESSAGE_STRING = "message"; public static final String MESSAGE_STRING = "message";
public static final String AMOUNT_ACCEPTED_REQUIRED_WHILE_APPROVING_APPLICATION="amount.accepted.required"; 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 STATUS="status";
public static final String COUNT="count";
public static final String APPLICATION_PER_CALL="applicationPerCall";
public static final String APPLICATION_PER_STATUS="applicationPerStatus";
} }

View File

@@ -1,5 +1,6 @@
package net.gepafin.tendermanagement.dao; package net.gepafin.tendermanagement.dao;
import net.gepafin.tendermanagement.constants.GepafinConstant;
import net.gepafin.tendermanagement.entities.CompanyEntity; import net.gepafin.tendermanagement.entities.CompanyEntity;
import net.gepafin.tendermanagement.entities.UserActionEntity; import net.gepafin.tendermanagement.entities.UserActionEntity;
import net.gepafin.tendermanagement.entities.UserEntity; import net.gepafin.tendermanagement.entities.UserEntity;
@@ -175,19 +176,19 @@ public class DashboardDao {
// Get applications per call // Get applications per call
List<Object[]> applicationsPerCall = applicationRepository.findApplicationsPerCallWithName(requestedUser.getHub().getId()); List<Object[]> applicationsPerCall = applicationRepository.findApplicationsPerCallWithName(requestedUser.getHub().getId());
stats.put("APPLICATION_PER_CALL", applicationsPerCall.stream().map(result -> { stats.put(GepafinConstant.APPLICATION_PER_CALL, applicationsPerCall.stream().map(result -> {
Map<String, Object> callData = new HashMap<>(); Map<String, Object> callData = new HashMap<>();
callData.put("CALL", result[0]); // Call name callData.put(GepafinConstant.CALL_NAME, result[0]); // Call name
callData.put("APPLICATIONS", result[1]); // Application count callData.put(GepafinConstant.NUMBER_OF_APPLICATIONS, result[1]); // Application count
return callData; return callData;
}).toList()); }).toList());
// Get applications grouped by status // Get applications grouped by status
List<Object[]> applicationsByStatus = applicationRepository.findApplicationsByStatus(requestedUser.getHub().getId()); List<Object[]> applicationsByStatus = applicationRepository.findApplicationsByStatus(requestedUser.getHub().getId());
stats.put("APPLICATION_STATUSES", applicationsByStatus.stream().map(result -> { stats.put(GepafinConstant.APPLICATION_PER_STATUS, applicationsByStatus.stream().map(result -> {
Map<String, Object> statusData = new HashMap<>(); Map<String, Object> statusData = new HashMap<>();
statusData.put("STATUS", result[0]); // Application status statusData.put(GepafinConstant.STATUS, result[0]); // Application status
statusData.put("COUNT", result[1]); // Count of applications statusData.put(GepafinConstant.NUMBER_OF_APPLICATIONS, result[1]); // Count of applications
return statusData; return statusData;
}).toList()); }).toList());