|
@@ -130,7 +130,9 @@ public class SyncTranForOAFacadeControllerBean extends AbstractSyncTranForOAFaca
|
|
|
String params = String.format("token = %s &data = %s", getToken(), data);
|
|
|
logger.error("executeSyncOrgUnitToOA----------------------params" + params);
|
|
|
//封装请求参数
|
|
|
+ //String syncOrgUnitApiUrl = "/api/hrm/resful/synDepartment";
|
|
|
String syncOrgUnitApiUrl = this.propt.getProperty("syncOrgUnitApiUrl");
|
|
|
+ String url = this.propt.getProperty("url");
|
|
|
logger.error("executeSyncOrgUnitToOA----------------------syncOrgUnitApiUrl" + syncOrgUnitApiUrl);
|
|
|
if (StringUtils.isEmpty(syncOrgUnitApiUrl)) {
|
|
|
throw new BOSException("同步组织到OA接口地址不能为空!");
|
|
@@ -139,7 +141,7 @@ public class SyncTranForOAFacadeControllerBean extends AbstractSyncTranForOAFaca
|
|
|
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
|
|
|
RequestBody body = RequestBody.create(mediaType, params);
|
|
|
Request request = new Request.Builder()
|
|
|
- .url(syncOrgUnitApiUrl)
|
|
|
+ .url(url + syncOrgUnitApiUrl)
|
|
|
.post(body)
|
|
|
.addHeader("Content-Type", "application/json")
|
|
|
.addHeader("Accept", "*/*")
|
|
@@ -148,8 +150,12 @@ public class SyncTranForOAFacadeControllerBean extends AbstractSyncTranForOAFaca
|
|
|
.addHeader("Connection", "keep-alive")
|
|
|
.build();
|
|
|
Response response = client.newCall(request).execute();
|
|
|
- //处理响应结果,写入日志
|
|
|
- handlerResponse(ctx, response, syncLogInfo);
|
|
|
+ String respBody = response.body().string();
|
|
|
+ if (response.isSuccessful()) {
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|