New file |
| | |
| | | package kr.wisestone.owl.repository; |
| | | |
| | | import kr.wisestone.owl.domain.IssueApiDefault; |
| | | import kr.wisestone.owl.domain.IssueComment; |
| | | import kr.wisestone.owl.vo.IssueCommentVo; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | import org.springframework.data.jpa.repository.Query; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IssueApiDefaultRepository extends JpaRepository<IssueApiDefault, Long> { |
| | | List<IssueApiDefault> findByUserIdAndIssueTypeId(@Param("UserId") Long userId, @Param("IssueTypeId") Long issueTypeId); |
| | | |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.service; |
| | | |
| | | import kr.wisestone.owl.domain.IssueApiDefault; |
| | | import kr.wisestone.owl.web.form.IssueApiDefaultForm; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface IssueApiDefaultService extends AbstractService<IssueApiDefault, Long, JpaRepository<IssueApiDefault, Long>> { |
| | | IssueApiDefault find(Map<String, Object> resJsonData, IssueApiDefaultForm form); |
| | | boolean modify(Map<String, Object> resJsonData, IssueApiDefaultForm form); |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.service.impl; |
| | | |
| | | import kr.wisestone.owl.constant.Constants; |
| | | import kr.wisestone.owl.domain.*; |
| | | import kr.wisestone.owl.repository.IssueApiDefaultRepository; |
| | | import kr.wisestone.owl.service.*; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | import kr.wisestone.owl.vo.*; |
| | | import kr.wisestone.owl.web.form.IssueApiDefaultForm; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class IssueApiDefaultServiceImpl extends AbstractServiceImpl<IssueApiDefault, Long, JpaRepository<IssueApiDefault, Long>> |
| | | implements IssueApiDefaultService { |
| | | |
| | | static final Logger log = LoggerFactory.getLogger(IssueApiDefaultServiceImpl.class); |
| | | |
| | | @Autowired |
| | | private IssueApiDefaultRepository issueApiDefaultRepository; |
| | | |
| | | @Autowired |
| | | private IssueTypeService issueTypeService; |
| | | |
| | | @Autowired |
| | | private PriorityService priorityService; |
| | | |
| | | @Autowired |
| | | private SeverityService severityService; |
| | | |
| | | @Autowired |
| | | private ProjectService projectService; |
| | | |
| | | @Override |
| | | protected JpaRepository<IssueApiDefault, Long> getRepository() { |
| | | return this.issueApiDefaultRepository; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public IssueApiDefault find(Map<String, Object> resJsonData, IssueApiDefaultForm form) { |
| | | UserVo userVo = this.webAppUtil.getLoginUser(); |
| | | List<IssueApiDefault> issueApiDefaults = this.issueApiDefaultRepository.findByUserIdAndIssueTypeId(userVo.getId(), form.getIssueTypeId()); |
| | | if (issueApiDefaults != null && issueApiDefaults.size() > 0) { |
| | | IssueApiDefault issueApiDefault = issueApiDefaults.get(0); |
| | | IssueApiDefaultVo issueApiDefaultVo = ConvertUtil.copyProperties(issueApiDefault, IssueApiDefaultVo.class); |
| | | Project project = issueApiDefault.getProject(); |
| | | if (project != null) { |
| | | issueApiDefaultVo.setProjectVo(ConvertUtil.copyProperties(project, ProjectVo.class)); |
| | | } |
| | | |
| | | Priority priority = issueApiDefault.getPriority(); |
| | | if (project != null) { |
| | | issueApiDefaultVo.setPriorityId(priority.getId()); |
| | | } |
| | | |
| | | Severity severity = issueApiDefault.getSeverity(); |
| | | if (severity != null) { |
| | | issueApiDefaultVo.setSeverityId(severity.getId()); |
| | | } |
| | | |
| | | resJsonData.put(Constants.RES_KEY_CONTENTS, issueApiDefaultVo); |
| | | return issueApiDefault; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public boolean modify(Map<String, Object> resJsonData, IssueApiDefaultForm form) { |
| | | User user = this.webAppUtil.getLoginUserObject(); |
| | | List<IssueApiDefault> issueApiDefaults = this.issueApiDefaultRepository.findByUserIdAndIssueTypeId(user.getId(), form.getIssueTypeId()); |
| | | if (issueApiDefaults != null && issueApiDefaults.size() > 0) { |
| | | this.issueApiDefaultRepository.deleteAll(issueApiDefaults); |
| | | } |
| | | IssueApiDefault issueApiDefault = new IssueApiDefault(); |
| | | issueApiDefault = ConvertUtil.copyProperties(form, IssueApiDefault.class); |
| | | if (form.getPriorityId() != null) |
| | | issueApiDefault.setPriority(this.priorityService.getPriority(form.getPriorityId())); |
| | | |
| | | if (form.getSeverityId() != null) |
| | | issueApiDefault.setSeverity(this.severityService.getSeverity(form.getSeverityId())); |
| | | |
| | | if (form.getProjectId() != null) |
| | | issueApiDefault.setProject(this.projectService.getProject(form.getProjectId())); |
| | | |
| | | issueApiDefault.setUser(user); |
| | | issueApiDefault.setIssueType(this.issueTypeService.getIssueType(form.getIssueTypeId())); |
| | | |
| | | this.issueApiDefaultRepository.saveAndFlush(issueApiDefault); |
| | | |
| | | return true; |
| | | } |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.vo; |
| | | |
| | | import java.util.Date; |
| | | |
| | | public class IssueApiDefaultVo extends BaseVo { |
| | | |
| | | private Long id; |
| | | private Long userId; |
| | | private Long issueTypeId; |
| | | private Long issueStatusId; |
| | | private Long projectId; |
| | | private Long priorityId; |
| | | private Long severityId; |
| | | private String title; |
| | | private String description; |
| | | private Long reverseIndex; |
| | | private Long issue_number; |
| | | private Date start_date; |
| | | private Date complete_date; |
| | | private ProjectVo projectVo; |
| | | |
| | | public IssueApiDefaultVo() { |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Long getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Long userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Long getIssueTypeId() { |
| | | return issueTypeId; |
| | | } |
| | | |
| | | public void setIssueTypeId(Long issueTypeId) { |
| | | this.issueTypeId = issueTypeId; |
| | | } |
| | | |
| | | public Long getIssueStatusId() { |
| | | return issueStatusId; |
| | | } |
| | | |
| | | public void setIssueStatusId(Long issueStatusId) { |
| | | this.issueStatusId = issueStatusId; |
| | | } |
| | | |
| | | public Long getProjectId() { |
| | | return projectId; |
| | | } |
| | | |
| | | public void setProjectId(Long projectId) { |
| | | this.projectId = projectId; |
| | | } |
| | | |
| | | public Long getPriorityId() { |
| | | return priorityId; |
| | | } |
| | | |
| | | public void setPriorityId(Long priorityId) { |
| | | this.priorityId = priorityId; |
| | | } |
| | | |
| | | public Long getSeverityId() { |
| | | return severityId; |
| | | } |
| | | |
| | | public void setSeverityId(Long severityId) { |
| | | this.severityId = severityId; |
| | | } |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | | public String getDescription() { |
| | | return description; |
| | | } |
| | | |
| | | public void setDescription(String description) { |
| | | this.description = description; |
| | | } |
| | | |
| | | public Long getReverseIndex() { |
| | | return reverseIndex; |
| | | } |
| | | |
| | | public void setReverseIndex(Long reverseIndex) { |
| | | this.reverseIndex = reverseIndex; |
| | | } |
| | | |
| | | public Long getIssue_number() { |
| | | return issue_number; |
| | | } |
| | | |
| | | public void setIssue_number(Long issue_number) { |
| | | this.issue_number = issue_number; |
| | | } |
| | | |
| | | public Date getStart_date() { |
| | | return start_date; |
| | | } |
| | | |
| | | public void setStart_date(Date start_date) { |
| | | this.start_date = start_date; |
| | | } |
| | | |
| | | public Date getComplete_date() { |
| | | return complete_date; |
| | | } |
| | | |
| | | public void setComplete_date(Date complete_date) { |
| | | this.complete_date = complete_date; |
| | | } |
| | | |
| | | public ProjectVo getProjectVo() { |
| | | return projectVo; |
| | | } |
| | | |
| | | public void setProjectVo(ProjectVo projectVo) { |
| | | this.projectVo = projectVo; |
| | | } |
| | | } |
| | |
| | | private GuideService guideService; |
| | | |
| | | // 이슈 추가 |
| | | @RequestMapping(value = "/api/add", produces = MediaType.APPLICATION_JSON_VALUE) |
| | | @RequestMapping(value = "api/issue", produces = MediaType.APPLICATION_JSON_VALUE) |
| | | public |
| | | @ResponseBody |
| | | Map<String, Object> add(@RequestBody Map<String, Map<String, Object>> params) { |
| | |
| | | } |
| | | |
| | | // 이슈 조회 |
| | | @RequestMapping(value = "/api/find", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) |
| | | @RequestMapping(value = "/api/issuelist", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) |
| | | public |
| | | @ResponseBody |
| | | Map<String, Object> find(@RequestBody Map<String, Map<String, Object>> params) { |
New file |
| | |
| | | package kr.wisestone.owl.web.controller; |
| | | |
| | | import kr.wisestone.owl.constant.Constants; |
| | | import kr.wisestone.owl.service.IssueApiDefaultService; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | import kr.wisestone.owl.web.form.IssueApiDefaultForm; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | @Controller |
| | | public class IssueApiDefaultController extends BaseController { |
| | | |
| | | @Autowired |
| | | private IssueApiDefaultService issueApiDefaultService; |
| | | |
| | | // 이슈 타입별 기본값 가져오기 |
| | | @RequestMapping(value = "issueApiDefault/find", produces = MediaType.APPLICATION_JSON_VALUE) |
| | | public |
| | | @ResponseBody |
| | | Map<String, Object> find(@RequestBody Map<String, Map<String, Object>> params) { |
| | | Map<String, Object> resJsonData = new HashMap<>(); |
| | | |
| | | this.issueApiDefaultService.find(resJsonData, ConvertUtil.convertMapToClass(params.get(Constants.REQ_KEY_CONTENT), IssueApiDefaultForm.class)); |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | // 이슈 타입별 기본값 가져오기 |
| | | @RequestMapping(value = "issueApiDefault/modify", produces = MediaType.APPLICATION_JSON_VALUE) |
| | | public |
| | | @ResponseBody |
| | | Map<String, Object> modify(@RequestBody Map<String, Map<String, Object>> params) { |
| | | Map<String, Object> resJsonData = new HashMap<>(); |
| | | |
| | | this.issueApiDefaultService.modify(resJsonData, ConvertUtil.convertMapToClass(params.get(Constants.REQ_KEY_CONTENT), IssueApiDefaultForm.class)); |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | // 이슈 타입 삭제 |
| | | @SuppressWarnings("unchecked") |
| | | @RequestMapping(value = "/issueType/remove", produces = MediaType.APPLICATION_JSON_VALUE) |
| | | public |
| | | @ResponseBody |
| | |
| | | public ModelAndView downloadExcel(HttpServletRequest request, Model model) { |
| | | return this.issueTypeService.downloadExcel(request, model); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.web.form; |
| | | |
| | | import com.google.common.collect.Lists; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | import kr.wisestone.owl.util.MapUtil; |
| | | import org.hibernate.annotations.DynamicInsert; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @DynamicInsert |
| | | public class IssueApiDefaultForm { |
| | | private Long id; |
| | | private Long userId; |
| | | private Long issueTypeId; |
| | | private Long projectId; |
| | | private Long priorityId; |
| | | private Long severityId; |
| | | private String title; |
| | | private String description; |
| | | |
| | | public IssueApiDefaultForm(){} |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Long getIssueTypeId() { |
| | | return issueTypeId; |
| | | } |
| | | |
| | | public void setIssueTypeId(Long issueTypeId) { |
| | | this.issueTypeId = issueTypeId; |
| | | } |
| | | |
| | | public Long getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Long userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Long getProjectId() { |
| | | return projectId; |
| | | } |
| | | |
| | | public void setProjectId(Long projectId) { |
| | | this.projectId = projectId; |
| | | } |
| | | |
| | | public Long getPriorityId() { |
| | | return priorityId; |
| | | } |
| | | |
| | | public void setPriorityId(Long priorityId) { |
| | | this.priorityId = priorityId; |
| | | } |
| | | |
| | | public Long getSeverityId() { |
| | | return severityId; |
| | | } |
| | | |
| | | public void setSeverityId(Long severityId) { |
| | | this.severityId = severityId; |
| | | } |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | | public String getDescription() { |
| | | return description; |
| | | } |
| | | |
| | | public void setDescription(String description) { |
| | | this.description = description; |
| | | } |
| | | } |
| | |
| | | "downIssueRemove" : "하위 이슈 삭제", |
| | | "failedToIssueAddIssueDown": "하위 이슈 추가 실패", |
| | | "failedToIssueDeleteIssueDown": "하위 이슈 삭제 실패", |
| | | "errorSelectDownIssue" : "하위 이슈가 선택되지 않았습니다." |
| | | "errorSelectDownIssue" : "하위 이슈가 선택되지 않았습니다.", |
| | | "failedToIssueTypeDefault": "이슈 유형 기본값 조회 실패" |
| | | }, |
| | | "project": { |
| | | "createProject": "프로젝트 만들기", |
| | |
| | | "failedToApiTokenRemove" : "API 토큰 삭제 실패", |
| | | "failedToApiTokenAdd" : "API 토큰 생성 실패", |
| | | "successToApiTokenRemove" : "API 토큰 삭제 성공", |
| | | "successToApiTokenAdd" : "API 토큰 생성 성공" |
| | | "successToApiTokenAdd" : "API 토큰 생성 성공", |
| | | "successToApiIssueDefault" : "기본값 설정 완료." |
| | | "failedToApiIssueDefault" : "기본값 설정 실패" |
| | | }, |
| | | "companyField" : { |
| | | "info": "업체정보", |
| | |
| | | 'app', 'angular' |
| | | ], |
| | | function (app, angular) { |
| | | app.controller('apiSettingController', ['$scope', '$rootScope', '$log', '$resourceProvider','$uibModal', 'SweetAlert', '$timeout', '$filter', |
| | | function ($scope, $rootScope, $log, $resourceProvider, $uibModal, SweetAlert, $timeout, $filter) { |
| | | app.controller('apiSettingController', ['$scope', '$rootScope', '$log', '$resourceProvider','$uibModal', 'SweetAlert', '$timeout', '$filter', '$injector', '$controller', 'Api', 'Priority', 'Severity', |
| | | function ($scope, $rootScope, $log, $resourceProvider, $uibModal, SweetAlert, $timeout, $filter, $injector, $controller, Api, Priority, Severity) { |
| | | |
| | | $scope.fn = { |
| | | changeTab : changeTab, |
| | | add : add, |
| | | getIssueTypeCallback : getIssueTypeCallback, |
| | | getProjectListCallback : getProjectListCallback, |
| | | formSubmit : formSubmit, |
| | | formCheck : formCheck, |
| | | initForm : initForm, |
| | | getPriorities : getPriorities, |
| | | getSeverities : getSeverities, |
| | | start : start |
| | | }; |
| | | |
| | | $scope.vm = { |
| | | tab : "API_COL_SETTING", |
| | | issueTypes : [], |
| | | severities : [], |
| | | priorities : [], |
| | | // projects : [], |
| | | form : { |
| | | issueApiDefault : { |
| | | title : "", |
| | | description : "", |
| | | priorityId : "", |
| | | severityId : "", |
| | | // projectName : "", |
| | | } |
| | | }, |
| | | |
| | | } |
| | | autoCompletePage : { |
| | | issueType : { |
| | | page : 0, |
| | | totalPage : 0 |
| | | }, |
| | | // project : { |
| | | // page : 0, |
| | | // totalPage : 0 |
| | | // } |
| | | }, |
| | | issueTypeName : "", |
| | | issueTypeData : null // 이슈 유형 객체 |
| | | }; |
| | | |
| | | // 생성 팝업 |
| | | function add() { |
| | | $uibModal.open({ |
| | | templateUrl : 'views/api/apiOverlapAdd.html', |
| | | size : "sm", |
| | | // controller : 'apiOverlapAddController', |
| | | backdrop : 'static' |
| | | angular.extend(this, $controller('autoCompleteController', {$scope : $scope, $injector : $injector})); |
| | | |
| | | function initForm() { |
| | | $scope.vm.form.issueApiDefault.title = ""; |
| | | $scope.vm.form.issueApiDefault.description = ""; |
| | | $scope.vm.form.issueApiDefault.priorityId = ""; |
| | | $scope.vm.form.issueApiDefault.severityId = ""; |
| | | } |
| | | |
| | | // 이슈 유형 클릭시 |
| | | $scope.$on("onClickIssueType", function (evnet, args) { |
| | | if (args != null && args.length > 0) { |
| | | |
| | | let conditions = { |
| | | issueTypeId: args[0].id |
| | | } |
| | | |
| | | Api.findApiDefault($resourceProvider.getContent( |
| | | conditions, $resourceProvider.getPageContent(0, 0))).then(function (result) { |
| | | $scope.fn.initForm(); |
| | | if (result.data.message.status === "success") { |
| | | if (angular.isDefined(result.data.data)) { |
| | | $scope.vm.form.issueApiDefault = result.data.data; |
| | | $scope.vm.form.issueApiDefault.priorityId = result.data.data.priorityId.toString(); |
| | | $scope.vm.form.issueApiDefault.severityId = result.data.data.severityId.toString(); |
| | | |
| | | // if (angular.isDefined(result.data.data.projectVo)) { |
| | | // $scope.vm.projects = []; |
| | | // $scope.vm.projects.push(result.data.data.projectVo); |
| | | // } |
| | | } |
| | | } else { |
| | | SweetAlert.swal($filter("translate")("common.failedToIssueTypeDefault"), result.data.message.message, "error"); // "프로젝트 목록 조회 실패" |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // 폼 체크 |
| | | function formCheck(formInvalid) { |
| | | if (formInvalid) { |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | function formSubmit() { |
| | | if ($scope.vm.issueTypes == null || $scope.vm.issueTypes.length === 0) |
| | | return; |
| | | |
| | | let condition = { |
| | | issueTypeId : $scope.vm.issueTypes[0].id, |
| | | title : $scope.vm.form.issueApiDefault.title, |
| | | // projectId : $scope.vm.projects != null && $scope.vm.projects.length > 0 ? $scope.vm.projects[0].id : null, |
| | | priorityId : $scope.vm.form.issueApiDefault.priorityId, |
| | | severityId : $scope.vm.form.issueApiDefault.severityId, |
| | | description : $scope.vm.form.issueApiDefault.description, |
| | | } |
| | | |
| | | Api.modifyApiDefault($resourceProvider.getContent(condition, |
| | | $resourceProvider.getPageContent(0, 1))).then(function (result) { |
| | | |
| | | if (result.data.message.status === "success") { |
| | | SweetAlert.swal($filter("translate")("api.successToApiIssueDefault"), result.data.message.message, "success"); // "api 토큰 생성 성공" |
| | | } |
| | | else { |
| | | SweetAlert.swal($filter("translate")("api.failedToApiIssueDefault"), result.data.message.message, "error"); // "api 토큰 생성 실패" |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function getIssueTypeCallback(result) { |
| | | $scope.vm.autoCompletePage.issueType.totalPage = result.data.page.totalPage; |
| | | } |
| | | |
| | | function getProjectListCallback(result) { |
| | | $scope.vm.autoCompletePage.project.totalPage = result.data.page.totalPage; |
| | | } |
| | | |
| | | // 우선순위 목록 |
| | | function getPriorities() { |
| | | Priority.find($resourceProvider.getContent({}, |
| | | $resourceProvider.getPageContent(0, 1000))).then(function (result) { |
| | | |
| | | if (result.data.message.status === "success") { |
| | | $scope.vm.priorities = result.data.data; |
| | | } |
| | | else { |
| | | SweetAlert.swal($filter("translate")("issue.failedToPriorityListLookup"), result.data.message.message, "error"); // 우선순위 목록 조회 실패 |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 중요도 목록 |
| | | function getSeverities() { |
| | | Severity.find($resourceProvider.getContent({}, |
| | | $resourceProvider.getPageContent(0, 1000))).then(function (result) { |
| | | |
| | | if (result.data.message.status === "success") { |
| | | $scope.vm.severities = result.data.data; |
| | | } |
| | | else { |
| | | SweetAlert.swal($filter("translate")("issue.failedToCriticalListLookup"), result.data.message.message, "error"); // 중요도 목록 조회 실패 |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | function changeTab(tab) { |
| | | $scope.vm.tab = tab; |
| | |
| | | } |
| | | } |
| | | |
| | | function start() { |
| | | $scope.fn.initForm(); |
| | | $scope.fn.getSeverities(); |
| | | $scope.fn.getPriorities(); |
| | | } |
| | | |
| | | $scope.fn.start(); |
| | | }]); |
| | | }); |
| | |
| | | define([ |
| | | 'app' |
| | | ], function (app) { |
| | | app.factory("Api", ['$http', '$log', function ($http, $log) { |
| | | app.factory( "Api", ['$http', '$log', function ($http, $log) { |
| | | return { |
| | | find : function (conditions) { |
| | | return $http.post("apiToken/find", conditions).then(function (response) { |
| | |
| | | $log.debug("토큰 삭제 결과 : ", response); |
| | | return response; |
| | | }); |
| | | }, |
| | | findApiDefault : function (conditions) { |
| | | return $http.post("issueApiDefault/find", conditions).then(function (response) { |
| | | $log.debug("이슈 유형 초기값 조회 결과 : ", response); |
| | | return response; |
| | | }); |
| | | }, |
| | | modifyApiDefault : function (conditions) { |
| | | return $http.post("issueApiDefault/modify", conditions).then(function (response) { |
| | | $log.debug("이슈 유형 초기값 수정 결과 : ", response); |
| | | return response; |
| | | }); |
| | | } |
| | | } |
| | | } |
| | |
| | | $log.debug("이슈 유형 삭제 결과 : ", response); |
| | | return response; |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | } |
| | | } |
| | | ]); |
| | |
| | | var UserWorkspace = $injector.get("UserWorkspace"); |
| | | var IspField = $injector.get("IspField"); |
| | | var HostingField = $injector.get("HostingField"); |
| | | var IssueType = $injector.get("IssueType"); |
| | | var $log = $injector.get("$log"); |
| | | var SweetAlert = $injector.get("SweetAlert"); |
| | | |
| | |
| | | $scope.fn.getIssueIspFieldList = getIssueIspFieldList; // ISP 목록 정보를 조회한다. |
| | | $scope.fn.getIssueHostingFieldList = getIssueHostingFieldList; // 호스팅 목록 정보를 조회한다. |
| | | $scope.fn.getCompanyList = getCompanyList; // 업체/isp/호스팅 목록 조회 |
| | | $scope.fn.getIssueTypeList = getIssueTypeList; // 이슈 유형 목록 조회 |
| | | |
| | | function getUserList(query, excludeList, page, callBack) { |
| | | var conditions = { |
| | |
| | | |
| | | 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; |
| | | } |
| | | } |
| | | ]); |
| | | } |
| | |
| | | <div class="row"> |
| | | <div class="col-md-4"> |
| | | <div class="form-group mb10"> |
| | | <label for="issueAddForm4" class="issue-label"> <span |
| | | translate="issue.issueType">이슈 타입</span> |
| | | </label> |
| | | <select id="issueAddForm4" |
| | | name="issueType" |
| | | class="form-control input-sm issue-select-label" |
| | | ng-model="vm.form.issueTypeId" |
| | | ng-change="fn.getIssueTypeCustomFields()" |
| | | ng-style="{ 'color' : fn.getOptionColor(vm.issueTypes, vm.form.issueTypeId) }" |
| | | required> |
| | | <option ng-style="{ 'color' : '#353535' }" value="">홈페이지 변조 감지 |
| | | </option> |
| | | <option ng-style="{ 'color' : '#353535' }" value="">경유지 탐지 |
| | | </option> |
| | | <option ng-repeat="issueType in vm.issueTypes" |
| | | ng-style="{ 'color' : issueType.color, 'font-weight': 600 }" |
| | | value="{{issueType.id}}">● {{issueType.name}} |
| | | </option> |
| | | </select> |
| | | <label class="issue-label"> <span translate="issue.issueType">이슈 유형</span> |
| | | <code class="highlighter-rouge">*</code></label> |
| | | <js-autocomplete-single data-input-name="issueType" |
| | | selected-model="vm.issueTypes" |
| | | search="vm.issueTypeName" |
| | | source="fn.getIssueTypeList(vm.issueTypeName, vm.issueTypes, vm.autoCompletePage.issueType.page, fn.getIssueTypeCallback)" |
| | | page="vm.autoCompletePage.issueType.page" |
| | | total-page="vm.autoCompletePage.issueType.totalPage" |
| | | input-disabled="false" |
| | | required |
| | | broad-cast="onClickIssueType" |
| | | translation-texts="{ empty : 'common.emptyIssueType' }" |
| | | extra-settings="{ displayProp : 'name' , idProp : 'id', imageable : false, imagePathProp : '', |
| | | type : '', maxlength : 200, autoResize : false, stopRemoveBodyEvent : true }"></js-autocomplete-single> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div class="element-box"> |
| | | <form role="form" name="issueAddForm"> |
| | | <form role="form" name="apiSettingColumnForm"> |
| | | <div class="form-group mb10"> |
| | | <label for="issueAddForm1" class="issue-label"><span translate="issue.issueTitle">일감 제목</span> </label> |
| | | <input id="issueAddForm1" |
| | | class="form-control input-sm" |
| | | ng-model="vm.form.title" |
| | | ng-model="vm.form.issueApiDefault.title" |
| | | name="title" |
| | | required |
| | | kr-input |
| | |
| | | owl-auto-focus> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-lg-4"> |
| | | <div class="form-group mb10"> |
| | | <label class="issue-label"> <span translate="common.project">프로젝트</span> </label> |
| | | <select id="issueAddForm6" |
| | | name="issueType" |
| | | class="form-control input-sm issue-select-label" |
| | | ng-model="vm.form.issueTypeId" |
| | | ng-change="fn.getIssueTypeCustomFields()" |
| | | ng-style="{ 'color' : fn.getOptionColor(vm.issueTypes, vm.form.issueTypeId) }" |
| | | required> |
| | | <option ng-style="{ 'color' : '#353535' }" value="">홈페이지 변조 감지 |
| | | </option> |
| | | <option ng-style="{ 'color' : '#353535' }" value="">MCF |
| | | </option> |
| | | <option ng-repeat="issueType in vm.issueTypes" |
| | | ng-style="{ 'color' : issueType.color, 'font-weight': 600 }" |
| | | value="{{issueType.id}}">● {{issueType.name}} |
| | | </option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="col-lg-4">--> |
| | | <!-- <div class="form-group mb10">--> |
| | | <!-- <label class="issue-label"> <span translate="common.project">프로젝트</span></label>--> |
| | | <!-- <js-autocomplete-single data-input-name="issueType"--> |
| | | <!-- selected-model="vm.projects"--> |
| | | <!-- search="vm.form.projectName"--> |
| | | <!-- source="fn.getProjectList(vm.form.projectName, vm.projects, vm.autoCompletePage.project.page, fn.getProjectListCallback)"--> |
| | | <!-- page="vm.autoCompletePage.project.page"--> |
| | | <!-- total-page="vm.autoCompletePage.project.totalPage"--> |
| | | <!-- input-disabled="false"--> |
| | | <!-- translation-texts="{ empty : 'common.emptyProject' }"--> |
| | | <!-- extra-settings="{ displayProp : 'name' , idProp : 'id', imageable : false, imagePathProp : '',--> |
| | | <!-- type : '', maxlength : 200, autoResize : false, stopRemoveBodyEvent : true }"></js-autocomplete-single>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <div class="col-lg-8 bdl1"> |
| | | <div class="col-lg-8"> |
| | | <div class="row"> |
| | | |
| | | <div class="col-md-4"> |
| | |
| | | <select id="issueAddForm2" |
| | | name="priority" |
| | | class="form-control input-sm issue-select-label" |
| | | ng-model="vm.form.priorityId" |
| | | ng-model="vm.form.issueApiDefault.priorityId" |
| | | ng-style="{ 'color' : fn.getOptionColor(vm.priorities, vm.form.priorityId) }" |
| | | required> |
| | | <option value="" ng-style="{ 'color' : '#353535' }"> |
| | | <span >보통</span> |
| | | </option> |
| | | <option value="" ng-style="{ 'color' : '#353535' }"> |
| | | <span >높음</span> |
| | | </option> |
| | | <option value="" ng-style="{ 'color' : '#353535' }"> |
| | | <span >낮음</span> |
| | | </option> |
| | | <option ng-repeat="priority in vm.priorities" |
| | | ng-style="{ 'color' : priority.color, 'font-weight': 600 }" |
| | | value="{{priority.id}}" |
| | |
| | | <select id="issueAddForm3" |
| | | name="severity" |
| | | class="form-control input-sm issue-select-label" |
| | | ng-model="vm.form.severityId" |
| | | ng-model="vm.form.issueApiDefault.severityId" |
| | | ng-style="{ 'color' : fn.getOptionColor(vm.severities, vm.form.severityId) }" |
| | | required> |
| | | <option value="" ng-style="{ color : '#353535' }"> |
| | | <span>보통</span> |
| | | </option> |
| | | <option value="" ng-style="{ color : '#353535' }"> |
| | | <span>높음</span> |
| | | </option> |
| | | <option value="" ng-style="{ color : '#353535' }"> |
| | | <span>낮음</span> |
| | | </option> |
| | | <option ng-repeat="severity in vm.severities" |
| | | ng-style="{ color : severity.color, 'font-weight': 600 }" |
| | | value="{{severity.id}}" |
| | |
| | | class="summernote" |
| | | lang="ko-KR" |
| | | summer-note-auto-focus |
| | | ng-model="vm.form.description" |
| | | ng-model="vm.form.issueApiDefault.description" |
| | | data-editor="vm.summerNote.editor" |
| | | data-editable="vm.summerNote.editable" |
| | | on-image-upload="fn.imageUpload(files)" |
| | | target=".note-editable"></summernote> |
| | | </div> |
| | | |
| | | <div class="row"> |
| | | <div class="col-lg-12"> |
| | | <div class="form-group mb10"> |
| | | <label for="issueAddForm5" class="issue-label"> <span translate="common.period">기간</span> |
| | | </label> |
| | | <input id="issueAddForm5" |
| | | tabindex="-1" |
| | | type="text" |
| | | readonly |
| | | class="form-control cursor" |
| | | placeholder="{{'issue.clickToSelectDate' | translate}}" |
| | | ng-model="vm.form.startCompleteDateRange" |
| | | modal-form-auto-scroll |
| | | date-format="YYYY-MM-DD" |
| | | parent-el="'#createdWidget'" |
| | | date-range-picker> |
| | | <div class="row"> |
| | | <div class="col-xs-12"> |
| | | <div id="createdWidget" class="bootstrap-datepicker"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-lg-3"> |
| | | <div class="form-group mb10"> |
| | | <div class="form-group mb10"> |
| | | <label class="issue-label"> <span translate="common.assigneeTeam">담당부서</span> </label> |
| | | <select id="issueAddForm" |
| | | name="issueType" |
| | | class="form-control input-sm issue-select-label" |
| | | ng-model="vm.form.issueTypeId" |
| | | ng-change="fn.getIssueTypeCustomFields()" |
| | | ng-style="{ 'color' : fn.getOptionColor(vm.issueTypes, vm.form.issueTypeId) }" |
| | | required> |
| | | <option value="" ng-style="{ 'color' : '#353535' }"><span>조치용역</span></option> |
| | | <option value="" ng-style="{ 'color' : '#353535' }"><span>분석용역</span></option> |
| | | <option value="" ng-style="{ 'color' : '#353535' }"><span>상황실</span></option> |
| | | <option ng-repeat="issueType in vm.issueTypes" |
| | | ng-style="{ 'color' : issueType.color, 'font-weight': 600 }" |
| | | value="{{issueType.id}}">● {{issueType.name}} |
| | | </option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="col-lg-3"> |
| | | <div class="form-group mb10"> |
| | | <div class="form-group mb10"> |
| | | <label class="issue-label"> <span>업종</span> </label> |
| | | <select id="issueAddFormIP" |
| | | name="issueType" |
| | | class="form-control input-sm issue-select-label" |
| | | ng-model="vm.form.issueTypeId" |
| | | ng-change="fn.getIssueTypeCustomFields()" |
| | | ng-style="{ 'color' : fn.getOptionColor(vm.issueTypes, vm.form.issueTypeId) }" |
| | | required> |
| | | <option value="" translate="common.selectTarget" ng-style="{ 'color' : '#353535' }"><span>대상 선택</span> |
| | | </option> |
| | | <option ng-repeat="issueType in vm.issueTypes" |
| | | ng-style="{ 'color' : issueType.color, 'font-weight': 600 }" |
| | | value="{{issueType.id}}">● {{issueType.name}} |
| | | </option> |
| | | </select> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="col-lg-3"> |
| | | <div class="form-group mb10"> |
| | | <div class="form-group mb10"> |
| | | <label class="issue-label"> <span>도메인</span> </label> |
| | | <input id="issueAddForm8" |
| | | tabindex="-1" |
| | | type="text" |
| | | class="form-control cursor" |
| | | /> |
| | | |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="col-lg-3"> |
| | | <div class="form-group mb10"> |
| | | <div class="form-group mb10"> |
| | | <label class="issue-label"> <span>경유지IP</span> </label> |
| | | <input id="issueAddForm*" |
| | | tabindex="-1" |
| | | type="text" |
| | | class="form-control cursor" |
| | | /> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | <div class="modal-footer buttons-on-right"> |
| | | <button type="button" class="btn btn-md btn-primary bold" |
| | | js-short-cut |
| | | js-short-cut-action="(fn.formCheck(issueStatusAddForm.$invalid) || $root.spinner) ? null : fn.formSubmit()" |
| | | js-short-cut-action="(fn.formCheck(apiSettingColumnForm.$invalid) || $root.spinner) ? null : fn.formSubmit()" |
| | | ng-click="fn.formSubmit()"><span translate="common.saved">생성</span> |
| | | </button> |
| | | </div> |