issue-47 #60

Merged
sebastian merged 13 commits from issue-47 into master 2023-11-13 18:54:08 +01:00
3 changed files with 30 additions and 17 deletions
Showing only changes of commit 299285e25b - Show all commits

View File

@ -4,9 +4,10 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="3a869f59-290a-4ab2-b036-a878ce801bc4" name="Changes" comment="Deploy on docker (not productive yet!)">
<list default="true" id="3a869f59-290a-4ab2-b036-a878ce801bc4" name="Changes" comment="Fix deleting tasks">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/core/services/TaskService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/services/TaskService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/core/api/models/timemanager/taskSchedule/scheduleInfos/AdvancedScheduleFieldInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/api/models/timemanager/taskSchedule/scheduleInfos/AdvancedScheduleFieldInfo.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/core/services/TaskScheduleService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/services/TaskScheduleService.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -558,14 +559,21 @@
<option name="project" value="LOCAL" />
<updated>1699803821051</updated>
</task>
<option name="localTasksCounter" value="43" />
<task id="LOCAL-00043" summary="Fix deleting tasks">
<option name="closed" value="true" />
<created>1699805283751</created>
<option name="number" value="00043" />
<option name="presentableId" value="LOCAL-00043" />
<option name="project" value="LOCAL" />
<updated>1699805283751</updated>
</task>
<option name="localTasksCounter" value="44" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="Forget single schedule" />
<MESSAGE value="Fix marking finished task as overdue" />
<MESSAGE value="Write simple Testcase for ci/cd" />
<MESSAGE value="Deactivate Overall System test (temporarly)" />
@ -590,7 +598,8 @@
<MESSAGE value="Adapt datetime-picker" />
<MESSAGE value="Fix wrong date" />
<MESSAGE value="Deploy on docker (not productive yet!)" />
<option name="LAST_COMMIT_MESSAGE" value="Deploy on docker (not productive yet!)" />
<MESSAGE value="Fix deleting tasks" />
<option name="LAST_COMMIT_MESSAGE" value="Fix deleting tasks" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
@ -612,7 +621,7 @@
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/main/java/core/services/TaskService.java</url>
<line>92</line>
<line>93</line>
<option name="timeStamp" value="35" />
</line-breakpoint>
</breakpoints>

View File

@ -2,40 +2,44 @@ package core.api.models.timemanager.taskSchedule.scheduleInfos;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.time.ZonedDateTime;
public class AdvancedScheduleFieldInfo extends ScheduleFieldInfo {
@NotNull
@JsonProperty
private LocalDateTime scheduleStartTime;
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
private ZonedDateTime scheduleStartTime;
@NotNull
@JsonProperty
private LocalDateTime scheduleStopTime;
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
private ZonedDateTime scheduleStopTime;
public AdvancedScheduleFieldInfo(LocalDateTime scheduleStartTime, LocalDateTime scheduleStopTime) {
this.scheduleStartTime = scheduleStartTime;
this.scheduleStopTime = scheduleStopTime;
this.scheduleStartTime = ZonedDateTime.from(scheduleStartTime);
this.scheduleStopTime = ZonedDateTime.from(scheduleStopTime);
}
public AdvancedScheduleFieldInfo() {
}
public LocalDateTime getScheduleStartTime() {
public ZonedDateTime getScheduleStartTime() {
return scheduleStartTime;
}
public void setScheduleStartTime(LocalDateTime scheduleStartTime) {
public void setScheduleStartTime(ZonedDateTime scheduleStartTime) {
this.scheduleStartTime = scheduleStartTime;
}
public LocalDateTime getScheduleStopTime() {
public ZonedDateTime getScheduleStopTime() {
return scheduleStopTime;
}
public void setScheduleStopTime(LocalDateTime scheduleStopTime) {
public void setScheduleStopTime(ZonedDateTime scheduleStopTime) {
this.scheduleStopTime = scheduleStopTime;
}
}

View File

@ -56,7 +56,7 @@ public class TaskScheduleService {
return new ServiceResult<>(ServiceExitCode.INVALID_PARAMETER);
}
AdvancedTaskSchedule advancedTaskSchedule = new AdvancedTaskSchedule(task, scheduleFieldInfo.getScheduleStartTime(), scheduleFieldInfo.getScheduleStopTime());
AdvancedTaskSchedule advancedTaskSchedule = new AdvancedTaskSchedule(task, scheduleFieldInfo.getScheduleStartTime().toLocalDateTime(), scheduleFieldInfo.getScheduleStopTime().toLocalDateTime());
scheduleRepository.save(advancedTaskSchedule);
return new ServiceResult<>(advancedTaskSchedule);
@ -89,8 +89,8 @@ public class TaskScheduleService {
return new ServiceResult<>(ServiceExitCode.INVALID_PARAMETER);
}
schedule.setScheduleStart(scheduleFieldInfo.getScheduleStartTime());
schedule.setScheduleEnd(scheduleFieldInfo.getScheduleStopTime());
schedule.setScheduleStart(scheduleFieldInfo.getScheduleStartTime().toLocalDateTime());
schedule.setScheduleEnd(scheduleFieldInfo.getScheduleStopTime().toLocalDateTime());
scheduleRepository.save(schedule);
return new ServiceResult<>(schedule);
}