From 1bf54ac4463cc9a821bb818f6c8cfb01d981e91a Mon Sep 17 00:00:00 2001
From: 이민희 <mhlee@maprex.co.kr>
Date: 목, 23 12월 2021 15:51:29 +0900
Subject: [PATCH] - '이슈관리' 권한은 내가 속해있는 프로젝트의 이슈에 대해서만 관리 권한이 있음 - 일반 사용자 검색 문제 해결 - 이슈리스트 툴팁 재추가

---
 src/main/java/kr/wisestone/owl/service/impl/WidgetServiceImpl.java |  216 ++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 195 insertions(+), 21 deletions(-)

diff --git a/src/main/java/kr/wisestone/owl/service/impl/WidgetServiceImpl.java b/src/main/java/kr/wisestone/owl/service/impl/WidgetServiceImpl.java
index 6e82dd0..a17c3b5 100644
--- a/src/main/java/kr/wisestone/owl/service/impl/WidgetServiceImpl.java
+++ b/src/main/java/kr/wisestone/owl/service/impl/WidgetServiceImpl.java
@@ -4,18 +4,19 @@
 import kr.wisestone.owl.common.ExcelConditionCheck;
 import kr.wisestone.owl.common.MessageAccessor;
 import kr.wisestone.owl.constant.Constants;
+import kr.wisestone.owl.constant.MngPermission;
 import kr.wisestone.owl.constant.MsgConstants;
-import kr.wisestone.owl.domain.IssueStatus;
-import kr.wisestone.owl.domain.Project;
+import kr.wisestone.owl.domain.*;
 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;
@@ -53,10 +54,25 @@
     private ProjectService projectService;
 
     @Autowired
+    private ProjectRoleDepartmentService projectRoleDepartmentService;
+
+    @Autowired
+    private ProjectClosureService projectClosureService;
+
+    @Autowired
     private IssueStatusService issueStatusService;
 
     @Autowired
     private UserService userService;
+
+    @Autowired
+    private UserLevelService userLevelService;
+
+    @Autowired
+    private UserDepartmentService userDepartmentService;
+
+    @Autowired
+    private UserDepartmentRepository userDepartmentRepository;
 
     @Autowired
     protected MessageAccessor messageAccessor;
@@ -72,6 +88,9 @@
 
     @Autowired
     private UserWorkspaceService userWorkspaceService;
+
+    @Autowired
+    private ProjectClosureRepository projectClosureRepository;
 
 
     //  �쟾泥� �쐞�젽�쓣 議고쉶�븳�떎.
@@ -151,9 +170,12 @@
     @Override
     @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()) {
+        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());
@@ -173,10 +195,62 @@
         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();
+        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(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);
+            }
+        }
     }
 
     //  �쟾泥� �씠�뒋 �젙蹂대�� 議고쉶�븳�떎.
@@ -190,13 +264,30 @@
         Long delayIssue = 0L; //  吏��뿰�맂 �씠�뒋
         Long completeIssue = 0L; // �셿猷뚮맂 �씠�뒋
 
