From 376c820b44532bd9b84ded0260c5d98d206b9649 Mon Sep 17 00:00:00 2001 From: Alyona Date: Sat, 10 Nov 2018 20:28:17 +0400 Subject: [PATCH] fix --- src/main/java/ru/ulstu/timeline/model/Event.java | 16 ++++++++++++++++ .../ulstu/timeline/service/EventScheduler.java | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/src/main/java/ru/ulstu/timeline/model/Event.java b/src/main/java/ru/ulstu/timeline/model/Event.java index b1b6c97..6a753e8 100644 --- a/src/main/java/ru/ulstu/timeline/model/Event.java +++ b/src/main/java/ru/ulstu/timeline/model/Event.java @@ -70,6 +70,22 @@ public class Event extends BaseEntity { this.title = title; } + public Event.EventStatus getStatus() { + return status; + } + + public void setStatus(EventStatus status) { + this.status = status; + } + + public PeriodEvent getPeriod() {return period;} + + public void setPeriod(PeriodEvent period){this.period = period;} + + public Date getBeginDate() {return beginDate;} + + public void setBeginDate(Date beginDate) {this.beginDate = beginDate;} + public Date getCreateDate() { return createDate; } diff --git a/src/main/java/ru/ulstu/timeline/service/EventScheduler.java b/src/main/java/ru/ulstu/timeline/service/EventScheduler.java index 14c1177..7ba07a9 100644 --- a/src/main/java/ru/ulstu/timeline/service/EventScheduler.java +++ b/src/main/java/ru/ulstu/timeline/service/EventScheduler.java @@ -7,6 +7,7 @@ import ru.ulstu.core.util.DateUtils; import ru.ulstu.timeline.model.Event; import ru.ulstu.timeline.model.EventDto; import ru.ulstu.timeline.repository.EventRepository; +import ru.ulstu.user.model.UserDto; import java.sql.Date; import java.time.LocalDate; @@ -14,6 +15,7 @@ import java.time.Period; import java.time.ZoneId; import java.util.ArrayList; import java.util.Calendar; +import java.util.List; public class EventScheduler { @@ -36,9 +38,11 @@ public class EventScheduler { event.setBeginDate(DateUtils.addDays(event.getBeginDate(), event.getPeriod().getPeriod().getDays())); event.setUpdateDate(null); + eventService.create(new EventDto( event.getId(), event.getTitle(), + event.getStatus(), event.getPeriod(), event.getBeginDate(), event.getExecuteDate(),