use of com.artezio.javax.jpa.abac.AbacContext in project ART-TIME by Artezio.
the class FilterService method getTimesheetFilter.
@AbacContext(VIEW_TIMESHEET)
public Filter getTimesheetFilter() {
Filter result = new Filter();
result.setDepartments(departmentRepository.getDepartments());
result.setHourTypes(hourTypeService.getAll());
employeeService.getLoggedEmployee().ifPresent(employee -> result.setEmployees(Collections.singletonList(employee)));
result.setProjects(getActiveAndReportedProjects(result.getPeriod()));
return result;
}
use of com.artezio.javax.jpa.abac.AbacContext in project ART-TIME by Artezio.
the class WorkTimeService method getRequiredWorkHours.
@PermitAll
@AbacContext(VIEW_TIMESHEET)
public BigDecimal getRequiredWorkHours(Employee employee, Period period) {
List<Date> workDayDates = getWorkDayDates(employee, period);
BigDecimal workDaysNumber = new BigDecimal(workDayDates.size());
return workDaysNumber.multiply(employee.getWorkLoadHours());
}
Aggregations