use of com.qcadoo.mes.basic.shift.Shift in project mes by qcadoo.
the class ShiftIntervalsProvider method getWorkIntervals.
private Set<Interval> getWorkIntervals(final TimeGapsContext context) {
Interval searchInterval = context.getInterval();
Date fromDate = searchInterval.getStart().toDate();
Date toDate = searchInterval.getEnd().toDate();
List<Shift> shifts = shiftsService.findAll();
List<DateTimeRange> dateTimeRanges = shiftsService.getDateTimeRanges(shifts, fromDate, toDate);
Set<Interval> shiftWorkTimeIntervals = Sets.newHashSet();
for (DateTimeRange dateTimeRange : dateTimeRanges) {
Interval shiftWorkTimeInterval = new Interval(dateTimeRange.getFrom(), dateTimeRange.getTo());
shiftWorkTimeIntervals.add(shiftWorkTimeInterval);
}
return shiftWorkTimeIntervals;
}
use of com.qcadoo.mes.basic.shift.Shift in project mes by qcadoo.
the class ShiftsGanttChartItemResolverImpl method resolve.
@Override
@Transactional
public Map<String, List<GanttChartItem>> resolve(final GanttChartScale scale, final JSONObject context, final Locale locale) {
List<Shift> shifts = shiftsService.findAll();
Map<String, List<GanttChartItem>> items = new LinkedHashMap<>();
for (Shift shift : shifts) {
items.put(shift.getEntity().getStringField(ShiftFields.NAME), getItemsForShift(shift, scale));
}
return items;
}
Aggregations