+15
-12
@@ -1231,19 +1231,10 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
|
|||||||
param.put("command", command);
|
param.put("command", command);
|
||||||
param.put("recvAmndHMS", recvTime);
|
param.put("recvAmndHMS", recvTime);
|
||||||
|
|
||||||
if (command.equals("delete")) {
|
|
||||||
JSONObject layout = (JSONObject) layoutObject;
|
|
||||||
String loutName = (String) layout.get("id");
|
|
||||||
String[] parts = loutName.split("_");
|
|
||||||
interfaceId = parts[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
//interfaceId 9번째 글자가 D가 아니면 interfaceId의 8번째 자리에 D를 추가하여 insert한다
|
|
||||||
boolean isDevMake = !"D".equals(interfaceId.substring(7,8));
|
|
||||||
|
|
||||||
if (command.equals("insert")) {
|
if (command.equals("insert")) {
|
||||||
insertInterfaceDjb(interfaceId, body);
|
insertInterfaceDjb(interfaceId, body);
|
||||||
if (isDevMake) {
|
if (this.isDevMake(interfaceId)) {
|
||||||
interfaceId = interfaceId.substring(0,8) + "D" + interfaceId.substring(8);
|
interfaceId = interfaceId.substring(0,8) + "D" + interfaceId.substring(8);
|
||||||
insertInterfaceDjb(interfaceId, body);
|
insertInterfaceDjb(interfaceId, body);
|
||||||
}
|
}
|
||||||
@@ -1256,7 +1247,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 (isDevMake) {
|
if (this.isDevMake(layout)) {
|
||||||
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,7 +1258,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 (isDevMake) {
|
if (this.isDevMake(layout)) {
|
||||||
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);
|
||||||
@@ -1276,6 +1267,18 @@ 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(JSONObject layout) {
|
||||||
|
String loutName = (String) layout.get("id");
|
||||||
|
String[] parts = loutName.split("_");
|
||||||
|
String interfaceId = parts[1];
|
||||||
|
return isDevMake(interfaceId);
|
||||||
|
}
|
||||||
|
|
||||||
private void insertInterfaceDjb(String interfaceId, JSONObject body) throws Exception
|
private void insertInterfaceDjb(String interfaceId, JSONObject body) throws Exception
|
||||||
{
|
{
|
||||||
HashMap<String, Object> param = new HashMap<String, Object>();
|
HashMap<String, Object> param = new HashMap<String, Object>();
|
||||||
|
|||||||
Reference in New Issue
Block a user