|
@@ -14,6 +14,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
import com.persagy.ibms.data.sdk.data.SceneDataObject;
|
|
import com.persagy.ibms.data.sdk.data.SceneDataObject;
|
|
import com.persagy.ibms.data.sdk.data.SceneDataPrimitive;
|
|
import com.persagy.ibms.data.sdk.data.SceneDataPrimitive;
|
|
import com.persagy.ibms.data.sdk.data.SceneDataSet;
|
|
import com.persagy.ibms.data.sdk.data.SceneDataSet;
|
|
@@ -51,19 +52,19 @@ public class RestUtil {
|
|
JSONArray array = (JSONArray) Content;
|
|
JSONArray array = (JSONArray) Content;
|
|
result.put("Count", array.size());
|
|
result.put("Count", array.size());
|
|
}
|
|
}
|
|
- return FastJsonUtil.toFormatString(Content);
|
|
|
|
|
|
+ return JSONObject.toJSONString(Content, SerializerFeature.WriteMapNullValue);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
result.put("Result", "failure");
|
|
result.put("Result", "failure");
|
|
result.put("Reason", LogUtil.GetExceptionStackTrace(e));
|
|
result.put("Reason", LogUtil.GetExceptionStackTrace(e));
|
|
}
|
|
}
|
|
- return FastJsonUtil.toFormatString(result);
|
|
|
|
|
|
+ return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
|
|
}
|
|
}
|
|
|
|
|
|
public static String showTree() {
|
|
public static String showTree() {
|
|
Repository Repository = RepositoryBase.instance;
|
|
Repository Repository = RepositoryBase.instance;
|
|
JSONObject JSON = (JSONObject) Repository.objectData.toJSON(-1);
|
|
JSONObject JSON = (JSONObject) Repository.objectData.toJSON(-1);
|
|
- return FastJsonUtil.toFormatString(JSON);
|
|
|
|
|
|
+ return JSONObject.toJSONString(JSON, SerializerFeature.WriteMapNullValue);
|
|
}
|
|
}
|
|
|
|
|
|
public static String check() {
|
|
public static String check() {
|
|
@@ -263,7 +264,7 @@ public class RestUtil {
|
|
try {
|
|
try {
|
|
Object valueObject = ComputeUtil.getValueObject(Repository, valuePath);
|
|
Object valueObject = ComputeUtil.getValueObject(Repository, valuePath);
|
|
Object valueJSON = ComputeUtil.getValueJSON(valueObject, read_level);
|
|
Object valueJSON = ComputeUtil.getValueJSON(valueObject, read_level);
|
|
- return FastJsonUtil.toString(valueJSON);
|
|
|
|
|
|
+ return JSONObject.toJSONString(valueJSON, SerializerFeature.WriteMapNullValue);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
String message = LogUtil.GetExceptionStackTrace(e);
|
|
String message = LogUtil.GetExceptionStackTrace(e);
|
|
@@ -290,12 +291,12 @@ public class RestUtil {
|
|
.ReadJSONObject(new File(Constant.GetPath() + Constant.getSeperator() + "work_order_sample.json"));
|
|
.ReadJSONObject(new File(Constant.GetPath() + Constant.getSeperator() + "work_order_sample.json"));
|
|
JSONArray work_orders = new JSONArray();
|
|
JSONArray work_orders = new JSONArray();
|
|
work_orders.add(work_order);
|
|
work_orders.add(work_order);
|
|
- return FastJsonUtil.toString(work_orders);
|
|
|
|
|
|
+ return JSONObject.toJSONString(work_orders, SerializerFeature.WriteMapNullValue);
|
|
} else {
|
|
} else {
|
|
Object valueObject = ComputeUtil.getValueObject(Repository, valuePath);
|
|
Object valueObject = ComputeUtil.getValueObject(Repository, valuePath);
|
|
RecursiveUtil.refreshObject(Repository, valueObject);
|
|
RecursiveUtil.refreshObject(Repository, valueObject);
|
|
Object valueJSON = ComputeUtil.getValueJSON(valueObject);
|
|
Object valueJSON = ComputeUtil.getValueJSON(valueObject);
|
|
- return FastJsonUtil.toString(valueJSON);
|
|
|
|
|
|
+ return JSONObject.toJSONString(valueJSON, SerializerFeature.WriteMapNullValue);
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|