Commit 7d059e6d746c60d99dfa78558e68f395cc83c050
1 parent
78c7585634
Exists in
master
and in
8 other branches
修改转诊1
Showing 1 changed file with 4 additions and 14 deletions
platform-common/src/main/java/com/lyms/platform/common/utils/JsonUtil.java
View file @
7d059e6
| ... | ... | @@ -18,16 +18,6 @@ |
| 18 | 18 | |
| 19 | 19 | public class JsonUtil { |
| 20 | 20 | |
| 21 | - static JsonConfig config = new JsonConfig(); | |
| 22 | - | |
| 23 | - static { | |
| 24 | - config.registerJsonValueProcessor(Date.class, | |
| 25 | - new DateJsonValueProcessor("yyyy-MM-dd hh:mm:ss")); | |
| 26 | - config.registerJsonValueProcessor(Timestamp.class, | |
| 27 | - new DateJsonValueProcessor("yyyy-MM-dd hh:mm:ss")); | |
| 28 | - } | |
| 29 | - | |
| 30 | - | |
| 31 | 21 | public static <T> T jkstr2Obj(String content, |
| 32 | 22 | Class<T> cls) { |
| 33 | 23 | ObjectMapper objectMapper = new ObjectMapper(); |
| ... | ... | @@ -63,7 +53,7 @@ |
| 63 | 53 | |
| 64 | 54 | public static JSONObject getObj(String content) { |
| 65 | 55 | if (StringUtils.isNotBlank(content)) |
| 66 | - return JSONObject.fromObject(content, config); | |
| 56 | + return JSONObject.fromObject(content); | |
| 67 | 57 | return null; |
| 68 | 58 | } |
| 69 | 59 | |
| ... | ... | @@ -77,7 +67,7 @@ |
| 77 | 67 | |
| 78 | 68 | public static String obj2JsonString(Object obj) { |
| 79 | 69 | try { |
| 80 | - return JSONObject.fromObject(obj, config).toString(); | |
| 70 | + return JSONObject.fromObject(obj).toString(); | |
| 81 | 71 | } catch (Exception e) { |
| 82 | 72 | ExceptionUtils.catchException(e, "obj2 json string error ." + e.getMessage()); |
| 83 | 73 | } |
| 84 | 74 | |
| ... | ... | @@ -85,13 +75,13 @@ |
| 85 | 75 | } |
| 86 | 76 | |
| 87 | 77 | public static String array2JsonString(Object obj) { |
| 88 | - return JSONArray.fromObject(obj, config).toString(); | |
| 78 | + return JSONArray.fromObject(obj).toString(); | |
| 89 | 79 | } |
| 90 | 80 | |
| 91 | 81 | @SuppressWarnings("unchecked") |
| 92 | 82 | public static <T> List<T> toList(String content, |
| 93 | 83 | Class<T> cls) { |
| 94 | - return (List<T>) JSONArray.toCollection(JSONArray.fromObject(content, config), cls); | |
| 84 | + return (List<T>) JSONArray.toCollection(JSONArray.fromObject(content), cls); | |
| 95 | 85 | } |
| 96 | 86 | |
| 97 | 87 | public static void main(String[] args) { |