This commit is contained in:
+7
-1
@@ -25,10 +25,16 @@ class KJBInterfaceService {
|
|||||||
HashMap detail = dao.selectDetailAPI(param);
|
HashMap detail = dao.selectDetailAPI(param);
|
||||||
if (detail == null) {
|
if (detail == null) {
|
||||||
dao.insertToHE01(param);
|
dao.insertToHE01(param);
|
||||||
|
|
||||||
dao.deleteToHE02(param);
|
dao.deleteToHE02(param);
|
||||||
dao.insertToHE02(param);
|
dao.insertToHE02(param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean existsInterface(String interfaceId) throws Exception {
|
||||||
|
HashMap<String, Object> param = new HashMap<>();
|
||||||
|
param.put("EAISVCNAME", interfaceId);
|
||||||
|
return dao.selectDetailAPI(param) != null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-9
@@ -1231,10 +1231,11 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
|
|||||||
param.put("command", command);
|
param.put("command", command);
|
||||||
param.put("recvAmndHMS", recvTime);
|
param.put("recvAmndHMS", recvTime);
|
||||||
|
|
||||||
|
boolean isDevMake = this.isDevMake(interfaceId);
|
||||||
|
|
||||||
if (command.equals("insert")) {
|
if (command.equals("insert")) {
|
||||||
insertInterfaceDjb(interfaceId, body);
|
insertInterfaceDjb(interfaceId, body);
|
||||||
if (this.isDevMake(interfaceId)) {
|
if (isDevMake) {
|
||||||
interfaceId = interfaceId.substring(0,8) + "D" + interfaceId.substring(8);
|
interfaceId = interfaceId.substring(0,8) + "D" + interfaceId.substring(8);
|
||||||
insertInterfaceDjb(interfaceId, body);
|
insertInterfaceDjb(interfaceId, body);
|
||||||
}
|
}
|
||||||
@@ -1247,7 +1248,7 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
|
|||||||
JSONObject layout = (JSONObject) layoutArray.get(i);
|
JSONObject layout = (JSONObject) layoutArray.get(i);
|
||||||
syncLayout(param, body, command, layout);
|
syncLayout(param, body, command, layout);
|
||||||
|
|
||||||
if (this.isDevMake(layout)) {
|
if (isDevMake) {
|
||||||
String layoutName = (String) layout.get("id");
|
String layoutName = (String) layout.get("id");
|
||||||
layoutName = layoutName.substring(0,12) + "D" + layoutName.substring(12);
|
layoutName = layoutName.substring(0,12) + "D" + layoutName.substring(12);
|
||||||
layout.put("id", layoutName);
|
layout.put("id", layoutName);
|
||||||
@@ -1258,7 +1259,7 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
|
|||||||
JSONObject layout = (JSONObject) layoutObject;
|
JSONObject layout = (JSONObject) layoutObject;
|
||||||
syncLayout(param, body, command, layout);
|
syncLayout(param, body, command, layout);
|
||||||
|
|
||||||
if (this.isDevMake(layout)) {
|
if (isDevMake) {
|
||||||
String layoutName = (String) layout.get("id");
|
String layoutName = (String) layout.get("id");
|
||||||
layoutName = layoutName.substring(0,12) + "D" + layoutName.substring(12);
|
layoutName = layoutName.substring(0,12) + "D" + layoutName.substring(12);
|
||||||
layout.put("id", layoutName);
|
layout.put("id", layoutName);
|
||||||
@@ -1267,13 +1268,22 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isDevMake(String interfaceId) {
|
private boolean isDevMake(String interfaceId) throws Exception {
|
||||||
//interfaceId 9번째 글자가 D가 아니면 interfaceId의 8번째 자리에 D를 추가하여 insert한다
|
//interfaceId 9번째 글자가 D이면 false
|
||||||
return !"D".equals(interfaceId.substring(7,8));
|
if ("D".equals(interfaceId.substring(7,8))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//신규 등록 true
|
||||||
|
if (!interfaceService.existsInterface(interfaceId)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
//interface는 있는데 Dev가 없으면 (필요없어서 삭제한경우) false
|
||||||
|
String devInterfaceId = interfaceId.substring(0,8) + "D" + interfaceId.substring(8);
|
||||||
|
return interfaceService.existsInterface(devInterfaceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isDevMake(JSONObject layout) {
|
private boolean isDevMake(JSONObject layout) throws Exception {
|
||||||
String loutName = (String) layout.get("id");
|
String loutName = (String) layout.get("id");
|
||||||
String[] parts = loutName.split("_");
|
String[] parts = loutName.split("_");
|
||||||
String interfaceId = parts[1];
|
String interfaceId = parts[1];
|
||||||
return isDevMake(interfaceId);
|
return isDevMake(interfaceId);
|
||||||
|
|||||||
Reference in New Issue
Block a user