| | |
| | | //this.issueUserService.modifyIssueUser(issue, project.getWorkspace(), issueForm.getUserIds()); |
| | | // 담당부서 지정 |
| | | this.issueDepartmentService.modifyIssueDepartment(issue, project.getWorkspace(), issueForm.getDepartmentIds()); |
| | | // 업체 정보 저장 |
| | | this.issueCompanyService.modifyIssueCompanyField(issue, issueForm.getIssueCompanyFields()); |
| | | // ISP 정보 저장 |
| | | this.issueIspService.modifyIssueIspField(issue, issueForm.getIssueIspFields()); |
| | | // HOSTING 정보 저장 |
| | | this.issueHostingService.modifyIssueHostingField(issue, issueForm.getIssueHostingFields()); |
| | | |
| | | // multipartFile 을 file Map List 객체로 변경한다. |
| | | List<Map<String, Object>> convertFileMaps = this.convertMultipartFileToFile(multipartFiles); |
| | |
| | | this.reservationIssueEmail(issue.getId(), EmailType.ISSUE_ADD); |
| | | // 사용자 시스템 기능 사용 정보 수집 |
| | | log.info(ElasticSearchUtil.makeUserActiveHistoryMessage(this.webAppUtil.getLoginUser(), ElasticSearchConstants.ISSUE_ADD)); |
| | | // 업체 정보 저장 |
| | | this.issueCompanyService.modifyIssueCompanyField(issue, issueForm.getIssueCompanyFields()); |
| | | // ISP 정보 저장 |
| | | this.issueIspService.modifyIssueIspField(issue, issueForm.getIssueIspFields()); |
| | | // HOSTING 정보 저장 |
| | | this.issueHostingService.modifyIssueHostingField(issue, issueForm.getIssueHostingFields()); |
| | | |
| | | return issue; |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | // 상위일감 정보 추가 |
| | | private void setParentIssue(Issue issue, IssueVo issueVo) { |
| | | if(issue.getParentIssue() != null){ |
| | |
| | | boolean hasPermission = false; |
| | | |
| | | // 업무 공간 관리자일 경우 수정 권한을 갖는다. |
| | | hasPermission = this.checkIssueModifyPermission(hasPermission, Issue.WORKSPACE_MANAGER, issueVo, null); |
| | | hasPermission = this.checkIssueModifyPermission(hasPermission, Issue.WORKSPACE_MANAGER, issueVo, null, null); |
| | | // 프로젝트 관리자일 경우 해당 프로젝트에 등록된 이슈는 수정 권한을 갖는다. |
| | | hasPermission = this.checkIssueModifyPermission(hasPermission, Issue.PROJECT_MANAGER, issueVo, null); |
| | | hasPermission = this.checkIssueModifyPermission(hasPermission, Issue.PROJECT_MANAGER, issueVo, null, null); |
| | | // 이슈 등록자일 경우 수정 권한을 갖는다. |
| | | hasPermission = this.checkIssueModifyPermission(hasPermission, Issue.REGISTER, issueVo, null); |
| | | hasPermission = this.checkIssueModifyPermission(hasPermission, Issue.REGISTER, issueVo, null, null); |
| | | // 이슈 담당자일 경우 수정 권한을 갖는다. => 담당부서로 수정 - 체크 |
| | | //hasPermission = this.checkIssueModifyPermission(hasPermission, Issue.ASSIGNEE, issueVo, issueUserVos); |
| | | // 담당자가 없으면 모든 사용자가 수정 권한을 갖는다. |
| | |
| | | } |
| | | |
| | | // 이슈 수정 권한을 확인한다. |
| | | private boolean checkIssueModifyPermission(Boolean hasPermission, String checkType, IssueVo issueVo, List<UserVo> issueUserVos) { |
| | | private boolean checkIssueModifyPermission(Boolean hasPermission, String checkType, IssueVo issueVo, List<UserVo> issueUserVos, List<DepartmentVo> issueDepartmentVos) { |
| | | if (!hasPermission) { |
| | | switch (checkType) { |
| | | case Issue.WORKSPACE_MANAGER: // 업무 공간 관리자 |
| | |
| | | hasPermission = true; |
| | | break; |
| | | } |
| | | |
| | | // 이슈 담당자 여부 확인 => 담당부서로 수정 - 체크 |
| | | /*for (UserVo issueUserVo : issueUserVos) { |
| | | // 이슈 담당자 여부 확인 |
| | | for (UserVo issueUserVo : issueUserVos) { |
| | | if (issueUserVo.getId().equals(this.webAppUtil.getLoginId())) { |
| | | hasPermission = true; |
| | | break; |
| | | } |
| | | }*/ |
| | | } |
| | | break; |
| | | |
| | | case Issue.DEPARTMENT: |
| | | // 담당부서가 없으면 모든 사용자가 수정 권한을 갖는다. |
| | | if (issueDepartmentVos.size() < 1) { |
| | | hasPermission = true; |
| | | break; |
| | | } |
| | | // 이슈 담당부서 여부 확인 |
| | | /*for (DepartmentVo issueDepartmentVo : issueDepartmentVos) { |
| | | if (issueDepartmentVo.getId().equals()) { |
| | | hasPermission = true; |
| | | break; |
| | | } |
| | | }*/ |
| | | break; |
| | | } |
| | | } |
| | |
| | | issue.setProject(this.projectService.getProject(issueForm.getProjectId())); |
| | | |
| | | // 변경 이력 정보 추출 |
| | | this.issueHistoryService.detectIssueManager(issue, issueForm, detectIssueChange); |
| | | this.issueHistoryService.detectIssueDepartment(issue, issueForm, detectIssueChange); |
| | | |
| | | //this.issueUserService.modifyIssueUser(issue, issue.getProject().getWorkspace(), issueForm.getUserIds()); |
| | | this.issueDepartmentService.modifyIssueDepartment(issue, issue.getProject().getWorkspace(), issueForm.getDepartmentIds()); |
| | |
| | | Map<String, Long> issueRiskMap = new HashMap<>(); |
| | | issueRiskMap.put("issueId", issueForm.getId()); |
| | | issueRiskMap.put("changeAssigneeCount", 0L); |
| | | issueRiskMap.put("changeDepartmentCount", 0L); |
| | | issueRiskMap.put("changeIssueStatusCount", 0L); |
| | | issueRiskMap.put("workspaceId", workspace.getId()); |
| | | issueRiskMap.put("issueStatusIds", issueForm.getIssueStatusId()); |
| | |
| | | |
| | | @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); |
| | | public void modifyParentIssue(IssueForm issueDownForm) { |
| | | System.out.println(issueDownForm.getTitle()); |
| | | Issue issue = this.getIssue(issueDownForm.getId()); |
| | | Issue parentIssue = issue.getParentIssue(); |
| | | |
| | | Long newParentIssueId = issueDownForm.getParentIssueId(); |
| | | StringBuilder sb = new StringBuilder(); |
| | | |
| | | IssueHistoryType type = IssueHistoryType.ADD; |
| | | if (newParentIssueId != null) { |
| | | // todo 이전 하위 일감 히스토리기록 필요 |
| | | type = IssueHistoryType.ADD; |
| | | parentIssue = this.getIssue(newParentIssueId); |
| | | issue.setParentIssue(parentIssue); |
| | | this.issueHistoryService.detectDownIssues(type, issue, sb); |
| | | } else { |
| | | // remove |
| | | type = IssueHistoryType.DELETE; |
| | | this.issueHistoryService.detectDownIssues(type, issue, sb); |
| | | issue.setParentIssue(null); |
| | | } |
| | | |
| | | this.issueHistoryService.addIssueHistory(parentIssue, IssueHistoryType.MODIFY, sb.toString()); |
| | | this.issueRepository.saveAndFlush(issue); |
| | | |
| | | } |
| | | } |