Updated code

This commit is contained in:
nisha
2024-11-18 12:25:13 +05:30
parent c29935c66f
commit dac9610b0f
4 changed files with 7 additions and 2 deletions

View File

@@ -32,6 +32,8 @@ public class EmailLogDao {
emailLogEntity.setUserId(emailLogRequest.getUserId()); emailLogEntity.setUserId(emailLogRequest.getUserId());
emailLogEntity.setEmailServiceResponse(emailLogRequest.getEmailServiceResponse()); emailLogEntity.setEmailServiceResponse(emailLogRequest.getEmailServiceResponse());
emailLogEntity.setRecipientEmails(emailLogRequest.getRecipientEmails()); emailLogEntity.setRecipientEmails(emailLogRequest.getRecipientEmails());
emailLogEntity.setEmailServiceType(emailLogRequest.getEmailServiceType().getValue());
emailLogEntity.setIsDeleted(false);
if(emailLogRequest.getEntityId()!=null && emailLogRequest.getEntityId()>0){ if(emailLogRequest.getEntityId()!=null && emailLogRequest.getEntityId()>0){
emailLogEntity.setEntityId(emailLogRequest.getEntityId()); emailLogEntity.setEntityId(emailLogRequest.getEntityId());
emailLogEntity.setEntityType(emailLogRequest.getEntitytype().getValue()); emailLogEntity.setEntityType(emailLogRequest.getEntitytype().getValue());

View File

@@ -151,7 +151,7 @@ public class EmailNotificationDao {
Map<String, String> bodyPlaceholders = new HashMap<>(); Map<String, String> bodyPlaceholders = new HashMap<>();
bodyPlaceholders.put("{{call_name}}", applicationEntity.getCall().getName()); bodyPlaceholders.put("{{call_name}}", applicationEntity.getCall().getName());
LocalDateTime lastReminderDateTime=amendmentRequest.getCreatedDate(); LocalDateTime lastReminderDateTime=amendmentRequest.getCreatedDate();
List<EmailLogEntity> emailLogEntity = emailLogRepository.findByUserIdAndEntityIdAndEntityType(user.getId(),amendmentRequest.getId(),EmailEntityTypeEnum.AMENDMENT.getValue()); List<EmailLogEntity> emailLogEntity = emailLogRepository.findByUserIdAndEntityIdAndEntityTypeAndIsDeletedFalse(user.getId(),amendmentRequest.getId(),EmailEntityTypeEnum.AMENDMENT.getValue());
if(emailLogEntity!=null && (!emailLogEntity.isEmpty())){ if(emailLogEntity!=null && (!emailLogEntity.isEmpty())){
EmailLogEntity emailLogEntity1=emailLogEntity.get(0); EmailLogEntity emailLogEntity1=emailLogEntity.get(0);
lastReminderDateTime=emailLogEntity1.getSendDateTime(); lastReminderDateTime=emailLogEntity1.getSendDateTime();

View File

@@ -50,5 +50,8 @@ public class EmailLogEntity extends BaseEntity{
@Column(name = "entity_type") @Column(name = "entity_type")
private String entityType; private String entityType;
@Column(name = "is_deleted")
private Boolean isDeleted;
} }

View File

@@ -7,5 +7,5 @@ import java.util.List;
public interface EmailLogRepository extends JpaRepository<EmailLogEntity,Long> { public interface EmailLogRepository extends JpaRepository<EmailLogEntity,Long> {
List<EmailLogEntity> findByUserIdAndEntityIdAndEntityType(Long userId,Long entityId,String entityType); List<EmailLogEntity> findByUserIdAndEntityIdAndEntityTypeAndIsDeletedFalse(Long userId,Long entityId,String entityType);
} }