| | |
| | | private SeverityService severityService; |
| | | |
| | | @Autowired |
| | | private CompanyFieldService companyFieldService; |
| | | |
| | | @Autowired |
| | | private IspFieldService ispFieldService; |
| | | |
| | | @Autowired |
| | | private HostingFieldService hostingFieldService; |
| | | |
| | | @Autowired |
| | | private CommonConfiguration configuration; |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @Autowired |
| | | private ProjectRoleUserService projectRoleUserService; |
| | | |
| | | @Autowired |
| | | private ProjectRoleDepartmentService projectRoleDepartmentService; |
| | | |
| | | @Autowired |
| | | private IssueRiskService issueRiskService; |
| | |
| | | issue.setIssueType(issueType); |
| | | issue.setPriority(priority); |
| | | issue.setSeverity(severity); |
| | | |
| | | // 업체 필드 유효성 체크 |
| | | if(issueForm.getCompanyId() != null){ |
| | | CompanyField companyField = this.companyFieldService.getCompany(issueForm.getCompanyId()); |
| | | issue.setCompanyField(companyField); |
| | | } |
| | | // ISP 필드 유효성 체크 |
| | | if(issueForm.getIspId() != null) { |
| | | IspField ispField = this.ispFieldService.getIsp(issueForm.getIspId()); |
| | | issue.setIspFieldId(ispField); |
| | | } |
| | | // HOSTING 필드 유효성 체크 |
| | | if (issueForm.getHostingId() != null){ |
| | | HostingField hostingField = this.hostingFieldService.getHosting(issueForm.getHostingId()); |
| | | issue.setHostingFieldId(hostingField); |
| | | } |
| | | |
| | | issue.setIssueNumber(this.issueNumberGeneratorService.generateIssueNumber(project)); // 각 프로젝트의 고유 이슈 번호 생성 |
| | | |
| | | this.issueRepository.saveAndFlush(issue); |
| | |
| | | issueMap.put("issueTypeName", issue.getIssueType().getName()); |
| | | issueMap.put("issueStatusName", issue.getIssueStatus().getName()); |
| | | |
| | | // 담당부서 |
| | | // 담당자 |
| | | StringBuilder assigneeBuilder = new StringBuilder(); |
| | | for (IssueDepartment issueDepartment : issue.getIssueDepartments()) { |
| | | //assigneeBuilder.append(issueUser.getUser().getName()); |
| | | assigneeBuilder.append(issueDepartment.getDepartment().getDepartmentName()); |
| | | /*assigneeBuilder.append("("); |
| | | for (IssueUser issueUser : issue.getIssueUsers()) { |
| | | assigneeBuilder.append(issueUser.getUser().getName()); |
| | | assigneeBuilder.append("("); |
| | | assigneeBuilder.append(CommonUtil.decryptAES128(issueUser.getUser().getAccount())); |
| | | assigneeBuilder.append(")");*/ |
| | | assigneeBuilder.append(")"); |
| | | assigneeBuilder.append("\n"); |
| | | } |
| | | |
| | | issueMap.put("assignees", assigneeBuilder.toString()); |
| | | |
| | | // 담당부서 |
| | | StringBuilder departsBuilder = new StringBuilder(); |
| | | for (IssueDepartment issueDepartment : issue.getIssueDepartments()) { |
| | | departsBuilder.append(issueDepartment.getDepartment().getDepartmentName()); |
| | | departsBuilder.append("\n"); |
| | | } |
| | | issueMap.put("departsBuilder", departsBuilder.toString()); |
| | | |
| | | // 기간 |
| | | if (!StringUtils.isEmpty(issue.getStartDate())) { |
| | | issueMap.put("period", issue.getStartDate() + " ~ " + issue.getCompleteDate()); |
| | |
| | | issueVo.setIssueStatusVo(ConvertUtil.copyProperties(issue.getIssueStatus(), IssueStatusVo.class)); |
| | | issueVo.setPriorityVo(ConvertUtil.copyProperties(issue.getPriority(), PriorityVo.class)); |
| | | issueVo.setSeverityVo(ConvertUtil.copyProperties(issue.getSeverity(), SeverityVo.class)); |
| | | issueVo.setCompanyFieldVo(ConvertUtil.copyProperties(issue.getCompanyField(), CompanyFieldVo.class)); |
| | | issueVo.setIspFieldVo(ConvertUtil.copyProperties(issue.getIspFieldId(), IspFieldVo.class)); |
| | | issueVo.setHostingFieldVo(ConvertUtil.copyProperties(issue.getHostingFieldId(), HostingFieldVo.class)); |
| | | |
| | | this.setRegister(issue, issueVo); // 등록자 정보 셋팅 |
| | | //this.setIssueUser(issue, issueVo); // 담당자 정보 셋팅 |
| | |
| | | this.setAttachedFiles(issue, issueVo); // 첨부 파일 정보 셋팅 |
| | | this.setIssueCustomFields(issue, issueVo); // 사용자 정의 필드 값 정보 셋팅 |
| | | this.setRelationIssue(issue, issueVo); //연관 일감 셋팅 |
| | | this.setDownIssues(issue, issueVo); |
| | | |
| | | break; |
| | | |
| | | case "02": // 프로젝트, 이슈 유형, 이슈 상태, 우선순위, 중요도, 담당자, 첨부파일, 사용자 정의 필드 정보, 댓글, 기록을 셋팅한다. |
| | |
| | | resJsonData.put(Constants.RES_KEY_CONTENTS, issueVo); |
| | | } |
| | | |
| | | // 하위 이슈 정보를 셋팅한다 |
| | | private void setDownIssues(Issue issue, IssueVo issueVo) { |
| | | List<Issue> downIssues = this.issueRepository.findByParentIssueId(issue.getId()); |
| | | List<IssueVo> issueVos = ConvertUtil.convertObjectsToClasses(downIssues, IssueVo.class); |
| | | issueVo.setIssueDownVos(issueVos); |
| | | } |
| | | |
| | | // 이슈 상세 정보를 셋팅한다. |
| | | @Override |
| | | @Transactional(readOnly = true) |
| | |
| | | issueVo.setIssueStatusVo(issueStatusVo); |
| | | issueVo.setPriorityVo(ConvertUtil.copyProperties(issue.getPriority(), PriorityVo.class)); |
| | | issueVo.setSeverityVo(ConvertUtil.copyProperties(issue.getSeverity(), SeverityVo.class)); |
| | | issueVo.setCompanyFieldVo(ConvertUtil.copyProperties(issue.getCompanyField(), CompanyFieldVo.class)); |
| | | issueVo.setIspFieldVo(ConvertUtil.copyProperties(issue.getIspFieldId(), IspFieldVo.class)); |
| | | issueVo.setHostingFieldVo(ConvertUtil.copyProperties(issue.getHostingFieldId(), HostingFieldVo.class)); |
| | | this.setRegister(issue, issueVo); // 등록자 정보 셋팅 |
| | | //this.setIssueUser(issue, issueVo); // 담당자 정보 셋팅 |
| | | this.setIssueDepartment(issue, issueVo); // 담당부서 정보 셋팅 |
| | |
| | | this.setIssueComments(issue, issueVo); // 댓글 정보 셋팅 |
| | | this.setIssueHistory(issue, issueVo); // 이슈 기록 정보 셋팅 |
| | | this.setRelationIssue(issue, issueVo); //연관 일감 셋팅 |
| | | this.setDownIssues(issue, issueVo); |
| | | } |
| | | |
| | | // 등록자 정보 추가 |
| | |
| | | // 사용하고 있는 업무 공간이 활성 상태인지 확인한다. 사용 공간에서 로그인한 사용자가 비활성인지 확인한다. |
| | | this.workspaceService.checkUseWorkspace(); |
| | | // 이슈 수정 권한 체크 |
| | | //this.verifyIssueModifyPermission(issueForm.getId()); |
| | | this.verifyIssueModifyPermission(issueForm.getId()); |
| | | // 프로젝트 유효성 체크 |
| | | Project project = this.projectService.getProject(issueForm.getProjectId()); |
| | | // 이슈 상태 유효성 체크 |
| | |
| | | // 날짜 유효성 체크 |
| | | this.checkStartCompleteDate(issueForm.getStartDate(), issueForm.getCompleteDate()); |
| | | |
| | | // 담당자 유효성 체크 => 담당부서로 변경 |
| | | // 담당자 유효성 체크 |
| | | //this.verifyIssueAssignee(project, issueForm); |
| | | // 담당부서 유효성 체크 |
| | | this.verifyIssueDepartment(project, issueForm); |
| | | |
| | | Issue issue = this.getIssue(issueForm.getId()); |
| | | |
| | |
| | | } |
| | | |
| | | // 이슈 담당부서로 지정될 부서가 해당 프로젝트에 참여 하고 있는 부서인지 확인 |
| | | private void verifyIssueAssignee(Project project, IssueForm issueForm) { |
| | | private void verifyIssueDepartment(Project project, IssueForm issueForm) { |
| | | if (issueForm.getDepartmentIds().size() > 0) { |
| | | List<Long> trustDepartmentIds = Lists.newArrayList(); // 참여 확인된 부서 |
| | | |
| | | for (Long departmentId : issueForm.getDepartmentIds()) { |
| | | boolean includeProject = false; |
| | | |
| | | /*for (ProjectRole projectRole : project.getProjectRoles()) { |
| | | ProjectRoleUser projectRoleUser = this.projectRoleUserService.findByProjectRoleIdAndDepartmentId(projectRole.getId(), departmentId); |
| | | for (ProjectRole projectRole : project.getProjectRoles()) { |
| | | ProjectRoleDepartment projectRoleDepartment = this.projectRoleDepartmentService.findByProjectRoleIdAndDepartmentId(projectRole.getId(), departmentId); |
| | | |
| | | if (projectRoleUser != null) { |
| | | if (projectRoleDepartment != null) { |
| | | includeProject = true; |
| | | trustDepartmentIds.add(departmentId); |
| | | break; |
| | | } |
| | | }*/ |
| | | } |
| | | |
| | | // 데이터 보정 작업 - 프로젝트에서 제외된 사용자는 담당자에서 제외 될 수 있도록 처리 |
| | | /*if (!includeProject) { |
| | | if (!includeProject) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.PROJECT_NOT_INCLUDE_USER)); |
| | | }*/ |
| | | } |
| | | } |
| | | // 참여 확인된 부서로 담당부서 변경 |
| | | issueForm.setDepartmentIds(trustDepartmentIds); |
| | | } |
| | | } |
| | | |
| | | /*// 이슈 담당자로 지정될 사용자가 해당 프로젝트에 참여 하고 있는 사용자 인지 확인 |
| | | // 이슈 담당자로 지정될 사용자가 해당 프로젝트에 참여 하고 있는 사용자 인지 확인 |
| | | private void verifyIssueAssignee(Project project, IssueForm issueForm) { |
| | | if (issueForm.getUserIds().size() > 0) { |
| | | List<Long> trustUserIds = Lists.newArrayList(); // 참여 확인된 사용자 |
| | |
| | | } |
| | | |
| | | // 데이터 보정 작업 - 프로젝트에서 제외된 사용자는 담당자에서 제외 될 수 있도록 처리 |
| | | *//*if (!includeProject) { |
| | | if (!includeProject) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.PROJECT_NOT_INCLUDE_USER)); |
| | | }*//* |
| | | } |
| | | } |
| | | // 참여 확인된 사용자로 담당자 변경 |
| | | issueForm.setUserIds(trustUserIds); |
| | | } |
| | | }*/ |
| | | } |
| | | |
| | | // 이슈 수정 권한 체크 |
| | | private void verifyIssueModifyPermission(Long issueId) { |
| | |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("title", this.messageAccessor.message("common.issueTitle"), 40, ExportExcelAttrVo.ALIGN_LEFT)); // 이슈 제목 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("description", this.messageAccessor.message("common.content"), 60, ExportExcelAttrVo.ALIGN_LEFT)); // 내용 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("issueTypeName", this.messageAccessor.message("common.issueType"), 10, ExportExcelAttrVo.ALIGN_CENTER)); // 이슈 타입 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("department", this.messageAccessor.message("common.department"), 20, ExportExcelAttrVo.ALIGN_CENTER)); // 담당부서 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("departments", this.messageAccessor.message("common.department"), 20, ExportExcelAttrVo.ALIGN_CENTER)); // 담당부서 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("priorityName", this.messageAccessor.message("common.priority"), 6, ExportExcelAttrVo.ALIGN_CENTER)); // 우선순위 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("severityName", this.messageAccessor.message("common.importance"), 6, ExportExcelAttrVo.ALIGN_CENTER)); // 중요도 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("register", this.messageAccessor.message("common.register"), 20, ExportExcelAttrVo.ALIGN_CENTER)); // 등록자 |
| | |
| | | result.put("description", description); |
| | | result.put("issueTypeName", issueVo.getIssueTypeName()); |
| | | result.put("assignees", CommonUtil.convertUserVosToString(issueVo.getUserVos())); |
| | | result.put("departments", CommonUtil.convertDepartmentVosToString(issueVo.getDepartmentVos())); |
| | | result.put("priorityName", issueVo.getPriorityName()); |
| | | result.put("severityName", issueVo.getSeverityName()); |
| | | |
| | |
| | | |
| | | return tasks; |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void modifyParentIssue(IssueForm issueForm) { |
| | | Issue issue = this.issueRepository.getOne(issueForm.getId()); |
| | | Long parentIssueId = issueForm.getParentIssueId(); |
| | | if (parentIssueId != null) { |
| | | Issue parentIssue = this.issueRepository.getOne(parentIssueId); |
| | | issue.setParentIssue(parentIssue); |
| | | } else { |
| | | issue.setParentIssue(null); |
| | | } |
| | | |
| | | this.issueRepository.saveAndFlush(issue); |
| | | } |
| | | } |