Merge branch 'devs/obp' into jenkins_with_weblogic
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
package com.eactive.eai.rms.onl.apim.portalorg;
|
||||
|
||||
import com.eactive.eai.rms.data.entity.man.monitoringProperty.service.MonitoringPropertyService;
|
||||
import com.eactive.ext.kjb.common.KjbObpException;
|
||||
import com.eactive.ext.kjb.common.KjbProperty;
|
||||
import com.eactive.ext.kjb.obp.KjbObpModule;
|
||||
import com.eactive.ext.kjb.util.KjbPropertyInjector;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* OBP 파트너코드 조회 서비스
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ObpPartnerCodeService {
|
||||
private static final String PROP_GROUP_ID = "Monitoring";
|
||||
|
||||
private final KjbPropertyInjector kjbPropertyInjector;
|
||||
|
||||
@Autowired
|
||||
public ObpPartnerCodeService(MonitoringPropertyService monitoringPropertyService) {
|
||||
this.kjbPropertyInjector = new KjbPropertyInjector(monitoringPropertyService, PROP_GROUP_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 사업자등록번호로 OBP 파트너코드 조회
|
||||
* @param compRegNo 사업자등록번호
|
||||
* @return 조회 결과 (success, partnerCode 또는 message)
|
||||
*/
|
||||
public Map<String, Object> queryPartnerCode(String compRegNo) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
|
||||
try {
|
||||
KjbProperty prop = kjbPropertyInjector.inject(new KjbProperty());
|
||||
KjbObpModule obpModule = KjbObpModule.getInstance(prop);
|
||||
|
||||
String partnerCode = obpModule.queryPartnerCode(compRegNo);
|
||||
|
||||
result.put("success", true);
|
||||
result.put("partnerCode", partnerCode);
|
||||
log.info("[OBP] 파트너코드 조회 성공 - compRegNo: {}, partnerCode: {}", compRegNo, partnerCode);
|
||||
|
||||
} catch (IllegalArgumentException e) {
|
||||
log.warn("[OBP] 파트너코드 조회 실패 - 잘못된 입력: {}", e.getMessage());
|
||||
result.put("success", false);
|
||||
result.put("message", e.getMessage());
|
||||
|
||||
} catch (KjbObpException e) {
|
||||
log.warn("[OBP] 파트너코드 조회 실패 - OBP 오류: {}", e.getMessage());
|
||||
result.put("success", false);
|
||||
result.put("message", "OBP 조회 실패: " + e.getMessage());
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("[OBP] 파트너코드 조회 중 오류 발생", e);
|
||||
result.put("success", false);
|
||||
result.put("message", "시스템 오류가 발생했습니다.");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
import com.eactive.eai.rms.onl.common.exception.BizException;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -25,13 +26,16 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
public class PortalOrgManController extends BaseAnnotationController {
|
||||
|
||||
private final PortalOrgManService portalOrgManService;
|
||||
private final ComboService comboService;
|
||||
private final ObpPartnerCodeService obpPartnerCodeService;
|
||||
|
||||
@GetMapping(value = "/onl/apim/portalorg/portalOrgMan.view")
|
||||
public void view() {
|
||||
@@ -104,4 +108,15 @@ public class PortalOrgManController extends BaseAnnotationController {
|
||||
return ResponseEntity.ok(new GridResponse<>(page));
|
||||
}
|
||||
|
||||
/**
|
||||
* OBP 파트너코드 조회
|
||||
* @param compRegNo 사업자등록번호
|
||||
* @return partnerCode
|
||||
*/
|
||||
@PostMapping(value = "/onl/apim/portalorg/portalOrgMan.json", params = "cmd=QUERY_OBP_PARTNER_CODE")
|
||||
public ResponseEntity<Map<String, Object>> queryObpPartnerCode(@RequestParam("compRegNo") String compRegNo) {
|
||||
Map<String, Object> result = obpPartnerCodeService.queryPartnerCode(compRegNo);
|
||||
return ResponseEntity.ok(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user