Updated code
This commit is contained in:
@@ -63,7 +63,6 @@ public class DashboardDao {
|
||||
widgetResponseBean.setWidget1(createWidget1(requestedUserEntity));
|
||||
Map<String, Object> widgetBars =getStatistics(requestedUserEntity);
|
||||
widgetResponseBean.setWidgetBars(widgetBars);
|
||||
widgetResponseBean.setUserActionWidgetList(getUserAction(requestedUserEntity));
|
||||
return widgetResponseBean;
|
||||
}
|
||||
|
||||
@@ -97,14 +96,14 @@ public class DashboardDao {
|
||||
private void setAmountRequested(Widget1 widget1, UserEntity requestedUserEntity) {
|
||||
BigDecimal amountRequested = applicationRepository.findTotalAmountRequestedOfApplication(requestedUserEntity.getHub().getId());
|
||||
if (amountRequested != null) {
|
||||
widget1.setAmountRequested(amountRequested);
|
||||
widget1.setTotalAmountRequested(amountRequested);
|
||||
}
|
||||
}
|
||||
|
||||
private void setAmountAccepted(Widget1 widget1, UserEntity requestedUserEntity) {
|
||||
BigDecimal amountAccepted = applicationRepository.findTotalAmountAcceptedOfApplication(requestedUserEntity.getHub().getId());
|
||||
if (amountAccepted != null) {
|
||||
widget1.setAmountAccepted(amountAccepted);
|
||||
widget1.setTotalAmountAccepted(amountAccepted);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,12 +193,12 @@ public class DashboardDao {
|
||||
|
||||
return stats;
|
||||
}
|
||||
public Page<UserActionEntity> getUserAction(UserEntity requestedUserEntity){
|
||||
Pageable pageable = PageRequest.of(0, 20); // Get the first 20 records
|
||||
List<String> roles=List.of(RoleStatusEnum.ROLE_PRE_INSTRUCTOR.getValue(),RoleStatusEnum.ROLE_GEPAFIN_OPERATOR.getValue(),RoleStatusEnum.ROLE_INSTRUCTOR_MANAGER.getValue());
|
||||
Page<UserActionEntity> userActionEntities=userActionsRepository.findActionsByRoleNamesAndHubId(roles,requestedUserEntity.getHub().getId(),pageable);
|
||||
return userActionEntities;
|
||||
}
|
||||
// public Page<UserActionEntity> getUserAction(UserEntity requestedUserEntity){
|
||||
// Pageable pageable = PageRequest.of(0, 20); // Get the first 20 records
|
||||
// List<String> roles=List.of(RoleStatusEnum.ROLE_PRE_INSTRUCTOR.getValue(),RoleStatusEnum.ROLE_GEPAFIN_OPERATOR.getValue(),RoleStatusEnum.ROLE_INSTRUCTOR_MANAGER.getValue());
|
||||
// Page<UserActionEntity> userActionEntities=userActionsRepository.findActionsByRoleNamesAndHubId(roles,requestedUserEntity.getHub().getId(),pageable);
|
||||
// return userActionEntities;
|
||||
// }
|
||||
public ApplicationWidgetResponseBean getApplicationDetails(UserEntity userEntity) {
|
||||
ApplicationWidgetResponseBean applicationWidgetResponseBean = initializeResponseBean();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user