use of com.gwc.workday.entity.WorkDay in project workday by peer44.
the class WorkDayService method findAllHolidays.
public List<WorkDay> findAllHolidays() {
Sort sort = new Sort(Sort.Direction.ASC, "date");
List<WorkDay> workDays = workDayDao.findAll(sort);
return workDays;
}
use of com.gwc.workday.entity.WorkDay in project workday by peer44.
the class HolidayController method init.
@ApiOperation(value = "加载节假日")
@GetMapping(value = "holiday/init")
@ResponseBody
public List<EventVO> init() {
List<WorkDay> workDays = workDayService.findAllHolidays();
List<EventVO> events = new ArrayList<>();
if (!CollectionUtils.isEmpty(workDays)) {
workDays.forEach(workDay -> {
EventVO event = new EventVO(workDay.getDate());
events.add(event);
});
}
return events;
}
use of com.gwc.workday.entity.WorkDay in project workday by peer44.
the class WorkDayService method save.
public WorkDay save(String date) {
List<WorkDay> workDayList = workDayDao.findByDate(date);
WorkDay workDay = new WorkDay();
workDay.setDate(date);
workDay.setIsWorkDay(false);
if (!CollectionUtils.isEmpty(workDayList)) {
workDay.setId(workDayList.get(0).getId());
}
return workDayDao.save(workDay);
}
use of com.gwc.workday.entity.WorkDay in project workday by peer44.
the class WorkDayService method findByYear.
public List<WorkDay> findByYear(String year) {
Sort sort = new Sort(Sort.Direction.ASC, "date");
List<WorkDay> workDays = workDayDao.findByDateGreaterThanEqual(year + "-01-01", sort);
return workDays;
}
use of com.gwc.workday.entity.WorkDay in project workday by peer44.
the class WorkDayService method delete.
public void delete(String date) {
List<WorkDay> workDayList = workDayDao.findByDate(date);
WorkDay workDay = new WorkDay();
workDay.setDate(date);
workDay.setIsWorkDay(false);
if (!CollectionUtils.isEmpty(workDayList)) {
workDay.setId(workDayList.get(0).getId());
}
workDayDao.delete(workDay);
}
Aggregations