public List<Vacation> findVacationsByTypesAndStatuses( Integer year, Integer month, Integer employeeId, List<DictionaryItem> types, List<DictionaryItem> statuses) { return vacationDAO.findVacationsByTypesAndStatuses(year, month, employeeId, types, statuses); }
@Transactional public List<Integer> getAllNotApprovedVacationsIds() { return vacationDAO.getAllNotApprovedVacationsIds(); }
@Transactional public Boolean isDayVacation(Employee employee, Date date) { return vacationDAO.isDayVacation(employee, date); }
@Transactional public void store(Vacation vacation) { vacationDAO.store(vacation); }
public Vacation getVacationWithoutPlanned(Employee employee, Date date) { return vacationDAO.getVacationWithoutPlanned(employee, date); }
public List<Vacation> findVacationsByType( Integer year, Integer month, Integer employeeId, DictionaryItem type) { return vacationDAO.findVacationsByType(year, month, employeeId, type); }
public List<Vacation> findVacations( Integer employeeId, Date beginDate, Date endDate, DictionaryItem typeId) { return vacationDAO.findVacations(employeeId, beginDate, endDate, typeId); }
public Integer getPlannedVacationsCountByPeriod(Employee employee, Date beginDate) { return vacationDAO.getVacationsCountByPeriod(employee, beginDate, false); }
public List<Vacation> findVacationsNeedsApproval(Integer employeeId) { return vacationDAO.findVacationsNeedApproval(employeeId); }
public Double getVacationsWorkdaysCount(Employee employee, Integer year, Integer month) { return (double) vacationDAO.getVacationsWorkdaysCount(employee, year, month); }
public int getApprovedVacationsWorkdaysCount( Employee employee, Integer year, Integer month, boolean toCurrentDate) { return vacationDAO.getApprovedVacationsWorkdaysCount( employee, year, month, null, toCurrentDate); }
/** * Удаляет планируемые отпуска уволенного сотрудника * * @param employee */ public void deleteFiredVacations(Employee employee) { vacationDAO.deleteFiredVacations(employee); }
@Transactional public void detach(Vacation vacation) { vacationDAO.detach(vacation); }
@Transactional public void delete(Vacation vacation) { vacationDAO.delete(vacation); }
@Transactional public Vacation tryFindVacation(Integer vacationId) { return vacationDAO.tryFindVacation(vacationId); }
public long getIntersectVacationsCount( Integer employeeId, Timestamp fromDate, Timestamp toDate, DictionaryItem item) { return vacationDAO.getIntersectVacationsCount(employeeId, fromDate, toDate, item); }
public Long getIntersectPlannedVacationsCount( Integer employeeId, Date fromDate, Date toDate, DictionaryItem item) { return vacationDAO.getIntersectPlannedVacationsCount(employeeId, fromDate, toDate, item); }
public Integer findVacationsNeedsApprovalCount(Integer employeeId) { return vacationDAO.findVacationsNeedApproval(employeeId).size(); }
public Integer getFactVacationsCountByPeriod(Employee employee, Date beginDate) { return vacationDAO.getVacationsCountByPeriod(employee, beginDate, true); }
public void createAndMailVacation( CreateVacationForm createVacationForm, Employee employee, Employee curEmployee, boolean isApprovedVacation) throws VacationApprovalServiceException { final Vacation vacation = new Vacation(); vacation.setCreationDate(new Date()); vacation.setBeginDate(DateTimeUtil.stringToTimestamp(createVacationForm.getCalFromDate())); vacation.setEndDate(DateTimeUtil.stringToTimestamp(createVacationForm.getCalToDate())); vacation.setComment(createVacationForm.getComment().trim()); vacation.setType(dictionaryItemService.find(createVacationForm.getVacationType())); vacation.setAuthor(curEmployee); vacation.setEmployee(employee); vacation.setRemind(false); vacation.setStatus( dictionaryItemService.find( isApprovedVacation ? VacationStatusEnum.APPROVED.getId() : VacationStatusEnum.APPROVEMENT_WITH_PM.getId())); TransactionStatus transactionStatus = null; try { transactionStatus = getNewTransaction(); store(vacation); boolean isPlannedVacation = vacation.getType().getId().equals(VacationTypesEnum.PLANNED.getId()); if (isPlannedVacation) { vacationApprovalProcessService.sendNoticeForPlannedVacaton(vacation); } else { List<Vacation> plannedVacations = vacationDAO.getPlannedVacationsByBeginAndEndDates( employee, vacation.getBeginDate(), vacation.getEndDate()); for (Vacation plannedVacation : plannedVacations) { delete(plannedVacation); } if (needsToBeApproved(vacation)) { vacationApprovalProcessService.sendVacationApproveRequestMessages( vacation); // рассылаем письма о согласовании отпуска } else { vacationApprovalProcessService.sendBackDateVacationApproved(vacation); } } commit(transactionStatus); } catch (VacationApprovalServiceException e) { if (transactionStatus != null) { rollback(transactionStatus); logger.error("Transaction rollbacked. Error saving vacation: {} ", e); } else { logger.error("TransactionStatus is null."); } } sendMailService.performVacationCreateMailing(vacation); }
public List<Vacation> findVacations( List<Employee> employees, Date beginDate, Date endDate, DictionaryItem typeId) { return vacationDAO.findVacations(employees, beginDate, endDate, typeId); }
@Transactional public Boolean isDayVacationWithoutPlanned(Employee employee, Date date) { return vacationDAO.getVacationWithoutPlanned(employee, date) != null ? true : false; }