OWL ITS + 탐지시스템(인터넷 진흥원)
이민희
2021-12-28 743fb98986d528be8b3b5bfd6d99fb1cabcd82b9
src/main/webapp/scripts/app/issue/issueAdd.controller.js
@@ -37,7 +37,8 @@
                    setIssueTypeTemplate : setIssueTypeTemplate,    //  이슈 유형 템플릿 적용하기
                    startExecute : startExecute, //  컨트롤 로딩시 처음으로 시작되는 함수
                    containsPartner : containsPartner,
                    getPartners : getPartners
                    getPartners : getPartners,
                    getDepartments : getDepartments,
                };
                $scope.vm = {
@@ -58,7 +59,8 @@
                        attachedFiles : [], //  섬머노트로 파일 업로드를 할 경우 서버에서 pk를 따고 issue id와 연동 작업이 필요하다.
                        startCompleteDateRange : "", //  시작일 ~ 종료일
                        detectingDateRange : "", //  탐지일
                        issueCustomFields : []  //  이슈에서 사용되는 사용자 정의 필드
                        issueCustomFields : [],  //  이슈에서 사용되는 사용자 정의 필드
                        issueStatusId: ""
                    },
                    infiniteAdd : false,    //  연속 생성
                    projectName : "",   //  프로젝트 명 검색
@@ -399,21 +401,44 @@
                    $scope.vm.companyUrl = result[0].url;
                    $scope.vm.companyMemo = result[0].memo;
                    $scope.vm.ispName = ispFieldVo.name;
                    $scope.vm.ispCode = ispFieldVo.code;
                    $scope.vm.ispManager = ispFieldVo.manager;
                    $scope.vm.ispTel = ispFieldVo.tel;
                    $scope.vm.ispEmail = ispFieldVo.email;
                    $scope.vm.ispUrl = ispFieldVo.url;
                    $scope.vm.ispMemo = ispFieldVo.memo;
                    $scope.vm.ispId = "";
                    $scope.vm.ispName = "";
                    $scope.vm.ispCode = "";
                    $scope.vm.ispManager = "";
                    $scope.vm.ispTel = "";
                    $scope.vm.ispEmail = "";
                    $scope.vm.ispUrl = "";
                    $scope.vm.ispMemo = "";
                    $scope.vm.hostingName = hostingFieldVo.name;
                    $scope.vm.hostingCode = hostingFieldVo.code;
                    $scope.vm.hostingManager = hostingFieldVo.manager;
                    $scope.vm.hostingTel = hostingFieldVo.tel;
                    $scope.vm.hostingEmail = hostingFieldVo.email;
                    $scope.vm.hostingUrl = hostingFieldVo.url;
                    $scope.vm.hostingMemo = hostingFieldVo.memo;
                    $scope.vm.hostingId = "";
                    $scope.vm.hostingName = "";
                    $scope.vm.hostingCode = "";
                    $scope.vm.hostingManager = "";
                    $scope.vm.hostingTel = "";
                    $scope.vm.hostingEmail = "";
                    $scope.vm.hostingUrl = "";
                    $scope.vm.hostingMemo = "";
                    if (ispFieldVo != null){
                        $scope.vm.ispId = ispFieldVo.id;
                        $scope.vm.ispName = ispFieldVo.name;
                        $scope.vm.ispCode = ispFieldVo.code;
                        $scope.vm.ispManager = ispFieldVo.manager;
                        $scope.vm.ispTel = ispFieldVo.tel;
                        $scope.vm.ispEmail = ispFieldVo.email;
                        $scope.vm.ispUrl = ispFieldVo.url;
                        $scope.vm.ispMemo = ispFieldVo.memo;
                    }
                    if (hostingFieldVo != null){
                        $scope.vm.hostingId = hostingFieldVo.id;
                        $scope.vm.hostingName = hostingFieldVo.name;
                        $scope.vm.hostingCode = hostingFieldVo.code;
                        $scope.vm.hostingManager = hostingFieldVo.manager;
                        $scope.vm.hostingTel = hostingFieldVo.tel;
                        $scope.vm.hostingEmail = hostingFieldVo.email;
                        $scope.vm.hostingUrl = hostingFieldVo.url;
                        $scope.vm.hostingMemo = hostingFieldVo.memo;
                    }
                });
                //ISP정보 결과 값 Event 처리(set)
