From 5996786ac1e76645be752a9971ad75ee2fe730d7 Mon Sep 17 00:00:00 2001
From: 이민희 <mhlee@maprex.co.kr>
Date: 화, 15 2월 2022 10:40:00 +0900
Subject: [PATCH] - 탐지일시가 제대로 검색되지 않는 문제 해결 - 이슈 테이블 표시 설정 시 팝업 타이밍 수정

---
 src/main/webapp/scripts/app/issue/issueAddDownTableConfig.controller.js |  218 +++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 149 insertions(+), 69 deletions(-)

diff --git a/src/main/webapp/scripts/app/issue/issueAddDownTableConfig.controller.js b/src/main/webapp/scripts/app/issue/issueAddDownTableConfig.controller.js
index 74a08f9..131dfbb 100644
--- a/src/main/webapp/scripts/app/issue/issueAddDownTableConfig.controller.js
+++ b/src/main/webapp/scripts/app/issue/issueAddDownTableConfig.controller.js
@@ -8,63 +8,78 @@
         'angular'
     ],
     function (app, angular) {
-        app.controller('issueAddDownTableConfigController', ['$scope', '$rootScope', '$log', '$resourceProvider', '$uibModalInstance', 'SweetAlert', '$timeout', 'IssueTableConfig', 'CustomField', '$q', '$filter',
-            function ($scope, $rootScope, $log, $resourceProvider, $uibModalInstance, SweetAlert, $timeout, IssueTableConfig, CustomField, $q, $filter) {
+        app.controller('issueAddDownTableConfigController', ['$scope', '$rootScope', '$log', '$resourceProvider', '$uibModalInstance', 'SweetAlert', '$timeout', 'Issue', 'IssueTableConfig', 'IssueTypeCustomField', '$q', '$filter', 'parameter',
+            function ($scope, $rootScope, $log, $resourceProvider, $uibModalInstance, SweetAlert, $timeout, Issue, IssueTableConfig, IssueTypeCustomField, $q, $filter, parameter) {
 
                 //  �븿�닔 紐⑥쓬
                 $scope.fn = {
                     cancel : cancel,    //  �뙘�뾽 李� �떕湲�
                     formSubmit : formSubmit,    //  �뤌 �쟾�넚
                     formCheck : formCheck,  //  �뤌 泥댄겕
+                    getUsePartner : getUsePartner,
                     getCustomFields : getCustomFields,   //  �궗�슜�옄 �젙�쓽 �븘�뱶 紐⑸줉�쓣 媛��졇�삩�떎.
-                    getIssueTableConfigs : getIssueTableConfigs //  �씠�뒋 紐⑸줉 �뀒�씠釉� �꽕�젙 �젙蹂대�� 媛��졇�삩�떎.
+                    getDownIssueTableConfigs : getDownIssueTableConfigs //  �씠�뒋 紐⑸줉 �뀒�씠釉� �꽕�젙 �젙蹂대�� 媛��졇�삩�떎.
                 };
 
                 //  蹂��닔 紐⑥쓬
                 $scope.vm = {
-                    issueTableConfigs : [{
-                        name : $filter("translate")("common.priority"), // �슦�꽑�닚�쐞
-                        key : "PRIORITY",
-                        width : "width-100-p",
+                    issueId : "",
+                    issueDownTableConfigs : [{
+                        name : $filter("translate")("issue.downIssueTitle"), // �븯�쐞 �씠�뒋 �젣紐�
+                        key : "DOWN_ISSUE_TITLE",
+                        width : "width-80-p",
+                        position : 0,
+                        display : true,
+                        checkboxShow : false
+                    }, {
+                        name : $filter("translate")("issue.issueStatus"), // �씠�뒋 �긽�깭
+                        key : "ISSUE_DOWN_STATUS_TYPE",
+                        width : "width-50-p",
                         position : 1,
-                        display : true
+                        display : false,
+                        checkboxShow : true
+                    }, {
+                        name : $filter("translate")("common.priority"), // �슦�꽑�닚�쐞
+                        key : "DOWN_PRIORITY",
+                        width : "width-50-p",
+                        position : 2,
+                        display : false,
+                        checkboxShow : true
                     }, {
                         name : $filter("translate")("common.importance"), // 以묒슂�룄
-                        key : "SEVERITY",
-                        width : "width-80-p",
-                        position : 2,
-                        display : true
-                    }, {
-                        name : $filter("translate")("issue.issueType"), // �씠�뒋 ���엯
-                        key : "ISSUE_TYPE",
-                        width : "width-140-p",
+                        key : "DOWN_SEVERITY",
+                        width : "width-50-p",
                         position : 3,
-                        display : true
+                        display : false,
+                        checkboxShow : true
                     }, {
-                        name : $filter("translate")("common.assignee"), // �떞�떦�옄
-                        key : "ASSIGNEE",
-                        width : "width-100-p",
+                        name : $filter("translate")("common.assigneeTeam"), // �떞�떦遺��꽌
+                        key : "DOWN_ASSIGNEE_TEAM",
+                        width : "width-50-p",
                         position : 4,
-                        display : true
+                        display : false,
+                        checkboxShow : true
                     }, {
                         name : $filter("translate")("common.register"), // �벑濡앹옄
-                        key : "REGISTER",
-                        width : "width-100-p",
+                        key : "DOWN_REGISTER",
+                        width : "width-50-p",
                         position : 5,
-                        display : false
+                        display : false,
+                        checkboxShow : true
                     }, {
                         name : $filter("translate")("common.period"), // 湲곌컙
-                        key : "PERIOD",
-                        width : "width-140-p",
+                        key : "DOWN_PERIOD",
+                        width : "width-100-p",
                         position : 6,
-                        display : false
+                        display : false,
+                        checkboxShow : true
                     }, {
                         name : $filter("translate")("common.lastChangeDate"), // 理쒓렐 蹂�寃쎌씪
-                        key : "MODIFY_DATE",
+                        key : "DOWN_MODIFY_DATE",
                         width : "width-100-p",
                         position : 7,
-                        display : false
-                    }, {
+                        display : false,
+                        checkboxShow : true
                     }]
                 };
 
@@ -83,23 +98,50 @@
                     $rootScope.spinner = true;
 
                     var content = {
-                        issueTableConfigs : JSON.stringify($scope.vm.issueTableConfigs)
+                        issueTypeId : (function () {
+                            var id = "";
+                            if ($rootScope.allIssueList) {
+                                id = -1;
+                            } else {
+                                id = $rootScope.getCurrentIssueTypeId();
+                            }
+                            return id;
+                        })(),
+                        issueTableConfigs : JSON.stringify($scope.vm.issueDownTableConfigs)
                     };
 
-                    IssueTableConfig.addDown($resourceProvider.getContent(content,
+                    IssueTableConfig.downAdd($resourceProvider.getContent(content,
                         $resourceProvider.getPageContent(0, 0))).then(function (result) {
 
                         if (result.data.message.status === "success") {
                             SweetAlert.success($filter("translate")("issue.completedSavingIssueTable"), $filter("translate")("issue.saveIssueTableSettingsInformation")); // "�씠�뒋 �뀒�씠釉� �꽕�젙 ���옣 �셿猷�", "�씠�뒋 �뀒�씠釉� �꽕�젙 �젙蹂닿� ���옣�릺�뿀�뒿�땲�떎."
+                            //swal.close();
+                            $scope.fn.cancel();
                             //  蹂�寃쎈맂 �씠�뒋 �뀒�씠釉� �젙蹂대�� �씠�뒋 紐⑸줉 �뀒�씠釉붿뿉 媛깆떊�븳�떎.
-                            $rootScope.$broadcast("getIssueTableConfigs", {});
+                            $rootScope.$broadcast("getIssueDetail", { id : $rootScope.currentDetailIssueId});
                         }
                         else {
                             SweetAlert.error($filter("translate")("issue.failedToSaveIssueTableSetting"), result.data.message.message); // �씠�뒋 �뀒�씠釉� �꽕�젙 ���옣 �떎�뙣
                         }
-
-                        $rootScope.spinner = false;
                     });
+                }
+
+                //  �씠�뒋�쑀�삎 蹂� �뙆�듃�꼫 紐⑸줉
+                function getUsePartner() {
+                    var deferred = $q.defer();
+                    $scope.vm.partners = [];
+
+                    Issue.findPartners($resourceProvider.getContent({issueTypeId : $rootScope.getCurrentIssueTypeId()},
+                        $resourceProvider.getPageContent(0, 1))).then(function (result) {
+                        if (result.data.message.status === "success") {
+                            $scope.vm.partnerVos = result.data.data;
+                        }
+                        else {
+                            SweetAlert.swal($filter("translate")("issue.failedToPartnerListLookup"), result.data.message.message, "error"); // �뙆�듃�꼫 紐⑸줉 議고쉶 �떎�뙣
+                        }
+                        deferred.resolve(result.data.data);
+                    });
+                    return deferred.promise;
                 }
 
 
@@ -114,7 +156,7 @@
                 function getCustomFields() {
                     var deferred = $q.defer();
 
-                    CustomField.find($resourceProvider.getContent({},
+                    IssueTypeCustomField.findByIssueType($resourceProvider.getContent({issueTypeId : $rootScope.getCurrentIssueTypeId()},
                         $resourceProvider.getPageContent(0, 1000))).then(function (result) {
                         if (result.data.message.status !== "success") {
                             SweetAlert.error($filter("translate")("issue.failedToUserDefinedFieldListLookup"), result.data.message.message); // �궗�슜�옄 �젙�쓽 �븘�뱶 紐⑸줉 議고쉶 �떎�뙣
@@ -127,10 +169,25 @@
                 }
 
                 //  �씠�뒋 紐⑸줉 �뀒�씠釉� �꽕�젙 �젙蹂대�� 媛��졇�삩�떎.
-                function getIssueTableConfigs() {
+                function getDownIssueTableConfigs() {
                     var deferred = $q.defer();
 
-                    IssueTableConfig.detail($resourceProvider.getContent({},
+                    var content = {
+                        issueId : $rootScope.currentDetailIssueId,
+                        //delValue : $scope.vm.issueDownTableConfigs.splice(8,1),
+                        issueTypeId : (function () {
+                            var id = "";
+                            if ($rootScope.allIssueList) {
+                                id = -1;
+                            } else {
+                                id = $rootScope.getCurrentIssueTypeId();
+                            }
+                            return id;
+                        })(),
+                        issueTableConfigs : JSON.stringify($scope.vm.issueDownTableConfigs)
+                    };
+
+                    IssueTableConfig.downDetail($resourceProvider.getContent(content,
                         $resourceProvider.getPageContent(0, 1000))).then(function (result) {
                         if (result.data.message.status !== "success") {
                             SweetAlert.error($filter("translate")("issue.failedToIssueTableColumnLookup"), result.data.message.message); // �씠�뒋 �뀒�씠釉� 而щ읆 議고쉶 �떎�뙣
@@ -142,46 +199,69 @@
                     return deferred.promise;
                 }
 
-                //  �궗�슜�옄 �젙�쓽 �븘�뱶瑜� 議고쉶�븳 �썑 �몴�떆�븷 �씠�뒋 �뀒�씠釉� 而щ읆�쓣 以�鍮꾪븳�떎.
-                $scope.fn.getCustomFields().then(function (result) {
-                    var count = 7;
-                    angular.forEach(result, function (customField) {
-                        $scope.vm.issueTableConfigs.push({
-                            name : customField.name,
-                            key : "CUSTOM_FIELD_" + customField.id,
+                //  �뙆�듃�꼫瑜� 議고쉶�븳 �썑 �몴�떆�븷 �씠�뒋 �뀒�씠釉� 而щ읆�쓣 以�鍮꾪븳�떎.
+                $scope.fn.getUsePartner().then(function (result) {
+                    var count = 8;
+                    angular.forEach(result, function (partner) {
+                        $scope.vm.issueDownTableConfigs.push({
+                            name : partner.name,
+                            key : (function () {
+                                var key = "";
+                                if (partner.name === "�뾽泥�") {
+                                    key = "DOWN_COMPANY";
+                                } else if(partner.name === "ISP") {
+                                    key = "DOWN_ISP";
+                                } else {
+                                    key = "DOWN_HOSTING";
+                                }
+                                return key;
+                            })(),
                             width : "width-100-p",
                             display : false,
+                            checkboxShow : true,
                             position : count
                         });
-
                         count++;
                     });
-
-                    //  �씠�뒋 紐⑸줉 �뀒�씠釉� �꽕�젙 �젙蹂대�� 媛��졇�삩�떎.
-                    $scope.fn.getIssueTableConfigs().then(function (issueTableConfigs) {
-                        if ($rootScope.isDefined(issueTableConfigs)) {
-                            $rootScope.spinner = true;
-
-                            var saveTableConfigs = JSON.parse(issueTableConfigs);
-
-                            angular.forEach(saveTableConfigs, function (saveTableConfig) {
-
-                                for (var count in $scope.vm.issueTableConfigs) {
-                                    var issueTableConfig = $scope.vm.issueTableConfigs[count];
-
-                                    if (issueTableConfig.key === saveTableConfig.key) {
-                                        issueTableConfig.display = saveTableConfig.display;
-                                        issueTableConfig.width = saveTableConfig.width;
-                                        issueTableConfig.position = saveTableConfig.position;
-                                        break;
-                                    }
-                                }
+                    //  �궗�슜�옄 �젙�쓽 �븘�뱶瑜� 議고쉶�븳 �썑 �몴�떆�븷 �씠�뒋 �뀒�씠釉� 而щ읆�쓣 以�鍮꾪븳�떎.
+                    $scope.fn.getCustomFields().then(function (result) {
+                        angular.forEach(result, function (customField) {
+                            $scope.vm.issueDownTableConfigs.push({
+                                name : customField.name,
+                                key : "CUSTOM_FIELD_" + customField.id,
+                                width : "width-100-p",
+                                display : false,
+                                checkboxShow : true,
+                                position : count
                             });
+                            count++;
+                        });
 
-                            $rootScope.spinner = false;
-                        }
+                        //  �씠�뒋 紐⑸줉 �뀒�씠釉� �꽕�젙 �젙蹂대�� 媛��졇�삩�떎.
+                        $scope.fn.getDownIssueTableConfigs().then(function (issueTableConfigs) {
+                            if ($rootScope.isDefined(issueTableConfigs)) {
+                                $rootScope.spinner = true;
+
+                                var saveTableConfigs = JSON.parse(issueTableConfigs);
+
+                                angular.forEach(saveTableConfigs, function (saveTableConfig) {
+
+                                    for (var count in $scope.vm.issueDownTableConfigs) {
+                                        var issueTableConfig = $scope.vm.issueDownTableConfigs[count];
+
+                                        if (issueTableConfig.key === saveTableConfig.key) {
+                                            issueTableConfig.display = saveTableConfig.display;
+                                            issueTableConfig.width = saveTableConfig.width;
+                                            issueTableConfig.position = parseInt(saveTableConfig.position);
+                                            break;
+                                        }
+                                    }
+                                });
+
+                                $rootScope.spinner = false;
+                            }
+                        });
                     });
                 });
-
             }]);
     });

--
Gitblit v1.8.0