OWL ITS + 탐지시스템(인터넷 진흥원)
wyu
2021-11-23 e35b0c987bac49abbb77d4b31e41270cc566e54d
src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java
@@ -54,6 +54,9 @@
    private IssueRepository issueRepository;
    @Autowired
    private IssueTableConfigService issueTableConfigService;
    @Autowired
    private ProjectService projectService;
    @Autowired
@@ -112,6 +115,9 @@
    @Autowired
    private UserService userService;
    @Autowired
    private DepartmentService departmentService;
    @Autowired
    private IssueCommentService issueCommentService;
@@ -194,6 +200,8 @@
        this.verifyTitle(issueForm.getTitle());
        //  날짜 유효성 체크
        this.checkStartCompleteDate(issueForm.getStartDate(), issueForm.getCompleteDate());
        //  담당 부서 유효성 체크
        this.verifyIssueDepartment(project, issueForm);
        //  이슈 상태 유형이 '대기' 인 이슈 상태 가져오기
        IssueStatus issueStatus = this.issueStatusService.findByIssueStatusTypeIsReady(issueType.getWorkflow());
@@ -428,13 +436,13 @@
        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();
        /*StopWatch serviceStart = new StopWatch();
        serviceStart.start();*/
        Long totalCount = this.issueMapper.count(issueCondition);
        //  튜닝 전 - 1.1, 1.1, 1.3, 1.2
        serviceStart.stop();
        log.debug("serviceENd1 : " + serviceStart.getTime());
        /*serviceStart.stop();
        log.debug("serviceENd1 : " + serviceStart.getTime());*/
        int totalPage = (int) Math.ceil((totalCount - 1) / pageable.getPageSize()) + 1;
        //  이슈 아이디 초기화
@@ -853,6 +861,16 @@
        this.setIssueCompanyField(issue, issueVo);  //업체 정보 세팅
        this.setIssueIspField(issue, issueVo);  //ISP 정보 세팅
        this.setIssueHostingField(issue, issueVo);  //HOSTING 정보 세팅
        this.setParentIssue(issue,issueVo); //상위 이슈 정보 세팅
    }
    //  상위일감 정보 추가
    private void setParentIssue(Issue issue, IssueVo issueVo) {
        if(issue.getParentIssue() != null){
            issueVo.setParentIssueVo(ConvertUtil.copyProperties(issue.getParentIssue(), IssueVo.class));
        }
    }
    //  등록자 정보 추가
@@ -940,7 +958,7 @@
        for (IssueDepartment issueDepartment : issue.getIssueDepartments()) {
            DepartmentVo departmentVo = ConvertUtil.copyProperties(issueDepartment.getDepartment(), DepartmentVo.class);
            departmentVo.setByName(departmentVo.getByName());
            departmentVo.setByName(departmentVo.getDepartmentName());
            departmentVos.add(departmentVo);
        }
        issueVo.setDepartmentVos(departmentVos);
@@ -1142,7 +1160,7 @@
                //  데이터 보정 작업 - 프로젝트에서 제외된 사용자는 담당자에서 제외 될 수 있도록 처리
                if (!includeProject) {
                    throw new OwlRuntimeException(
                            this.messageAccessor.getMessage(MsgConstants.PROJECT_NOT_INCLUDE_USER));
                            this.messageAccessor.getMessage(MsgConstants.PROJECT_NOT_INCLUDE_DEPARTMENT));
                }
            }
            //  참여 확인된 부서로 담당부서 변경
@@ -1307,7 +1325,7 @@
    }
    //  이슈 담당자 변경
    /*@Override
    @Override
    @Transactional
    public void modifyIssueUser(IssueForm issueForm) {
        //  사용하고 있는 업무 공간이 활성 상태인지 확인한다. 사용 공간에서 로그인한 사용자가 비활성인지 확인한다.
@@ -1340,7 +1358,7 @@
        //  사용자 시스템 기능 사용 정보 수집
        log.info(ElasticSearchUtil.makeUserActiveHistoryMessage(this.webAppUtil.getLoginUser(), ElasticSearchConstants.ISSUE_USER_CHANGE));
    }*/
    }
    @Override
    @Transactional
@@ -1804,13 +1822,14 @@
            Map<String, Priority> priorityMaps = new HashMap<>();   //  우선 순위 모음
            Map<String, Severity> severityMaps = new HashMap<>();   //  중요도 모음
            Map<String, Object> userMaps = new HashMap<>(); //  사용자 모음
            Map<String, Object> departmentMaps = new HashMap<>(); //  부서 모음
            Map<String, CustomField> customFieldMaps = new HashMap<>();
            Map<String, IssueStatus> issueStatusReadyMaps = new HashMap<>();   //  상태 속성 '대기'인 이슈 상태
            Map<Long, Long> issueNumberMaps = new HashMap<>();  //  이슈 번호 모음
            Map<String, Long> issueTypeCustomFieldMaps = new HashMap<>(); //  이슈 타입 + 사용자 정의 필드 연결 정보
            Workspace workspace = this.workspaceService.getWorkspace(this.userService.getUser(this.webAppUtil.getLoginId()).getLastWorkspaceId());  //  이슈를 넣으려는 업무 공간
            //  이슈의 주요 속성을 map 에 저장하여 엑셀 import 에서 지정한 대상(이슈 속성)을 빠르게 찾을 수 있게 한다.
            this.IssueAttributeMapToList(projectMaps, issueTypeMaps, priorityMaps, severityMaps, userMaps, customFieldMaps, issueNumberMaps, issueTypeCustomFieldMaps, issueStatusReadyMaps);
            this.IssueAttributeMapToList(projectMaps, issueTypeMaps, priorityMaps, severityMaps, userMaps, departmentMaps, customFieldMaps, issueNumberMaps, issueTypeCustomFieldMaps, issueStatusReadyMaps);
            //  0.237 - 0.230
            List<IssueForm> issueForms = Lists.newArrayList();
@@ -2003,7 +2022,7 @@
    //  이슈의 주요 속성을 map 에 저장하여 엑셀 import 에서 지정한 대상(이슈 속성)을 빠르게 찾을 수 있게 한다.
    private void IssueAttributeMapToList(Map<String, Project> projectMaps, Map<String, IssueType> issueTypeMaps, Map<String, Priority> priorityMaps, Map<String, Severity> severityMaps,
                                         Map<String, Object> userMaps, Map<String, CustomField> customFieldMaps, Map<Long, Long> issueNumberMaps, Map<String, Long> issueTypeCustomFieldMaps, Map<String, IssueStatus> issueStatusReadyMaps) {
                                         Map<String, Object> userMaps, Map<String, Object> departmentMaps, Map<String, CustomField> customFieldMaps, Map<Long, Long> issueNumberMaps, Map<String, Long> issueTypeCustomFieldMaps, Map<String, IssueStatus> issueStatusReadyMaps) {
        //  프로젝트 키로 바로 찾을 수 있게 준비
        List<Project> projects = this.projectService.findByWorkspaceId();
        List<Long> projectIds = Lists.newArrayList();
@@ -2029,6 +2048,14 @@
            }
            userMaps.put(project.getProjectKey(), userMap);
            //  프로젝트에 참여하는 부서 정보
            List<Map<String, Object>> departments = this.departmentService.findProjectDepartment(project);
            List<Long> departmentList = Lists.newArrayList();
            //  부서 정보를 저장
            for (Map<String, Object> department : departments) {
                departmentList.add(MapUtil.getLong(department, "departmentId"));
            }
        }
        //  이슈 유형을 바로 찾을 수 있게 준비