#98 project deadlines edited

This commit is contained in:
Васин Антон 2019-05-28 16:16:41 +03:00
parent 3b0a2dd964
commit c25392337a
5 changed files with 13 additions and 35 deletions

View File

@ -31,8 +31,6 @@ public class ProjectDto {
private List<Integer> removedDeadlineIds = new ArrayList<>();
private Set<Integer> executorIds;
private List<UserDto> executors;
private boolean hasAge;
private boolean hasDegree;
private final static int MAX_EXECUTORS_LENGTH = 40;
@ -52,9 +50,7 @@ public class ProjectDto {
@JsonProperty("repository") String repository,
@JsonProperty("deadlines") List<Deadline> deadlines,
@JsonProperty("executorIds") Set<Integer> executorIds,
@JsonProperty("executors") List<UserDto> executors,
@JsonProperty("hasAge") boolean hasAge,
@JsonProperty("hasDegree") boolean hasDegree) {
@JsonProperty("executors") List<UserDto> executors) {
this.id = id;
this.title = title;
this.status = status;
@ -65,8 +61,6 @@ public class ProjectDto {
this.applicationFileName = null;
this.executorIds = executorIds;
this.executors = executors;
this.hasAge = hasAge;
this.hasDegree = hasDegree;
}
@ -172,22 +166,6 @@ public class ProjectDto {
this.executors = executors;
}
public boolean isHasAge() {
return hasAge;
}
public void setHasAge(boolean hasAge) {
this.hasAge = hasAge;
}
public boolean isHasDegree() {
return hasDegree;
}
public void setHasDegree(boolean hasDegree) {
this.hasDegree = hasDegree;
}
public String getExecutorsString() {
return StringUtils.abbreviate(executors
.stream()

View File

@ -110,8 +110,8 @@ public class ProjectService {
}
public void removeDeadline(ProjectDto projectDto, Integer deadlineId) {
if (projectDto.getDeadlines().get(deadlineId).getId() != null) {
projectDto.getRemovedDeadlineIds().add(projectDto.getDeadlines().get(deadlineId).getId());
if (deadlineId != null) {
projectDto.getRemovedDeadlineIds().add(deadlineId);
}
projectDto.getDeadlines().remove((int) deadlineId);
}
@ -121,8 +121,8 @@ public class ProjectService {
}
public List<User> getProjectExecutors(ProjectDto projectDto) {
List<User> filteredUsers = userService.filterByAgeAndDegree(projectDto.isHasAge(), projectDto.isHasDegree());
return filteredUsers;
List<User> users = userService.findAll();
return users;
}
}

View File

@ -2,15 +2,15 @@
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<changeSet author="anton" id="20190528_000000-1">
<changeSet author="anton" id="20190528_000000-3">
<createTable tableName="deadline_executors">
<column name="deadline_id" type="integer"/>
<column name="executors" type="integer"/>
<column name="executors_id" type="integer"/>
</createTable>
<addForeignKeyConstraint baseTableName="deadline_executors" baseColumnNames="deadline_id"
constraintName="fk_deadline_deadline_executors" referencedTableName="deadline"
referencedColumnNames="id"/>
<addForeignKeyConstraint baseTableName="deadline_executors" baseColumnNames="executors"
<addForeignKeyConstraint baseTableName="deadline_executors" baseColumnNames="executors_id"
constraintName="fk_user_deadline_executors" referencedTableName="users"
referencedColumnNames="id"/>
</changeSet>

View File

@ -48,5 +48,5 @@
<include file="db/changelog-20190520_000000-schema.xml"/>
<include file="db/changelog-20190523_000000-schema.xml"/>
<include file="db/changelog-20190528_000000-schema.xml"/>
<include file="db/changelog-20190528_000001-schema.xml"/>
<include file="db/changelog-20190528_000002-schema.xml"/>
</databaseChangeLog>

View File

@ -92,11 +92,11 @@
</div>
<div class="col-12" style="margin-bottom: 15px;"></div>
<div class="col-10 div-deadline-executor">
<select class="selectpicker form-control" data-live-search="true"
<select class="selectpicker form-control" multiple="true" data-live-search="true"
title="-- Выберите исполнителя --" id="executors"
th:field="*{deadlines[__${rowStat.index}__].executor}" data-size="5">
<option th:each="executor : ${allExecutors}" th:value="${executor.id}"
th:text="${executor.lastName}"> Участник
th:field="*{deadlines[__${rowStat.index}__].executors}" data-size="5">
<option th:each="executors : ${allExecutors}" th:value="${executors.id}"
th:text="${executors.lastName}"> Участник
</option>
</select>
</div>