Skip to content

Commit

Permalink
[ADD] ProjectDTO pm eno
Browse files Browse the repository at this point in the history
  • Loading branch information
choi3179 committed Apr 17, 2024
1 parent 1d5b529 commit fe86ba8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.boogle.papplan.dto.project;

import com.boogle.papplan.dto.EmployeeDTO;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
public class ProjectCreateDTO {

//private Integer projNo;
private String projTitle;
//private String projPm;
private Integer projPmEno;
//private String projPmDept;
private Date projStartDate;
private Date projEndDate;
//private Integer projPercent;
private Date projCreateDate;
private String projDesc;
private String projectPriority;
private String projectStatus;
private List<Integer> contributors;
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ private ProjectDTO convertToDto(Project project) {
if(project.getProjPm() != null) {
dto.setProjPm(project.getProjPm().getName());
dto.setProjPmDept(project.getProjPm().getDepartment().getDept_no());
dto.setProjPmEno(project.getProjPm().getEno());
}
dto.setProjStartDate(project.getProjStartDate());
dto.setProjEndDate(project.getProjEndDate());
Expand Down Expand Up @@ -211,24 +212,7 @@ public Project convertToEntity(ProjectDTO projectDTO) {

// 프로젝트에 참여자 리스트 설정
project.setContributors(contributorEnos);
//
// List<Integer> enos = projectDTO.getContributors().stream()
// .map(EmployeeDTO::getEno)
// .collect(Collectors.toList());
// Optional<List<EmployeeDTO>> employeesDTOs = employeeRepository.findAllByEnos(enos);
// List<Contributor> contributors = employeesDTOs.orElseThrow(() -> new RuntimeException("Employees not found"))
// .stream()
// .map(dto -> {
// Employees employee = employeeRepository.findById(dto.getEno()).orElseThrow();
// Contributor contributor = new Contributor();
// contributor.setProject(project);
// contributor.setEmployees(employee);
// return contributor;
// })
// .collect(Collectors.toList());
//
// // 프로젝트에 참여자 리스트 설정
// project.setContributors(contributors);


return project;
}
Expand Down

0 comments on commit fe86ba8

Please sign in to comment.