Merge branch 'jenkins_with_weblogic' of ssh://git@192.168.240.178:18081/eapim/eapim-online.git into jenkins_with_weblogic
This commit is contained in:
+13
-1
@@ -16,6 +16,7 @@ import com.eactive.eai.adapter.AdapterManager;
|
||||
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceKey;
|
||||
import com.eactive.eai.common.property.PropGroupVO;
|
||||
import com.eactive.eai.common.property.PropManager;
|
||||
import com.eactive.eai.common.server.EAIServerManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
|
||||
@@ -28,6 +29,12 @@ public class KFTCFaceFilter implements HttpClientAdapterFilter, HttpAdapterServi
|
||||
public static final String B_ORG_CODE = "org_code";
|
||||
public static final String B_TRANSACTION_ID = "transaction_id";
|
||||
public static final String B_REQUEST_DATETIME = "request_datetime";
|
||||
public static String instId = null;
|
||||
|
||||
static {
|
||||
EAIServerManager eaiServerManager = EAIServerManager.getInstance();
|
||||
instId = eaiServerManager.getInstId();
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
@Override
|
||||
@@ -47,7 +54,12 @@ public class KFTCFaceFilter implements HttpClientAdapterFilter, HttpAdapterServi
|
||||
}
|
||||
|
||||
String request_datetime = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
|
||||
String transaction_id = orgCode + request_datetime + "1" + RandomStringUtils.random(4, true, true).toUpperCase();
|
||||
String reqDate = new SimpleDateFormat("yyMMdd").format(new Date());
|
||||
String reqTime = new SimpleDateFormat("HHmmss").format(new Date());
|
||||
// 기관코드(3) + 요청일자(6) -- 금결원 표준화 항목, 고정 9자리.
|
||||
// 요청시간(6) + 인스턴스ID(2) + RandomString(3) -- 기관별 생성 거래고유번호(11자리)
|
||||
// 기관코드(3) + 요청일자(6) + 요청시간(6) + 인스턴스ID(2) + RandomString(3) -- 20자리.
|
||||
String transaction_id = orgCode + reqDate + reqTime + instId + RandomStringUtils.random(3, true, true).toUpperCase();
|
||||
|
||||
Properties filterHeaders = (Properties) tempProp.get("FILTERHEADER");
|
||||
if (filterHeaders == null) {
|
||||
|
||||
+13
-4
@@ -11,6 +11,7 @@ import org.apache.commons.lang3.RandomStringUtils;
|
||||
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceKey;
|
||||
import com.eactive.eai.common.property.PropGroupVO;
|
||||
import com.eactive.eai.common.property.PropManager;
|
||||
import com.eactive.eai.common.server.EAIServerManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
|
||||
@@ -22,21 +23,29 @@ public class KFTCP2PFilter implements HttpClientAdapterFilter, HttpAdapterServic
|
||||
public static final String H_ORG_CODE = "org_code";
|
||||
public static final String H_TRX_NO = "api_trx_no";
|
||||
public static final String H_TRX_DTM = "api_trx_dtm";
|
||||
public static String instId = null;
|
||||
|
||||
static {
|
||||
EAIServerManager eaiServerManager = EAIServerManager.getInstance();
|
||||
instId = eaiServerManager.getInstId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object doPreFilter(String adptGrpName, String adptName, Properties prop, Object message, Properties tempProp)
|
||||
throws Exception {
|
||||
|
||||
logger.debug("KFTCP2PFilter] PreFilter Processing Start!!");
|
||||
String orgCode = "034"; // 광주은행 행코드
|
||||
String orgCode = "D210400012"; // 광주은행 개발 기관코드(운영: K210800020)
|
||||
|
||||
PropGroupVO propGroupVo = PropManager.getInstance().getPropGroupVO(KJB_HEADER);
|
||||
if (propGroupVo != null) {
|
||||
orgCode = propGroupVo.getProperty(PROP_PREFIX + "." + H_ORG_CODE);
|
||||
}
|
||||
|
||||
String apiTrxDtm = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
|
||||
String apiTrxNo = orgCode + apiTrxDtm + "1" + RandomStringUtils.random(5, true, true).toUpperCase();
|
||||
|
||||
String apiTrxDtm = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date());
|
||||
String apiTrxTm = new SimpleDateFormat("HHmmss").format(new Date());
|
||||
// 기관코드(10) + 인스턴스ID(2) + 일시(6) + RandomString(2) -- 총 20자리
|
||||
String apiTrxNo = orgCode + instId + apiTrxTm + RandomStringUtils.random(2, true, true).toUpperCase();
|
||||
|
||||
Properties filterHeaders = (Properties) tempProp.get("FILTERHEADER");
|
||||
if (filterHeaders == null) {
|
||||
|
||||
@@ -87,7 +87,7 @@ public class StandardMessageCoordinatorKJB extends DefaultStandardMessageCoordin
|
||||
//전문요청일자
|
||||
standardMessage.setData("Common.BizProc_Info.MESG_DMAN_DT", DatetimeUtil.getCurrentDate());
|
||||
//전문요청시간
|
||||
standardMessage.setData("Common.BizProc_Info.MESG_DMAN_TKTM", DatetimeUtil.getTime8());
|
||||
standardMessage.setData("Common.BizProc_Info.MESG_DMAN_TKTM", DatetimeUtil.getFormattedDate("HHmmssSSS"));
|
||||
|
||||
|
||||
//2012-07-24 임의 로 영업일자에 system시간 설정
|
||||
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
package com.eactive.eai.custom.transformer.function.userdefined;
|
||||
|
||||
import com.eactive.eai.common.context.ElinkTransactionContext;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.jayway.jsonpath.Configuration;
|
||||
import com.jayway.jsonpath.JsonPath;
|
||||
import com.jayway.jsonpath.spi.json.JacksonJsonNodeJsonProvider;
|
||||
import com.jayway.jsonpath.spi.json.JacksonJsonProvider;
|
||||
import org.nfunk.jep.ParseException;
|
||||
import org.nfunk.jep.function.PostfixMathCommand;
|
||||
|
||||
import java.util.Stack;
|
||||
|
||||
public class JsonPathExtractRequestMessage extends PostfixMathCommand {
|
||||
|
||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
public JsonPathExtractRequestMessage() {
|
||||
numberOfParameters = -1;
|
||||
}
|
||||
|
||||
public void run(Stack inStack) throws ParseException {
|
||||
checkStack(inStack);
|
||||
|
||||
String bizData = ElinkTransactionContext.getRequestBizData();
|
||||
|
||||
Object p1 = inStack.pop();
|
||||
String path = String.valueOf(p1);
|
||||
|
||||
inStack.clear();
|
||||
|
||||
try {
|
||||
// Jackson을 JsonPath의 JSON 프로바이더로 설정
|
||||
Configuration config = Configuration.builder()
|
||||
.jsonProvider(new JacksonJsonNodeJsonProvider())
|
||||
.build();
|
||||
|
||||
JsonNode resultNode = JsonPath.using(config).parse(bizData).read(path);
|
||||
|
||||
if (resultNode == null) {
|
||||
inStack.push(null);
|
||||
} else if (resultNode.isValueNode()) {
|
||||
// 단순 값(문자열, 숫자, boolean 등)은 텍스트로 반환
|
||||
inStack.push(resultNode.asText());
|
||||
} else {
|
||||
// 객체/배열은 JsonNode 그대로 반환
|
||||
inStack.push(resultNode);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new ParseException("JsonPath extract error: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private JsonNode getNodeAtPath(JsonNode rootNode, String path) {
|
||||
String[] tokens = path.split("/");
|
||||
JsonNode currentNode = rootNode;
|
||||
|
||||
for (String token : tokens) {
|
||||
if (token.isEmpty()) continue;
|
||||
|
||||
if (token.matches("\\d+")) {
|
||||
currentNode = currentNode.get(Integer.parseInt(token));
|
||||
} else {
|
||||
currentNode = currentNode.get(token);
|
||||
}
|
||||
|
||||
if (currentNode == null) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return currentNode;
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.eactive.eai.custom.transformer.function.userdefined;
|
||||
|
||||
import com.eactive.eai.common.context.ElinkTransactionContext;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.nfunk.jep.ParseException;
|
||||
import org.nfunk.jep.function.PostfixMathCommand;
|
||||
|
||||
import java.util.Stack;
|
||||
|
||||
public class SubStringRequestMessage extends PostfixMathCommand {
|
||||
public SubStringRequestMessage() {
|
||||
numberOfParameters = -1;
|
||||
}
|
||||
|
||||
public void run(Stack inStack) throws ParseException {
|
||||
checkStack(inStack);
|
||||
|
||||
String bizData = ElinkTransactionContext.getRequestBizData();
|
||||
|
||||
Object p1 = inStack.pop();
|
||||
Object p2 = inStack.pop();
|
||||
|
||||
int start = toInt(p2);
|
||||
int end = toInt(p1);
|
||||
|
||||
String resultStr = bizData.substring(start, end);
|
||||
inStack.clear();
|
||||
|
||||
inStack.push(resultStr);
|
||||
}
|
||||
|
||||
public static int toInt(Object obj) {
|
||||
if (obj instanceof Number) {
|
||||
return ((Number) obj).intValue();
|
||||
}
|
||||
if (obj instanceof String) {
|
||||
return Integer.parseInt(((String) obj).trim());
|
||||
}
|
||||
throw new IllegalArgumentException("Cannot convert to int: " + obj);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user