public static final String encodeObject2Json(Object pObject, String pFormatString) {
String jsonString = "[]";
if (G4Utils.isEmpty(pObject)) {
// log.warn("传入的Java对象为空,不能将其序列化为Json资料格式.请检查!");
} else {
JsonConfig cfg = new JsonConfig();
cfg.registerJsonValueProcessor(java.sql.Timestamp.class, new JsonValueProcessorImpl(pFormatString));
cfg.registerJsonValueProcessor(java.util.Date.class, new JsonValueProcessorImpl(pFormatString));
cfg.registerJsonValueProcessor(java.sql.Date.class, new JsonValueProcessorImpl(pFormatString));
if (pObject instanceof ArrayList) {
JSONArray jsonArray = JSONArray.fromObject(pObject, cfg);
jsonString = jsonArray.toString();
} else {
JSONObject jsonObject = JSONObject.fromObject(pObject, cfg);