This commit is contained in:
Rinjae
2025-09-05 17:16:26 +09:00
commit c54ef1903f
4947 changed files with 817291 additions and 0 deletions
@@ -0,0 +1,40 @@
package com.eactive.eai.custom;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.InitializingBean;
import com.eactive.eai.transformer.message.ISO8583MessageFactory;
/**
* 이곳에서 Custermizing 대상 class 및 변수의 초기화 작업을 수행한다.
*/
public class CustomizingAppInitializer implements InitializingBean {
final Logger logger = Logger.getLogger(CustomizingAppInitializer.class);
public static final String MESSAGE_TYPE_H2H = "H2H";
public static final String LAYOUT_TYPE_H2H = "ISO8583H2H";
public static final String ISO8583_H2H_CLASS_NAME = "com.eactive.eai.custom.transformer.message.ISO8583H2HMessage";
public static final String MESSAGE_TYPE_SVL = "SVL";
public static final String LAYOUT_TYPE_SVL = "ISO8583SVL";
public static final String ISO8583_SVL_CLASS_NAME = "com.eactive.eai.custom.transformer.message.ISO8583SilverlakeMessage";
@Override
public void afterPropertiesSet() throws Exception {
/*
* @formatter:off
* Custom ISO8583 메시지 추가시
* - ONLWeb: Custom Mesaage java 추가, 아래 맵에 추가
* - EMSWeb: Custom Mesaage java 추가, 아래 맵에 추가(로그조회시 parsing 위해)
* @formatter:on
*/
ISO8583MessageFactory.ISO8583_MESSAGE_TYPE_CLASS_MAP.put(MESSAGE_TYPE_H2H, ISO8583_H2H_CLASS_NAME);
ISO8583MessageFactory.ISO8583_MESSAGE_TYPE_CLASS_MAP.put(MESSAGE_TYPE_SVL, ISO8583_SVL_CLASS_NAME);
ISO8583MessageFactory.ISO8583_LAYOUT_TYPE_CLASS_MAP.put(LAYOUT_TYPE_H2H, ISO8583_H2H_CLASS_NAME);
ISO8583MessageFactory.ISO8583_LAYOUT_TYPE_CLASS_MAP.put(LAYOUT_TYPE_SVL, ISO8583_SVL_CLASS_NAME);
logger.info(String.format("ISO8583MessageFactory registered - %s = %s", MESSAGE_TYPE_H2H, ISO8583_H2H_CLASS_NAME));
logger.info(String.format("ISO8583MessageFactory registered - %s = %s", MESSAGE_TYPE_SVL, ISO8583_SVL_CLASS_NAME));
logger.info(String.format("ISO8583MessageFactory registered - %s = %s", LAYOUT_TYPE_H2H, ISO8583_H2H_CLASS_NAME));
logger.info(String.format("ISO8583MessageFactory registered - %s = %s", LAYOUT_TYPE_SVL, ISO8583_SVL_CLASS_NAME));
}
}
@@ -0,0 +1,162 @@
package com.eactive.eai.custom.transformer.message;
import java.util.HashMap;
import com.eactive.eai.transformer.message.ISO8583Message;
import com.solab.iso8583.IsoMessage;
import com.solab.iso8583.IsoType;
import com.solab.iso8583.MessageFactory;
import com.solab.iso8583.parse.FieldParseInfo;
/**
* <pre>
* ISO 8583 H2H(전문) 형식의 데이터를 변환하기 위한 메시지.(For KB Bukopin)
*
* [참조]
* https://en.wikipedia.org/wiki/ISO_8583
* </pre>
*/
@SuppressWarnings("serial")
public class ISO8583H2HMessage extends ISO8583Message {
private static HashMap<Integer, FieldParseInfo> fullSpecMap = null;
private static HashMap<Integer, String> fullFieldNameMap = null;
@Override
public MessageFactory<IsoMessage> createMessageFactory() {
MessageFactory<IsoMessage> mf = new MessageFactory<>();
mf.setCharacterEncoding(System.getProperty("file.encoding"));
mf.setForceStringEncoding(false);
return mf;
}
@Override
public HashMap<Integer, FieldParseInfo> getFullSpecMap(String encode) {
if (fullSpecMap != null) {
return fullSpecMap;
}
fullSpecMap = new HashMap<>();
fullSpecMap.put(2, FieldParseInfo.getInstance(IsoType.LLVAR, 19, encode));
fullSpecMap.put(3, FieldParseInfo.getInstance(IsoType.NUMERIC, 6, encode));
fullSpecMap.put(4, FieldParseInfo.getInstance(IsoType.NUMERIC, 12, encode));
fullSpecMap.put(6, FieldParseInfo.getInstance(IsoType.NUMERIC, 12, encode));
fullSpecMap.put(7, FieldParseInfo.getInstance(IsoType.DATE10, 10, encode));
fullSpecMap.put(11, FieldParseInfo.getInstance(IsoType.NUMERIC, 6, encode));
fullSpecMap.put(12, FieldParseInfo.getInstance(IsoType.TIME, 6, encode));
fullSpecMap.put(13, FieldParseInfo.getInstance(IsoType.DATE4, 4, encode));
fullSpecMap.put(14, FieldParseInfo.getInstance(IsoType.DATE_EXP, 4, encode));
fullSpecMap.put(15, FieldParseInfo.getInstance(IsoType.DATE4, 4, encode));
fullSpecMap.put(18, FieldParseInfo.getInstance(IsoType.NUMERIC, 4, encode));
fullSpecMap.put(22, FieldParseInfo.getInstance(IsoType.NUMERIC, 3, encode));
fullSpecMap.put(24, FieldParseInfo.getInstance(IsoType.NUMERIC, 3, encode));
fullSpecMap.put(25, FieldParseInfo.getInstance(IsoType.NUMERIC, 2, encode));
fullSpecMap.put(26, FieldParseInfo.getInstance(IsoType.NUMERIC, 2, encode));
fullSpecMap.put(32, FieldParseInfo.getInstance(IsoType.LLVAR, 11, encode));
fullSpecMap.put(33, FieldParseInfo.getInstance(IsoType.LLVAR, 11, encode));
fullSpecMap.put(35, FieldParseInfo.getInstance(IsoType.LLVAR, 37, encode));
fullSpecMap.put(37, FieldParseInfo.getInstance(IsoType.ALPHA, 12, encode));
fullSpecMap.put(38, FieldParseInfo.getInstance(IsoType.ALPHA, 6, encode));
fullSpecMap.put(39, FieldParseInfo.getInstance(IsoType.ALPHA, 2, encode));
fullSpecMap.put(40, FieldParseInfo.getInstance(IsoType.ALPHA, 3, encode));
fullSpecMap.put(41, FieldParseInfo.getInstance(IsoType.ALPHA, 8, encode));
fullSpecMap.put(42, FieldParseInfo.getInstance(IsoType.ALPHA, 15, encode));
fullSpecMap.put(43, FieldParseInfo.getInstance(IsoType.ALPHA, 40, encode));
fullSpecMap.put(48, FieldParseInfo.getInstance(IsoType.LLLVAR, 999, encode));
fullSpecMap.put(49, FieldParseInfo.getInstance(IsoType.ALPHA, 3, encode));
// fullSpecMap.put(52, FieldParseInfo.getInstance(IsoType.BINARY, 64, encode));
fullSpecMap.put(52, FieldParseInfo.getInstance(IsoType.ALPHA, 16, encode)); // 표준X
fullSpecMap.put(54, FieldParseInfo.getInstance(IsoType.LLLVAR, 120, encode));
fullSpecMap.put(55, FieldParseInfo.getInstance(IsoType.LLLVAR, 765, encode));
fullSpecMap.put(60, FieldParseInfo.getInstance(IsoType.LLLVAR, 999, encode));
fullSpecMap.put(61, FieldParseInfo.getInstance(IsoType.LLLVAR, 999, encode));
fullSpecMap.put(62, FieldParseInfo.getInstance(IsoType.LLLVAR, 999, encode));
fullSpecMap.put(63, FieldParseInfo.getInstance(IsoType.LLLVAR, 999, encode));
fullSpecMap.put(70, FieldParseInfo.getInstance(IsoType.NUMERIC, 3, encode));
fullSpecMap.put(90, FieldParseInfo.getInstance(IsoType.NUMERIC, 42, encode));
fullSpecMap.put(98, FieldParseInfo.getInstance(IsoType.ALPHA, 25, encode));
fullSpecMap.put(102, FieldParseInfo.getInstance(IsoType.LLVAR, 28, encode));
fullSpecMap.put(103, FieldParseInfo.getInstance(IsoType.LLVAR, 28, encode));
fullSpecMap.put(120, FieldParseInfo.getInstance(IsoType.LLLVAR, 999, encode));
// fullSpecMap.put(126, FieldParseInfo.getInstance(IsoType.LLLVAR, 999,
// encode));
fullSpecMap.put(126, FieldParseInfo.getInstance(IsoType.LLLLVAR, 9999, encode)); // 표준X
fullSpecMap.put(127, FieldParseInfo.getInstance(IsoType.LLLVAR, 999, encode));
fullSpecMap.put(128, FieldParseInfo.getInstance(IsoType.BINARY, 64, encode));
return fullSpecMap;
}
public String getFieldName(int key) {
if (fullFieldNameMap == null) {
fullFieldNameMap = new HashMap<>();
fullFieldNameMap.put(1, "Bitmap, Secondary");
fullFieldNameMap.put(2, "Primary Account Number");
fullFieldNameMap.put(3, "Processing Code");
fullFieldNameMap.put(4, "Amount, Transaction");
fullFieldNameMap.put(6, "Amount, Cardholder Billing");
fullFieldNameMap.put(7, "Transmission Date and Time");
fullFieldNameMap.put(11, "System Trace Audit Number");
fullFieldNameMap.put(12, "Time, Local Transaction");
fullFieldNameMap.put(13, "Date, Local Transaction");
fullFieldNameMap.put(14, "Date, Expiration");
fullFieldNameMap.put(15, "Date, Settlement");
fullFieldNameMap.put(18, "Merchant Type");
fullFieldNameMap.put(22, "Point of Service Entry Mode");
fullFieldNameMap.put(24, "Network/Function Indentification Id");
fullFieldNameMap.put(25, "Point-Of-Service Condition Code");
fullFieldNameMap.put(26, "Point-Of-Service PIN Capture Code");
fullFieldNameMap.put(32, "Acquiring Institution Identification Code");
fullFieldNameMap.put(33, "Forwarding Institution Identification Code");
fullFieldNameMap.put(35, "Track 2 Data");
fullFieldNameMap.put(37, "Retrieval Reference Number");
fullFieldNameMap.put(38, "Authorization Identification Response");
fullFieldNameMap.put(39, "Response Code");
fullFieldNameMap.put(40, "Service Restriction Code");
fullFieldNameMap.put(41, "Card Acceptor Terminal Identification");
fullFieldNameMap.put(42, "Card Acceptor Identification");
fullFieldNameMap.put(43, "Card Acceptor Name and Location");
fullFieldNameMap.put(48, "Additional Data Private");
fullFieldNameMap.put(49, "Transaction Currency Code");
fullFieldNameMap.put(52, "Personal Identification Number");
fullFieldNameMap.put(54, "Amount, Additional");
fullFieldNameMap.put(55, "Integrated Circuit Card (ICC) System Related Data");
fullFieldNameMap.put(60, "Reserved Private F60");
fullFieldNameMap.put(61, "Reserved Private F61");
fullFieldNameMap.put(62, "Reserved Private F62");
fullFieldNameMap.put(63, "Reserved Private F63");
fullFieldNameMap.put(70, "Network Management Information Code");
fullFieldNameMap.put(90, "Original Data Element");
fullFieldNameMap.put(98, "Payee");
fullFieldNameMap.put(102, "Account Identification 1");
fullFieldNameMap.put(103, "Account Identification 2");
fullFieldNameMap.put(120, "Reserved Private F120");
fullFieldNameMap.put(126, "Reserved Private F126");
fullFieldNameMap.put(127, "Destination Institution Identification Code");
fullFieldNameMap.put(128, "Message Authentication Code Field");
}
return fullFieldNameMap.get(new Integer(key));
}
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append(
"[ISO8583H2H message]");
sb.append("\n" + super.toString());
sb.append(
"\n");
return sb.toString();
}
}
@@ -0,0 +1,134 @@
package com.eactive.eai.custom.transformer.message;
import java.util.HashMap;
import com.eactive.eai.transformer.message.ISO8583Message;
import com.solab.iso8583.IsoMessage;
import com.solab.iso8583.IsoType;
import com.solab.iso8583.MessageFactory;
import com.solab.iso8583.parse.FieldParseInfo;
/**
* @formatter:off
* ISO 8583 Silverlake(전문) 형식의 데이터를 변환하기 위한 메시지.(For KB Bukopin)
* - Binary, EBCDIC
*
* [참조] https://en.wikipedia.org/wiki/ISO_8583
* @formatter:on
*/
@SuppressWarnings("serial")
public class ISO8583SilverlakeMessage extends ISO8583Message {
private static HashMap<Integer, FieldParseInfo> fullSpecMap = null;
private static HashMap<Integer, String> fullFieldNameMap = null;
private static String encode = "Cp1047"; // EBCDIC(1047)
public MessageFactory<IsoMessage> createMessageFactory() {
MessageFactory<IsoMessage> mf = new MessageFactory<>();
mf.setUseBinaryMessages(true);
mf.setUseBinaryBitmap(true);
mf.setVariableLengthFieldsInHex(false);
mf.setCharacterEncoding(encode);
mf.setForceStringEncoding(true);
return mf;
}
public HashMap<Integer, FieldParseInfo> getFullSpecMap(String enc) {
if (fullSpecMap != null) {
return fullSpecMap;
}
fullSpecMap = new HashMap<>();
fullSpecMap.put(2, FieldParseInfo.getInstance(IsoType.LLBCDBIN, 10, encode));
fullSpecMap.put(3, FieldParseInfo.getInstance(IsoType.BINARY, 3, encode));
fullSpecMap.put(4, FieldParseInfo.getInstance(IsoType.BINARY, 6, encode));
fullSpecMap.put(7, FieldParseInfo.getInstance(IsoType.BINARY, 5, encode));
fullSpecMap.put(11, FieldParseInfo.getInstance(IsoType.BINARY, 3, encode));
fullSpecMap.put(12, FieldParseInfo.getInstance(IsoType.BINARY, 3, encode));
fullSpecMap.put(13, FieldParseInfo.getInstance(IsoType.BINARY, 2, encode));
fullSpecMap.put(14, FieldParseInfo.getInstance(IsoType.BINARY, 2, encode));
fullSpecMap.put(18, FieldParseInfo.getInstance(IsoType.BINARY, 2, encode));
fullSpecMap.put(22, FieldParseInfo.getInstance(IsoType.BINARY, 2, encode));
fullSpecMap.put(23, FieldParseInfo.getInstance(IsoType.BINARY, 2, encode));
fullSpecMap.put(25, FieldParseInfo.getInstance(IsoType.BINARY, 1, encode));
fullSpecMap.put(35, FieldParseInfo.getInstance(IsoType.LLBCDBIN, 19, encode));
fullSpecMap.put(37, FieldParseInfo.getInstance(IsoType.ALPHA, 12, encode));
fullSpecMap.put(38, FieldParseInfo.getInstance(IsoType.ALPHA, 6, encode));
fullSpecMap.put(39, FieldParseInfo.getInstance(IsoType.ALPHA, 2, encode));
fullSpecMap.put(41, FieldParseInfo.getInstance(IsoType.ALPHA, 8, encode));
fullSpecMap.put(42, FieldParseInfo.getInstance(IsoType.ALPHA, 15, encode));
fullSpecMap.put(43, FieldParseInfo.getInstance(IsoType.ALPHA, 40, encode));
fullSpecMap.put(47, FieldParseInfo.getInstance(IsoType.LLLVAR, 256, encode));
fullSpecMap.put(48, FieldParseInfo.getInstance(IsoType.LLLVAR, 256, encode));
fullSpecMap.put(52, FieldParseInfo.getInstance(IsoType.BINARY, 8, encode));
fullSpecMap.put(54, FieldParseInfo.getInstance(IsoType.LLLVAR, 120, encode));
fullSpecMap.put(55, FieldParseInfo.getInstance(IsoType.LLLVAR, 255, encode));
fullSpecMap.put(57, FieldParseInfo.getInstance(IsoType.LLLVAR, 255, encode));
fullSpecMap.put(58, FieldParseInfo.getInstance(IsoType.LLLVAR, 255, encode));
fullSpecMap.put(60, FieldParseInfo.getInstance(IsoType.LLLVAR, 120, encode));
fullSpecMap.put(61, FieldParseInfo.getInstance(IsoType.LLLVAR, 120, encode));
fullSpecMap.put(62, FieldParseInfo.getInstance(IsoType.LLLVAR, 512, encode));
fullSpecMap.put(63, FieldParseInfo.getInstance(IsoType.LLLVAR, 512, encode));
fullSpecMap.put(120, FieldParseInfo.getInstance(IsoType.LLLVAR, 700, encode));
fullSpecMap.put(121, FieldParseInfo.getInstance(IsoType.LLLVAR, 500, encode));
fullSpecMap.put(122, FieldParseInfo.getInstance(IsoType.LLLVAR, 350, encode));
fullSpecMap.put(123, FieldParseInfo.getInstance(IsoType.LLLVAR, 999, encode));
fullSpecMap.put(124, FieldParseInfo.getInstance(IsoType.LLLVAR, 450, encode));
fullSpecMap.put(125, FieldParseInfo.getInstance(IsoType.LLLVAR, 255, encode));
return fullSpecMap;
}
public String getFieldName(int key) {
if (fullFieldNameMap == null) {
fullFieldNameMap = new HashMap<>();
fullFieldNameMap.put(1, "Secondary Bit Map");
fullFieldNameMap.put(2, "Primary Account Number");
fullFieldNameMap.put(3, "Processing code");
fullFieldNameMap.put(4, "Amount,transaction");
fullFieldNameMap.put(7, "Transmission date & time");
fullFieldNameMap.put(11, "System audit trace number");
fullFieldNameMap.put(12, "Time, local transaction");
fullFieldNameMap.put(13, "Date, local transaction");
fullFieldNameMap.put(14, "Date, expiration");
fullFieldNameMap.put(18, "Merchant type");
fullFieldNameMap.put(22, "POS entry mode");
fullFieldNameMap.put(23, "Card sequence number");
fullFieldNameMap.put(25, "POS condition code");
fullFieldNameMap.put(35, "Track 2 data");
fullFieldNameMap.put(37, "Retrieval reference number");
fullFieldNameMap.put(38, "Authorisation ID response");
fullFieldNameMap.put(39, "Response code");
fullFieldNameMap.put(41, "Terminal ID");
fullFieldNameMap.put(42, "Card acceptor ID");
fullFieldNameMap.put(43, "Card acceptor name/location");
fullFieldNameMap.put(47, "Private Use");
fullFieldNameMap.put(48, "Request header");
fullFieldNameMap.put(52, "PIN data");
fullFieldNameMap.put(54, "Private Use");
fullFieldNameMap.put(55, "ICC system related data");
fullFieldNameMap.put(57, "Private Use");
fullFieldNameMap.put(58, "Private Use");
fullFieldNameMap.put(60, "Private Use");
fullFieldNameMap.put(61, "Private Use");
fullFieldNameMap.put(62, "Private Use");
fullFieldNameMap.put(63, "Private Use");
fullFieldNameMap.put(120, "Private Use");
fullFieldNameMap.put(121, "Private Use");
fullFieldNameMap.put(122, "Response detail");
fullFieldNameMap.put(123, "Response detail");
fullFieldNameMap.put(124, "Private Use");
fullFieldNameMap.put(125, "Private Use");
}
return fullFieldNameMap.get(new Integer(key));
}
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("[ISO8583 Silverlake message]");
sb.append("\n" + super.toString());
sb.append("\n");
return sb.toString();
}
}