OWL ITS + 탐지시스템(인터넷 진흥원)
wyu
2021-11-29 0783fb3611c0f59dfde624af0d49ec180537fa3e
src/main/webapp/scripts/app/issue/issueAdd.controller.js
@@ -9,9 +9,9 @@
    ],
    function (app, angular) {
        app.controller('issueAddController', ['$scope', '$rootScope', '$log', '$resourceProvider', '$uibModalInstance', '$uibModal', '$injector',
            '$controller', '$tableProvider', 'SweetAlert', '$timeout', '$stateParams', '$q', 'Issue', 'User', 'AttachedFile', 'IssueType', 'Priority', 'Severity', 'IssueTypeCustomField', '$filter', '$state',
            '$controller', '$tableProvider', 'SweetAlert', '$timeout', '$stateParams', '$q', 'Issue', 'User', 'AttachedFile', 'IssueType', 'HostingField', 'Priority', 'Severity', 'IssueTypeCustomField', '$filter', '$state',
            function ($scope, $rootScope, $log, $resourceProvider, $uibModalInstance, $uibModal,  $injector, $controller, $tableProvider, SweetAlert, $timeout,
                      $stateParams, $q, Issue, User, AttachedFile, IssueType, Priority, Severity, IssueTypeCustomField, $filter, $state) {
                      $stateParams, $q, Issue, User, AttachedFile, IssueType, HostingField, Priority, Severity, IssueTypeCustomField, $filter, $state) {
                $scope.fn = {
                    cancel : cancel,    //  팝업 창 닫기
@@ -33,8 +33,11 @@
                    getIssueTypeCustomFields : getIssueTypeCustomFields,    //  이슈 유형에 연결된 사용자 정의 필드 목록 가져오기
                    removeUploadFile : removeUploadFile,    //  업로드하려는 특정 파일을 삭제
                    removeManager : removeManager,  //  담당자 삭제
                    removeDepartment : removeDepartment,  //  담당부서 삭제
                    setIssueTypeTemplate : setIssueTypeTemplate,    //  이슈 유형 템플릿 적용하기
                    startExecute : startExecute //  컨트롤 로딩시 처음으로 시작되는 함수
                    startExecute : startExecute, //  컨트롤 로딩시 처음으로 시작되는 함수
                    containsPartner : containsPartner,
                    getPartners : getPartners,
                };
                $scope.vm = {
@@ -60,25 +63,26 @@
                    projectName : "",   //  프로젝트 명 검색
                    userName : "",  //  사용자 검색
                    departmentName : "",  // 부서명 검색
                    companyId : -1, // 부서 ID
                    companyName : "",   // 업체명 검색
                    companyManager : "",   // 업체 담당자
                    companyTel : "",  // 업체 전화번호
                    companyEmail : "",  // 업체 이메일
                    companyMemo : "",  // 업체 비고
                    ispId : -1, // ISP ID
                    ispName : "", // ISP 명
                    ispCode : "", // ISP 코드
                    ispManager : "", // ISP 담당자
                    ispTel : "", // ISP 전화번호
                    ispEmail : "", // ISP 이메일
                    ispMemo : "", // ISP 비고
                    hostingId : -1, // 호스팅 ID
                    hostingName : "", // 호스팅명 검색
                    hostingManager : "", // 호스팅 담당자
                    hostingTel : "", // 호스팅 전화번호
                    hostingEmail : "", // 호스팅 이메일
                    hostingMemo : "", // 호스팅 비고
                    companyId : -1,
                    ispId : -1,
                    hostingId : -1,
                    hostingMemo :"", // 호스팅 비고
                    autoCompletePage : {
                        user : {
                            page : 0,
@@ -135,6 +139,10 @@
                        //  이슈 유형에 연결된 사용자 정의 필드 가져오기
                        $scope.fn.getIssueTypeCustomFields();
                    }
                });
                $scope.$watch("vm.form.issueTypeId", function (newValue, oldValue) {
                    $scope.vm.partnerVos = $scope.fn.getPartners();
                });
                //  섬머노트 이미지 업로드
@@ -293,6 +301,11 @@
                    $scope.vm.form.departments.splice(index, 1);
                }
                // 담당부서 삭제
                function removeDepartment(index) {
                    $scope.vm.form.departments.splice(index, 1);
                }
                //  업로드 파일 삭제
                function removeUploadFile(index) {
                    $scope.vm.form.files.splice(index, 1);
@@ -300,6 +313,21 @@
                    angular.forEach($scope.vm.form.files, function (file, index) {
                        file.index = index;
                    });
                }
                // 업체/ISP/호스팅 이름이 포함 여부 확인
                function containsPartner(name) {
                    var result = false;
                    if ($scope.vm.viewer.usePartnerVo != null) {
                        $scope.vm.viewer.usePartnerVo.forEach(function (partnerVo) {
                            if (name === partnerVo.name) {
                                result = true;
                            }
                        });
                    }
                    return result;
                }
                //  담당자 autocomplete page 업데이트트
@@ -343,6 +371,7 @@
                // 업체정보 결과 값 Event 처리(set)
                $scope.$on("companyFieldEvent", function (event, result) {
                    $scope.vm.companyId = result[0].id;
                    $scope.vm.companyName = result[0].name;
                    $scope.vm.companyManager = result[0].manager;
                    $scope.vm.companyTel = result[0].tel;
                    $scope.vm.companyEmail = result[0].email;
@@ -353,6 +382,7 @@
                // ISP정보 결과 값 Event 처리(set)
                $scope.$on("ispFieldEvent", function (event, result) {
                    $scope.vm.ispId = result[0].id;
                    $scope.vm.ispName = result[0].name;
                    $scope.vm.ispCode = result[0].code;
                    $scope.vm.ispManager = result[0].manager;
                    $scope.vm.ispTel = result[0].tel;
@@ -363,6 +393,7 @@
                // 호스팅정보 결과 값 Event 처리(set)
                $scope.$on("hostingFieldEvent", function (event, result) {
                    $scope.vm.hostingId = result[0].id;
                    $scope.vm.hostingName = result[0].name;
                    $scope.vm.hostingCode = result[0].code;
                    $scope.vm.hostingManager = result[0].manager;
                    $scope.vm.hostingTel = result[0].tel;
@@ -377,6 +408,7 @@
                    var content = {
                        title : $rootScope.preventXss($scope.vm.form.title),    //  제목
                        description : $rootScope.preventXss($scope.vm.form.description),   //  내용
                        projectId : (function () {   //  프로젝트 아이디
                            var projectId = "";
@@ -386,9 +418,11 @@
                            return projectId;
                        })(),
                        issueTypeId : $scope.vm.form.issueTypeId,   //  이슈 유형 아이디
                        priorityId : $scope.vm.form.priorityId,    //  우선순위 아이디
                        severityId : $scope.vm.form.severityId,    //  중요도 아이디
                        companyId : (function () {   //  업체 아이디
                            var companyId = -1;
                            if ($scope.vm.form.issueCompanyFields.length > 0) {
@@ -444,9 +478,6 @@
                            return attachedFileIds;
                        })(),
                        startCompleteDateRange : $scope.vm.form.startCompleteDateRange,
                        detectingDateRange : $scope.vm.form.detectingDateRange,
                        issueCompanyFields : (function () {
                            var issueCompanyFields = [];
@@ -509,6 +540,9 @@
                            return issueHostingFields;
                        })(),
                        startCompleteDateRange : $scope.vm.form.startCompleteDateRange,
                        detectingDateRange : $scope.vm.form.detectingDateRange,
                        issueCustomFields : (function () {    //  이슈에서 사용되는 사용자 정의 필드
                            var issueCustomFields = [];
@@ -551,7 +585,7 @@
                                else {
                                    $scope.fn.cancel();
                                    if ($state.current.name !== "issues.list") {
                                    if ($state.current.name !== "issues.list" || $state.current.name === "issues.list") {
                                        $state.go("issues.list");
                                    }
                                }
@@ -613,6 +647,22 @@
                    return deferred.promise;
                }
                // 업체/ISP/호스팅 이름이 포함 여부 확인
                function containsPartner(name) {
                    var result = false;
                    if ($scope.vm.partnerVos != null) {
                        $scope.vm.partnerVos.forEach(function (partnerVo) {
                            if (name === partnerVo.name) {
                                result = true;
                            }
                        });
                    }
                    return result;
                }
                //  중요도 목록
                function getSeverities() {
@@ -726,6 +776,18 @@
                    }
                }
                function getPartners() {
                    HostingField.getPartnerList($resourceProvider.getContent(
                        {},
                        $resourceProvider.getPageContent(0, 1))).then(function (result) {
                        if (result.data.message.status === "success") {
                            $scope.vm.partnerVos = result.data.content;
                        }
                    });
                }
                //  최초 실행
                function startExecute() {