|
@@ -28,7 +28,7 @@ public class ToolUtil {
|
|
Map<String, JSONObject> SETDLSMap = getMap_object("equipment", "SETDLS");
|
|
Map<String, JSONObject> SETDLSMap = getMap_object("equipment", "SETDLS");
|
|
Map<String, JSONObject> GeneralZoneMap = getMap_object("space", "GeneralZone");
|
|
Map<String, JSONObject> GeneralZoneMap = getMap_object("space", "GeneralZone");
|
|
|
|
|
|
- JSONArray louceng = getArray_relation("MechInArch", "Eq2Fl");
|
|
|
|
|
|
+ JSONArray louceng = getArray_relation("MechInArch", "Eq2Fl", null);
|
|
Map<String, String> SELTCC2floor = new HashMap<String, String>();
|
|
Map<String, String> SELTCC2floor = new HashMap<String, String>();
|
|
for (int i = 0; i < louceng.size(); i++) {
|
|
for (int i = 0; i < louceng.size(); i++) {
|
|
JSONObject item = (JSONObject) louceng.get(i);
|
|
JSONObject item = (JSONObject) louceng.get(i);
|
|
@@ -37,7 +37,7 @@ public class ToolUtil {
|
|
SELTCC2floor.put(objFrom, objTo);
|
|
SELTCC2floor.put(objFrom, objTo);
|
|
}
|
|
}
|
|
|
|
|
|
- JSONArray kongzhi = getArray_relation("MechCtrl", "EqCtrl");
|
|
|
|
|
|
+ JSONArray kongzhi = getArray_relation("MechCtrl", "EqCtrl", null);
|
|
Map<String, String> SELTCC2SELTCU = new HashMap<String, String>();
|
|
Map<String, String> SELTCC2SELTCU = new HashMap<String, String>();
|
|
for (int i = 0; i < kongzhi.size(); i++) {
|
|
for (int i = 0; i < kongzhi.size(); i++) {
|
|
JSONObject item = (JSONObject) kongzhi.get(i);
|
|
JSONObject item = (JSONObject) kongzhi.get(i);
|
|
@@ -46,7 +46,7 @@ public class ToolUtil {
|
|
SELTCC2SELTCU.put(objTo, objFrom);
|
|
SELTCC2SELTCU.put(objTo, objFrom);
|
|
}
|
|
}
|
|
|
|
|
|
- JSONArray gongdian = getArray_relation("MechPower", "EqNormal");
|
|
|
|
|
|
+ JSONArray gongdian = getArray_relation("MechPower", "EqNormal", null);
|
|
Map<String, String> SELTCU2SETDLS = new HashMap<String, String>();
|
|
Map<String, String> SELTCU2SETDLS = new HashMap<String, String>();
|
|
for (int i = 0; i < gongdian.size(); i++) {
|
|
for (int i = 0; i < gongdian.size(); i++) {
|
|
JSONObject item = (JSONObject) gongdian.get(i);
|
|
JSONObject item = (JSONObject) gongdian.get(i);
|
|
@@ -55,7 +55,7 @@ public class ToolUtil {
|
|
SELTCU2SETDLS.put(objTo, objFrom);
|
|
SELTCU2SETDLS.put(objTo, objFrom);
|
|
}
|
|
}
|
|
|
|
|
|
- JSONArray suozai = getArray_relation("MechInArch", "Eq2Sp");
|
|
|
|
|
|
+ JSONArray suozai = getArray_relation("MechInArch", "Eq2Sp", "GeneralZone");
|
|
Map<String, String> SETDLS2GeneralZone = new HashMap<String, String>();
|
|
Map<String, String> SETDLS2GeneralZone = new HashMap<String, String>();
|
|
for (int i = 0; i < suozai.size(); i++) {
|
|
for (int i = 0; i < suozai.size(); i++) {
|
|
JSONObject item = (JSONObject) suozai.get(i);
|
|
JSONObject item = (JSONObject) suozai.get(i);
|
|
@@ -64,6 +64,7 @@ public class ToolUtil {
|
|
SETDLS2GeneralZone.put(objFrom, objTo);
|
|
SETDLS2GeneralZone.put(objFrom, objTo);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ String[] ids = { "louti", "louti", "jingguan", "jingguan", "biaozhi", "biaozhi" };
|
|
String[] levels = { "楼体照明", "楼体照明", "景观照明", "景观照明", "标识照明", "标识照明" };
|
|
String[] levels = { "楼体照明", "楼体照明", "景观照明", "景观照明", "标识照明", "标识照明" };
|
|
String[] types = { "A", "B", "A", "B", "A", "B" };
|
|
String[] types = { "A", "B", "A", "B", "A", "B" };
|
|
JSONArray result = new JSONArray();
|
|
JSONArray result = new JSONArray();
|
|
@@ -111,16 +112,16 @@ public class ToolUtil {
|
|
String floor = SELTCC2floor.get(SELTCC);
|
|
String floor = SELTCC2floor.get(SELTCC);
|
|
if (floor != null) {
|
|
if (floor != null) {
|
|
item.put("楼层", floor);
|
|
item.put("楼层", floor);
|
|
- item.put("二级编组", levels[index] + "-" + floorMap.get(floor).get("localId") + "-" + types[index]);
|
|
|
|
|
|
+ item.put("二级编组", ids[index] + "-" + floorMap.get(floor).get("localId") + "-" + types[index]);
|
|
item.put("二级编组名称", levels[index] + "-" + floorMap.get(floor).get("localId") + "-" + types[index]);
|
|
item.put("二级编组名称", levels[index] + "-" + floorMap.get(floor).get("localId") + "-" + types[index]);
|
|
- item.put("一级编组", levels[index]);
|
|
|
|
|
|
+ item.put("一级编组", ids[index]);
|
|
item.put("一级编组名称", levels[index]);
|
|
item.put("一级编组名称", levels[index]);
|
|
result.add(item);
|
|
result.add(item);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- item.put("二级编组", levels[index] + "-" + types[index]);
|
|
|
|
|
|
+ item.put("二级编组", ids[index] + "-" + types[index]);
|
|
item.put("二级编组名称", levels[index] + "-" + types[index]);
|
|
item.put("二级编组名称", levels[index] + "-" + types[index]);
|
|
- item.put("一级编组", levels[index]);
|
|
|
|
|
|
+ item.put("一级编组", ids[index]);
|
|
item.put("一级编组名称", levels[index]);
|
|
item.put("一级编组名称", levels[index]);
|
|
result.add(item);
|
|
result.add(item);
|
|
}
|
|
}
|
|
@@ -134,11 +135,15 @@ public class ToolUtil {
|
|
return FastJsonUtil.toFormatString(result);
|
|
return FastJsonUtil.toFormatString(result);
|
|
}
|
|
}
|
|
|
|
|
|
- public static JSONArray getArray_relation(String graphCode, String relCode) {
|
|
|
|
- JSONObject Target = generateTarget_relation(graphCode, relCode);
|
|
|
|
|
|
+ public static JSONArray getArray_relation(String graphCode, String relCode, String relValue) {
|
|
|
|
+ JSONObject Target = generateTarget_relation(graphCode, relCode, relValue);
|
|
JSONObject param = new JSONObject();
|
|
JSONObject param = new JSONObject();
|
|
param.put("Target", Target);
|
|
param.put("Target", Target);
|
|
- param.put("Criteria", new JSONObject());
|
|
|
|
|
|
+ JSONObject Criteria = new JSONObject();
|
|
|
|
+ if (relValue != null) {
|
|
|
|
+ Criteria.put("relValue", relValue);
|
|
|
|
+ }
|
|
|
|
+ param.put("Criteria", Criteria);
|
|
param.put("QueryType", "select");
|
|
param.put("QueryType", "select");
|
|
String queryResult = RestUtil.query(param.toJSONString());
|
|
String queryResult = RestUtil.query(param.toJSONString());
|
|
JSONArray resultArray = JSON.parseArray(queryResult);
|
|
JSONArray resultArray = JSON.parseArray(queryResult);
|
|
@@ -196,7 +201,7 @@ public class ToolUtil {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
- private static JSONObject generateTarget_relation(String graphCode, String relCode) {
|
|
|
|
|
|
+ private static JSONObject generateTarget_relation(String graphCode, String relCode, String relValue) {
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
result.put("Source", "rwd");
|
|
result.put("Source", "rwd");
|
|
result.put("rwd", "relation");
|
|
result.put("rwd", "relation");
|