| | |
| | | import kr.wisestone.owl.constant.Constants; |
| | | import kr.wisestone.owl.constant.ElasticSearchConstants; |
| | | import kr.wisestone.owl.constant.MsgConstants; |
| | | import kr.wisestone.owl.constant.UsePartner; |
| | | import kr.wisestone.owl.domain.*; |
| | | import kr.wisestone.owl.domain.enumType.CustomFieldType; |
| | | import kr.wisestone.owl.domain.enumType.EmailType; |
| | |
| | | List<Issue> downIssues = this.issueRepository.findByParentIssueId(issue.getId()); |
| | | List<IssueVo> downIssueVos = ConvertUtil.convertObjectsToClasses(downIssues, IssueVo.class); |
| | | List<IssueVo> resultList = new ArrayList<>(); |
| | | |
| | | for(IssueVo downIssueVo : downIssueVos){ |
| | | for(Issue downIssue : downIssues){ |
| | | downIssueVo.setTitle(downIssue.getTitle()); |
| | | downIssueVo.setIssueTypeVo(ConvertUtil.copyProperties(downIssue.getIssueType(), IssueTypeVo.class)); |
| | | downIssueVo.setPriorityVo(ConvertUtil.copyProperties(downIssue.getPriority(), PriorityVo.class)); |
| | | downIssueVo.setSeverityVo(ConvertUtil.copyProperties(downIssue.getSeverity(), SeverityVo.class)); |
| | | this.setRegister(downIssue, downIssueVo); // 등록자 |
| | | this.setIssueDepartment(downIssue, downIssueVo); // 담당부서 정보 셋팅 |
| | | this.setIssueCustomFields(downIssue, downIssueVo); // 사용자정의필드 정보 세팅 |
| | | if(downIssues != null && downIssueVos.size()>0){ |
| | | for(IssueVo downIssueVo : downIssueVos){ |
| | | for(Issue downIssue : downIssues){ |
| | | downIssueVo.setTitle(downIssue.getTitle()); |
| | | downIssueVo.setIssueTypeVo(ConvertUtil.copyProperties(downIssue.getIssueType(), IssueTypeVo.class)); |
| | | downIssueVo.setPriorityVo(ConvertUtil.copyProperties(downIssue.getPriority(), PriorityVo.class)); |
| | | downIssueVo.setSeverityVo(ConvertUtil.copyProperties(downIssue.getSeverity(), SeverityVo.class)); |
| | | this.setRegister(downIssue, downIssueVo); // 등록자 |
| | | this.setIssueDepartment(downIssue, downIssueVo); // 담당부서 정보 셋팅 |
| | | this.setIssueCustomFields(downIssue, downIssueVo); // 사용자정의필드 정보 세팅 |
| | | } |
| | | resultList.add(downIssueVo); |
| | | } |
| | | resultList.add(downIssueVo); |
| | | issueVo.setIssueDownVos(resultList); //프론트에서 List형태로 받아줘서 리스트 형식으로 보내줌 |
| | | }else{ |
| | | issueVo.setIssueDownVos(null); |
| | | } |
| | | issueVo.setIssueDownVos(resultList); //프론트에서 List형태로 받아줘서 리스트 형식으로 보내줌 |
| | | } |
| | | |
| | | // 이슈 상세 정보를 셋팅한다. |
| | |
| | | this.setIssueComments(issue, issueVo); // 댓글 정보 셋팅 |
| | | this.setIssueHistory(issue, issueVo); // 이슈 기록 정보 셋팅 |
| | | this.setRelationIssue(issue, issueVo); //연관 일감 셋팅 |
| | | this.setDownIssues(issue, issueVo); |
| | | this.setDownIssues(issue, issueVo); //하위 일감 세팅 |
| | | |
| | | IssueType issueType = this.issueTypeService.getIssueType(issueVo.getIssueTypeVo().getId()); // 이슈의 이슈유형 객체 |
| | | Integer using = issueType.getUsePartner() != null ? issueType.getUsePartner().intValue() : 0; // 이슈유형별로 사용중인 업체/ISP/호스팅 값 |
| | | |
| | | List<UsePartnerVo> usePartnerVos = Lists.newArrayList(); |
| | | for (Integer usePartner : UsePartner.partners) { //1(업체), 2(ISP), 4(호스팅) |
| | | UsePartnerVo usePartnerVo = UsePartner.checkUsePartner(using, usePartner); |
| | | |
| | | if (usePartnerVo != null) { |
| | | usePartnerVos.add(usePartnerVo); |
| | | //useCompanyVo.setValues(); |
| | | } |
| | | issueVo.setUsePartnerVos(usePartnerVos); |
| | | } |
| | | |
| | | this.setIssueCompanyField(issue, issueVo); //업체 정보 세팅 |
| | | this.setIssueIspField(issue, issueVo); //ISP 정보 세팅 |
| | | this.setIssueHostingField(issue, issueVo); //HOSTING 정보 세팅 |
| | | this.setParentIssue(issue,issueVo); //상위 이슈 정보 세팅 |
| | | |
| | | this.setParentIssue(issue,issueVo); //상위 이슈 정보 세팅 |
| | | } |
| | | |
| | | // 상위일감 정보 추가 |
| | |
| | | // 이슈 상태 변경 |
| | | this.modifyIssueStatus(issueForm); |
| | | } |
| | | |
| | | // 담당 부서 수정 |
| | | if (issueForm.getDepartmentIds().size() > 0) { |
| | | Issue issue = this.getIssue(issueForm.getId()); |
| | | Project project = this.projectService.getProject(issueForm.getProjectId()); |
| | | |
| | | this.issueDepartmentService.modifyIssueDepartment(issue, project.getWorkspace(), issueForm.getDepartmentIds()); |
| | | } |
| | | } |
| | | |
| | | // 이슈 Import 용 엑셀 템플릿 다운로드 |
| | |
| | | |
| | | switch (customField.getCustomFieldType()) { |
| | | case INPUT: |
| | | case NUMBER: |
| | | case DATETIME: |
| | | case IP_ADDRESS: |
| | | case EMAIL: |
| | | case SITE: |
| | | case TEL: |
| | | if (cellValue.length() > 100) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.CUSTOM_FIELD_TEXT_TYPE_MAX_LENGTH_OUT)); |
| | |
| | | this.issueRepository.saveAndFlush(issue); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void findPartner(Map<String, Object> resJsonData, Map<String, Object> params) { |
| | | Long issueTypeId = MapUtil.getLong(params, "issueTypeId"); |
| | | IssueType issueType = this.issueTypeService.getIssueType(issueTypeId); // 이슈의 이슈유형 객체 |
| | | Integer using = issueType.getUsePartner() != null ? issueType.getUsePartner().intValue() : 0; // 이슈유형별로 사용중인 업체/ISP/호스팅 값 |
| | | |
| | | List<UsePartnerVo> usePartnerVos = Lists.newArrayList(); |
| | | for (Integer usePartner : UsePartner.partners) { //1(업체), 2(ISP), 4(호스팅) |
| | | UsePartnerVo usePartnerVo = UsePartner.checkUsePartner(using, usePartner); |
| | | if (usePartnerVo != null) { |
| | | usePartnerVos.add(usePartnerVo); |
| | | } |
| | | resJsonData.put(Constants.RES_KEY_CONTENTS, usePartnerVos); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void findMailTargetAll(Map<String, Object> resJsonData, IssueCondition condition, Pageable pageable) { |
| | | IssueVo issueVo = new IssueVo(); |
| | | //Long issueId = MapUtil.getLong(params, "issueId"); |
| | | Long issueId = condition.getId(); |
| | | |
| | | List<String> emailList = Lists.newArrayList(); |
| | | |
| | | if(issueId != null){ |
| | | Issue issue = this.getIssue(issueId); |
| | | issueVo = ConvertUtil.copyProperties(issue, IssueVo.class); |
| | | this.setIssueCompanyField(issue, issueVo); //업체 정보 세팅 |
| | | this.setIssueIspField(issue, issueVo); //ISP 정보 세팅 |
| | | this.setIssueHostingField(issue, issueVo); //HOSTING 정보 세팅 |
| | | for(IssueCompanyVo issueCompanyVo : issueVo.getIssueCompanyVos()) { |
| | | emailList.add(issueCompanyVo.getEmail()); |
| | | } |
| | | for(IssueIspVo issueIspVo : issueVo.getIssueIspVos()) { |
| | | emailList.add(issueIspVo.getEmail()); |
| | | } |
| | | for(IssueHostingVo issueHostingVo : issueVo.getIssueHostingVos()) { |
| | | emailList.add(issueHostingVo.getEmail()); |
| | | } |
| | | |
| | | } |
| | | |
| | | Long totalCount = this.issueMapper.count(condition); |
| | | int totalPage = (int) Math.ceil((totalCount - 1) / pageable.getPageSize()) + 1; |
| | | |
| | | condition.setPage(pageable.getPageNumber() * pageable.getPageSize()); |
| | | condition.setPageSize(pageable.getPageSize()); |
| | | //resJsonData.put(Constants.RES_KEY_CONTENTS, emailList); |
| | | resJsonData.put(Constants.RES_KEY_CONTENTS, emailList); |
| | | resJsonData.put(Constants.REQ_KEY_PAGE_VO, new ResPage(pageable.getPageNumber(), pageable.getPageSize(), |
| | | totalPage, totalCount)); |
| | | } |
| | | |
| | | /*@Override |
| | | @Transactional |
| | | public void findMailTargetCompany(Map<String, Object> resJsonData, Map<String, Object> params) { |
| | | IssueVo issueVo = new IssueVo(); |
| | | Long issueId = MapUtil.getLong(params, "issueId"); |
| | | |
| | | List<String> emailList = Lists.newArrayList(); |
| | | |
| | | if(issueId != null){ |
| | | Issue issue = this.getIssue(issueId); |
| | | issueVo = ConvertUtil.copyProperties(issue, IssueVo.class); |
| | | this.setIssueCompanyField(issue, issueVo); //업체 정보 세팅 |
| | | for(IssueCompanyVo issueCompanyVo : issueVo.getIssueCompanyVos()) { |
| | | emailList.add(issueCompanyVo.getEmail()); |
| | | } |
| | | } |
| | | resJsonData.put(Constants.RES_KEY_CONTENTS, emailList); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void findMailTargetIsp(Map<String, Object> resJsonData, Map<String, Object> params) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void findMailTargetHosting(Map<String, Object> resJsonData, Map<String, Object> params) { |
| | | |
| | | }*/ |
| | | } |