This commit is contained in:
@@ -31,4 +31,10 @@ class KJBInterfaceService {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean existsInterface(String interfaceId) throws Exception {
|
||||
HashMap<String, Object> param = new HashMap<>();
|
||||
param.put("EAISVCNAME", interfaceId);
|
||||
return dao.selectDetailAPI(param) != null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+17
-7
@@ -1231,10 +1231,11 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
|
||||
param.put("command", command);
|
||||
param.put("recvAmndHMS", recvTime);
|
||||
|
||||
boolean isDevMake = this.isDevMake(interfaceId);
|
||||
|
||||
if (command.equals("insert")) {
|
||||
insertInterfaceDjb(interfaceId, body);
|
||||
if (this.isDevMake(interfaceId)) {
|
||||
if (isDevMake) {
|
||||
interfaceId = interfaceId.substring(0,8) + "D" + interfaceId.substring(8);
|
||||
insertInterfaceDjb(interfaceId, body);
|
||||
}
|
||||
@@ -1247,7 +1248,7 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
|
||||
JSONObject layout = (JSONObject) layoutArray.get(i);
|
||||
syncLayout(param, body, command, layout);
|
||||
|
||||
if (this.isDevMake(layout)) {
|
||||
if (isDevMake) {
|
||||
String layoutName = (String) layout.get("id");
|
||||
layoutName = layoutName.substring(0,12) + "D" + layoutName.substring(12);
|
||||
layout.put("id", layoutName);
|
||||
@@ -1258,7 +1259,7 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
|
||||
JSONObject layout = (JSONObject) layoutObject;
|
||||
syncLayout(param, body, command, layout);
|
||||
|
||||
if (this.isDevMake(layout)) {
|
||||
if (isDevMake) {
|
||||
String layoutName = (String) layout.get("id");
|
||||
layoutName = layoutName.substring(0,12) + "D" + layoutName.substring(12);
|
||||
layout.put("id", layoutName);
|
||||
@@ -1267,12 +1268,21 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isDevMake(String interfaceId) {
|
||||
//interfaceId 9번째 글자가 D가 아니면 interfaceId의 8번째 자리에 D를 추가하여 insert한다
|
||||
return !"D".equals(interfaceId.substring(7,8));
|
||||
private boolean isDevMake(String interfaceId) throws Exception {
|
||||
//interfaceId 9번째 글자가 D이면 false
|
||||
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[] parts = loutName.split("_");
|
||||
String interfaceId = parts[1];
|
||||
|
||||
Reference in New Issue
Block a user