|
|
@ -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()));
|
|
|
|