diff --git a/src/main/java/net/gepafin/tendermanagement/dao/NotificationDao.java b/src/main/java/net/gepafin/tendermanagement/dao/NotificationDao.java index 9acacdb0..5308f163 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/NotificationDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/NotificationDao.java @@ -192,6 +192,20 @@ public class NotificationDao { } } + public void sendNotificationToInstructorManager(Map placeHolders, ApplicationEvaluationEntity applicationEvaluationEntity, NotificationTypeEnum notificationTypeEnum) { + + List userEntities=userRepository.findByRoleEntity_RoleTypeAndHubId(RoleStatusEnum.ROLE_INSTRUCTOR_MANAGER.getValue(),applicationEvaluationEntity.getAssignedApplicationsEntity().getApplication().getHubId()); + for (UserEntity user:userEntities) { + Long instructorId=user.getId(); + ApplicationEntity application = applicationService.validateApplication(applicationEvaluationEntity.getApplicationId()); + if (instructorId != null) { + NotificationReq notificationreq = createNotificationReq(notificationTypeEnum.getValue(), placeHolders, instructorId, application.getUserWithCompany(), + null); + sendNotification(notificationreq); + } + } + } + public List getAllCompanyIdsForUser(Long userId) { return userWithCompanyRepository.findActiveCompanyIdsByUserId(userId); diff --git a/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationAmendmentRequestRepository.java b/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationAmendmentRequestRepository.java index 3c89993c..1192f334 100644 --- a/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationAmendmentRequestRepository.java +++ b/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationAmendmentRequestRepository.java @@ -57,7 +57,7 @@ public interface ApplicationAmendmentRequestRepository extends JpaRepository 'CLOSE' " + + "AND a.status NOT IN('CLOSE','EXPIRED') " + "AND a.endDate < :currentTime") List findAmendmentsDueForExpiration(LocalDateTime currentTime); @@ -70,7 +70,7 @@ public interface ApplicationAmendmentRequestRepository extends JpaRepository 'CLOSE' " + + " AND activeAmendment.status NOT IN('CLOSE','EXPIRED') " + " AND activeAmendment.isDeleted = false) ") Set findEvaluationsWithoutActiveAmendmentsByIds(@Param("applicationEvaluationIds") Set applicationEvaluationIds); diff --git a/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationEvaluationRepository.java b/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationEvaluationRepository.java index cf0b9c66..d8e13228 100644 --- a/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationEvaluationRepository.java +++ b/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationEvaluationRepository.java @@ -32,7 +32,7 @@ public interface ApplicationEvaluationRepository extends JpaRepository findAllByIsDeletedFalseAndEndDateBefore(@Param("currentDate") LocalDateTime currentDate); @Query("SELECT a FROM ApplicationEvaluationEntity a " + diff --git a/src/main/java/net/gepafin/tendermanagement/scheduler/ApplicationEvaluationScheduler.java b/src/main/java/net/gepafin/tendermanagement/scheduler/ApplicationEvaluationScheduler.java index e7249645..c43aca10 100644 --- a/src/main/java/net/gepafin/tendermanagement/scheduler/ApplicationEvaluationScheduler.java +++ b/src/main/java/net/gepafin/tendermanagement/scheduler/ApplicationEvaluationScheduler.java @@ -90,7 +90,7 @@ public class ApplicationEvaluationScheduler { Map placeHolders = notificationDao.sendNotificationToBeneficiary(application, NotificationTypeEnum.EVALUATION_EXPIRED); notificationDao.sendNotificationToSuperUser(application,placeHolders,NotificationTypeEnum.EVALUATION_EXPIRED); notificationDao.sendNotificationToInstructor(placeHolders,evaluation,NotificationTypeEnum.EVALUATION_EXPIRED); - + notificationDao.sendNotificationToInstructorManager(placeHolders,evaluation,NotificationTypeEnum.EVALUATION_EXPIRED); // Logging version history for the update operation loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(httpServletRequest)