From f3144afceaa82dfc199ab2cb2f9518d49a151f7f Mon Sep 17 00:00:00 2001
From: wyu <kknd09321@nate.com>
Date: 월, 29 11월 2021 09:29:33 +0900
Subject: [PATCH] 이슈 상세 유형별 수정

---
 src/main/webapp/scripts/app/issue/issueAdd.controller.js |   80 ++++++++++++++++++++++++++++++++++++---
 1 files changed, 73 insertions(+), 7 deletions(-)

diff --git a/src/main/webapp/scripts/app/issue/issueAdd.controller.js b/src/main/webapp/scripts/app/issue/issueAdd.controller.js
index 53ef440..73379b8 100644
--- a/src/main/webapp/scripts/app/issue/issueAdd.controller.js
+++ b/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,11 +33,15 @@
                     getIssueTypeCustomFields : getIssueTypeCustomFields,    //  �씠�뒋 �쑀�삎�뿉 �뿰寃곕맂 �궗�슜�옄 �젙�쓽 �븘�뱶 紐⑸줉 媛��졇�삤湲�
                     removeUploadFile : removeUploadFile,    //  �뾽濡쒕뱶�븯�젮�뒗 �듅�젙 �뙆�씪�쓣 �궘�젣
                     removeManager : removeManager,  //  �떞�떦�옄 �궘�젣
+                    removeDepartment : removeDepartment,  //  �떞�떦遺��꽌 �궘�젣
                     setIssueTypeTemplate : setIssueTypeTemplate,    //  �씠�뒋 �쑀�삎 �뀥�뵆由� �쟻�슜�븯湲�
-                    startExecute : startExecute //  而⑦듃濡� 濡쒕뵫�떆 泥섏쓬�쑝濡� �떆�옉�릺�뒗 �븿�닔
+                    startExecute : startExecute, //  而⑦듃濡� 濡쒕뵫�떆 泥섏쓬�쑝濡� �떆�옉�릺�뒗 �븿�닔
+                    containsPartner : containsPartner,
+                    getPartners : getPartners,
                 };
 
                 $scope.vm = {
+                    partnerVos : "",
                     form : {
                         title : "",    //  �젣紐�
                         description : "",   //  �궡�슜
@@ -136,6 +140,10 @@
                         //  �씠�뒋 �쑀�삎�뿉 �뿰寃곕맂 �궗�슜�옄 �젙�쓽 �븘�뱶 媛��졇�삤湲�
                         $scope.fn.getIssueTypeCustomFields();
                     }
+                });
+
+                $scope.$watch("vm.form.issueTypeId", function (newValue, oldValue) {
+                    $scope.vm.partnerVos = $scope.fn.getPartners();
                 });
 
                 //  �꽟癒몃끂�듃 �씠誘몄� �뾽濡쒕뱶
@@ -294,6 +302,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);
@@ -301,6 +314,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 �뾽�뜲�씠�듃�듃
@@ -344,6 +372,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;
@@ -354,6 +383,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;
@@ -364,6 +394,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;
@@ -378,6 +409,7 @@
                     var content = {
                         title : $rootScope.preventXss($scope.vm.form.title),    //  �젣紐�
                         description : $rootScope.preventXss($scope.vm.form.description),   //  �궡�슜
+
                         projectId : (function () {   //  �봽濡쒖젥�듃 �븘�씠�뵒
                             var projectId = "";
 
@@ -387,9 +419,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) {
@@ -445,9 +479,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 = [];
@@ -614,6 +648,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() {
@@ -727,13 +777,29 @@
                     }
                 }
 
+
+                function getPartners() {
+                    var content = {
+                        issueTypeId : $scope.vm.form.issueTypeId
+                    };
+                    Issue.findPartners($resourceProvider.getContent(
+                        content,
+                        $resourceProvider.getPageContent(0, 1))).then(function (result) {
+                        if (result.data.message.status === "success") {
+                            $scope.vm.partnerVos = result.data.data;
+                        }
+                    });
+
+                }
+
                 //  理쒖큹 �떎�뻾
                 function startExecute() {
 
                     var promises = {
                         getIssueTypes : $scope.fn.getIssueTypes(),
                         getPriorities : $scope.fn.getPriorities(),
-                        getSeverities : $scope.fn.getSeverities()
+                        getSeverities : $scope.fn.getSeverities(),
+                        getPartners : $scope.fn.getPartners()
                     };
                     $q.all(promises).then(function (results) {
                         // �쁽�옱 �봽濡쒖젥�듃 �꽕�젙

--
Gitblit v1.8.0