+        widgetCondition.setLoginUserId(this.webAppUtil.getLoginId());
+        widgetCondition.setWorkspaceId(this.userService.getUser(this.webAppUtil.getLoginId()).getLastWorkspaceId());
+        User user = this.webAppUtil.getLoginUserObject();
+        UserLevel userLevel = this.userLevelService.getUserLevel(user.getUserLevel().getId());
+
         if (widgetCondition.getProjectIds().size() > 0) {
-            remainIssue = this.widgetMapper.countRemainIssue(widgetCondition);   //  �옍�뿬 �씠�뒋
-            delayIssue = this.widgetMapper.countTodayDelayIssue(widgetCondition); //  吏��뿰�맂 �씠�뒋
-            assigneeIssue = this.widgetMapper.countAssigneeIssue(widgetCondition);   //  �븷�떦�맂 �씠�뒋
-            registerIssue = this.widgetMapper.countTodayRegisterIssue(widgetCondition);    //  �벑濡앺븳 �씠�뒋
-            noAssigneeIssue = this.widgetMapper.countNoAssigneeIssue(widgetCondition);   //  誘명븷�떦 �씠�뒋
-            completeIssue = this.widgetMapper.countCompleteIssue(widgetCondition); // �셿猷뚮맂 �씠�뒋
+            SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition);
+            if (this.userWorkspaceService.checkWorkspaceManager(user)
+                    || (MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_ISSUE))) {
+                remainIssue = this.widgetMapper.countRemainIssue(widgetCondition);   //  �옍�뿬 �씠�뒋
+                delayIssue = this.widgetMapper.countTodayDelayIssue(widgetCondition); //  吏��뿰�맂 �씠�뒋
+                assigneeIssue = this.widgetMapper.countAssigneeIssue(widgetCondition);   //  �븷�떦�맂 �씠�뒋
+                registerIssue = this.widgetMapper.countTodayRegisterIssue(widgetCondition);    //  �벑濡앺븳 �씠�뒋
+                noAssigneeIssue = this.widgetMapper.countNoAssigneeIssue(widgetCondition);   //  誘명븷�떦 �씠�뒋
+                completeIssue = this.widgetMapper.countCompleteIssue(widgetCondition); // �셿猷뚮맂 �씠�뒋
+            } else {
+                SetMyDepartmentId(widgetCondition);
+                remainIssue = this.widgetMapper.countRemainIssueByDepartment(widgetCondition);   //  �옍�뿬 �씠�뒋
+                delayIssue = this.widgetMapper.countTodayDelayIssueByDepartment(widgetCondition); //  吏��뿰�맂 �씠�뒋
+                assigneeIssue = this.widgetMapper.countAssigneeIssueByDepartment(widgetCondition);   //  �븷�떦�맂 �씠�뒋
+                registerIssue = this.widgetMapper.countTodayRegisterIssueByDepartment(widgetCondition);    //  �벑濡앺븳 �씠�뒋
+                //noAssigneeIssue = this.widgetMapper.countNoAssigneeIssueByDepartment(widgetCondition);   //  �씪諛� �쑀���뒗 誘명븷�떦 �씠�뒋 0媛쒕줈 蹂댁씠寃�
+                completeIssue = this.widgetMapper.countCompleteIssueByDepartment(widgetCondition); // �셿猷뚮맂 �씠�뒋
+            }
         }
 
         Map<String, Object> results = new HashMap<>();
@@ -220,8 +311,13 @@
     public void findProjectProgress(Map<String, Object> resJsonData, WidgetCondition widgetCondition) {
         List<Map<String, Object>> progressingProjectDetails = Lists.newArrayList();
 
+        User user = this.webAppUtil.getLoginUserObject();
+        UserLevel userLevel = this.userLevelService.getUserLevel(user.getUserLevel().getId());
+
         if (widgetCondition.getProjectIds().size() > 0) {
-            if (this.userWorkspaceService.checkWorkspaceManager()) {
+            SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition);
+            if (this.userWorkspaceService.checkWorkspaceManager(user)
+                    || MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_PROJECT)) {
                 progressingProjectDetails = this.widgetMapper.findProjectProgressAll(widgetCondition);
             } else {
                 progressingProjectDetails = this.widgetMapper.findProjectProgress(widgetCondition);
@@ -320,11 +416,12 @@
         Long totalCount = 0L;
 
         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);
         }
-
 
         //  0.156 - 0.166
         int totalPage = (int) Math.ceil((totalCount - 1) / pageable.getPageSize()) + 1;
@@ -350,6 +447,8 @@
         Long totalCount = 0L;
 
         if (widgetCondition.getProjectIds().size() > 0) {
+            SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition);
+
             delayIssues = this.widgetMapper.findDelayIssue(widgetCondition);
             totalCount = this.widgetMapper.countDelayIssue(widgetCondition);
         }
@@ -396,6 +495,7 @@
         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);
@@ -419,13 +519,26 @@
         //  �쐞�젽 寃��깋 議곌굔�쓣 留뚮뱾怨� �쟾泥� �봽濡쒖젥�듃 �젙蹂대�� 由ы꽩�븳�떎.
         Map<String, Object> results = this.makeWidgetConditionAllProject(widgetCondition, getWidgetCondition);
 
