|
@@ -23,13 +23,10 @@ public class ToolUtil {
|
|
|
}
|
|
|
|
|
|
private static String Lighting(boolean is_public) {
|
|
|
- Map<String, JSONObject> floorMap = new HashMap<String, JSONObject>();
|
|
|
- JSONArray floorArray = getArray_object("floor", null);
|
|
|
- for (int i = 0; i < floorArray.size(); i++) {
|
|
|
- JSONObject item = (JSONObject) floorArray.get(i);
|
|
|
- String id = (String) item.get("id");
|
|
|
- floorMap.put(id, item);
|
|
|
- }
|
|
|
+ Map<String, JSONObject> floorMap = getMap_object("floor", null);
|
|
|
+ Map<String, JSONObject> SELTCUMap = getMap_object("equipment", "SELTCU");
|
|
|
+ Map<String, JSONObject> SETDLSMap = getMap_object("equipment", "SETDLS");
|
|
|
+ Map<String, JSONObject> GeneralZoneMap = getMap_object("space", "GeneralZone");
|
|
|
|
|
|
JSONArray louceng = getArray_relation("MechInArch", "Eq2Fl");
|
|
|
Map<String, String> SELTCC2floor = new HashMap<String, String>();
|
|
@@ -88,21 +85,43 @@ public class ToolUtil {
|
|
|
int index = BKDRHash.getHashCode(SELTCC) % levels.length;
|
|
|
JSONObject item = new JSONObject();
|
|
|
item.put("回路编号", SELTCC);
|
|
|
- item.put("模块编号", SELTCU);
|
|
|
- item.put("配电箱编号", SETDLS);
|
|
|
- item.put("电井编号", GeneralZone);
|
|
|
+ if (SELTCU != null && SELTCUMap.containsKey(SELTCU)) {
|
|
|
+ item.put("模块编号", SELTCU);
|
|
|
+ item.put("模块名称", SELTCUMap.get(SELTCU).get("localId"));
|
|
|
+ } else {
|
|
|
+ item.put("模块编号", null);
|
|
|
+ item.put("模块名称", null);
|
|
|
+ }
|
|
|
+ if (SETDLS != null && SETDLSMap.containsKey(SETDLS)) {
|
|
|
+ item.put("配电箱编号", SETDLS);
|
|
|
+ item.put("配电箱名称", SETDLSMap.get(SETDLS).get("localId"));
|
|
|
+ } else {
|
|
|
+ item.put("配电箱编号", null);
|
|
|
+ item.put("配电箱名称", null);
|
|
|
+ }
|
|
|
+ if (GeneralZone != null && GeneralZoneMap.containsKey(GeneralZone)) {
|
|
|
+ item.put("电井编号", GeneralZone);
|
|
|
+ item.put("电井名称", GeneralZoneMap.get(GeneralZone).get("localId"));
|
|
|
+ } else {
|
|
|
+ item.put("电井编号", null);
|
|
|
+ item.put("电井名称", null);
|
|
|
+ }
|
|
|
item.put("类型", types[index]);
|
|
|
if (is_public) {
|
|
|
String floor = SELTCC2floor.get(SELTCC);
|
|
|
if (floor != null) {
|
|
|
item.put("楼层", floor);
|
|
|
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("一级编组名称", levels[index]);
|
|
|
result.add(item);
|
|
|
}
|
|
|
} else {
|
|
|
item.put("二级编组", levels[index] + "-" + types[index]);
|
|
|
+ item.put("二级编组名称", levels[index] + "-" + types[index]);
|
|
|
item.put("一级编组", levels[index]);
|
|
|
+ item.put("一级编组名称", levels[index]);
|
|
|
result.add(item);
|
|
|
}
|
|
|
}
|
|
@@ -126,6 +145,17 @@ public class ToolUtil {
|
|
|
return resultArray;
|
|
|
}
|
|
|
|
|
|
+ public static Map<String, JSONObject> getMap_object(String objType, String classCode) {
|
|
|
+ Map<String, JSONObject> floorMap = new HashMap<String, JSONObject>();
|
|
|
+ JSONArray floorArray = getArray_object(objType, classCode);
|
|
|
+ for (int i = 0; i < floorArray.size(); i++) {
|
|
|
+ JSONObject item = (JSONObject) floorArray.get(i);
|
|
|
+ String id = (String) item.get("id");
|
|
|
+ floorMap.put(id, item);
|
|
|
+ }
|
|
|
+ return floorMap;
|
|
|
+ }
|
|
|
+
|
|
|
public static JSONArray getArray_object(String objType, String classCode) {
|
|
|
JSONObject Target = generateTarget_object(objType, classCode);
|
|
|
JSONArray ReturnColumns = generateReturnColumns();
|