Commit 13179208e6cd4b1613f89856b57e7df2b354e581
1 parent
b3c538d70c
Exists in
master
and in
1 other branch
add mongo sync
Showing 2 changed files with 9 additions and 1 deletions
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/MongoSyncService.java
View file @
1317920
... | ... | @@ -25,6 +25,11 @@ |
25 | 25 | public static String mongo_crypto_key = Config.getItem("mongo_crypto_key", "0"); |
26 | 26 | |
27 | 27 | public boolean syncData(String action, String id, String className, String json) { |
28 | + System.out.println(mongo_crypto_key); | |
29 | + System.out.println(action); | |
30 | + System.out.println(id); | |
31 | + System.out.println(className); | |
32 | + System.out.println(json); | |
28 | 33 | try { |
29 | 34 | if ("ADD".equals(action)) { |
30 | 35 | Object entity = JsonUtil.str2Obj(LymsEncodeUtil.aesDecrypt(json, mongo_crypto_key), Class.forName(LymsEncodeUtil.aesDecrypt(className, mongo_crypto_key))); |
platform-common/src/main/java/com/lyms/platform/common/utils/MongoSyncUtil.java
View file @
1317920
... | ... | @@ -24,6 +24,7 @@ |
24 | 24 | public static String mongo_crypto_key = Config.getItem("mongo_crypto_key", "0"); |
25 | 25 | |
26 | 26 | public static boolean sync(String action, Object data, String id) { |
27 | + System.out.println(mongo_sync +" :: "+id+" -- "+action); | |
27 | 28 | if ("1".equals(mongo_sync)) { |
28 | 29 | boolean boo = false; |
29 | 30 | try { |
... | ... | @@ -41,6 +42,7 @@ |
41 | 42 | post.setRequestBody(pairs); |
42 | 43 | client.executeMethod(post); |
43 | 44 | int statusCode = post.getStatusCode(); |
45 | + System.out.println(post.getResponseBodyAsString()); | |
44 | 46 | post.releaseConnection(); |
45 | 47 | if (200 == statusCode) { |
46 | 48 | boo = true; |
... | ... | @@ -63,7 +65,8 @@ |
63 | 65 | info.setLimit(456); |
64 | 66 | Object aaa = JsonUtil.str2Obj(JsonUtil.obj2JsonString(info), Class.forName(info.getClass().getName())); |
65 | 67 | System.out.println(MD5Utils.md5(aaa.getClass().getName())); |
66 | - | |
68 | + System.out.println(LymsEncodeUtil.aesEncrypt("com.lyms.platform.common.utils.MongoSyncUtil", "Lymsh@2016")); | |
69 | + System.out.println(LymsEncodeUtil.aesDecrypt("JusDAcSiQQ6QmFo+VYVuS1YL8F3IPj0IXSd3zoNE6frCm+5TpiA0RRsD4MiXuh9e","Lymsh@2016123")); | |
67 | 70 | } |
68 | 71 | |
69 | 72 | } |