OWL ITS + 탐지시스템(인터넷 진흥원)
src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java
@@ -289,7 +289,7 @@
                    issueApiForm.addUseIssueCustomFieldId(customFieldApiOverlap.getCustomField().getId());
                }
                // 중복된 이슈검색
                // 종료상태가 아닌 중복된 상위 이슈검색
                List<Issue> issues = this.findIssue(issueApiForm, customFieldApiOverlaps, user.getId());
                int size = issues.size();
                if (size > 0) {
@@ -446,6 +446,7 @@
            issueCustomFieldValueCondition.setUseValue(concatUseValue);
            issueCustomFieldValueCondition.setUseValues(userValues);
            issueCustomFieldValueCondition.setIssueTypeId(issueApiform.getIssueTypeId());
            issueCustomFieldValueCondition.setIssueStatusType("CLOSE");
            List<Map<String, Object>> results = this.issueMapper.findByCustomFieldValue(issueCustomFieldValueCondition);
            if (results != null && results.size() > 0) {
                for (Map<String, Object> result : results) {
@@ -944,7 +945,7 @@
//        if (!this.userWorkspaceService.checkWorkspaceManager(user)
//                && !MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_ISSUE)) { //최고관리자 & 프로젝트,이슈 관리자 일 경우 모든 이슈 보기
//            this.SetMyDepartmentId(issueCondition);
            //this.SetAllDepartmentId(issueCondition);
        //this.SetAllDepartmentId(issueCondition);
//        } /*else{
//            results = this.issueMapper.findByDepartment(issueCondition);
//            totalCount = this.issueMapper.countByDepartment(issueCondition);
@@ -1471,17 +1472,22 @@
    //  이슈 상세 정보를 조회한다.
    @Override
    @Transactional(readOnly = true)
    public void detailIssue(Map<String, Object> resJsonData, IssueCondition issueCondition, Pageable relPageable, Pageable downPageable) {
    public void detailIssue(Map<String, Object> resJsonData, IssueCondition issueCondition) {
        IssueVo issueVo = new IssueVo();
        Pageable relPageable = issueCondition.getRelPageable();
        Pageable downPageable = issueCondition.getDownPageable();
        if (issueCondition.getId() != null) {
            Issue issue = this.getIssue(issueCondition.getId());
            issueVo = ConvertUtil.copyProperties(issue, IssueVo.class);
            User user = this.webAppUtil.getLoginUserObject();
            issueVo.setRelPage(relPageable.getPageNumber() * relPageable.getPageSize());
            issueVo.setRelPageSize(relPageable.getPageSize());
            issueVo.setRelPageNumber(relPageable.getPageNumber());
            issueVo.setRelPageSize(relPageable.getPageSize());
            issueVo.setRelPage(relPageable.getPageNumber() * relPageable.getPageSize());
            issueVo.setDownPageNumber(downPageable.getPageNumber());
            issueVo.setDownPage(downPageable.getPageNumber() * downPageable.getPageSize());
            issueVo.setDownPageSize(downPageable.getPageSize());
@@ -1509,19 +1515,10 @@
                    break;
            }
        }
        Long relTotalCount = issueVo.getRelTotalCount();
        int relTotalPage = issueVo.getRelTotalPage();
        Long downTotalCount = issueVo.getDownTotalCount();
        int downTotalPage = issueVo.getDownTotalPage();
        //  사용자 시스템 기능 사용 정보 수집
        log.info(ElasticSearchUtil.makeUserActiveHistoryMessage(this.webAppUtil.getLoginUser(), ElasticSearchConstants.ISSUE_DETAIL));
        resJsonData.put(Constants.RES_KEY_CONTENTS, issueVo);
        resJsonData.put(Constants.REQ_KEY_RELATION_ISSUE_PAGE_VO, new ResPage(relPageable.getPageNumber(), relPageable.getPageSize(),
                relTotalPage, relTotalCount));
        resJsonData.put(Constants.REQ_KEY_DOWN_ISSUE_PAGE_VO, new ResPage(downPageable.getPageNumber(), downPageable.getPageSize(),
                downTotalPage, downTotalCount));
    }
    // 테이블 설정 셋팅
@@ -2969,7 +2966,7 @@
            Workspace workspace = this.workspaceService.getWorkspace(this.userService.getUser(this.webAppUtil.getLoginId()).getLastWorkspaceId());  //  이슈를 넣으려는 업무 공간
            //  이슈의 주요 속성을 map 에 저장하여 엑셀 import 에서 지정한 대상(이슈 속성)을 빠르게 찾을 수 있게 한다.
            this.IssueAttributeMapToList(priorityMaps, severityMaps, departmentMaps, customFieldMaps, issueTypeCustomFieldMaps);
            this.IssueAttributeMapToList(issueForm, priorityMaps, severityMaps, departmentMaps, customFieldMaps, issueTypeCustomFieldMaps);
            //  0.237 - 0.230
            List<IssueForm> issueForms = Lists.newArrayList();
@@ -3050,7 +3047,9 @@
                issue.setIssueType(issueType);
                issue.setProject(project);
                issue.setIssueNumber(issueNumber);
                issue.setParentIssue(this.getIssue(saveIssueForm.getParentIssueId()));
                if (saveIssueForm.getParentIssueId() != null && saveIssueForm.getParentIssueId() > -1) {
                    issue.setParentIssue(this.getIssue(saveIssueForm.getParentIssueId()));
                }
                issue = this.issueRepository.saveAndFlush(issue);
@@ -3061,10 +3060,12 @@
                issueDepartment.setWorkspace(workspace);
                List<Long> departmentsIds = this.workflowDepartmentService.findFirstDepartmentIds(workflow);
                for (Long departmentId : departmentsIds) {
                    issueDepartment.setDepartment(this.departmentService.getDepartment(departmentId));
                if (departmentsIds != null && departmentsIds.size() > 0) {
                    for (Long departmentId : departmentsIds) {
                        issueDepartment.setDepartment(this.departmentService.getDepartment(departmentId));
                    }
                    issue.addIssueDepartment(issueDepartment);
                }
                issue.addIssueDepartment(issueDepartment);
                saveIssueForm.setIssueStatusId(issueStatus.getId());
            }
@@ -3209,8 +3210,16 @@
    }
    //  이슈의 주요 속성을 map 에 저장하여 엑셀 import 에서 지정한 대상(이슈 속성)을 빠르게 찾을 수 있게 한다.
    private void IssueAttributeMapToList(Map<String, Priority> priorityMaps, Map<String, Severity> severityMaps,
    private void IssueAttributeMapToList(IssueForm issueForm, Map<String, Priority> priorityMaps, Map<String, Severity> severityMaps,
                                         Map<String, DepartmentVo> departmentMaps, Map<String, CustomField> customFieldMaps,Map<String, Long> issueTypeCustomFieldMaps) {
        Project project = this.projectService.getProject(issueForm.getProjectId());
        for (IssueTypeCustomField issueTypeCustomField : project.getIssueTypeCustomFields()) {
            //  빠르게 찾기 위해 이슈 타입 아이디 + 사용자 정의 필드 아이디를 키로 한다.
            String makeKey = issueTypeCustomField.getIssueType().getId().toString() + issueTypeCustomField.getCustomField().getId().toString();
            issueTypeCustomFieldMaps.put(makeKey, issueTypeCustomField.getId());
        }
        //  우선순위를 바로 찾을 수 있게 준비
        List<Priority> priorities = this.priorityService.findByWorkspaceId();
@@ -3395,7 +3404,7 @@
            //  값이 공백이면 중지
            String cellValue = CommonUtil.convertExcelStringToCell(cell);
            if (StringUtils.isEmpty(cellValue)) {
            if (StringUtils.isEmpty(cellValue) || !cell.toString().equals("null")) {
                return;
            }
@@ -3593,6 +3602,37 @@
        this.issueHistoryService.addIssueHistory(issue, IssueHistoryType.SEND, sb.toString());
    }
    @Override
    public void sendCommonEmail(EmailCommonForm emailCommonForm) {
        if (emailCommonForm.getSendEmails().size() < 1) {
            throw new OwlRuntimeException(
                    this.messageAccessor.getMessage(MsgConstants.ISSUE_NOT_SEND_USER));
        } else if (emailCommonForm.getIssueId() == null) {
            throw new OwlRuntimeException(
                    this.messageAccessor.getMessage(MsgConstants.ISSUE_NOT_EXIST));
        }
        Issue issue = this.getIssue(emailCommonForm.getIssueId());
        //  발신자 표시
        User user = this.webAppUtil.getLoginUserObject();
        UserVo toUser = this.webAppUtil.getLoginUser();
        //  사용자 시스템 기능 사용 정보 수집
        log.info(ElasticSearchUtil.makeUserActiveHistoryMessage(this.webAppUtil.getLoginUser(), ElasticSearchConstants.ISSUE_ANOTHER_USER_SEND_EMAIL));
        StringBuilder sb = new StringBuilder();
        Locale locale = CommonUtil.getUserLanguage(user.getLanguage());
        String[] sendMails = ConvertUtil.ToArray(emailCommonForm.getSendEmails());
        for(int i=0; i < sendMails.length; i++) {
            sendMails[i] = CommonUtil.decryptAES128(sendMails[i]);
        }
        this.systemEmailService.sendEmail(emailCommonForm.getTitle(), emailCommonForm.getDescription(), sendMails, null);
        this.issueHistoryService.detectSendIssueMail(IssueHistoryType.SEND, emailCommonForm.getSendEmails(), sb);
        this.issueHistoryService.addIssueHistory(issue, IssueHistoryType.SEND, sb.toString());
    }
    //  예약 발생 이슈를 실행한다
    @Override
    @Transactional