| | |
| | | private IssueUserService issueUserService; |
| | | |
| | | @Autowired |
| | | private IssueDepartmentService issueDepartmentService; |
| | | |
| | | @Autowired |
| | | private CustomFieldService customFieldService; |
| | | |
| | | @Autowired |
| | |
| | | // 담당자 지정 |
| | | //this.issueUserService.modifyIssueUser(issue, project.getWorkspace(), issueForm.getUserIds()); |
| | | // 담당부서 지정 |
| | | this.issueUserService.modifyIssueDepartment(issue, project.getWorkspace(), issueForm.getDepartmentIds()); |
| | | this.issueDepartmentService.modifyIssueDepartment(issue, project.getWorkspace(), issueForm.getDepartmentIds()); |
| | | |
| | | // multipartFile 을 file Map List 객체로 변경한다. |
| | | List<Map<String, Object>> convertFileMaps = this.convertMultipartFileToFile(multipartFiles); |
| | |
| | | |
| | | // 담당부서 |
| | | StringBuilder assigneeBuilder = new StringBuilder(); |
| | | for (IssueUser issueUser : issue.getIssueUsers()) { |
| | | for (IssueDepartment issueDepartment : issue.getIssueDepartments()) { |
| | | //assigneeBuilder.append(issueUser.getUser().getName()); |
| | | assigneeBuilder.append(issueUser.getDepartment().getDepartmentName()); |
| | | assigneeBuilder.append(issueDepartment.getDepartment().getDepartmentName()); |
| | | /*assigneeBuilder.append("("); |
| | | assigneeBuilder.append(CommonUtil.decryptAES128(issueUser.getUser().getAccount())); |
| | | assigneeBuilder.append(")");*/ |
| | |
| | | issueCondition.setIssueIds(issueKeys); |
| | | |
| | | List<Map<String, Object>> results = this.issueMapper.find(issueCondition); |
| | | |
| | | // 튜닝 전 - 0.8, 0.9, 0.9, 0.9, 0.9 |
| | | StopWatch serviceStart = new StopWatch(); |
| | | serviceStart.start(); |
| | |
| | | return true; |
| | | } |
| | | |
| | | // 이슈 담당자 정보를 셋팅한다. => 담당부서 |
| | | private void setIssueDepartmentList(List<IssueVo> issueVos, IssueCondition issueCondition) { |
| | | // 이슈 담당자 정보를 셋팅한다. |
| | | private void setIssueUserList(List<IssueVo> issueVos, IssueCondition issueCondition) { |
| | | if (issueVos.size() < 1) { |
| | | return; |
| | | } |
| | |
| | | List<Map<String, Object>> issueUsers = this.issueMapper.findIssueUser(issueCondition); |
| | | Map<String, Object> issueConverterUsers = new HashMap<>(); |
| | | |
| | | // 이슈에 해당하는 이슈 담당부서 정보 셋팅 |
| | | // 이슈에 해당하는 이슈 담당자 정보 셋팅 |
| | | for (Map<String, Object> issueUser : issueUsers) { |
| | | String issueId = MapUtil.getString(issueUser, "issueId"); |
| | | |
| | | if (MapUtil.getObject(issueConverterUsers, issueId) != null) { |
| | | List<DepartmentVo> departments = (List) MapUtil.getObject(issueConverterUsers, issueId); |
| | | departments.add(new DepartmentVo(MapUtil.getLong(issueUser, "id"), MapUtil.getString(issueUser, "departmentName"), MapUtil.getString(issueUser, "departmentDescription"))); |
| | | //List<UserVo> users = (List) MapUtil.getObject(issueConverterUsers, issueId); |
| | | //users.add(new UserVo(MapUtil.getLong(issueUser, "id"), MapUtil.getString(issueUser, "name"), CommonUtil.decryptAES128(MapUtil.getString(issueUser, "account")), MapUtil.getString(issueUser, "profile"))); |
| | | List<UserVo> users = (List) MapUtil.getObject(issueConverterUsers, issueId); |
| | | users.add(new UserVo(MapUtil.getLong(issueUser, "id"), MapUtil.getString(issueUser, "name"), CommonUtil.decryptAES128(MapUtil.getString(issueUser, "account")), MapUtil.getString(issueUser, "profile"))); |
| | | } else { |
| | | List<DepartmentVo> departments = Lists.newArrayList(new DepartmentVo(MapUtil.getLong(issueUser, "id"), MapUtil.getString(issueUser, "departmentName"), MapUtil.getString(issueUser, "departmentDescription"))); |
| | | issueConverterUsers.put(issueId, departments); |
| | | /*List<UserVo> users = Lists.newArrayList(new UserVo(MapUtil.getLong(issueUser, "id"), MapUtil.getString(issueUser, "name"), CommonUtil.decryptAES128(MapUtil.getString(issueUser, "account")), |
| | | List<UserVo> users = Lists.newArrayList(new UserVo(MapUtil.getLong(issueUser, "id"), MapUtil.getString(issueUser, "name"), CommonUtil.decryptAES128(MapUtil.getString(issueUser, "account")), |
| | | MapUtil.getString(issueUser, "profile"))); |
| | | issueConverterUsers.put(issueId, users);*/ |
| | | issueConverterUsers.put(issueId, users); |
| | | } |
| | | } |
| | | |
| | | // 이슈Vo에 담당자 정보를 셋팅 |
| | | for (IssueVo issueVo : issueVos) { |
| | | if (MapUtil.getObject(issueConverterUsers, String.valueOf(issueVo.getId())) != null) { |
| | | List<UserVo> userVos = (List) MapUtil.getObject(issueConverterUsers, String.valueOf(issueVo.getId())); |
| | | |
| | | issueVo.setUserVos(userVos); |
| | | } |
| | | |
| | | // 이슈 수정 권한을 갖고 있는지 확인 |
| | | if (this.checkHasPermission(issueVo, issueVo.getUserVos())) { |
| | | issueVo.setModifyPermissionCheck(Boolean.TRUE); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 이슈 담당부서 정보를 셋팅한다. |
| | | private void setIssueDepartmentList(List<IssueVo> issueVos, IssueCondition issueCondition) { |
| | | if (issueVos.size() < 1) { |
| | | return; |
| | | } |
| | | |
| | | List<Map<String, Object>> issueDepartments = this.issueMapper.findIssueDepartment(issueCondition); |
| | | Map<String, Object> issueConverterDepartments = new HashMap<>(); |
| | | |
| | | // 이슈에 해당하는 이슈 담당부서 정보 셋팅 |
| | | for (Map<String, Object> issueDepartment : issueDepartments) { |
| | | String issueId = MapUtil.getString(issueDepartment, "issueId"); |
| | | |
| | | if (MapUtil.getObject(issueConverterDepartments, issueId) != null) { |
| | | List<DepartmentVo> departments = (List) MapUtil.getObject(issueConverterDepartments, issueId); |
| | | departments.add(new DepartmentVo(MapUtil.getLong(issueDepartment, "id"), MapUtil.getString(issueDepartment, "departmentName"), MapUtil.getString(issueDepartment, "departmentDescription"))); |
| | | } else { |
| | | List<DepartmentVo> departments = Lists.newArrayList(new DepartmentVo(MapUtil.getLong(issueDepartment, "id"), MapUtil.getString(issueDepartment, "departmentName"), MapUtil.getString(issueDepartment, "departmentDescription"))); |
| | | issueConverterDepartments.put(issueId, departments); |
| | | } |
| | | } |
| | | |
| | | // 이슈Vo에 담당부서 정보를 셋팅 |
| | | for (IssueVo issueVo : issueVos) { |
| | | if (MapUtil.getObject(issueConverterUsers, String.valueOf(issueVo.getId())) != null) { |
| | | List<DepartmentVo> departmentVos = (List) MapUtil.getObject(issueConverterUsers, String.valueOf(issueVo.getId())); |
| | | if (MapUtil.getObject(issueConverterDepartments, String.valueOf(issueVo.getId())) != null) { |
| | | List<DepartmentVo> departmentVos = (List) MapUtil.getObject(issueConverterDepartments, String.valueOf(issueVo.getId())); |
| | | |
| | | issueVo.setDepartmentVos(departmentVos); |
| | | } |
| | |
| | | private void setIssueDepartment(Issue issue, IssueVo issueVo) { |
| | | List<DepartmentVo> departmentVos = Lists.newArrayList(); |
| | | |
| | | for (IssueUser issueUser : issue.getIssueUsers()) { |
| | | DepartmentVo departmentVo = ConvertUtil.copyProperties(issueUser.getDepartment(), DepartmentVo.class); |
| | | for (IssueDepartment issueDepartment : issue.getIssueDepartments()) { |
| | | DepartmentVo departmentVo = ConvertUtil.copyProperties(issueDepartment.getDepartment(), DepartmentVo.class); |
| | | departmentVo.setByName(departmentVo.getByName()); |
| | | departmentVos.add(departmentVo); |
| | | } |
| | |
| | | this.checkStartCompleteDate(issueForm.getStartDate(), issueForm.getCompleteDate()); |
| | | |
| | | // 담당자 유효성 체크 => 담당부서로 변경 |
| | | this.verifyIssueAssignee(project, issueForm); |
| | | //this.verifyIssueAssignee(project, issueForm); |
| | | |
| | | Issue issue = this.getIssue(issueForm.getId()); |
| | | |
| | |
| | | issue.setCompleteDate(issueForm.getCompleteDate()); |
| | | |
| | | this.issueRepository.saveAndFlush(issue); |
| | | // 담당부서 지정 |
| | | //this.issueUserService.modifyIssueUser(issue, project.getWorkspace(), issueForm.getUserIds()); |
| | | this.issueUserService.modifyIssueDepartment(issue, project.getWorkspace(), issueForm.getDepartmentIds()); |
| | | // 담당부서 지정 |
| | | if(issueForm.getDepartmentIds().size()>0){ |
| | | this.issueDepartmentService.modifyIssueDepartment(issue, project.getWorkspace(), issueForm.getDepartmentIds()); |
| | | } |
| | | |
| | | // multipartFile 을 file Map List 객체로 변경한다. |
| | | List<Map<String, Object>> convertFileMaps = this.convertMultipartFileToFile(multipartFiles); |
| | |
| | | for (Long departmentId : issueForm.getDepartmentIds()) { |
| | | boolean includeProject = false; |
| | | |
| | | for (ProjectRole projectRole : project.getProjectRoles()) { |
| | | /*for (ProjectRole projectRole : project.getProjectRoles()) { |
| | | ProjectRoleUser projectRoleUser = this.projectRoleUserService.findByProjectRoleIdAndDepartmentId(projectRole.getId(), departmentId); |
| | | |
| | | if (projectRoleUser != null) { |
| | |
| | | trustDepartmentIds.add(departmentId); |
| | | break; |
| | | } |
| | | } |
| | | }*/ |
| | | |
| | | // 데이터 보정 작업 - 프로젝트에서 제외된 사용자는 담당자에서 제외 될 수 있도록 처리 |
| | | /*if (!includeProject) { |
| | |
| | | } |
| | | }*/ |
| | | |
| | | /*// 이슈 수정 권한 체크 |
| | | // 이슈 수정 권한 체크 |
| | | private void verifyIssueModifyPermission(Long issueId) { |
| | | Issue issue = this.getIssue(issueId); |
| | | |
| | |
| | | } |
| | | |
| | | return userVos; |
| | | }*/ |
| | | } |
| | | |
| | | // 이슈 수정 권한을 갖고 있는지 확인 |
| | | private boolean checkHasPermission(IssueVo issueVo, List<UserVo> issueUserVos) { |
| | |
| | | // 변경 이력 정보 추출 |
| | | StringBuilder detectIssueChange = new StringBuilder(); |
| | | // 이슈 수정 권한 체크 |
| | | //this.verifyIssueModifyPermission(issueForm.getId()); |
| | | this.verifyIssueModifyPermission(issueForm.getId()); |
| | | Issue issue = this.getIssue(issueForm.getId()); |
| | | |
| | | IssueStatus issueStatus = this.issueStatusService.getIssueStatus(issueForm.getIssueStatusId()); |
| | |
| | | // 변경 이력 정보 추출 |
| | | StringBuilder detectIssueChange = new StringBuilder(); |
| | | // 이슈 수정 권한 체크 |
| | | //this.verifyIssueModifyPermission(issueForm.getId()); |
| | | this.verifyIssueModifyPermission(issueForm.getId()); |
| | | Issue issue = this.getIssue(issueForm.getId()); |
| | | issue.setProject(this.projectService.getProject(issueForm.getProjectId())); |
| | | |
| | |
| | | this.issueHistoryService.detectIssueManager(issue, issueForm, detectIssueChange); |
| | | |
| | | //this.issueUserService.modifyIssueUser(issue, issue.getProject().getWorkspace(), issueForm.getUserIds()); |
| | | this.issueUserService.modifyIssueDepartment(issue, issue.getProject().getWorkspace(), issueForm.getDepartmentIds()); |
| | | this.issueDepartmentService.modifyIssueDepartment(issue, issue.getProject().getWorkspace(), issueForm.getDepartmentIds()); |
| | | this.issueRepository.saveAndFlush(issue); |
| | | |
| | | // 이슈 이력 등록 |
| | |
| | | private Issue issueRemoves(Long issueId) { |
| | | Issue issue = this.getIssue(issueId); |
| | | // 이슈 수정 권한을 갖고 있는지 확인 |
| | | //this.verifyIssueModifyPermission(issueId); |
| | | this.verifyIssueModifyPermission(issueId); |
| | | |
| | | // 이슈 첨부 파일을 삭제한다. |
| | | if (issue.getAttachedFiles().size() > 0) { |
| | |
| | | |
| | | if (issueAssigneeMaps.size() > 0) { |
| | | // 이슈 담당자 벌크 등록 |
| | | this.issueUserService.insertIssueUser(issueAssigneeMaps); |
| | | //this.issueUserService.insertIssueUser(issueAssigneeMaps); |
| | | this.issueDepartmentService.insertIssueDepartment(issueAssigneeMaps); |
| | | } |
| | | } |
| | | |