#98 project statuses edited

This commit is contained in:
a.vasin 2019-05-28 00:40:36 +04:00
parent 7388e12e3f
commit eb87c6d52f
3 changed files with 12 additions and 12 deletions

View File

@ -27,11 +27,11 @@ import java.util.Set;
public class Project extends BaseEntity implements UserContainer { public class Project extends BaseEntity implements UserContainer {
public enum ProjectStatus { public enum ProjectStatus {
APPLICATION("Заявка"), TT("ТЗ"),
ON_COMPETITION("Отправлен на конкурс"), OPEN("Открыт"),
SUCCESSFUL_PASSAGE("Успешное прохождение"),
IN_WORK("В работе"), IN_WORK("В работе"),
COMPLETED("Завершен"), CERTIFICATE_ISSUED("Оформление свидетельства"),
CLOSED("Закрыт"),
FAILED("Провалены сроки"); FAILED("Провалены сроки");
private String statusName; private String statusName;
@ -49,7 +49,7 @@ public class Project extends BaseEntity implements UserContainer {
private String title; private String title;
@Enumerated(value = EnumType.STRING) @Enumerated(value = EnumType.STRING)
private ProjectStatus status = ProjectStatus.APPLICATION; private ProjectStatus status = ProjectStatus.TT;
@NotNull @NotNull
private String description; private String description;

View File

@ -19,7 +19,7 @@ import java.util.List;
import static org.springframework.util.ObjectUtils.isEmpty; import static org.springframework.util.ObjectUtils.isEmpty;
import static ru.ulstu.core.util.StreamApiUtils.convert; import static ru.ulstu.core.util.StreamApiUtils.convert;
import static ru.ulstu.project.model.Project.ProjectStatus.APPLICATION; import static ru.ulstu.project.model.Project.ProjectStatus.TT;
@Service @Service
public class ProjectService { public class ProjectService {
@ -89,7 +89,7 @@ public class ProjectService {
private Project copyFromDto(Project project, ProjectDto projectDto) throws IOException { private Project copyFromDto(Project project, ProjectDto projectDto) throws IOException {
project.setDescription(projectDto.getDescription()); project.setDescription(projectDto.getDescription());
project.setStatus(projectDto.getStatus() == null ? APPLICATION : projectDto.getStatus()); project.setStatus(projectDto.getStatus() == null ? TT : projectDto.getStatus());
project.setTitle(projectDto.getTitle()); project.setTitle(projectDto.getTitle());
if (projectDto.getGrant() != null && projectDto.getGrant().getId() != null) { if (projectDto.getGrant() != null && projectDto.getGrant().getId() != null) {
project.setGrant(grantRepository.findOne(projectDto.getGrant().getId())); project.setGrant(grantRepository.findOne(projectDto.getGrant().getId()));

View File

@ -6,19 +6,19 @@
<body> <body>
<span th:fragment="projectStatus (projectStatus)" class="fa-stack fa-1x"> <span th:fragment="projectStatus (projectStatus)" class="fa-stack fa-1x">
<th:block th:switch="${projectStatus.name()}"> <th:block th:switch="${projectStatus.name()}">
<div th:case="'APPLICATION'"> <div th:case="'TT'">
<i class="fa fa-circle fa-stack-2x text-draft"></i> <i class="fa fa-circle fa-stack-2x text-draft"></i>
</div> </div>
<div th:case="'ON_COMPETITION'"> <div th:case="'OPEN'">
<i class="fa fa-circle fa-stack-2x text-review"></i> <i class="fa fa-circle fa-stack-2x text-review"></i>
</div> </div>
<div th:case="'SUCCESSFUL_PASSAGE'"> <div th:case="'IN_WORK'">
<i class="fa fa-circle fa-stack-2x text-accepted"></i> <i class="fa fa-circle fa-stack-2x text-accepted"></i>
</div> </div>
<div th:case="'IN_WORK'"> <div th:case="'CERTIFICATE_ISSUED'">
<i class="fa fa-circle fa-stack-2x text-primary"></i> <i class="fa fa-circle fa-stack-2x text-primary"></i>
</div> </div>
<div th:case="'COMPLETED'"> <div th:case="'CLOSED'">
<i class="fa fa-circle fa-stack-2x text-success"></i> <i class="fa fa-circle fa-stack-2x text-success"></i>
</div> </div>
<div th:case="'FAILED'"> <div th:case="'FAILED'">