| | |
| | | if(companyFields != null && companyFields.size() > 0) { |
| | | for (Map<String, Object> companyField : companyFields) { |
| | | CompanyFieldVo companyFieldVo = ConvertUtil.convertMapToClass(companyField, CompanyFieldVo.class); |
| | | if(useValue.equals(companyFieldVo.getUrl())) { |
| | | if(companyFieldVo.getUrl() != null && useValue.equals(companyFieldVo.getUrl())) { |
| | | companyField.put("companyId", companyField.get("id")); |
| | | issueCompanyFields.add(companyField); |
| | | if(companyFieldVo.getIspId() != null) { |
| | | if(companyFieldVo.getIspId() != null && companyFieldVo.getIspId() != -1) { |
| | | Map<String, Object> ispField = this.ispFieldService.find(companyFieldVo.getIspId()); |
| | | if (ispField != null) { |
| | | ispField.put("ispId", ispField.get("id")); |
| | | issueIspFields.add(ispField); |
| | | } |
| | | } |
| | | if(companyFieldVo.getHostingId() != null) { |
| | | if(companyFieldVo.getHostingId() != null && companyFieldVo.getHostingId() != -1) { |
| | | Map<String, Object> hostingField = this.hostingFieldService.find(companyFieldVo.getHostingId()); |
| | | if (hostingField != null) { |
| | | hostingField.put("hostingId", hostingField.get("id")); |
| | |
| | | * @param issueForm IssueForm |
| | | */ |
| | | private void setIssuePartners(IssueForm issueForm, Issue issue) { |
| | | IssueCompany issueCompany = new IssueCompany(); |
| | | IssueIsp issueIsp = new IssueIsp(); |
| | | IssueHosting issueHosting = new IssueHosting(); |
| | | //issueCompany 등록 |
| | | if (issueForm.getIssueCompanyFields() != null && issueForm.getIssueCompanyFields().size() > 0) { |
| | | for (Map<String, Object> issueCompanyMap : issueForm.getIssueCompanyFields()) { |
| | | CompanyField companyField = ConvertUtil.convertMapToClass(issueCompanyMap, CompanyField.class); |
| | | IssueCompany issueCompany = ConvertUtil.convertMapToClass(issueCompanyMap, IssueCompany.class); |
| | | issueCompany = ConvertUtil.convertMapToClass(issueCompanyMap, IssueCompany.class, "id"); |
| | | issueCompany.setCompanyField(companyField); |
| | | issueCompany.setIssue(issue); |
| | | this.issueCompanyRepository.saveAndFlush(issueCompany); |
| | | |
| | | // 업체의 ISP가 있는 경우 issueISP 등록 |
| | | if (companyField.getIspId() != null) { |
| | | IspField ispField = this.ispFieldService.getIsp(companyField.getIspId()); |
| | | IssueIsp issueIsp = ConvertUtil.copyProperties(ispField, IssueIsp.class); |
| | | issueIsp.setIspField(ispField); |
| | | issueIsp.setIssue(issue); |
| | | this.issueIspRepository.saveAndFlush(issueIsp); |
| | | |
| | | // 사용자가 ISP를 직접 입력하지 않았을 경우 업체에 등록되어있는 ISP 설정 |
| | | if (issueForm.getIssueIspFields() == null || issueForm.getIssueIspFields().size() < 1) { |
| | | // 업체의 ISP가 있는 경우 issueISP 등록 |
| | | if (companyField.getIspId() != null && companyField.getIspId() != -1) { |
| | | IspField ispField = this.ispFieldService.getIsp(companyField.getIspId()); |
| | | issueIsp = ConvertUtil.copyProperties(ispField, IssueIsp.class, "id"); |
| | | issueIsp.setIspField(ispField); |
| | | issueIsp.setIssue(issue); |
| | | this.issueIspRepository.saveAndFlush(issueIsp); |
| | | } |
| | | } |
| | | // 업체의 호스팅이 있는 경우 issueHosting 등록 |
| | | if (companyField.getHostingId() != null) { |
| | | HostingField hostingField = this.hostingFieldService.getHosting(companyField.getHostingId()); |
| | | IssueHosting issueHosting = ConvertUtil.copyProperties(hostingField, IssueHosting.class); |
| | | issueHosting.setHostingField(hostingField); |
| | | issueHosting.setIssue(issue); |
| | | this.issueHostingRepository.saveAndFlush(issueHosting); |
| | | // 사용자가 호스팅을 직접 입력하지 않았을 경우 업체에 등록되어있는 호스팅 설정 |
| | | if (issueForm.getIssueHostingFields() == null || issueForm.getIssueHostingFields().size() < 1) { |
| | | // 업체의 호스팅이 있는 경우 issueHosting 등록 |
| | | if (companyField.getHostingId() != null && companyField.getHostingId() != -1) { |
| | | HostingField hostingField = this.hostingFieldService.getHosting(companyField.getHostingId()); |
| | | issueHosting = ConvertUtil.copyProperties(hostingField, IssueHosting.class, "id"); |
| | | issueHosting.setHostingField(hostingField); |
| | | issueHosting.setIssue(issue); |
| | | this.issueHostingRepository.saveAndFlush(issueHosting); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //issueIsp 등록 |
| | | if (issueForm.getIssueIspFields() != null && issueForm.getIssueIspFields().size() > 0) { |
| | | for (Map<String, Object> issueIspMap : issueForm.getIssueIspFields()) { |
| | | IssueIsp issueIsp = ConvertUtil.convertMapToClass(issueIspMap, IssueIsp.class); |
| | | issueIsp = ConvertUtil.convertMapToClass(issueIspMap, IssueIsp.class, "id"); |
| | | IspField ispField = ConvertUtil.convertMapToClass(issueIspMap, IspField.class); |
| | | issueIsp.setIspField(ispField); |
| | | issueIsp.setIssue(issue); |
| | |
| | | //issueHosting 등록 |
| | | if (issueForm.getIssueHostingFields() != null && issueForm.getIssueHostingFields().size() > 0) { |
| | | for (Map<String, Object> issueHostingMap : issueForm.getIssueHostingFields()) { |
| | | IssueHosting issueHosting = ConvertUtil.convertMapToClass(issueHostingMap, IssueHosting.class); |
| | | issueHosting = ConvertUtil.convertMapToClass(issueHostingMap, IssueHosting.class, "id"); |
| | | HostingField hostingField = ConvertUtil.convertMapToClass(issueHostingMap, HostingField.class); |
| | | issueHosting.setHostingField(hostingField); |
| | | issueHosting.setIssue(issue); |
| | |
| | | * @return boolean |
| | | */ |
| | | private Boolean cellNullCheck (Cell cell) { |
| | | return cell != null && cell.getStringCellValue() != null && cell.getCellType() != Cell.CELL_TYPE_BLANK; |
| | | if (cell != null && cell.getStringCellValue() != null) { |
| | | cell.setCellValue(cell.getStringCellValue().trim());//셀 값 공백 제거 |
| | | } |
| | | return cell != null && cell.getStringCellValue() != null && !cell.getStringCellValue().equals("") && cell.getCellType() != Cell.CELL_TYPE_BLANK; |
| | | } |
| | | |
| | | // 엑셀 필드에 있는 정보를 이슈 form 으로 옮긴다. |