| | |
| | | import kr.wisestone.owl.mapper.IssueMapper; |
| | | import kr.wisestone.owl.mapper.IssueRelationMapper; |
| | | import kr.wisestone.owl.mapper.ProjectMapper; |
| | | import kr.wisestone.owl.repository.IssueRelationRepository; |
| | | import kr.wisestone.owl.repository.IssueRepository; |
| | | import kr.wisestone.owl.repository.UserDepartmentRepository; |
| | | import kr.wisestone.owl.repository.WorkflowDepartmentRepository; |
| | | import kr.wisestone.owl.repository.*; |
| | | import kr.wisestone.owl.service.*; |
| | | import kr.wisestone.owl.util.*; |
| | | import kr.wisestone.owl.util.DateUtil; |
| | |
| | | private IssueMapper issueMapper; |
| | | |
| | | @Autowired |
| | | private IssueCompanyRepository issueCompanyRepository; |
| | | |
| | | @Autowired |
| | | private IssueIspRepository issueIspRepository; |
| | | |
| | | @Autowired |
| | | private IssueHostingRepository issueHostingRepository; |
| | | |
| | | @Autowired |
| | | private ExcelConditionCheck excelConditionCheck; |
| | | |
| | | @Autowired |
| | |
| | | List<Map<String, Object>> issueHostingFields = Lists.newArrayList(); |
| | | |
| | | for (Map<String, Object> issueCustomField : issueForm.getIssueCustomFields()) { |
| | | int customFieldId = (Integer) issueCustomField.get("customFieldId"); |
| | | Long customId = (long) customFieldId; |
| | | CustomField customField = this.customFieldService.getCustomField(customId); |
| | | Long customFieldId = MapUtil.getLong(issueCustomField, "customFieldId"); |
| | | CustomField customField = this.customFieldService.getCustomField(customFieldId); |
| | | if(customField != null && customField.getCustomFieldType().toString().equals("SITE") && customField.getName().equals("도메인")) { |
| | | String useValue = issueCustomField.get("useValue").toString(); |
| | | if(companyFields != null && companyFields.size() > 0) { |
| | |
| | | |
| | | // 하위 이슈 정보를 셋팅한다 |
| | | private void setDownIssues(Issue issue, IssueVo issueVo) { |
| | | //List<Issue> downIssues = this.issueRepository.findByParentIssueId(issue.getId()); |
| | | int startPage = (int) Math.floor(issueVo.getDownPage()/issueVo.getDownPageSize()); |
| | | Pageable pageable = PageRequest.of(startPage, issueVo.getDownPageSize()); |
| | | Page<Issue> downIssues = this.issueRepository.findByParentIssueId(issue.getId(), pageable); |
| | | issueVo.setDownTotalPage(downIssues.getTotalPages()); |
| | | issueVo.setDownTotalCount(downIssues.getTotalElements()); |
| | | Page<Issue> downIssues = null; |
| | | |
| | | List<Issue> downIssueList = this.issueRepository.findByParentIssueId(issue.getId()); |
| | | if(downIssueList != null && downIssueList.size() > 0) { |
| | | int startPage = (int) Math.floor(issueVo.getDownPage()/issueVo.getDownPageSize()); |
| | | Pageable pageable = PageRequest.of(startPage, issueVo.getDownPageSize()); |
| | | downIssues = this.issueRepository.findByParentIssueId(issue.getId(), pageable); |
| | | } |
| | | if(downIssues != null){ |
| | | issueVo.setDownTotalPage(downIssues.getTotalPages()); |
| | | issueVo.setDownTotalCount(downIssues.getTotalElements()); |
| | | |
| | | List<IssueVo> resultList = new ArrayList<>(); |
| | | for(Issue downIssue : downIssues){ |
| | | IssueVo downIssueVo = ConvertUtil.copyProperties(downIssue, IssueVo.class); |
| | |
| | | // 연관 이슈 정보를 셋팅한다 |
| | | private void setRelationIssue(Issue issue, IssueVo issueVo) { |
| | | //Set<IssueRelation> issueRelations = issue.getIssueRelations(); |
| | | |
| | | List<Map<String, Object>> results = this.issueRelationMapper.findByIssueId(issueVo); |
| | | Long totalCount = this.issueRelationMapper.count(issueVo); |
| | | |
| | | int totalPage = (int) Math.ceil((totalCount - 1) / issueVo.getRelPageSize()) + 1; |
| | | issueVo.setRelTotalPage(totalPage); |
| | | issueVo.setRelTotalCount(totalCount); |
| | | |
| | | if (issue != null && issueVo != null && results.size() > 0) { |
| | | int totalPage = (int) Math.ceil((totalCount - 1) / issueVo.getRelPageSize()) + 1; |
| | | issueVo.setRelTotalPage(totalPage); |
| | | issueVo.setRelTotalCount(totalCount); |
| | | for (Map<String, Object> result : results) { |
| | | IssueRelationVo issueRelationVo = ConvertUtil.convertMapToClass(result, IssueRelationVo.class); |
| | | Issue relationIssue = this.findOne(issueRelationVo.getId()); |
| | |
| | | this.bulkInsertIssueCustomFieldValue(issueForms, issueTypeCustomFieldMaps); |
| | | // 3.628 - 3.445 |
| | | |
| | | // 업체,ISP,호스팅 추가 |
| | | |
| | | /*serviceStart.stop(); |
| | | log.debug("2차 저장 시간 : " + serviceStart.getTime());*/ |
| | | |
| | |
| | | issueCustomField.put("registerId", this.webAppUtil.getLoginId()); |
| | | issueCustomFieldValueMaps.add(issueCustomField); |
| | | } |
| | | IssueForm partners = this.findCompanyField(issueForm); // 같은 도메인 업체 찾기 |
| | | Issue issue = this.findOne(issueForm.getId()); |
| | | if (partners.getIssueCompanyFields() != null && partners.getIssueCompanyFields().size() > 0) { |
| | | for (Map<String, Object> company : partners.getIssueCompanyFields()) { |
| | | IssueCompany issueCompany = ConvertUtil.convertMapToClass(company, IssueCompany.class); |
| | | issueCompany.setIssue(issue); |
| | | this.issueCompanyRepository.saveAndFlush(issueCompany); |
| | | } |
| | | } |
| | | if (partners.getIssueIspFields() != null && partners.getIssueIspFields().size() > 0) { |
| | | for (Map<String, Object> isp : partners.getIssueIspFields()) { |
| | | IssueIsp issueIsp = ConvertUtil.convertMapToClass(isp, IssueIsp.class); |
| | | issueIsp.setIssue(issue); |
| | | this.issueIspRepository.saveAndFlush(issueIsp); |
| | | } |
| | | } |
| | | if (partners.getIssueHostingFields() != null && partners.getIssueHostingFields().size() > 0) { |
| | | for (Map<String, Object> hosting : partners.getIssueHostingFields()) { |
| | | IssueHosting issueHosting = ConvertUtil.convertMapToClass(hosting, IssueHosting.class); |
| | | issueHosting.setIssue(issue); |
| | | this.issueHostingRepository.saveAndFlush(issueHosting); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (issueCustomFieldValueMaps.size() > 0) { |
| | |
| | | break;*/ |
| | | case 4: |
| | | // 시작일을 IssueForm 에 저장한다. |
| | | if (cell != null) { |
| | | if (cell != null && cell.getCellType() != Cell.CELL_TYPE_BLANK) { |
| | | this.setIssueFormPeriod(cell, issueForm, true, rowIndex); |
| | | } |
| | | break; |
| | | case 5: |
| | | // 종료일을 IssueForm 에 저장한다. |
| | | if (cell != null) { |
| | | if (cell != null && cell.getCellType() != Cell.CELL_TYPE_BLANK) { |
| | | this.setIssueFormPeriod(cell, issueForm, false, rowIndex); |
| | | } |
| | | break; |