From bdb1efdc604fce543e21152b4263a9362f64389f Mon Sep 17 00:00:00 2001 From: minhee <alsdldlfrl@gmail.com> Date: 목, 10 3월 2022 15:35:19 +0900 Subject: [PATCH] - api 이슈 추가 시 입력한 ip에 속해있는 업체정보를 가진 이슈의 하위로 입력되도록 수정 - issue_company 테이블에 ip 컬럼 추가 및 이슈 추가/수정 시 ip 대역대 항목 추가 --- src/main/webapp/scripts/app/issue/issueAddDown.controller.js | 84 ++++++++++++++++++++++++++++++------------ 1 files changed, 60 insertions(+), 24 deletions(-) diff --git a/src/main/webapp/scripts/app/issue/issueAddDown.controller.js b/src/main/webapp/scripts/app/issue/issueAddDown.controller.js index 3e1c6d0..82ed200 100644 --- a/src/main/webapp/scripts/app/issue/issueAddDown.controller.js +++ b/src/main/webapp/scripts/app/issue/issueAddDown.controller.js @@ -90,6 +90,8 @@ companyTel : "", // �뾽泥� �쟾�솕踰덊샇 companyEmail : "", // �뾽泥� �씠硫붿씪 companyUrl : "", // �뾽泥� url + ipStart : "", //ip�떆�옉二쇱냼 + ipEnd : "", //ip醫낅즺二쇱냼 companyMemo : "", // �뾽泥� 鍮꾧퀬 ispId : -1, // ISP ID ispName : "", // ISP 紐� @@ -468,6 +470,8 @@ $scope.vm.companyTel = result[0].tel; $scope.vm.companyEmail = result[0].email; $scope.vm.companyUrl = result[0].url; + $scope.vm.ipStart = result[0].ipStart; + $scope.vm.ipEnd = result[0].ipEnd; $scope.vm.companyMemo = result[0].memo; $scope.vm.form.companyTypeId = result[0].companyTypeId; $scope.vm.form.parentSectorId = result[0].parentSectorId; @@ -596,6 +600,8 @@ companyTel : $scope.vm.companyTel, companyEmail :$scope.vm.companyEmail, companyUrl : $scope.vm.companyUrl, + ipStart :$scope.vm.ipStart, + ipEnd :$scope.vm.ipEnd, companyMemo : $scope.vm.companyMemo, companyTypeId : (function () { var companyTypeId = -1; @@ -740,6 +746,8 @@ tel : $scope.vm.companyTel, email :$scope.vm.companyEmail, url :$scope.vm.companyUrl, + ipStart :$scope.vm.ipStart, + ipEnd :$scope.vm.ipEnd, memo : $scope.vm.companyMemo, companyTypeId : $scope.vm.form.companyTypeId, parentSectorId : $scope.vm.form.parentSectorId, @@ -845,8 +853,6 @@ if (result.data.message.status === "success") { $scope.fn.addDownIssue(result.data.data); - $scope.fn.cancel(); - // �씠�뒋 �긽�꽭 �솕硫� �슂泥� $rootScope.$broadcast("getIssueDetail", { id : parameter.id @@ -862,29 +868,59 @@ } // �븯�쐞 �씠�뒋 異붽� - function addDownIssue(downId) { + function addDownIssue(issueVo) { + $rootScope.spinner = true; + let inheritYn = issueVo.inheritPartners; + let usePartner = issueVo.usePartner; + var ids = []; - let inheritYn = false; + if (issueVo.id != null) { + ids.push(issueVo.id); + } - SweetAlert.swal({ - title : $filter("translate")("issue.addDownIssue"), // �븯�쐞 �씠�뒋 異붽� - text : $filter("translate")("issue.wantToInheritPartnersOfParentIssue"), // �긽�쐞�씠�뒋�쓽 �뙆�듃�꼫 �젙蹂�(�뾽泥�/ISP/�샇�뒪�똿)瑜� �쟻�슜�떆�궎寃좎뒿�땲源�? - type : "warning", - showCancelButton : true, - confirmButtonColor : "#DD6B55", - confirmButtonText : $filter("translate")("common.ok"), // �꽕 - cancelButtonText : $filter("translate")("common.no"), // �븘�땲�삤 - closeOnConfirm : false, - closeOnCancel : false - }, - function (isConfirm) { - if (isConfirm) { - inheritYn = true; - } + if ($rootScope.isDefined(usePartner) && usePartner > 0 + && $rootScope.isDefined(inheritYn) && inheritYn) { + SweetAlert.swal({ + title : $filter("translate")("issue.addDownIssue"), // �븯�쐞 �씠�뒋 異붽� + text : $filter("translate")("issue.wantToInheritPartnersOfParentIssue"), // �긽�쐞�씠�뒋�쓽 �뙆�듃�꼫 �젙蹂�(�뾽泥�/ISP/�샇�뒪�똿)瑜� �쟻�슜�떆�궎寃좎뒿�땲源�? + type : "warning", + showCancelButton : true, + confirmButtonColor : "#DD6B55", + confirmButtonText : $filter("translate")("common.ok"), // �꽕 + cancelButtonText : $filter("translate")("common.no"), // �븘�땲�삤 + closeOnConfirm : false, + closeOnCancel : false + }, + function (isConfirm) { + if (!isConfirm) { + inheritYn = false; + } - if (downId != null) { - ids.push(downId); - } + var contents = { + issueId : parameter.id, + ids : ids, + parentIssueId : parameter.id, + inheritYn : inheritYn + }; + + Issue.modifyParentIssue($resourceProvider.getContent( + contents, + $resourceProvider.getPageContent(0, 10))).then(function (result) { + + if (result.data.message.status === "success") { + $scope.fn.cancel(); + // �씠�뒋 �긽�꽭 �솕硫� �슂泥� + $rootScope.$broadcast("getIssueDetail", { + id : parameter.id + }); + } + else { + SweetAlert.error($filter("translate")("issue.failedToIssueAddIssueDown"), result.data.message.message); // "�븯�쐞�씠�뒋 �깮�꽦 �떎�뙣" + } + $rootScope.spinner = false; + }); + }); + } else { var contents = { issueId : parameter.id, @@ -898,7 +934,7 @@ $resourceProvider.getPageContent(0, 10))).then(function (result) { if (result.data.message.status === "success") { - SweetAlert.close(); + $scope.fn.cancel(); // �씠�뒋 �긽�꽭 �솕硫� �슂泥� $rootScope.$broadcast("getIssueDetail", { id : parameter.id @@ -908,7 +944,7 @@ SweetAlert.error($filter("translate")("issue.failedToIssueAddIssueDown"), result.data.message.message); // "�븯�쐞�씠�뒋 �깮�꽦 �떎�뙣" } }); - }); + } } // �뙘�뾽 李� �떕湲� -- Gitblit v1.8.0