+        widgetCondition.setLoginUserId(this.webAppUtil.getLoginId());
+        widgetCondition.setWorkspaceId(this.userService.getUser(this.webAppUtil.getLoginId()).getLastWorkspaceId());
+        User user = this.webAppUtil.getLoginUserObject();
+        UserLevel userLevel = this.userLevelService.getUserLevel(user.getUserLevel().getId());
+
         if (widgetCondition.getProjectId() != null) {
-            List<Map<String, Object>> projectMemberIssues = this.widgetMapper.findProjectMemberIssue(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_ISSUE)) {
+                projectMemberIssues = this.widgetMapper.findProjectMemberIssue(widgetCondition);
+            } else {
+                projectMemberIssues = this.widgetMapper.findProjectMemberIssueByDepartment(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");
@@ -449,6 +562,8 @@
         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);
@@ -524,6 +639,7 @@
         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);
@@ -614,6 +730,8 @@
         Long totalIssueCount = 0L;
 
         if (widgetCondition.getProjectIds().size() > 0) {
+            SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition);
+
             dateCounts = this.widgetMapper.findIssueComplete(widgetCondition);
             totalIssueCount = this.widgetMapper.countTotalIssue(widgetCondition);
         }
@@ -692,9 +810,17 @@
         }
 
         List<Map<String, Object>> results = Lists.newArrayList();
+        User user = this.webAppUtil.getLoginUserObject();
+        UserLevel userLevel = this.userLevelService.getUserLevel(user.getUserLevel().getId());
 
         if (widgetCondition.getProjectIds().size() > 0) {
-            results = this.widgetMapper.findByStandIssueStatus(widgetCondition);
+            SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition);
+            if (this.userWorkspaceService.checkWorkspaceManager(user)
+                    || MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_ISSUE)) {
+                results = this.widgetMapper.findByStandIssueStatus(widgetCondition);
+            }else {
+                results = this.widgetMapper.findByStandIssueStatusOfDepartment(widgetCondition);
+            }
         }
 
         for (Map<String, Object> result : results) {
@@ -718,9 +844,24 @@
     public void findByStandIssueType(Map<String, Object> resJsonData, WidgetCondition widgetCondition, Boolean getWidgetCondition) {
         //  �쐞�젽 寃��깋 議곌굔�쓣 �뼸�뼱�빞 �븷 �긽�솴�씪 �븣 - �솕硫댁뿉�꽌 �꺆�쓣 �닃�윭 �뜲�씠�꽣瑜� �옱�슂泥��뻽�쓣 �븣 �쐞�젽 寃��깋 議곌굔�쓣 留뚮뱾怨� �쟾泥� �봽濡쒖젥�듃 �젙蹂대�� 由ы꽩�븳�떎.
         Map<String, Object> results = this.makeWidgetConditionAllProject(widgetCondition, getWidgetCondition);
-
+        User user = this.webAppUtil.getLoginUserObject();
+        UserLevel userLevel = this.userLevelService.getUserLevel(user.getUserLevel().getId());
         if (widgetCondition.getProjectId() != null) {
-            List<Map<String, Object>> issueTypeIssues = this.widgetMapper.findByStandIssueType(widgetCondition);
+            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)) {
+                issueTypeIssues = this.widgetMapper.findByStandIssueType(widgetCondition);
+            } else {
+                issueTypeIssues = this.widgetMapper.findByStandIssueTypeOfDepartment(widgetCondition);
+            }
             //  �씠�뒋 �젙蹂�
             results.put("issues", issueTypeIssues);
         } else {
@@ -733,6 +874,7 @@
     //  �쐞�젽 寃��깋 議곌굔�쓣 留뚮뱾怨� �쟾泥� �봽濡쒖젥�듃 �젙蹂대�� 由ы꽩�븳�떎.
     private Map<String, Object> makeWidgetConditionAllProject(WidgetCondition widgetCondition, boolean getWidgetCondition) {
         Map<String, Object> results = new HashMap<>();
+        SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition);
 
         //  �쐞�젽 寃��깋 議곌굔�쓣 �뼸�뼱�빞 �븷 �긽�솴�씪 �븣 - �솕硫댁뿉�꽌 �꺆�쓣 �닃�윭 �뜲�씠�꽣瑜� �옱�슂泥��뻽�쓣 �븣
         if (getWidgetCondition) {
@@ -793,10 +935,24 @@
         List<Map<String, Object>> severityIssues = Lists.newArrayList();
         Long totalCount = 0L;
 
+        widgetCondition.setLoginUserId(this.webAppUtil.getLoginId());
+        widgetCondition.setWorkspaceId(this.userService.getUser(this.webAppUtil.getLoginId()).getLastWorkspaceId());
+        User user = this.webAppUtil.getLoginUserObject();
+        UserLevel userLevel = this.userLevelService.getUserLevel(user.getUserLevel().getId());
+
         if (widgetCondition.getProjectIds().size() > 0) {
-            severityCounts = this.widgetMapper.countSeverityIssue(widgetCondition);
-            severityIssues = this.widgetMapper.findSeverityIssues(widgetCondition);
-            totalCount = this.widgetMapper.countSearchIssue(widgetCondition);
+            SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition);
+            if (this.userWorkspaceService.checkWorkspaceManager(user)
+                    || MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_ISSUE)) {
+                severityCounts = this.widgetMapper.countSeverityIssue(widgetCondition);
+                severityIssues = this.widgetMapper.findSeverityIssues(widgetCondition);
+                totalCount = this.widgetMapper.countSearchIssue(widgetCondition);
+            }else {
+                SetMyDepartmentId(widgetCondition);
+                severityCounts = this.widgetMapper.countSeverityIssueByDepartment(widgetCondition);
+                severityIssues = this.widgetMapper.findSeverityIssuesByDepartment(widgetCondition);
+                totalCount = this.widgetMapper.countSearchIssueByDepartment(widgetCondition);
+            }
         }
 
         Long criticalIssueCount = 0L, majorIssueCount = 0L, minorIssueCount = 0L, trivialIssueCount = 0L;
