api 이슈 추가시 업체/isp/호스팅에 해당 도메인이 포함되면 해당 업체 자동 입력
| | |
| | | |
| | | List<Map<String, Object>> findEvent(); |
| | | |
| | | Long findByHosting(Long id); |
| | | Map<String, Object> findById(Long id); |
| | | } |
| | |
| | | |
| | | List<Map<String, Object>> findEvent(); |
| | | |
| | | Long findByIsp(Long id); |
| | | Map<String, Object> findById(Long id); |
| | | } |
| | |
| | | |
| | | List<CompanyFieldVo> findCompany(Map<String, Object> resJsonData, CompanyFieldCondition make, Pageable pageable); |
| | | |
| | | List<Map<String, Object>> find(CompanyFieldCondition condition); |
| | | |
| | | CompanyField getCompany(Long id); |
| | | |
| | | void detailCompany(Map<String, Object> resJsonData, CompanyFieldCondition make); |
| | |
| | | |
| | | List<HostingFieldVo> find(Map<String, Object> resJsonData, HostingFieldCondition make, Pageable pageable); |
| | | |
| | | Map<String, Object> find(Long id); |
| | | |
| | | HostingField getHosting(Long id); |
| | | |
| | | void detail(Map<String, Object> resJsonData, HostingFieldCondition make); |
| | |
| | | |
| | | List<IspFieldVo> find(Map<String, Object> resJsonData, IspFieldCondition make, Pageable pageable); |
| | | |
| | | Map<String, Object> find(Long id); |
| | | |
| | | IspField getIsp(Long id); |
| | | |
| | | void detail(Map<String, Object> resJsonData, IspFieldCondition make); |
| | |
| | | package kr.wisestone.owl.service.impl; |
| | | |
| | | import kr.wisestone.owl.domain.CompanyField; |
| | | import kr.wisestone.owl.domain.CustomField; |
| | | import kr.wisestone.owl.domain.HostingField; |
| | | import kr.wisestone.owl.domain.IspField; |
| | | import kr.wisestone.owl.domain.*; |
| | | import kr.wisestone.owl.repository.HostingFieldRepository; |
| | | import kr.wisestone.owl.repository.IspFieldRepository; |
| | | import kr.wisestone.owl.service.*; |
| | |
| | | return this.convertCompanyVoToMap(results, totalCompanyCount, pageable, resJsonData); |
| | | } |
| | | |
| | | public List<Map<String, Object>> find(CompanyFieldCondition condition) { |
| | | return this.companyFieldMapper.find(condition); |
| | | } |
| | | |
| | | // 업체 상세 조회한다. |
| | | @Override |
| | | @Transactional |
| | |
| | | return this.convertHostingVoToMap(results, totalHostingCount, pageable, resJsonData); |
| | | } |
| | | |
| | | public Map<String, Object> find(Long id) { |
| | | return this.hostingFieldMapper.findById(id); |
| | | } |
| | | |
| | | // Hosting 상세 조회한다. |
| | | @Override |
| | |
| | | return this.convertIspVoToMap(results, totalIspCount, pageable, resJsonData); |
| | | } |
| | | |
| | | public Map<String, Object> find(Long id) { |
| | | return this.ispFieldMapper.findById(id); |
| | | } |
| | | |
| | | // Isp 상세 조회한다. |
| | | @Override |
| | | public void detail(Map<String, Object> resJsonData, IspFieldCondition ispFieldCondition) { |
| | |
| | | private ApiTokenService apiTokenService; |
| | | |
| | | @Autowired |
| | | private CompanyFieldService companyFieldService; |
| | | |
| | | @Autowired |
| | | private IspFieldService ispFieldService; |
| | | |
| | | @Autowired |
| | | private HostingFieldService hostingFieldService; |
| | | |
| | | @Autowired |
| | | private CommonConfiguration configuration; |
| | | |
| | | @Autowired |
| | |
| | | |
| | | // 사용자 정의 필드 설정 |
| | | issueForm.setIssueCustomFields(issueApiForm.getCustomFieldValues()); |
| | | // 같은 도메인 업체 찾기 |
| | | this.findCompanyField(issueForm); |
| | | |
| | | // api 입력값 적용 |
| | | ConvertUtil.copyProperties(issueApiForm, issueForm); |
| | |
| | | } |
| | | } |
| | | |
| | | private void findCompanyField(IssueForm issueForm) { |
| | | if(issueForm.getIssueCustomFields() != null && issueForm.getIssueCustomFields().size() > 0) { |
| | | CompanyFieldCondition condition = new CompanyFieldCondition(); |
| | | List<Map<String, Object>> companyFields = this.companyFieldService.find(condition); |
| | | List<Map<String, Object>> issueCompanyFields = Lists.newArrayList(); |
| | | List<Map<String, Object>> issueIspFields = Lists.newArrayList(); |
| | | 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); |
| | | if(customField != null && customField.getCustomFieldType().toString().equals("SITE") && customField.getName().equals("도메인")) { |
| | | String useValue = issueCustomField.get("useValue").toString(); |
| | | if(companyFields != null && companyFields.size() > 0) { |
| | | for (Map<String, Object> companyField : companyFields) { |
| | | CompanyFieldVo companyFieldVo = ConvertUtil.convertMapToClass(companyField, CompanyFieldVo.class); |
| | | if(useValue.equals(companyFieldVo.getUrl())) { |
| | | companyField.put("companyId", companyField.get("id")); |
| | | issueCompanyFields.add(companyField); |
| | | if(companyFieldVo.getIspId() != null) { |
| | | 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) { |
| | | Map<String, Object> hostingField = this.hostingFieldService.find(companyFieldVo.getHostingId()); |
| | | if (hostingField != null) { |
| | | hostingField.put("hostingId", hostingField.get("id")); |
| | | issueHostingFields.add(hostingField); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | issueForm.setIssueCompanyFields(issueCompanyFields); |
| | | issueForm.setIssueIspFields(issueIspFields); |
| | | issueForm.setIssueHostingFields(issueHostingFields); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private User convertToUser(String token) { |
| | | // 토큰으로 유저 정보 가져오기 |
| | | UserVo userVo = this.apiTokenService.certification(token); |
| | |
| | | import com.google.common.collect.Lists; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | import kr.wisestone.owl.util.MapUtil; |
| | | import kr.wisestone.owl.vo.CompanyFieldVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | AND h.id like CONCAT('%',#{id},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="findById" resultType="java.util.HashMap" parameterType="java.lang.Long"> |
| | | SELECT |
| | | h.id as id, |
| | | h.code as code, |
| | | h.name as name, |
| | | h.manager as manager, |
| | | h.tel as tel, |
| | | h.email as email, |
| | | h.url as url, |
| | | h.memo as memo |
| | | FROM |
| | | hosting_field h |
| | | WHERE h.id = ${id} |
| | | </select> |
| | | </mapper> |
| | |
| | | AND i.id like CONCAT('%',#{id},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="findById" resultType="java.util.HashMap" parameterType="java.lang.Long"> |
| | | SELECT |
| | | i.id as id, |
| | | i.code as code, |
| | | i.name as name, |
| | | i.manager as manager, |
| | | i.tel as tel, |
| | | i.email as email, |
| | | i.url as url, |
| | | i.memo as memo |
| | | FROM |
| | | isp_field i |
| | | WHERE i.id = ${id} |
| | | </select> |
| | | </mapper> |