|
@@ -2,7 +2,10 @@ package com.persagy.ibms.data.sdk.util;
|
|
|
|
|
|
import java.io.BufferedInputStream;
|
|
|
import java.io.FileInputStream;
|
|
|
+import java.util.LinkedHashMap;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
+import com.google.common.collect.Maps;
|
|
|
import org.apache.poi.ss.usermodel.Cell;
|
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
|
import org.apache.poi.ss.usermodel.Sheet;
|
|
@@ -19,7 +22,7 @@ import com.persagy.ibms.data.sdk.service.rest.RestUtil;
|
|
|
|
|
|
public class ExeclReadEquipStaticInfoUtil {
|
|
|
|
|
|
- public static JSONObject ReadEquipStaticInfoById(String objId) throws Exception {
|
|
|
+ public static Map<String, JSONArray> ReadEquipStaticInfoById(String objId) throws Exception {
|
|
|
String ibmsSceneCode = null;
|
|
|
String ibmsClassCode = null;
|
|
|
JSONObject queryTarget = new JSONObject();
|
|
@@ -38,7 +41,7 @@ public class ExeclReadEquipStaticInfoUtil {
|
|
|
ibmsSceneCode = queryObj.getString("ibmsSceneCode");
|
|
|
ibmsClassCode = queryObj.getString("ibmsClassCode");
|
|
|
String classCode = queryObj.getString("classCode");
|
|
|
- JSONObject object = new JSONObject();
|
|
|
+ Map<String, JSONArray> object = Maps.newLinkedHashMap();
|
|
|
// 如果ibmsClassCode和ibmsSceneCode为空则返回,意味着查询失败
|
|
|
if (ibmsSceneCode == null && ibmsClassCode == null) {
|
|
|
return object;
|
|
@@ -100,10 +103,11 @@ public class ExeclReadEquipStaticInfoUtil {
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
- public static JSONObject ReadEquipStaticInfoById(String ibmsSceneCode, String ibmsClassCode, String classCode, JSONObject queryObj)
|
|
|
+ public static Map<String, JSONArray> ReadEquipStaticInfoById(String ibmsSceneCode, String ibmsClassCode, String classCode, JSONObject queryObj)
|
|
|
throws Exception {
|
|
|
RepositoryImpl Repository = RepositoryContainer.instance;
|
|
|
JSONObject object = new JSONObject();
|
|
|
+ LinkedHashMap<String, JSONArray> map= Maps.newLinkedHashMap();
|
|
|
// 根据ibmsSceneCode和ibmsClassCode查询对应的excel获取台账信息点
|
|
|
if (Constant.info_point_version.equals("old")) {
|
|
|
FileInputStream fis = new FileInputStream(FileUtil.file(ibmsSceneCode + ".xlsx"));
|
|
@@ -136,10 +140,12 @@ public class ExeclReadEquipStaticInfoUtil {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- object.put(caVal, dic);
|
|
|
+ //object.put(caVal, dic);
|
|
|
+ map.put(caVal,dic);
|
|
|
}
|
|
|
fis.close();
|
|
|
- } else if (Constant.info_point_version.equals("new")) {
|
|
|
+ }
|
|
|
+ else if (Constant.info_point_version.equals("new")) {
|
|
|
JSONArray infoArray = Repository.infoArrayJson.get(classCode);
|
|
|
|
|
|
String infoClass = "基本参数";
|
|
@@ -168,9 +174,11 @@ public class ExeclReadEquipStaticInfoUtil {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- object.put(infoClass, dic);
|
|
|
+ //object.put(infoClass, dic);
|
|
|
+ map.put(infoClass,dic);
|
|
|
}
|
|
|
- return object;
|
|
|
+ //return object;
|
|
|
+ return map;
|
|
|
}
|
|
|
|
|
|
public static String getCellValue(Cell cell) {
|