use of com.axelor.apps.base.db.AppRecruitment in project axelor-open-suite by axelor.
the class JobPositionServiceImpl method updateLastEmailId.
@Transactional
public void updateLastEmailId(Message message) {
AppRecruitment appRecruitment = appRecruitmentRepo.all().fetchOne();
appRecruitment.setLastEmailId(message.getId().toString());
appRecruitmentRepo.save(appRecruitment);
}
use of com.axelor.apps.base.db.AppRecruitment in project axelor-open-suite by axelor.
the class MailAccountServiceTalentImpl method createMessage.
@Transactional(rollbackOn = { Exception.class })
@Override
public Message createMessage(EmailAccount mailAccount, MailParser parser, Date date) throws MessagingException {
Message message = super.createMessage(mailAccount, parser, date);
AppRecruitment appRecruitment = appRecruitmentRepo.all().fetchOne();
if (appRecruitment != null && appRecruitment.getApp().getActive() && message.getMailAccount() != null && message.getMailAccount().getServerTypeSelect() > 1) {
String lastEmailId = appRecruitment.getLastEmailId();
if (lastEmailId == null || message.getId() > Long.parseLong(lastEmailId)) {
jobPositionService.createJobApplication(message);
}
}
return message;
}
Aggregations