src/main/java/kr/wisestone/owl/mapper/WidgetMapper.java | ●●●●● 패치 | 보기 | raw | blame | 히스토리 | |
src/main/java/kr/wisestone/owl/service/impl/WidgetServiceImpl.java | ●●●●● 패치 | 보기 | raw | blame | 히스토리 | |
src/main/resources/migration/V1_12__Alter_Table.sql | ●●●●● 패치 | 보기 | raw | blame | 히스토리 | |
src/main/resources/mybatis/query-template/issue-template.xml | ●●●●● 패치 | 보기 | raw | blame | 히스토리 | |
src/main/resources/mybatis/query-template/project-template.xml | ●●●●● 패치 | 보기 | raw | blame | 히스토리 | |
src/main/resources/mybatis/query-template/widget-template.xml | ●●●●● 패치 | 보기 | raw | blame | 히스토리 | |
src/main/webapp/scripts/app/issue/issueModifyDepartment.controller.js | ●●●●● 패치 | 보기 | raw | blame | 히스토리 | |
src/main/webapp/scripts/components/utils/autoComplete.controller.js | ●●●●● 패치 | 보기 | raw | blame | 히스토리 |
src/main/java/kr/wisestone/owl/mapper/WidgetMapper.java
@@ -102,4 +102,8 @@ List<Map<String, Object>> findProjectMemberIssueByDepartment(WidgetCondition widgetCondition); List<Map<String, Object>> findMyAssigneeIssueByDepartment(WidgetCondition makeWidgetCondition); List<Map<String, Object>> findByStandIssueTypeOfDepartment(WidgetCondition widgetCondition); List<Map<String, Object>> findByStandIssueStatusOfDepartment(WidgetCondition widgetCondition); } src/main/java/kr/wisestone/owl/service/impl/WidgetServiceImpl.java
@@ -782,10 +782,15 @@ } List<Map<String, Object>> results = Lists.newArrayList(); User user = this.webAppUtil.getLoginUserObject(); if (widgetCondition.getProjectIds().size() > 0) { SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); results = this.widgetMapper.findByStandIssueStatus(widgetCondition); if (this.userWorkspaceService.checkWorkspaceManager(user)) { results = this.widgetMapper.findByStandIssueStatus(widgetCondition); }else { results = this.widgetMapper.findByStandIssueStatusOfDepartment(widgetCondition); } } for (Map<String, Object> result : results) { @@ -809,10 +814,15 @@ public void findByStandIssueType(Map<String, Object> resJsonData, WidgetCondition widgetCondition, Boolean getWidgetCondition) { // 위젯 검색 조건을 얻어야 할 상황일 때 - 화면에서 탭을 눌러 데이터를 재요청했을 때 위젯 검색 조건을 만들고 전체 프로젝트 정보를 리턴한다. Map<String, Object> results = this.makeWidgetConditionAllProject(widgetCondition, getWidgetCondition); User user = this.webAppUtil.getLoginUserObject(); if (widgetCondition.getProjectId() != null) { SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition); List<Map<String, Object>> issueTypeIssues = this.widgetMapper.findByStandIssueType(widgetCondition); List<Map<String, Object>> issueTypeIssues = Lists.newArrayList(); if (this.userWorkspaceService.checkWorkspaceManager(user)) { issueTypeIssues = this.widgetMapper.findByStandIssueType(widgetCondition); } else { issueTypeIssues = this.widgetMapper.findByStandIssueTypeOfDepartment(widgetCondition); } // 이슈 정보 results.put("issues", issueTypeIssues); } else { src/main/resources/migration/V1_12__Alter_Table.sql
@@ -5,3 +5,7 @@ ALTER TABLE `company_field` ADD COLUMN `url` VARCHAR(255) NULL; ALTER TABLE `isp_field` ADD COLUMN `url` VARCHAR(255) NULL; ALTER TABLE `hosting_field` ADD COLUMN `url` VARCHAR(255) NULL; ALTER TABLE `issue_company` ADD COLUMN `url` VARCHAR(255) NULL; ALTER TABLE `issue_isp` ADD COLUMN `url` VARCHAR(255) NULL; ALTER TABLE `issue_hosting` ADD COLUMN `url` VARCHAR(255) NULL; src/main/resources/mybatis/query-template/issue-template.xml
@@ -241,7 +241,7 @@ INNER JOIN priority priority FORCE INDEX(PRIMARY) ON issue.priority_id = priority.id INNER JOIN severity severity FORCE INDEX(PRIMARY) ON issue.severity_id = severity.id INNER JOIN issue_department isd ON isd.issue_id = issue.id INNER JOIN department d ON d.id = isd.department_id INNER JOIN user_department ud ON ud.department_id = isd.department_id LEFT OUTER JOIN issue_custom_field_value issue_custom FORCE INDEX(issueIdIndex) ON issue.id = issue_custom.issue_id LEFT OUTER JOIN (SELECT issue_id, COUNT(id) as attachedFileCount FROM attached_file GROUP BY issue_id) temp_attached_file on (temp_attached_file.issue_id = issue.id) src/main/resources/mybatis/query-template/project-template.xml
@@ -74,11 +74,10 @@ project p INNER JOIN project_role pr on p.id = pr.project_id INNER JOIN project_role_department prd on prd.project_role_id = pr.id INNER JOIN department d on d.id = prd.department_id INNER JOIN user_department ud on ud.department_id = prd.department_id INNER JOIN workspace ws on ws.id = p.workspace_id LEFT JOIN project_closure pc ON p.id = pc.project_id WHERE if (pc.parent_project_id > -1, pc.parent_project_id, -1) = -1 AND prd.department_id = d.id <if test="name != '' and name != null"> AND p.name like CONCAT('%',#{name},'%') </if> @@ -89,9 +88,6 @@ #{item} </foreach> </when> <otherwise> AND 1 != 1 </otherwise> </choose> <choose> @@ -178,14 +174,23 @@ project p INNER JOIN project_role pr on p.id = pr.project_id INNER JOIN project_role_department prd on prd.project_role_id = pr.id INNER JOIN department d on d.id = prd.department_id INNER JOIN user_department ud on ud.department_id = prd.department_id INNER JOIN workspace ws on ws.id = p.workspace_id LEFT JOIN project_closure pc on p.id = pc.project_id WHERE prd.department_id = d.id WHERE prd.department_id = ud.id AND if (pc.parent_project_id > -1, pc.parent_project_id, -1) = -1 <if test="name != '' and name != null"> AND p.name like CONCAT('%',#{name},'%') </if> <choose> <when test="myDepartmentIds.size != 0"> AND prd.department_id IN <foreach collection="myDepartmentIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> </choose> <choose> <when test="roleTypes.size != 0"> @@ -466,9 +471,9 @@ project p INNER JOIN project_role pr on p.id = pr.project_id INNER JOIN project_role_department prd on prd.project_role_id = pr.id INNER JOIN department d on d.id = prd.department_id INNER JOIN user_department ud on ud.department_id = prd.department_id LEFT JOIN project_closure pc ON p.id = pc.project_id WHERE prd.department_id = d.id WHERE prd.department_id = ud.department_id AND if (pc.parent_project_id > -1, pc.parent_project_id, -1) = -1 AND p.workspace_id = #{workspaceId} <if test="name != '' and name != null"> @@ -511,7 +516,7 @@ project p INNER JOIN project_role pr on p.id = pr.project_id INNER JOIN project_role_department prd on prd.project_role_id = pr.id INNER JOIN department d on d.id = prd.department_id INNER JOIN user_department ud on ud.department_id = prd.department_id WHERE 1=1 AND p.id = #{id} </select> src/main/resources/mybatis/query-template/widget-template.xml
@@ -29,7 +29,7 @@ SELECT COUNT(i.id) FROM issue i INNER JOIN issue_department isd ON isd.issue_id = i.id INNER JOIN department d ON d.id = isd.department_id INNER JOIN user_department ud ON ud.department_id = isd.department_id WHERE EXISTS(SELECT 1 FROM issue_status iss WHERE iss.issue_status_type != 'CLOSE' AND i.issue_status_id = iss.id) <choose> @@ -73,7 +73,7 @@ SELECT COUNT(i.id) FROM issue i INNER JOIN issue_department isd ON isd.issue_id = i.id INNER JOIN department d ON d.id = isd.department_id INNER JOIN user_department ud ON ud.department_id = isd.department_id where exists(select 1 from issue_status iss where iss.id = i.issue_status_id and iss.issue_status_type != 'CLOSE') <choose> <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> @@ -153,7 +153,7 @@ SELECT COUNT(i.id) FROM issue i INNER JOIN issue_department isd ON isd.issue_id = i.id INNER JOIN department d ON d.id = isd.department_id INNER JOIN user_department ud ON ud.department_id = isd.department_id WHERE EXISTS(SELECT 1 FROM issue_department isd WHERE isd.issue_id = i.id <choose> <when test="myDepartmentIds.size != 0"> @@ -199,7 +199,7 @@ select count(i.id) as todayCount from issue i INNER JOIN issue_department isd ON isd.issue_id = i.id INNER JOIN department d ON d.id = isd.department_id INNER JOIN user_department ud ON ud.department_id = isd.department_id where i.register_id = #{loginUserId} <choose> @@ -308,7 +308,7 @@ count(*) as issueCount from issue i inner join issue_status iss on iss.id = i.issue_status_id INNER JOIN issue_department isd ON isd.issue_id = i.id INNER JOIN department d ON d.id = isd.department_id INNER JOIN user_department ud ON ud.department_id = isd.department_id where iss.issue_status_type = 'CLOSE' <choose> <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> @@ -535,7 +535,9 @@ parameterType="kr.wisestone.owl.web.condition.WidgetCondition"> select count(i.id) as todayCount from issue i where exists(select 1 from issue_department isd where isd.issue_id = i.id exists(select 1 from issue_department isd INNER JOIN user_department ud ON ud.department_id = isd.department_id where isd.issue_id = i.id <choose> <when test="myDepartmentIds.size != 0"> AND isd.department_id IN @@ -684,6 +686,7 @@ replace(SUBSTRING(i.register_date, 1, 10), "-", ".") as registerDate from issue i inner join issue_department isd on isd.issue_id = i.id INNER JOIN user_department ud ON ud.department_id = isd.department_id inner join issue_status iss on iss.id = i.issue_status_id inner join project p on p.id = i.project_id WHERE 1=1 @@ -1001,6 +1004,35 @@ group by p.id </select> <select id="findByStandIssueStatusOfDepartment" resultType="java.util.HashMap" parameterType="kr.wisestone.owl.web.condition.WidgetCondition"> select <choose> <when test="issueStatuses.size != 0"> <foreach collection="issueStatuses" item="item" index="index" separator="," open="" close=""> count(case when i.issue_status_id = #{item.id} then 1 end) as #{item.name} </foreach> </when> </choose> ,p.id, p.name as projectName from issue i inner join project p on p.id = i.project_id inner join issue_status iss on iss.id = i.issue_status_id INNER JOIN issue_department isd ON isd.issue_id = i.id INNER JOIN user_department ud ON ud.department_id = isd.department_id where 1=1 <choose> <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> AND i.project_id IN <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> </choose> group by p.id </select> <!-- 9번 위젯 끝 --> <!-- 11번 위젯 시작 --> @@ -1085,6 +1117,7 @@ from department d inner join project_role_department prd on prd.department_id = d.id INNER JOIN user_department ud ON ud.department_id = prd.department_id inner join project_role pr on pr.id = prd.project_role_id inner join project p on p.id = pr.project_id WHERE @@ -1243,8 +1276,18 @@ <select id="findByStandIssueType" resultType="java.util.HashMap" parameterType="kr.wisestone.owl.web.condition.WidgetCondition"> SELECT issue_type.name as name, COUNT(issue.id) as issueCount FROM issue issue INNER JOIN issue_type issue_type ON issue.issue_type_id = issue_type.id SELECT issue_type.name as name, COUNT(issue.id) as issueCount FROM issue INNER JOIN issue_type ON issue.issue_type_id = issue_type.id WHERE issue.project_id = #{projectId} GROUP BY issue_type.name </select> <select id="findByStandIssueTypeOfDepartment" resultType="java.util.HashMap" parameterType="kr.wisestone.owl.web.condition.WidgetCondition"> SELECT issue_type.name as name, COUNT(issue.id) as issueCount FROM issue INNER JOIN issue_type ON issue.issue_type_id = issue_type.id INNER JOIN issue_department isd ON isd.issue_id = issue.id INNER JOIN user_department ud ON ud.department_id = isd.department_id WHERE issue.project_id = #{projectId} GROUP BY issue_type.name </select> @@ -1289,6 +1332,7 @@ INNER JOIN severity s ON s.id = i.severity_id INNER JOIN issue_status iss ON iss.id = i.issue_status_id INNER JOIN issue_department isd on isd.issue_id = i.id INNER JOIN user_department ud ON ud.department_id = isd.department_id WHERE w.id = #{workspaceId} AND iss.issue_status_type != 'CLOSE' <choose> @@ -1363,6 +1407,7 @@ INNER JOIN severity s ON s.id = i.severity_id INNER JOIN issue_status iss ON iss.id = i.issue_status_id INNER JOIN issue_department isd on isd.issue_id = i.id INNER JOIN user_department ud ON ud.department_id = isd.department_id WHERE w.id = #{workspaceId} AND s.id = #{severityId} AND iss.issue_status_type != 'CLOSE' src/main/webapp/scripts/app/issue/issueModifyDepartment.controller.js
@@ -26,7 +26,8 @@ $scope.vm = { form : { departments : [], // 담당부서 projects : [] projects : [], issueTypeId : "" }, departmentName : "", // 부서 검색 autoCompletePage : { src/main/webapp/scripts/components/utils/autoComplete.controller.js
@@ -312,7 +312,8 @@ function getIssueDepartmentList(query, excludeList, page, callBack) { var conditions = { issueTypeId : $scope.vm.form.issueTypeId, //issueTypeId : $scope.vm.form.issueTypeId, issueTypeId : $rootScope.currentDetailIssueId, departmentName : query, userId : $rootScope.user.id, projectId : (function () {