| | |
| | | import kr.wisestone.owl.constant.MsgConstants; |
| | | import kr.wisestone.owl.domain.IssueStatus; |
| | | import kr.wisestone.owl.domain.Project; |
| | | import kr.wisestone.owl.domain.ProjectClosure; |
| | | import kr.wisestone.owl.domain.UserDepartment; |
| | | import kr.wisestone.owl.domain.enumType.ProjectType; |
| | | import kr.wisestone.owl.exception.OwlRuntimeException; |
| | | import kr.wisestone.owl.mapper.IssueMapper; |
| | | import kr.wisestone.owl.mapper.WidgetMapper; |
| | | import kr.wisestone.owl.repository.ProjectClosureRepository; |
| | | import kr.wisestone.owl.repository.UserDepartmentRepository; |
| | | import kr.wisestone.owl.service.*; |
| | | import kr.wisestone.owl.util.*; |
| | | import kr.wisestone.owl.vo.*; |
| | | import kr.wisestone.owl.web.condition.IssueCondition; |
| | | import kr.wisestone.owl.web.condition.ProjectCondition; |
| | | import kr.wisestone.owl.web.condition.WidgetCondition; |
| | | import kr.wisestone.owl.web.view.ExcelView; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | private ProjectService projectService; |
| | | |
| | | @Autowired |
| | | private ProjectClosureService projectClosureService; |
| | | |
| | | @Autowired |
| | | private IssueStatusService issueStatusService; |
| | | |
| | | @Autowired |
| | | private UserService userService; |
| | | |
| | | @Autowired |
| | | private UserDepartmentService userDepartmentService; |
| | | |
| | | @Autowired |
| | | private UserDepartmentRepository userDepartmentRepository; |
| | | |
| | | @Autowired |
| | | protected MessageAccessor messageAccessor; |
| | |
| | | |
| | | @Autowired |
| | | private UserWorkspaceService userWorkspaceService; |
| | | |
| | | @Autowired |
| | | private ProjectClosureRepository projectClosureRepository; |
| | | |
| | | |
| | | // 전체 위젯을 조회한다. |
| | |
| | | widgetCondition.setProjectIds(projectIds); |
| | | widgetCondition.setProjects(projects); |
| | | widgetCondition.setLoginUserId(this.webAppUtil.getLoginId()); |
| | | this.SetMyDepartmentId(widgetCondition); // 로그인 한 유저가 속해있는 부서 |
| | | widgetCondition.setCompleteDate(DateUtil.convertDateToStr(new Date())); |
| | | widgetCondition.setWorkspaceId(this.userService.getUser(this.webAppUtil.getLoginId()).getLastWorkspaceId()); |
| | | |
| | | return widgetCondition; |
| | | } |
| | | |
| | | void SetMyDepartmentId(WidgetCondition widgetCondition){ |
| | | Long loginId = widgetCondition.getLoginUserId(); |
| | | List<Long> myDepartmentIds = Lists.newArrayList(); |
| | | List<UserDepartment> myDepartments = this.userDepartmentRepository.findByUserId(loginId); |
| | | |
| | | if(myDepartments != null && myDepartments.size() > 0){ |
| | | for(UserDepartment myDepartment : myDepartments){ |
| | | myDepartmentIds.add(myDepartment.getDepartmentId()); |
| | | } |
| | | } |
| | | widgetCondition.setMyDepartmentIds(myDepartmentIds); |
| | | } |
| | | |
| | | void SetMeAndDownProjectIds(List<Long> parentProjectIds, WidgetCondition widgetCondition) { |
| | | List<Long> downProjectIds = Lists.newArrayList(); |
| | | if(parentProjectIds != null && parentProjectIds.size() > 0){ |
| | | for(Long parentProjectId : parentProjectIds){ |
| | | List<ProjectClosure> projectClosures = this.projectClosureRepository.findByParentProjectId(parentProjectId); //내 프로젝트ID가 상위프로젝트인게 있는지 |
| | | if(projectClosures != null && projectClosures.size() > 0){ |
| | | for(ProjectClosure projectClosure : projectClosures){ |
| | | if(projectClosure.getParentProject().getId().equals(parentProjectId)){ |
| | | downProjectIds.add(projectClosure.getProject().getId()); |
| | | //widgetCondition.setDownProjectIds(downProjectIds); |
| | | }else{ |
| | | downProjectIds.clear(); |
| | | } |
| | | } |
| | | }else{ |
| | | downProjectIds.clear(); |
| | | } |
| | | widgetCondition.setDownProjectIds(downProjectIds); |
| | | List<Long> meAndDownProjectIds = Lists.newArrayList(); |
| | | meAndDownProjectIds.addAll(widgetCondition.getProjectIds()); |
| | | meAndDownProjectIds.addAll(widgetCondition.getDownProjectIds()); |
| | | widgetCondition.setMeAndDownProjectIds(meAndDownProjectIds); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 전체 이슈 정보를 조회한다. |
| | |
| | | Long completeIssue = 0L; // 완료된 이슈 |
| | | |
| | | if (widgetCondition.getProjectIds().size() > 0) { |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | |
| | | remainIssue = this.widgetMapper.countRemainIssue(widgetCondition); // 잔여 이슈 |
| | | delayIssue = this.widgetMapper.countTodayDelayIssue(widgetCondition); // 지연된 이슈 |
| | | assigneeIssue = this.widgetMapper.countAssigneeIssue(widgetCondition); // 할당된 이슈 |
| | |
| | | List<Map<String, Object>> progressingProjectDetails = Lists.newArrayList(); |
| | | |
| | | if (widgetCondition.getProjectIds().size() > 0) { |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | if (this.userWorkspaceService.checkWorkspaceManager()) { |
| | | progressingProjectDetails = this.widgetMapper.findProjectProgressAll(widgetCondition); |
| | | } else { |
| | |
| | | Long totalCount = 0L; |
| | | |
| | | if (widgetCondition.getProjectIds().size() > 0) { |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | todayCount = this.widgetMapper.countTodayMyAssigneeIssue(widgetCondition); |
| | | assigneeIssues = this.widgetMapper.findMyAssigneeIssue(widgetCondition); |
| | | totalCount = this.widgetMapper.countMyAssigneeIssue(widgetCondition); |
| | |
| | | Long totalCount = 0L; |
| | | |
| | | if (widgetCondition.getProjectIds().size() > 0) { |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | |
| | | delayIssues = this.widgetMapper.findDelayIssue(widgetCondition); |
| | | totalCount = this.widgetMapper.countDelayIssue(widgetCondition); |
| | | } |
| | |
| | | Long totalCount = 0L; |
| | | |
| | | if (widgetCondition.getProjectIds().size() > 0) { |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | todayCount = this.widgetMapper.countTodayRegisterIssue(widgetCondition); |
| | | registerIssues = this.widgetMapper.findRegisterIssue(widgetCondition); |
| | | totalCount = this.widgetMapper.countRegisterIssue(widgetCondition); |
| | |
| | | Map<String, Object> results = this.makeWidgetConditionAllProject(widgetCondition, getWidgetCondition); |
| | | |
| | | if (widgetCondition.getProjectId() != null) { |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | List<Map<String, Object>> projectMemberIssues = this.widgetMapper.findProjectMemberIssue(widgetCondition); |
| | | |
| | | for (Map<String, Object> projectMemberIssue : projectMemberIssues) { |
| | | //String departmentName = MapUtil.getString(projectMemberIssue, "departmentName"); |
| | | Long completeCount = MapUtil.getLong(projectMemberIssue, "completeCount"); |
| | | Long remainCount = MapUtil.getLong(projectMemberIssue, "remainCount"); |
| | | projectMemberIssue.put("account", CommonUtil.decryptAES128(MapUtil.getString(projectMemberIssue, "account"))); |
| | | //projectMemberIssue.put("account", CommonUtil.decryptAES128(MapUtil.getString(projectMemberIssue, "account"))); |
| | | |
| | | // 프로젝트 진행률 정보를 구한다. |
| | | this.statisticsProject(completeCount, remainCount, projectMemberIssue, "projectProgressPercent"); |
| | |
| | | List<Map<String, Object>> assigneeRemainIssueMaps = Lists.newArrayList(); |
| | | |
| | | if (widgetCondition.getProjectIds().size() > 0) { |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | |
| | | registerCompleteIssueMaps = this.widgetMapper.findMyRegisterCompleteIssue(widgetCondition); |
| | | registerRemainIssueMaps = this.widgetMapper.findMyRegisterRemainIssue(widgetCondition); |
| | | assigneeCompleteIssueMaps = this.widgetMapper.findMyAssigneeCompleteIssue(widgetCondition); |
| | |
| | | Long totalCount = 0L; |
| | | |
| | | if (widgetCondition.getProjectIds().size() > 0) { |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | //countChangeStatusAndAssigneeIssue = this.widgetMapper.countChangeStatusAndAssigneeIssue(widgetCondition); |
| | | countChangeStatusAndDepartmentIssue = this.widgetMapper.countChangeStatusAndDepartmentIssue(widgetCondition); |
| | | riskIssues = this.widgetMapper.findRiskIssue(widgetCondition); |
| | |
| | | Long totalIssueCount = 0L; |
| | | |
| | | if (widgetCondition.getProjectIds().size() > 0) { |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | |
| | | dateCounts = this.widgetMapper.findIssueComplete(widgetCondition); |
| | | totalIssueCount = this.widgetMapper.countTotalIssue(widgetCondition); |
| | | } |
| | |
| | | List<Map<String, Object>> results = Lists.newArrayList(); |
| | | |
| | | if (widgetCondition.getProjectIds().size() > 0) { |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | results = this.widgetMapper.findByStandIssueStatus(widgetCondition); |
| | | } |
| | | |
| | |
| | | Map<String, Object> results = this.makeWidgetConditionAllProject(widgetCondition, getWidgetCondition); |
| | | |
| | | if (widgetCondition.getProjectId() != null) { |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | List<Map<String, Object>> issueTypeIssues = this.widgetMapper.findByStandIssueType(widgetCondition); |
| | | // 이슈 정보 |
| | | results.put("issues", issueTypeIssues); |
| | |
| | | Long totalCount = 0L; |
| | | |
| | | if (widgetCondition.getProjectIds().size() > 0) { |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | |
| | | severityCounts = this.widgetMapper.countSeverityIssue(widgetCondition); |
| | | severityIssues = this.widgetMapper.findSeverityIssues(widgetCondition); |
| | | totalCount = this.widgetMapper.countSearchIssue(widgetCondition); |
| | |
| | | excelInfo.setDatas(assigneeIssues); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("issueKey", this.messageAccessor.message("common.issueKey"), 6, ExportExcelAttrVo.ALIGN_CENTER)); // 이슈 번호 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("registerDate", this.messageAccessor.message("common.registerDate"), 8, 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("completeDate", this.messageAccessor.message("common.endDate"), 15, ExportExcelAttrVo.ALIGN_CENTER)); // 종료일 |
| | |
| | | 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("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)); // 담당자 |
| | |
| | | |
| | | // 내가 등록한 이슈 |
| | | if (widgetCondition.getProjectIds().size() > 0) { |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | registerIssues = this.widgetMapper.findRegisterIssue(widgetCondition); |
| | | } |
| | | |
| | |
| | | excelInfo.setDatas(registerIssues); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("issueKey", this.messageAccessor.message("common.issueKey"), 6, ExportExcelAttrVo.ALIGN_CENTER)); // 이슈 번호 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("issueStatusName", this.messageAccessor.message("common.status"), 6, 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("period", this.messageAccessor.message("common.period"), 15, ExportExcelAttrVo.ALIGN_CENTER)); // 기간 |
| | | return excelInfo; |
| | |
| | | widgetCondition.setPageSize(totalCount.intValue()); |
| | | |
| | | if (widgetCondition.getProjectIds().size() > 0) { |
| | | SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); |
| | | delayIssues = this.widgetMapper.findDelayIssue(widgetCondition); |
| | | } |
| | | |
| | |
| | | excelInfo.setDatas(delayIssues); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("issueKey", this.messageAccessor.message("common.issueKey"), 6, ExportExcelAttrVo.ALIGN_CENTER)); // 이슈 번호 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("delayDay", this.messageAccessor.message("common.delayDate"), 10, 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("period", this.messageAccessor.message("common.period"), 20, ExportExcelAttrVo.ALIGN_CENTER)); // 기간 |
| | |
| | | excelInfo.setFileName(this.messageAccessor.message("common.progressByMember")); // 멤버별 진행률 |
| | | excelInfo.setDatas(members); |
| | | |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("byName", this.messageAccessor.message("common.teamMember"), 15, ExportExcelAttrVo.ALIGN_LEFT)); // 팀원 |
| | | //excelInfo.addAttrInfos(new ExportExcelAttrVo("byName", this.messageAccessor.message("common.teamMember"), 15, ExportExcelAttrVo.ALIGN_LEFT)); // 팀원 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("projectName", this.messageAccessor.message("common.project"), 15, ExportExcelAttrVo.ALIGN_LEFT)); // 프로젝트 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("departmentName", this.messageAccessor.message("common.teamDepartment"), 15, ExportExcelAttrVo.ALIGN_LEFT)); // 담당부서 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("projectProgressPercent", this.messageAccessor.message("common.progressPercent"), 6, ExportExcelAttrVo.ALIGN_LEFT)); // 진행률 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("issueCount", this.messageAccessor.message("common.assignedIssue"), 10, ExportExcelAttrVo.ALIGN_CENTER)); // 담당 이슈 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("delayCount", this.messageAccessor.message("common.delaying"), 6, ExportExcelAttrVo.ALIGN_CENTER)); // 지연중 |
| | |
| | | excelInfo.setDatas(severityIssue); |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("issueKey", this.messageAccessor.message("common.issueKey"), 8, ExportExcelAttrVo.ALIGN_CENTER)); //이슈 번호 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("severityName", this.messageAccessor.message("common.importance"), 6, 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_CENTER)); // 이슈제목 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("issueStatusName", this.messageAccessor.message("common.status"), 6, ExportExcelAttrVo.ALIGN_CENTER)); //이슈 상태 |
| | | excelInfo.addAttrInfos(new ExportExcelAttrVo("period", this.messageAccessor.message("common.period"), 15, ExportExcelAttrVo.ALIGN_CENTER)); // 기간 |