Merge branch 'devs/obp' into jenkins_with_weblogic
This commit is contained in:
@@ -20,6 +20,16 @@
|
||||
<jsp:include page="/jsp/common/include/css.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/script.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/portal.jsp"/>
|
||||
<style>
|
||||
.jnotification {
|
||||
position: fixed;
|
||||
top: 20px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
right: auto;
|
||||
bottom: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script language="javascript" >
|
||||
var url = '<c:url value="/onl/apim/portalorg/portalOrgMan.json" />';
|
||||
@@ -394,6 +404,47 @@
|
||||
downloadFile(fileId, '1'); // fileSn은 '1'로 가정
|
||||
});
|
||||
|
||||
// OBP 파트너코드 조회 버튼 클릭
|
||||
$("#btn_query_obp").click(function() {
|
||||
var compRegNo = $("#compRegNo").val();
|
||||
if (!compRegNo) {
|
||||
jSuites.notification({ name: '알림', message: '사업자등록번호를 먼저 입력해주세요.', error: true });
|
||||
$("#compRegNo").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
// 하이픈 제거
|
||||
compRegNo = compRegNo.replace(/-/g, '');
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: {
|
||||
cmd: 'QUERY_OBP_PARTNER_CODE',
|
||||
compRegNo: compRegNo
|
||||
},
|
||||
beforeSend: function() {
|
||||
$("#btn_query_obp").prop("disabled", true).html('<i class="material-icons">hourglass_empty</i> 조회중...');
|
||||
},
|
||||
success: function(json) {
|
||||
if (json.success) {
|
||||
$("#orgCode").val(json.partnerCode);
|
||||
jSuites.notification({ name: '성공', message: '파트너코드가 조회되었습니다: ' + json.partnerCode });
|
||||
} else {
|
||||
jSuites.notification({ name: '실패', message: json.message, error: true });
|
||||
}
|
||||
},
|
||||
error: function(e) {
|
||||
jSuites.notification({ name: '오류', message: '파트너코드 조회 중 오류가 발생했습니다.', error: true });
|
||||
console.error(e.responseText);
|
||||
},
|
||||
complete: function() {
|
||||
$("#btn_query_obp").prop("disabled", false).html('<i class="material-icons">search</i> 파트너코드 조회');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#btn_modify").click(function(){
|
||||
if (!checkRequired("ajaxForm")) return;
|
||||
|
||||
@@ -564,7 +615,10 @@
|
||||
<tr>
|
||||
<th style="width:15%;"><%= getRequiredLabel(localeMessage.getString("portalOrg.orgCode")) %></th>
|
||||
<td colspan="3" style="width:35%;">
|
||||
<input type="text" name="orgCode" id="orgCode" readonly/>
|
||||
<div style="display: flex; align-items: center;">
|
||||
<input type="text" name="orgCode" id="orgCode" style="width: 200px; margin-right: 10px;"/>
|
||||
<button type="button" class="cssbtn smallBtn" id="btn_query_obp"><i class="material-icons">search</i> 파트너코드 조회</button>
|
||||
</div>
|
||||
</td>
|
||||
<th><%= localeMessage.getString("portalOrg.orgIndustryType") %></th> <%--업종--%>
|
||||
<td><input type="text" name="orgIndustryType" id="orgIndustryType" maxlength="50" /></td>
|
||||
|
||||
@@ -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