| | |
| | | private ProjectService projectService; |
| | | |
| | | @Autowired |
| | | private ProjectRoleDepartmentService projectRoleDepartmentService; |
| | | |
| | | @Autowired |
| | | private ProjectClosureService projectClosureService; |
| | | |
| | | @Autowired |
| | |
| | | @Transactional(readOnly = true) |
| | | public WidgetCondition makeWidgetCondition() { |
| | | User user = this.webAppUtil.getLoginUserObject(); |
| | | UserLevel userLevel = this.userLevelService.getUserLevel(user.getUserLevel().getId()); |
| | | // 해당 워크스페이스에서 참여하고 있는 프로젝트 중 상태가 오픈인 프로젝트 |
| | | List<Map<String, Object>> projects = null; |
| | | if (this.userWorkspaceService.checkWorkspaceManager(user)) { |
| | | if (this.userWorkspaceService.checkWorkspaceManager(user) |
| | | || MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_PROJECT)) { |
| | | projects = this.projectService.findByWorkspaceManagerAll(); |
| | | } else { |
| | | projects = this.projectService.findByWorkspaceIdAndIncludeProjectAll(Lists.newArrayList("02"), ProjectType.BTS_PROJECT.toString()); |
| | |
| | | |
| | | void SetMeAndDownProjectIds(List<Long> parentProjectIds, WidgetCondition widgetCondition) { |
| | | List<Long> downProjectIds = Lists.newArrayList(); |
| | | List<Long> projectIds = Lists.newArrayList(); |
| | | projectIds.add(-1L); |
| | | User user = this.webAppUtil.getLoginUserObject(); |
| | | UserLevel userLevel = this.userLevelService.getUserLevel(user.getUserLevel().getId()); |
| | | if(parentProjectIds != null && parentProjectIds.size() > 0){ |
| | | for(Long parentProjectId : parentProjectIds){ |
| | | if(!this.userWorkspaceService.checkWorkspaceManager(user) || !MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_PROJECT)){ |
| | | Project project = this.projectService.getProject(parentProjectId); |
| | | List<Map<String, Object>> results = this.projectService.findByWorkspaceIdAndIncludeProject(Lists.newArrayList("01", "02", "03"), project.getProjectType().toString()); |
| | | if(results == null || results.size() < 1) { |
| | | widgetCondition.setMeAndDownProjectIds(projectIds); |
| | | break; |
| | | } |
| | | } |
| | | List<ProjectClosure> projectClosures = this.projectClosureRepository.findByParentProjectId(parentProjectId); //내 프로젝트ID가 상위프로젝트인게 있는지 |
| | | if(projectClosures != null && projectClosures.size() > 0){ |
| | | for(ProjectClosure projectClosure : projectClosures){ |
| | |
| | | if (widgetCondition.getProjectIds().size() > 0) { |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | if (this.userWorkspaceService.checkWorkspaceManager(user) |
| | | || MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_ISSUE_ALL)) { |
| | | || (MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_ISSUE))) { |
| | | remainIssue = this.widgetMapper.countRemainIssue(widgetCondition); // 잔여 이슈 |
| | | delayIssue = this.widgetMapper.countTodayDelayIssue(widgetCondition); // 지연된 이슈 |
| | | assigneeIssue = this.widgetMapper.countAssigneeIssue(widgetCondition); // 할당된 이슈 |
| | |
| | | SetMyDepartmentId(widgetCondition); |
| | | remainIssue = this.widgetMapper.countRemainIssueByDepartment(widgetCondition); // 잔여 이슈 |
| | | delayIssue = this.widgetMapper.countTodayDelayIssueByDepartment(widgetCondition); // 지연된 이슈 |
| | | assigneeIssue = this.widgetMapper.countAssigneeIssueByDepartment(widgetCondition); // 할당된 이슈 |
| | | registerIssue = this.widgetMapper.countTodayRegisterIssueByDepartment(widgetCondition); // 등록한 이슈 |
| | | //assigneeIssue = this.widgetMapper.countAssigneeIssueByDepartment(widgetCondition); // 할당된 이슈 |
| | | assigneeIssue = this.widgetMapper.countAssigneeIssue(widgetCondition); // 할당된 이슈 |
| | | //registerIssue = this.widgetMapper.countTodayRegisterIssueByDepartment(widgetCondition); // 등록한 이슈 |
| | | registerIssue = this.widgetMapper.countTodayRegisterIssue(widgetCondition); // 등록한 이슈 |
| | | //noAssigneeIssue = this.widgetMapper.countNoAssigneeIssueByDepartment(widgetCondition); // 일반 유저는 미할당 이슈 0개로 보이게 |
| | | completeIssue = this.widgetMapper.countCompleteIssueByDepartment(widgetCondition); // 완료된 이슈 |
| | | } |
| | |
| | | if (widgetCondition.getProjectIds().size() > 0) { |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | if (this.userWorkspaceService.checkWorkspaceManager(user) |
| | | || MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_PROJECT_ALL)) { |
| | | || MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_PROJECT)) { |
| | | progressingProjectDetails = this.widgetMapper.findProjectProgressAll(widgetCondition); |
| | | } else { |
| | | progressingProjectDetails = this.widgetMapper.findProjectProgress(widgetCondition); |
| | |
| | | |
| | | if (widgetCondition.getProjectIds().size() > 0) { |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | this.SetMyDepartmentId(widgetCondition); |
| | | todayCount = this.widgetMapper.countTodayMyAssigneeIssue(widgetCondition); |
| | | assigneeIssues = this.widgetMapper.findMyAssigneeIssue(widgetCondition); |
| | | totalCount = this.widgetMapper.countMyAssigneeIssue(widgetCondition); |
| | |
| | | |
| | | if (widgetCondition.getProjectIds().size() > 0) { |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | |
| | | this.SetMyDepartmentId(widgetCondition); |
| | | delayIssues = this.widgetMapper.findDelayIssue(widgetCondition); |
| | | totalCount = this.widgetMapper.countDelayIssue(widgetCondition); |
| | | } |
| | |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | List<Map<String, Object>> projectMemberIssues = Lists.newArrayList(); |
| | | if (this.userWorkspaceService.checkWorkspaceManager(user) |
| | | || MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_PROJECT_ALL)) { |
| | | || MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_ISSUE)) { |
| | | projectMemberIssues = this.widgetMapper.findProjectMemberIssue(widgetCondition); |
| | | } else { |
| | | projectMemberIssues = this.widgetMapper.findProjectMemberIssueByDepartment(widgetCondition); |
| | |
| | | if (widgetCondition.getProjectIds().size() > 0) { |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | if (this.userWorkspaceService.checkWorkspaceManager(user) |
| | | || MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_ISSUE_ALL)) { |
| | | || MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_ISSUE)) { |
| | | results = this.widgetMapper.findByStandIssueStatus(widgetCondition); |
| | | }else { |
| | | results = this.widgetMapper.findByStandIssueStatusOfDepartment(widgetCondition); |
| | |
| | | UserLevel userLevel = this.userLevelService.getUserLevel(user.getUserLevel().getId()); |
| | | if (widgetCondition.getProjectId() != null) { |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | if (widgetCondition.getMeAndDownProjectIds() != null) { |
| | | for (Long meAndProjectId : widgetCondition.getMeAndDownProjectIds()) { |
| | | if(meAndProjectId == -1L) { |
| | | results.replace("projectVos", null); |
| | | } |
| | | } |
| | | } |
| | | List<Map<String, Object>> issueTypeIssues = Lists.newArrayList(); |
| | | if (this.userWorkspaceService.checkWorkspaceManager(user) |
| | | || MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_ISSUE_ALL)) { |
| | | || MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_ISSUE)) { |
| | | issueTypeIssues = this.widgetMapper.findByStandIssueType(widgetCondition); |
| | | } else { |
| | | issueTypeIssues = this.widgetMapper.findByStandIssueTypeOfDepartment(widgetCondition); |
| | |
| | | // 위젯 검색 조건을 만들고 전체 프로젝트 정보를 리턴한다. |
| | | private Map<String, Object> makeWidgetConditionAllProject(WidgetCondition widgetCondition, boolean getWidgetCondition) { |
| | | Map<String, Object> results = new HashMap<>(); |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | |
| | | // 위젯 검색 조건을 얻어야 할 상황일 때 - 화면에서 탭을 눌러 데이터를 재요청했을 때 |
| | | if (getWidgetCondition) { |
| | |
| | | if (widgetCondition.getProjectIds().size() > 0) { |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | if (this.userWorkspaceService.checkWorkspaceManager(user) |
| | | || MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_ISSUE_ALL)) { |
| | | || MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_ISSUE)) { |
| | | severityCounts = this.widgetMapper.countSeverityIssue(widgetCondition); |
| | | severityIssues = this.widgetMapper.findSeverityIssues(widgetCondition); |
| | | totalCount = this.widgetMapper.countSearchIssue(widgetCondition); |
| | |
| | | |
| | | if (changeAssigneeType != null) { |
| | | if (changeAssigneeType.equals("1")) { |
| | | riskType = this.messageAccessor.message("common.reversalAssigneeUpdate"); // 빈번한 담당자 변경 |
| | | riskType = this.messageAccessor.message("common.reversalAssigneeTeamUpdate"); // 빈번한 담당부서 변경 |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (changeAssigneeType != null && changeIssueStatusType != null) { |
| | | if (changeAssigneeType.equals("1") && changeIssueStatusType.equals("1")) { |
| | | riskType = this.messageAccessor.message("common.reversalAssigneeUpdate") + '\n' + this.messageAccessor.message("common.reversalStatusUpdate"); // 빈번한 담당자 변경, 번복되는 상태 변경 |
| | | riskType = this.messageAccessor.message("common.reversalAssigneeTeamUpdate") + '\n' + this.messageAccessor.message("common.reversalStatusUpdate"); // 빈번한 담당부서 변경, 번복되는 상태 변경 |
| | | } |
| | | } |
| | | |
| | |
| | | excelInfo.setFileName(this.messageAccessor.message("common.managementRisk")); // 위험 관리 |
| | | excelInfo.setDatas(riskIssues); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("issueKey", this.messageAccessor.message("common.issueKey"), 6, ExportExcelAttrVo.ALIGN_CENTER)); // 이슈 번호 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("riskType", this.messageAccessor.message("common.division"), 15, ExportExcelAttrVo.ALIGN_CENTER)); // 구분 |
| | | //excelInfo.addAttrInfos(new ExportExcelAttrVo("riskType", this.messageAccessor.message("common.division"), 15, ExportExcelAttrVo.ALIGN_CENTER)); // 구분 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("projectName", this.messageAccessor.message("common.project"), 15, ExportExcelAttrVo.ALIGN_LEFT)); // 프로젝트 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("title", this.messageAccessor.message("common.issueTitle"), 40, ExportExcelAttrVo.ALIGN_LEFT)); // 이슈 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("issueStatusName", this.messageAccessor.message("common.status"), 6, ExportExcelAttrVo.ALIGN_CENTER)); // 상태 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("issueUsers", this.messageAccessor.message("common.assignee"), 20, ExportExcelAttrVo.ALIGN_CENTER)); // 담당자 |
| | | //excelInfo.addAttrInfos(new ExportExcelAttrVo("issueUsers", this.messageAccessor.message("common.assignee"), 20, ExportExcelAttrVo.ALIGN_CENTER)); // 담당자 |
| | | return excelInfo; |
| | | } |
| | | |