@@ -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);
|
||||
}
|
||||
|
||||
+68
-3
@@ -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);
|
||||
}
|
||||
|
||||
@@ -956,6 +962,7 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
|
||||
vo.put("loutName",layoutName);
|
||||
vo.put("loutPtrnName",msgType); // ASCII, EBCDIC, XML
|
||||
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");
|
||||
@@ -1184,4 +1191,62 @@ 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("단독 레이아웃 연동은 지원하지 않습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user