@@ -954,10 +1110,19 @@
     //  �굹�뿉寃� �븷�떦�맂 �씠�뒋 �젙蹂대�� �뿊��濡� �떎�슫濡쒕뱶 �븳�떎.
     private ExportExcelVo downloadExcelMyAssigneeIssue() {
         WidgetCondition widgetCondition = this.makeWidgetCondition();
+
+        /*widgetCondition.setLoginUserId(this.webAppUtil.getLoginId());
+        widgetCondition.setWorkspaceId(this.userService.getUser(this.webAppUtil.getLoginId()).getLastWorkspaceId());
+        User user = this.webAppUtil.getLoginUserObject();*/
+
         //  �굹�뿉寃� �븷�떦�맂 �씠�뒋
         List<Map<String, Object>> assigneeIssues = Lists.newArrayList();
         if (widgetCondition.getProjectIds().size() > 0) {
+            //if (this.userWorkspaceService.checkWorkspaceManager(user)) {
             assigneeIssues = this.widgetMapper.findMyAssigneeIssue(this.makeWidgetCondition());
+            /*} else {
+                assigneeIssues = this.widgetMapper.findMyAssigneeIssueByDepartment(this.makeWidgetCondition());
+            }*/
         }
 
         ExportExcelVo excelInfo = new ExportExcelVo();
@@ -965,6 +1130,7 @@
         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)); // 醫낅즺�씪
@@ -1032,6 +1198,7 @@
         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)); // �떞�떦�옄
@@ -1053,6 +1220,7 @@
 
         //  �궡媛� �벑濡앺븳 �씠�뒋
         if (widgetCondition.getProjectIds().size() > 0) {
+            SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition);
             registerIssues = this.widgetMapper.findRegisterIssue(widgetCondition);
         }
 
@@ -1064,6 +1232,7 @@
         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;
@@ -1094,6 +1263,7 @@
         widgetCondition.setPageSize(totalCount.intValue());
 
         if (widgetCondition.getProjectIds().size() > 0) {
+            SetMeAndDownProjectIds(widgetCondition.getProjectIds(), widgetCondition);
             delayIssues = this.widgetMapper.findDelayIssue(widgetCondition);
         }
 
@@ -1108,6 +1278,7 @@
         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)); // 湲곌컙
@@ -1149,7 +1320,9 @@
         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)); // 吏��뿰以�
@@ -1226,6 +1399,7 @@
         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)); // 湲곌컙

--
Gitblit v1.8.0