Commit 7617e85bd75b829464ab3af038ff854023d7c682
1 parent
ca47de3104
Exists in
master
and in
1 other branch
检查报告
Showing 2 changed files with 1 additions and 40 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java
View file @
7617e85
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/SyncDataTaskService.java
View file @
7617e85
| ... | ... | @@ -118,45 +118,6 @@ |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | |
| 121 | - | |
| 122 | - public void qhdfySyncData() { | |
| 123 | - try { | |
| 124 | - HttpClient client = new HttpClient(); | |
| 125 | - client.getHttpConnectionManager().getParams().setConnectionTimeout(10000); | |
| 126 | - client.getHttpConnectionManager().getParams().setSoTimeout(10000); | |
| 127 | - PostMethod post = new MessageUtil.UTF8PostMethod("http://121.22.16.246:18018/findSyncData"); | |
| 128 | - client.executeMethod(post); | |
| 129 | - int statusCode = post.getStatusCode(); | |
| 130 | - String json = post.getResponseBodyAsString(); | |
| 131 | - System.out.println(json); | |
| 132 | - post.releaseConnection(); | |
| 133 | - StringBuffer ids = new StringBuffer(); | |
| 134 | - if (200 == statusCode) { | |
| 135 | - List<SyncDataModel> list = JsonUtil.toList(json, SyncDataModel.class); | |
| 136 | - for (SyncDataModel model : list) { | |
| 137 | - boolean boo = mongoSyncService.syncData(model.getAction(), model.getDataId(), model.getClassName(), model.getJsonData()); | |
| 138 | - if (boo) { | |
| 139 | - ids.append(model.getId()); | |
| 140 | - ids.append(","); | |
| 141 | - } | |
| 142 | - } | |
| 143 | - if (ids.length() > 0) { | |
| 144 | - PostMethod post1 = new MessageUtil.UTF8PostMethod("http://121.22.16.246:18018/updateSyncData"); | |
| 145 | - NameValuePair[] pairs = { | |
| 146 | - new NameValuePair("ids", ids.toString()), | |
| 147 | - }; | |
| 148 | - post1.setRequestBody(pairs); | |
| 149 | - client.executeMethod(post1); | |
| 150 | - System.out.println(post1.getResponseBodyAsString()); | |
| 151 | - post.releaseConnection(); | |
| 152 | - } | |
| 153 | - } | |
| 154 | - } catch (Exception e) { | |
| 155 | - ExceptionUtils.catchException(e, "qhdfySyncData Error."); | |
| 156 | - } | |
| 157 | - } | |
| 158 | - | |
| 159 | - | |
| 160 | 121 | /** |
| 161 | 122 | * 同步区域数据到线上服务器 |
| 162 | 123 | * 定时任务配置applicationContext.xml |