@@ -464,7 +489,7 @@
                        companyId : (function () {   //  업체 아이디
                            var companyId = -1;
                            if ($scope.vm.form.issueCompanyFields.length > 0) {
                            if ($scope.vm.form.issueCompanyFields != null && $scope.vm.form.issueCompanyFields.length > 0) {
                                companyId = $scope.vm.form.issueCompanyFields[0].id;
                            }
                            return companyId;
@@ -472,7 +497,11 @@
                        ispId : (function () {  // ISP 아이디
                            var ispId = -1;
                            if ($scope.vm.form.issueIspFields.length > 0) {
                            if ($scope.vm.form.issueCompanyFields != null && $scope.vm.form.issueCompanyFields.length > 0) {
                                if ($scope.vm.form.issueCompanyFields[0].ispId != null){
                                    ispId = $scope.vm.form.issueCompanyFields[0].ispId;
                                }
                            }else if ($scope.vm.form.issueIspFields != null && $scope.vm.form.issueIspFields.length > 0) {
                                ispId = $scope.vm.form.issueIspFields[0].id;
                            }
                            return ispId;
@@ -480,7 +509,11 @@
                        hostingId : (function () {  // Hosting 아이디
                            var hostingId = -1;
                            if ($scope.vm.form.issueHostingFields.length > 0) {
                            if ($scope.vm.form.issueCompanyFields != null && $scope.vm.form.issueCompanyFields.length > 0) {
                                if ($scope.vm.form.issueCompanyFields[0].hostingId != null){
                                    hostingId = $scope.vm.form.issueCompanyFields[0].hostingId;
                                }
                            }else if ($scope.vm.form.issueHostingFields != null && $scope.vm.form.issueHostingFields.length > 0) {
                                hostingId = $scope.vm.form.issueHostingFields[0].id;
                            }
                            return hostingId;
@@ -517,14 +550,11 @@
                            return attachedFileIds;
                        })(),
                        issueCompanyFields : (function () {
                            var issueCompanyFields = [];
                            if ($scope.vm.form.issueCompanyFields != null && $scope.vm.form.issueCompanyFields.length > 0 ){
                                var companyField = $scope.vm.form.issueCompanyFields[0];
                                issueCompanyFields.push({
                                    id : companyField.id,
                                    companyId : $scope.vm.companyId,
                                    name : $scope.vm.companyName,
                                    manager : $scope.vm.companyManager,
@@ -534,17 +564,22 @@
                                    memo : $scope.vm.companyMemo
                                });
                            }
                            return issueCompanyFields;
                        })(),
                        companyName : $scope.vm.companyName,
                        companyManager : $scope.vm.companyManager,
                        companyTel : $scope.vm.companyTel,
                        companyEmail :$scope.vm.companyEmail,
                        companyUrl :$scope.vm.companyUrl,
                        companyMemo : $scope.vm.companyMemo,
                        issueIspFields : (function () {
                            var issueIspFields = [];
                            if ($scope.vm.form.issueIspFields != null && $scope.vm.form.issueIspFields.length > 0 ){
                            if ($scope.vm.form.issueCompanyFields != null && $scope.vm.form.issueCompanyFields.length > 0
                                && $scope.vm.form.issueCompanyFields[0].ispFieldVo != null
                                || $scope.vm.form.issueIspFields != null && $scope.vm.form.issueIspFields.length > 0 ){
                                var ispField = $scope.vm.form.issueIspFields[0];
                                issueIspFields[0] = {
                                    id : ispField.id,
                                issueIspFields.push({
                                    ispId : $scope.vm.ispId,
                                    name : $scope.vm.ispName,
                                    code : $scope.vm.ispCode,
@@ -553,21 +588,25 @@
                                    email :$scope.vm.ispEmail,
                                    url :$scope.vm.ispUrl,
                                    memo : $scope.vm.ispMemo
                                };
                                });
                            }
                            return issueIspFields;
                        })(),
                        ispName : $scope.vm.ispName,
                        ispCode : $scope.vm.ispCode,
                        ispManager : $scope.vm.ispManager,
                        ispTel : $scope.vm.ispTel,
                        ispEmail :$scope.vm.ispEmail,
                        ispUrl :$scope.vm.ispUrl,
                        ispMemo : $scope.vm.ispMemo,
                        issueHostingFields : (function () {
                            var issueHostingFields = [];
                            if ($scope.vm.form.issueHostingFields != null && $scope.vm.form.issueHostingFields.length > 0 ){
                            if ($scope.vm.form.issueCompanyFields != null && $scope.vm.form.issueCompanyFields.length > 0
                                && $scope.vm.form.issueCompanyFields[0].hostingFieldVo != null
                                || $scope.vm.form.issueHostingFields != null && $scope.vm.form.issueHostingFields.length > 0 ){
                                var hostingField = $scope.vm.form.issueHostingFields[0];
                                issueHostingFields[0] = {
                                    id : hostingField.id,
                                    hostingId : $scope.vm.hostingId,
                                    name : $scope.vm.hostingName,
                                    code : $scope.vm.hostingCode,
@@ -578,9 +617,15 @@
                                    memo : $scope.vm.hostingMemo
                                };
                            }
                            return issueHostingFields;
                        })(),
                        hostingName : $scope.vm.hostingName,
                        hostingCode : $scope.vm.hostingCode,
                        hostingManager : $scope.vm.hostingManager,
                        hostingTel : $scope.vm.hostingTel,
                        hostingEmail :$scope.vm.hostingEmail,
                        hostingUrl :$scope.vm.hostingUrl,
                        hostingMemo : $scope.vm.hostingMemo,
                        startCompleteDateRange : $scope.vm.form.startCompleteDateRange,
                        detectingDateRange : $scope.vm.form.detectingDateRange,
@@ -620,6 +665,7 @@
                        fileFormDataName : "file"
                    }).then(function (result) {
                        if (result.data.message.status === "success") {
                            //  연속 등록 체크시 이동하지 않음.
                            if ($scope.vm.infiniteAdd) {
                                $scope.fn.infiniteAddForm();
@@ -628,7 +674,9 @@
                                $scope.fn.cancel();
                                if ($state.current.name !== "issues.list" || $state.current.name === "issues.list") {
                                    $state.go("issues.list");
                                    $state.go($state.current, {}, {reload : true});
                                    // $state.go("issues.list");
                                    // $state.go("dashboards.dashboard")
                                }
                            }
@@ -822,6 +870,25 @@
                            $scope.vm.partnerVos = result.data.data;
                        }
                    });
                }
                function getDepartments() {
                    if($scope.vm.form.issueTypeId === ""){
                        $scope.vm.form.issueTypeId = $rootScope.issueTypeMenu.id
                    }
                    var content = {
                        issueTypeId : $scope.vm.form.issueTypeId,
                    };
                    Issue.findReadyDepartments($resourceProvider.getContent(
                        content,
                        $resourceProvider.getPageContent(0, 1))).then(function (result) {
                        if (result.data.message.status === "success") {
                            angular.forEach(result.data.data, function (department) {
                                department.byName = department.departmentName;
                                $scope.vm.form.departments.push(department);
                            });
                        }
                    });
                }
@@ -832,7 +899,8 @@
                        getIssueTypes : $scope.fn.getIssueTypes(),
                        getPriorities : $scope.fn.getPriorities(),
                        getSeverities : $scope.fn.getSeverities(),
                        getPartners : $scope.fn.getPartners()
                        getPartners : $scope.fn.getPartners(),
                        getDepartments : $scope.fn.getDepartments()
                    };
                    $q.all(promises).then(function (results) {
                        // 현재 프로젝트 설정