| | |
| | | var IssueType = $injector.get("IssueType"); |
| | | var IssueTypeCustomField = $injector.get("IssueTypeCustomField"); |
| | | var CustomField = $injector.get("CustomField"); |
| | | var CompanyFieldCategory = $injector.get("CompanyFieldCategory"); |
| | | var $log = $injector.get("$log"); |
| | | var SweetAlert = $injector.get("SweetAlert"); |
| | | |
| | |
| | | $scope.fn.getUserList = getUserList; // 사용자 목록 정보를 조회한다. |
| | | $scope.fn.getProjectList = getProjectList; // 프로젝트 목록 정보를 조회한다. |
| | | $scope.fn.getIssueList = getIssueList; // 일감 목록 정보를 조회한다. |
| | | $scope.fn.getParentIssueList = getParentIssueList; // 상위 이슈 목록 정보를 조회한다. |
| | | $scope.fn.getRelIssueList = getRelIssueList; // 연관 이슈 목록 정보를 조회한다. |
| | | $scope.fn.getDownIssueList = getDownIssueList; // 하위 이슈 목록 정보를 조회한다. |
| | | $scope.fn.getWorkflowList = getWorkflowList; // 워크플로우 목록 정보를 조회한다. |
| | | $scope.fn.getUserDepartmentList = getUserDepartmentList; // 부서 목록 정보를 조회한다. |
| | |
| | | $scope.fn.getCustomFieldList = getCustomFieldList; // 사용자 정의 필드 목록 조회 |
| | | $scope.fn.getMailTargetAll = getMailTargetAll; // 사용자 정의 필드 목록 조회 |
| | | $scope.fn.getIssueTypeCustomFieldList = getIssueTypeCustomFieldList; // 이슈 유형에서 사용중인 사용자정의 필드가져오기 |
| | | $scope.fn.getCompanyTypeCategory = getCompanyTypeCategory; // 업체 카테고리 목록 정보를 조회한다. |
| | | $scope.fn.getCompanyChildSector = getCompanyChildSector; // 업체 카테고리 목록 정보를 조회한다. |
| | | |
| | | function getUserList(query, excludeList, page, callBack) { |
| | | var conditions = { |
| | |
| | | return deferred.promise; |
| | | } |
| | | |
| | | function getParentIssueList(query, issueTypeId, excludeList, page, callBack) { |
| | | var conditions = { |
| | | name : query, |
| | | excludeIds : (function () { |
| | | var excludeIds = []; |
| | | |
| | | function getDownIssueList(query, issueTypeId, excludeList, page, callBack) { |
| | | angular.forEach(excludeList, function (exclude) { |
| | | excludeIds.push(exclude.id); |
| | | }); |
| | | return excludeIds; |
| | | })() |
| | | }; |
| | | |
| | | var deferred = $q.defer(); |
| | | |
| | | if ($rootScope.isDefined(page) && page > 0) { |
| | | $rootScope.spinner = true; |
| | | } |
| | | |
| | | Issue.find($resourceProvider.getContent( |
| | | conditions, $resourceProvider.getPageContent($rootScope.isDefined(page) ? page : 0, $rootScope.isDefined(page) ? 10 : 25))).then(function (result) { |
| | | if (result.data.message.status === "success") { |
| | | if ($rootScope.isDefined(callBack)) { |
| | | callBack(result); |
| | | } |
| | | deferred.resolve(result.data.data); |
| | | } |
| | | else { |
| | | SweetAlert.swal($filter("translate")("common.failedToIssueListLookUp"), result.data.message.message, "error"); // "워크플로우 목록 조회 실패" |
| | | } |
| | | $rootScope.spinner = false; |
| | | }); |
| | | return deferred.promise; |
| | | } |
| | | |
| | | function getRelIssueList(parentYN, project, query, issueTypeId, excludeList, page, callBack) { |
| | | var conditions = { |
| | | name : query, |
| | | excludeIds : (function () { |
| | | var excludeIds = []; |
| | | |
| | | angular.forEach(excludeList, function (exclude) { |
| | | excludeIds.push(exclude.id); |
| | | }); |
| | | return excludeIds; |
| | | })(), |
| | | parentYN : parentYN, |
| | | projectIds : (function () { |
| | | var projectIds = []; |
| | | if (project != null) { |
| | | if (project.length < 1) { |
| | | SweetAlert.swal($filter("translate")("common.failedToIssueListLookUp"), $filter("translate")("common.selectToProjectListLookUp"), "error"); // "프로젝트를 먼저 선택 해 주세요." |
| | | } |
| | | if ($rootScope.isDefined(project[0])) { |
| | | projectIds.push(project[0].id); |
| | | } |
| | | } |
| | | return projectIds; |
| | | })() |
| | | }; |
| | | |
| | | var deferred = $q.defer(); |
| | | |
| | | if ($rootScope.isDefined(page) && page > 0) { |
| | | $rootScope.spinner = true; |
| | | } |
| | | |
| | | Issue.find($resourceProvider.getContent( |
| | | conditions, $resourceProvider.getPageContent($rootScope.isDefined(page) ? page : 0, $rootScope.isDefined(page) ? 10 : 25))).then(function (result) { |
| | | if (result.data.message.status === "success") { |
| | | if ($rootScope.isDefined(callBack)) { |
| | | callBack(result); |
| | | } |
| | | deferred.resolve(result.data.data); |
| | | } |
| | | else { |
| | | SweetAlert.swal($filter("translate")("common.failedToIssueListLookUp"), result.data.message.message, "error"); // "워크플로우 목록 조회 실패" |
| | | } |
| | | $rootScope.spinner = false; |
| | | }); |
| | | return deferred.promise; |
| | | } |
| | | |
| | | function getDownIssueList(query, issueTypeId, parentIssueId, excludeList, page, callBack) { |
| | | var conditions = { |
| | | name : query, |
| | | issueTypeIds : (function () { |
| | |
| | | excludeIds.push(exclude.id); |
| | | }); |
| | | |
| | | if(parentIssueId != null) { |
| | | excludeIds.push(parentIssueId); |
| | | } |
| | | return excludeIds; |
| | | })() |
| | | }; |
| | | |
| | | var deferred = $q.defer(); |
| | | |
| | | if ($rootScope.isDefined(page) && page > 0) { |
| | | $rootScope.spinner = true; |
| | | } |
| | | |
| | | Issue.find($resourceProvider.getContent( // 페이징 업데이트가 필요한 컴포넌트 일경우, page 업데이트가 있을 경우 기본 10개씩 가져오고 아닐경우 25개씩 가져온다. |
| | | conditions, $resourceProvider.getPageContent($rootScope.isDefined(page) ? page : 0, $rootScope.isDefined(page) ? 10 : 25))).then(function (result) { |
| | | if (result.data.message.status === "success") { |
| | | |
| | | if ($rootScope.isDefined(callBack)) { |
| | | callBack(result); |
| | | } |
| | | |
| | | deferred.resolve(result.data.data); |
| | | } |
| | | else { |
| | | SweetAlert.swal($filter("translate")("common.failedToIssueListLookUp"), result.data.message.message, "error"); // "워크플로우 목록 조회 실패" |
| | | } |
| | | $rootScope.spinner = false; |
| | | }); |
| | | |
| | | return deferred.promise; |
| | | } |
| | | |
| | |
| | | |
| | | function getIssueCompanyFieldList(query, excludeList, page, callBack) { |
| | | var conditions = { |
| | | companyName : query, |
| | | name : query, |
| | | excludeIds : (function () { |
| | | var excludeIds = []; |
| | | |
| | |
| | | |
| | | |
| | | CompanyField.find($resourceProvider.getContent( // 페이징 업데이트가 필요한 컴포넌트 일경우, page 업데이트가 있을 경우 기본 10개씩 가져오고 아닐경우 25개씩 가져온다. |
| | | conditions, $resourceProvider.getPageContent($rootScope.isDefined(page) ? page : 0, $rootScope.isDefined(page) ? 10 : 25))).then(function (result) { |
| | | conditions, $resourceProvider.getPageContent($rootScope.isDefined(page) ? page : 0, $rootScope.isDefined(page) ? 100 : 1000))).then(function (result) { |
| | | if (result.data.message.status === "success") { |
| | | if ($rootScope.isDefined(callBack)) { |
| | | callBack(result); |
| | |
| | | function getIssueDepartmentList(issueTypeId, query, excludeList, page, callBack) { |
| | | var conditions = { |
| | | //issueTypeId : $scope.vm.form.issueTypeId, |
| | | issueTypeId : issueTypeId, |
| | | issueTypeId : Number(issueTypeId), |
| | | departmentName : query, |
| | | userId : $rootScope.user.id, |
| | | projectId : (function () { |
| | |
| | | var deferred = $q.defer(); |
| | | |
| | | |
| | | //워크플로우에 속해있는 담당부서 찾기 |
| | | UserWorkspace.findWorkflowDepartment($resourceProvider.getContent( // 페이징 업데이트가 필요한 컴포넌트 일경우, page 업데이트가 있을 경우 기본 10개씩 가져오고 아닐경우 25개씩 가져온다. |
| | | //프로젝트에 속해있는 담당부서 찾기 |
| | | UserWorkspace.findProjectDepartment($resourceProvider.getContent( // 페이징 업데이트가 필요한 컴포넌트 일경우, page 업데이트가 있을 경우 기본 10개씩 가져오고 아닐경우 25개씩 가져온다. |
| | | conditions, $resourceProvider.getPageContent($rootScope.isDefined(page) ? page : 0, $rootScope.isDefined(page) ? 10 : 25))).then(function (result) { |
| | | if (result.data.message.status === "success") { |
| | | const departments = result.data.data; |
| | |
| | | |
| | | function getIssueIspFieldList(query, excludeList, page, callBack) { |
| | | var conditions = { |
| | | ispName : query, |
| | | name : query, |
| | | excludeIds : (function () { |
| | | var excludeIds = []; |
| | | |
| | |
| | | var deferred = $q.defer(); |
| | | |
| | | IspField.find($resourceProvider.getContent( // 페이징 업데이트가 필요한 컴포넌트 일경우, page 업데이트가 있을 경우 기본 10개씩 가져오고 아닐경우 25개씩 가져온다. |
| | | conditions, $resourceProvider.getPageContent($rootScope.isDefined(page) ? page : 0, $rootScope.isDefined(page) ? 10 : 25))).then(function (result) { |
| | | conditions, $resourceProvider.getPageContent($rootScope.isDefined(page) ? page : 0, $rootScope.isDefined(page) ? 100 : 1000))).then(function (result) { |
| | | if (result.data.message.status === "success") { |
| | | if ($rootScope.isDefined(callBack)) { |
| | | callBack(result); |
| | |
| | | |
| | | function getIssueHostingFieldList(query, excludeList, page, callBack) { |
| | | var conditions = { |
| | | hostingName : query, |
| | | name : query, |
| | | excludeIds : (function () { |
| | | var excludeIds = []; |
| | | |
| | |
| | | else { |
| | | SweetAlert.swal($filter("translate")("common.failedToProjectListLookUp"), result.data.message.message, "error"); // "프로젝트 목록 조회 실패" |
| | | } |
| | | }); |
| | | |
| | | return deferred.promise; |
| | | } |
| | | |
| | | function getCompanyTypeCategory(typeCategory, query, excludeList, page, callBack) { |
| | | var conditions = { |
| | | typeCategory : typeCategory, |
| | | useValue : query, |
| | | excludeIds : (function () { |
| | | var excludeIds = []; |
| | | |
| | | angular.forEach(excludeList, function (exclude) { |
| | | excludeIds.push(exclude.id); |
| | | }); |
| | | |
| | | return excludeIds; |
| | | })() |
| | | }; |
| | | |
| | | var deferred = $q.defer(); |
| | | |
| | | if ($rootScope.isDefined(page) && page > 0) { |
| | | $rootScope.spinner = true; |
| | | } |
| | | |
| | | CompanyFieldCategory.find($resourceProvider.getContent( // 페이징 업데이트가 필요한 컴포넌트 일경우, page 업데이트가 있을 경우 기본 10개씩 가져오고 아닐경우 25개씩 가져온다. |
| | | conditions, $resourceProvider.getPageContent($rootScope.isDefined(page) ? page : 0, $rootScope.isDefined(page) ? 100 : 1000))).then(function (result) { |
| | | if (result.data.message.status === "success") { |
| | | if ($rootScope.isDefined(callBack)) { |
| | | callBack(result, query); |
| | | } |
| | | deferred.resolve(result.data.data); |
| | | } |
| | | else { |
| | | SweetAlert.swal($filter("translate")("common.failedToCompanyCategoryListLookUp"), result.data.message.message, "error"); |
| | | } |
| | | $rootScope.spinner = false; |
| | | }); |
| | | |
| | | return deferred.promise; |
| | | } |
| | | |
| | | function getCompanyChildSector(parentSector, parentSectorId, typeCategory, query, excludeList, page, callBack) { |
| | | var conditions = { |
| | | parentId : (function () { // 업종(대분류) |
| | | var parentId = ""; |
| | | if (parentSector != null && parentSector !== "") { |
| | | parentId = parentSector; |
| | | }else { |
| | | parentId = parentSectorId; |
| | | } |
| | | return parentId; |
| | | })(), |
| | | typeCategory : typeCategory, |
| | | useValue : query, |
| | | excludeIds : (function () { |
| | | var excludeIds = []; |
| | | |
| | | angular.forEach(excludeList, function (exclude) { |
| | | excludeIds.push(exclude.id); |
| | | }); |
| | | |
| | | return excludeIds; |
| | | })() |
| | | }; |
| | | |
| | | var deferred = $q.defer(); |
| | | |
| | | if ($rootScope.isDefined(page) && page > 0) { |
| | | $rootScope.spinner = true; |
| | | } |
| | | |
| | | CompanyFieldCategory.find($resourceProvider.getContent( // 페이징 업데이트가 필요한 컴포넌트 일경우, page 업데이트가 있을 경우 기본 10개씩 가져오고 아닐경우 25개씩 가져온다. |
| | | conditions, $resourceProvider.getPageContent($rootScope.isDefined(page) ? page : 0, $rootScope.isDefined(page) ? 100 : 1000))).then(function (result) { |
| | | if (result.data.message.status === "success") { |
| | | if ($rootScope.isDefined(callBack)) { |
| | | callBack(result); |
| | | } |
| | | deferred.resolve(result.data.data); |
| | | } |
| | | else { |
| | | SweetAlert.swal($filter("translate")("common.failedToCompanyCategoryListLookUp"), result.data.message.message, "error"); |
| | | } |
| | | $rootScope.spinner = false; |
| | | }); |
| | | |
| | | return deferred.promise; |
| | |
| | | var deferred = $q.defer(); |
| | | |
| | | var partners = $scope.vm.partners.slice(); |
| | | if (excludeList != null && excludeList.length > 0) { |
| | | if (excludeList != null && excludeList.id.length > 0) { |
| | | var filterData = excludeList.id.filter(function(item, idx){ |
| | | return excludeList.id.findIndex(function(item2, idx2){ |
| | | return item === item2 |
| | | }) == idx; |
| | | }); |
| | | for (let i = partners.length - 1 ; i >= 0 ; i--) { |
| | | excludeList.forEach(function (exclude) { |
| | | if (partners[i].id === exclude.id) { |
| | | filterData.forEach(function (exclude) { |
| | | if (partners[i] != null && partners[i].id === exclude) { |
| | | partners.splice(i, 1); |
| | | if (partners[i] == null) { |
| | | return false; |
| | | } |
| | | } |
| | | }); |
| | | } |