| | |
| | | var User = $injector.get("User"); |
| | | var Project = $injector.get("Project"); |
| | | var Workflow = $injector.get("Workflow"); |
| | | var CompanyField = $injector.get("CompanyField"); |
| | | var Issue = $injector.get("Issue"); |
| | | var UserWorkspace = $injector.get("UserWorkspace"); |
| | | var IspField = $injector.get("IspField"); |
| | | var HostingField = $injector.get("HostingField"); |
| | | var IssueType = $injector.get("IssueType"); |
| | | var IssueTypeCustomField = $injector.get("IssueTypeCustomField"); |
| | | var CustomField = $injector.get("CustomField"); |
| | | var $log = $injector.get("$log"); |
| | | var SweetAlert = $injector.get("SweetAlert"); |
| | | |
| | |
| | | $scope.fn.getUserList = getUserList; // 사용자 목록 정보를 조회한다. |
| | | $scope.fn.getProjectList = getProjectList; // 프로젝트 목록 정보를 조회한다. |
| | | $scope.fn.getIssueList = getIssueList; // 일감 목록 정보를 조회한다. |
| | | $scope.fn.getRelIssueList = getRelIssueList; // 연관 이슈 목록 정보를 조회한다. |
| | | $scope.fn.getDownIssueList = getDownIssueList; // 하위 이슈 목록 정보를 조회한다. |
| | | $scope.fn.getWorkflowList = getWorkflowList; // 워크플로우 목록 정보를 조회한다. |
| | | $scope.fn.getUserDepartmentList = getUserDepartmentList; // 부서 목록 정보를 조회한다. |
| | | $scope.fn.getIssueCompanyFieldList = getIssueCompanyFieldList; // 업체 목록 정보를 조회한다. |
| | | $scope.fn.getIssueDepartmentList = getIssueDepartmentList; // 담당자 -> 담당부서 목록 정보를 조회한다. |
| | | $scope.fn.getIssueIspFieldList = getIssueIspFieldList; // ISP 목록 정보를 조회한다. |
| | | $scope.fn.getIssueHostingFieldList = getIssueHostingFieldList; // 호스팅 목록 정보를 조회한다. |
| | | $scope.fn.getPartnerList = getPartnerList; // 업체/isp/호스팅 목록 조회 |
| | | $scope.fn.getIssueTypeList = getIssueTypeList; // 이슈 유형 목록 조회 |
| | | $scope.fn.getCustomFieldList = getCustomFieldList; // 사용자 정의 필드 목록 조회 |
| | | $scope.fn.getMailTargetAll = getMailTargetAll; // 사용자 정의 필드 목록 조회 |
| | | $scope.fn.getIssueTypeCustomFieldList = getIssueTypeCustomFieldList; // 이슈 유형에서 사용중인 사용자정의 필드가져오기 |
| | | |
| | | function getUserList(query, excludeList, page, callBack) { |
| | | var conditions = { |
| | |
| | | }); |
| | | |
| | | return excludeIds; |
| | | })() |
| | | })(), |
| | | issueId : $rootScope.currentDetailIssueId |
| | | }; |
| | | |
| | | var deferred = $q.defer(); |
| | |
| | | |
| | | var deferred = $q.defer(); |
| | | |
| | | |
| | | |
| | | Project.findWork($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") { |
| | |
| | | return deferred.promise; |
| | | } |
| | | |
| | | function getUserDepartmentList(query, excludeList, page, callBack) { //체크 필요 |
| | | function getIssueList(query, issueTypeId, excludeList, page, callBack) { |
| | | var conditions = { |
| | | departmentName : query, |
| | | excludeIds : (function () { //어떤 역할? 체크 필요 |
| | | name : query, |
| | | /*issueTypeIds : (function () { |
| | | var ids = []; |
| | | |
| | | ids.push(issueTypeId); |
| | | |
| | | return ids; |
| | | })(),*/ |
| | | excludeIds : (function () { |
| | | var excludeIds = []; |
| | | |
| | | angular.forEach(excludeList, function (exclude) { |
| | | excludeIds.push(exclude.id); |
| | | }); |
| | |
| | | return excludeIds; |
| | | })() |
| | | }; |
| | | |
| | | var deferred = $q.defer(); |
| | | |
| | | UserWorkspace.userDepartmentDetail($resourceProvider.getContent( // 페이징 업데이트가 필요한 컴포넌트 일경우, page 업데이트가 있을 경우 기본 10개씩 가져오고 아닐경우 25개씩 가져온다. |
| | | 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") { |
| | | |
| | |
| | | deferred.resolve(result.data.data); |
| | | } |
| | | else { |
| | | SweetAlert.swal($filter("translate")("managementWorkspace.failedToSelectWorkspaceFullDepartmentList"), result.data.message.message, "error"); // "부서 목록 조회 실패" |
| | | SweetAlert.swal($filter("translate")("common.failedToIssueListLookUp"), result.data.message.message, "error"); // "워크플로우 목록 조회 실패" |
| | | } |
| | | }); |
| | | |
| | | return deferred.promise; |
| | | } |
| | | |
| | | function getRelIssueList(query, issueTypeId, excludeList, page, callBack) { |
| | | var conditions = { |
| | | name : 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; |
| | | } |
| | | |
| | | 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 () { |
| | | var ids = []; |
| | | |
| | | ids.push(issueTypeId); |
| | | |
| | | return ids; |
| | | })(), |
| | | excludeIds : (function () { |
| | | var excludeIds = []; |
| | | |
| | | angular.forEach(excludeList, function (exclude) { |
| | | 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; |
| | | } |
| | | |
| | |
| | | return deferred.promise; |
| | | } |
| | | |
| | | function getIssueList(query, excludeList, page, callBack) { |
| | | function getUserDepartmentList(query, excludeList, page, callBack) { |
| | | var conditions = { |
| | | departmentName : query, |
| | | excludeIds : (function () { //excludeIds : 제외 할 리스트 |
| | | var excludeIds = []; |
| | | angular.forEach(excludeList, function (exclude) { |
| | | excludeIds.push(exclude.id); |
| | | }); |
| | | |
| | | return excludeIds; |
| | | })() |
| | | }; |
| | | var deferred = $q.defer(); |
| | | |
| | | UserWorkspace.departmentFind($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")("managementWorkspace.failedToSelectWorkspaceFullDepartmentList"), result.data.message.message, "error"); // "부서 목록 조회 실패" |
| | | } |
| | | }); |
| | | return deferred.promise; |
| | | } |
| | | |
| | | function getIssueCompanyFieldList(query, excludeList, page, callBack) { |
| | | var conditions = { |
| | | name : query, |
| | | excludeIds : (function () { |
| | |
| | | |
| | | var deferred = $q.defer(); |
| | | |
| | | Issue.find($resourceProvider.getContent( // 페이징 업데이트가 필요한 컴포넌트 일경우, page 업데이트가 있을 경우 기본 10개씩 가져오고 아닐경우 25개씩 가져온다. |
| | | |
| | | |
| | | CompanyField.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.failedToProjectListLookUp"), result.data.message.message, "error"); // "프로젝트 목록 조회 실패" |
| | | } |
| | | }); |
| | | |
| | | return deferred.promise; |
| | | } |
| | | |
| | | function getIssueDepartmentList(issueTypeId, query, excludeList, page, callBack) { |
| | | var conditions = { |
| | | //issueTypeId : $scope.vm.form.issueTypeId, |
| | | issueTypeId : Number(issueTypeId), |
| | | departmentName : query, |
| | | userId : $rootScope.user.id, |
| | | projectId : (function () { |
| | | var projectId = ""; |
| | | |
| | | if ($rootScope.isDefined($scope.vm.form)) { |
| | | angular.forEach($scope.vm.form.projects, function (project) { |
| | | projectId = project.id; |
| | | }); |
| | | } |
| | | |
| | | return projectId; |
| | | })(), |
| | | excludeIds : (function () { |
| | | var excludeIds = []; |
| | | |
| | | angular.forEach(excludeList, function (exclude) { |
| | | excludeIds.push(exclude.id); |
| | | }); |
| | | |
| | | return excludeIds; |
| | | })() |
| | | }; |
| | | |
| | | var deferred = $q.defer(); |
| | | |
| | | |
| | | //워크플로우에 속해있는 담당부서 찾기 |
| | | UserWorkspace.findWorkflowDepartment($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; |
| | | if(departments != null){ |
| | | var filterDepartments = departments.filter(function(item, idx){ |
| | | return departments.findIndex(function(item2, idx2){ |
| | | return item.departmentName === item2.departmentName |
| | | }) == idx; |
| | | }); |
| | | } |
| | | |
| | | if ($rootScope.isDefined(callBack)) { |
| | | callBack(result); |
| | | } |
| | | deferred.resolve(filterDepartments); |
| | | } |
| | | else { |
| | | SweetAlert.swal($filter("translate")("common.failedToProjectListLookUp"), result.data.message.message, "error"); // "프로젝트 목록 조회 실패" |
| | | } |
| | | }); |
| | | |
| | | return deferred.promise; |
| | | } |
| | | |
| | | function getIssueIspFieldList(query, excludeList, page, callBack) { |
| | | var conditions = { |
| | | ispName : query, |
| | | excludeIds : (function () { |
| | | var excludeIds = []; |
| | | |
| | | angular.forEach(excludeList, function (exclude) { |
| | | excludeIds.push(exclude.id); |
| | | }); |
| | | |
| | | return 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) { |
| | | if (result.data.message.status === "success") { |
| | | if ($rootScope.isDefined(callBack)) { |
| | | callBack(result); |
| | | } |
| | | |
| | | deferred.resolve(result.data.data); |
| | | } |
| | | else { |
| | | SweetAlert.swal($filter("translate")("common.failedToProjectListLookUp"), result.data.message.message, "error"); // "프로젝트 목록 조회 실패" |
| | | } |
| | | }); |
| | | |
| | | return deferred.promise; |
| | | } |
| | | |
| | | function getIssueHostingFieldList(query, excludeList, page, callBack) { |
| | | var conditions = { |
| | | hostingName : query, |
| | | excludeIds : (function () { |
| | | var excludeIds = []; |
| | | |
| | | angular.forEach(excludeList, function (exclude) { |
| | | excludeIds.push(exclude.id); |
| | | }); |
| | | |
| | | return excludeIds; |
| | | })() |
| | | }; |
| | | |
| | | var deferred = $q.defer(); |
| | | |
| | | |
| | | HostingField.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.failedToProjectListLookUp"), result.data.message.message, "error"); // "프로젝트 목록 조회 실패" |
| | | } |
| | | }); |
| | | |
| | | return deferred.promise; |
| | | } |
| | | |
| | | function getPartnerList(query, excludeList, page, callBack) { |
| | | var conditions = { |
| | | partnerName : query, |
| | | excludeIds : (function () { |
| | | var excludeIds = []; |
| | | |
| | | angular.forEach(excludeList, function (exclude) { |
| | | excludeIds.push(exclude.id); |
| | | }); |
| | | |
| | | return excludeIds; |
| | | })() |
| | | }; |
| | | |
| | | var deferred = $q.defer(); |
| | | |
| | | HostingField.getPartnerList($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.content); |
| | | } |
| | | else { |
| | | SweetAlert.swal($filter("translate")("common.failedToProjectListLookUp"), result.data.message.message, "error"); // "프로젝트 목록 조회 실패" |
| | | } |
| | | }); |
| | | |
| | | return deferred.promise; |
| | | } |
| | | |
| | | function getCustomFieldList(query, excludeList, page, callBack) { |
| | | var conditions = { |
| | | name : query, |
| | | excludeIds : (function () { |
| | | var excludeIds = []; |
| | | |
| | | angular.forEach(excludeList, function (exclude) { |
| | | excludeIds.push(exclude.id); |
| | | }); |
| | | |
| | | return excludeIds; |
| | | })() |
| | | }; |
| | | |
| | | var deferred = $q.defer(); |
| | | |
| | | CustomField.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") { |
| | | |
| | |
| | | deferred.resolve(result.data.data); |
| | | } |
| | | else { |
| | | SweetAlert.swal($filter("translate")("common.failedToIssueListLookUp"), result.data.message.message, "error"); // "워크플로우 목록 조회 실패" |
| | | SweetAlert.swal($filter("translate")("issue.failedToIssueTypeListLookup"), result.data.message.message, "error"); // "이슈 유형 목록 조회 실패" |
| | | } |
| | | }); |
| | | |
| | | return deferred.promise; |
| | | } |
| | | |
| | | function getIssueTypeList(query, excludeList, page, callBack) { |
| | | var conditions = { |
| | | name : query, |
| | | excludeIds : (function () { |
| | | var excludeIds = []; |
| | | |
| | | angular.forEach(excludeList, function (exclude) { |
| | | excludeIds.push(exclude.id); |
| | | }); |
| | | |
| | | return excludeIds; |
| | | })() |
| | | }; |
| | | |
| | | var deferred = $q.defer(); |
| | | |
| | | IssueType.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")("issue.failedToIssueTypeListLookup"), result.data.message.message, "error"); // "이슈 유형 목록 조회 실패" |
| | | } |
| | | }); |
| | | |
| | | return deferred.promise; |
| | | } |
| | | |
| | | // 이슈 유형에 연결된 사용자 정의 필드 |
| | | function getIssueTypeCustomFieldList(query, excludeList, projectId, issueTypeId, page, callBack) { |
| | | |
| | | if (projectId == null) return; |
| | | if (issueTypeId == null) return; |
| | | |
| | | var deferred = $q.defer(); |
| | | |
| | | IssueTypeCustomField.find($resourceProvider.getContent({ |
| | | name : query, |
| | | projectId : projectId, |
| | | issueTypeId : issueTypeId, |
| | | excludeIds : (function () { |
| | | var excludeIds = []; |
| | | |
| | | angular.forEach(excludeList, function (exclude) { |
| | | excludeIds.push(exclude.id); |
| | | }); |
| | | |
| | | return excludeIds; |
| | | })() |
| | | }, |
| | | $resourceProvider.getPageContent(0, 1000))).then(function (result) { |
| | | if (result.data.message.status === "success") { |
| | | if ($rootScope.isDefined(callBack)) { |
| | | callBack(result); |
| | | } |
| | | |
| | | var customFields = result.data.data; |
| | | var customFieldVos = []; |
| | | customFields.forEach(function (customField) { |
| | | customFieldVos.push(customField.customFieldVo); |
| | | }) |
| | | |
| | | deferred.resolve(customFieldVos); |
| | | } |
| | | else { |
| | | SweetAlert.swal($filter("translate")("issue.failedToUserDefinedFieldListAssociatedLookup"), result.data.message.message, "error"); // 이슈 유형에 연결된 사용자 정의 필드 목록 조회 실패 |
| | | } |
| | | |
| | | }); |
| | | |
| | | return deferred.promise; |
| | | } |
| | | |
| | | function getMailTargetAll(excludeList) { |
| | | var deferred = $q.defer(); |
| | | |
| | | var partners = $scope.vm.partners.slice(); |
| | | if (excludeList != null && excludeList.length > 0) { |
| | | for (let i = partners.length - 1 ; i >= 0 ; i--) { |
| | | excludeList.forEach(function (exclude) { |
| | | if (partners[i].id === exclude.id) { |
| | | partners.splice(i, 1); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | deferred.resolve(partners); |
| | | |
| | | return deferred.promise; |
| | | } |
| | | } |
| | | ]); |
| | | } |