IIM연동 DJB 커스텀
eapim-admin CI / build (push) Has been cancelled

This commit is contained in:
eastargh
2026-06-25 11:42:09 +09:00
parent 25a8e13752
commit 908b2ebcc8
2 changed files with 70 additions and 4 deletions
@@ -74,6 +74,7 @@ public class LayoutDao extends SqlMapClientTemplateDao {
entity.setEaibzwkdstcd((String) paramMap.get("eaiBzwkDstcd"));
entity.setUapplname((String) paramMap.get("uapplName"));
entity.setSysintfacname((String) paramMap.get("sysIntfacName"));
entity.setUseyn((String) paramMap.get("useYn"));
layoutService.save(entity);
}
@@ -683,7 +683,9 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
param.put("recvData", "");
}
syncLayout(param, recvTime, json);
//syncLayout(param, recvTime, json);
syncLayoutDjb(param, recvTime, json);
// results.getChild("Result").setText("S".equals(param.get("prcssRslt"))?"True":"False");
// results.getChild("ResultMessage").setText("S".equals(param.get("prcssRslt"))?"성공":param.get("prcssRsltCmnt"));
@@ -900,7 +902,11 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
private void syncLayout(HashMap<String, String> param, JSONObject body, String command, JSONObject layout)
throws Exception, BizException, ParseException {
String layoutName = (String) layout.get("id");
String id = (String) layout.get("id");
String layoutName = (String) layout.get("layoutName");
if (StringUtils.isEmpty(layoutName)) {
layoutName = id;
}
String useSystem = (String) layout.get("usesystem");
param.put("logPrcssSeqno", UUIDGenerator.getUUID());
@@ -935,7 +941,7 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
break;
}
if(!layoutName.matches(fattern)) {
if(!id.matches(fattern)) {
throw new BizException("잘못된 전문레이아웃명 입니다.\n명명규칙을 확인하세요.\n"+fattern);
}
@@ -955,7 +961,8 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
// Layout Format (TR07)
vo.put("loutName",layoutName);
vo.put("loutPtrnName",msgType); // ASCII, EBCDIC, XML
vo.put("loutDesc",layout.get("desc"));
vo.put("loutDesc",layout.get("desc"));
vo.put("useYn", "1");
String date = (String) layout.get("date");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -1183,5 +1190,63 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
}
return null ;
}
private void syncLayoutDjb(HashMap<String, String> param, String recvTime, JSONObject json)
throws Exception, BizException, ParseException {
JSONObject header = (JSONObject) ((JSONObject) json.get("Message")).get("Header");
JSONObject body = (JSONObject) ((JSONObject) json.get("Message")).get("Body");
String serviceName = (String) header.get("ServiceName");
String command = (String) header.get("Command");
param.put("serviceName", serviceName);
param.put("command", command);
param.put("recvAmndHMS", recvTime);
Object layoutObject = body.get("Layout");
JSONArray layoutArray = null;
if (layoutObject instanceof JSONArray) {
String interfaceId = (String) body.get("interfaceCode");
if (interfaceId.startsWith("ES")) {
interfaceId = interfaceId.replaceFirst("ES", "AS");
}
layoutArray = (JSONArray) layoutObject;
for (int i = 0; i < layoutArray.size(); i++) {
JSONObject layout = (JSONObject)layoutArray.get(i);
String usesystem = (String)layout.get("usesystem");
if ("EAI".equals(usesystem)) {
String id = (String)layout.get("id");
String inOutType = "OPA".equals(id.substring(5,8)) ? "S1" : "S2";
String group = (String)layout.get("group");
String ioType = (String)layout.get("ioType");
if ("I".equals(ioType)) {
layout.put("layoutName", group + "_" + interfaceId + inOutType + "_SRCS");
syncLayout(param, body, command, layout);
layout.put("layoutName", group + "_" + interfaceId + inOutType + "_TGTS");
syncLayout(param, body, command, layout);
} else {
layout.put("layoutName", group + "_" + interfaceId + inOutType + "_SRCR");
syncLayout(param, body, command, layout);
layout.put("layoutName", group + "_" + interfaceId + inOutType + "_TGTR");
syncLayout(param, body, command, layout);
}
}
}
} else {
throw new BizException("단독 레이아웃 연동은 지원하지 않습니다.");
}
}
}