광주은행 표준전문 관련 작업

This commit is contained in:
yunjy-hp
2025-12-09 13:46:56 +09:00
parent c5ad5f7b7d
commit 24958ac00e
6 changed files with 76 additions and 17 deletions
@@ -107,16 +107,22 @@ public class FlatReader implements StandardReader {
case StandardType.GROUP:
logger.debug("@GROUP name={}, getLength={}, getRefPath={}, getRefValue=[{}]"
, currentItem.getName(), currentItem.getLength(), currentItem.getRefPath(), currentItem.getRefValue());
if( currentItem.getSize() == 0
&& StringUtils.isNotBlank(currentItem.getRefPath())
if( currentItem.getSize() == 0
&& StringUtils.isNotBlank(currentItem.getRefPath())
&& StringUtils.isNotBlank(currentItem.getRefValue()) ) {
String refItemValue = itemMap.get(currentItem.getRefPath());
//2024.08.07 아래추가로직은 Group 하위의 field 값에 따라서
//파싱을 해야 될경우 추가
String refItemValue ="";
if (currentItem.getRefPath().startsWith(fieldName)){
refItemValue = getRefItemValue(currentItem.getRefPath(), fieldName, srcbytes, currentItem, start);
}else{
refItemValue = itemMap.get(currentItem.getRefPath());
}
logger.debug("@GROUP name={}, getRefPath={}, refItemValue=[{}], getRefValue=[{}]"
, currentItem.getName(), currentItem.getRefPath(), refItemValue, currentItem.getRefValue());
if(refItemValue != null) refItemValue = refItemValue.trim();
/*
* 값의 경우의수 NR,ER,""(blank)
* ER이 아닐경우 표현하고 싶어서 ! 를 추가했음
@@ -284,6 +290,26 @@ public class FlatReader implements StandardReader {
}
return result;
}
private String getRefItemValue(String orgRef, String fieldName, byte[] srcbytes , StandardItem currentItem ,int start ){
String currentFieldName = orgRef.replace(fieldName+".","");
ArrayList<StandardItem> childList = currentItem.getChildsList();
String refItemValue ="";
for(StandardItem item : childList) {
if (currentFieldName.indexOf(".") < 0) {
byte[] tempValue = null;
if (orgRef.equals(fieldName + "." + item.getName())) {
tempValue = cut(fieldName, srcbytes, start, item.getLength());
return new String(tempValue);
}else{
start = start + item.getLength();
}
} else {
return getRefItemValue(orgRef, fieldName+"."+item.getName(), srcbytes, item, start);
}
}
return refItemValue;
}
// public static void main(String[] args) {
// }
}
@@ -25,6 +25,11 @@ public class DefaultStandardMessageCoordinator implements StandardMessageCoordin
mapper.setGuid(standardMessage, UUIDGenerator.getGUID(eaiServerManager.getSystemType()));
}
@Override
public void coordinateBeforeStandardMessageSend(StandardMessage standardMessage, String msgType, String charset) {
}
@Override
public void coordinateInReturnObject(StandardMessage standardMessage) {
}
@@ -72,5 +77,7 @@ public class DefaultStandardMessageCoordinator implements StandardMessageCoordin
}
@Override
public void coordinateBeforeResponse(StandardMessage standardMessage, ProcessVO processVO, Properties prop, String charset) {
}
}
@@ -26,7 +26,14 @@ public interface StandardMessageCoordinator {
* @param prop
*/
public void coordinateAfterCreateMessageByRule(StandardMessage standardMessage, Object paramObject, Properties prop);
/**
* 표준전문 송신 전 메시지 조립 전 처리
*
* @param standardMessage
*/
public void coordinateBeforeStandardMessageSend(StandardMessage standardMessage, String msgType, String charset);
/**
* 표준 메시지일경우 ReturnObject 에서 처리
*
@@ -97,4 +104,15 @@ public interface StandardMessageCoordinator {
* @param responseMessage
*/
public void coordinateAfterRecvNonStdSyncResponse(StandardMessage responseMessage);
/**
* RequestProcess 400 응답 로그 전 표준 메시지 조작 처리
*
* @param standardMessage
* @param processVO
* @param prop
* @param charset
*/
public void coordinateBeforeResponse(StandardMessage standardMessage, ProcessVO processVO, Properties prop, String charset);
}