|
@@ -105,7 +105,7 @@ public class SyncTranForOAFacadeControllerBean extends AbstractSyncTranForOAFaca
|
|
|
dataList.add(adminOrg);
|
|
|
}
|
|
|
//执行同步组织到OA
|
|
|
- executeSyncOrgUnitToOA(ctx, dataList, syncLogInfo);
|
|
|
+ executeSyncOrgUnitToOA(ctx, dataList, syncLogInfo, this.propt.getProperty("syncOrgUnitApiUrl"));
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
syncLogInfo.setSyncStatus(SyncStatusEnum.ERROR);
|
|
@@ -122,7 +122,7 @@ public class SyncTranForOAFacadeControllerBean extends AbstractSyncTranForOAFaca
|
|
|
* @param dataList
|
|
|
* @return
|
|
|
*/
|
|
|
- public void executeSyncOrgUnitToOA(Context ctx, List dataList, SyncLogInfo syncLogInfo) throws IOException, BOSException, EASBizException {
|
|
|
+ public void executeSyncOrgUnitToOA(Context ctx, List dataList, SyncLogInfo syncLogInfo, String syncApiUrl) throws IOException, BOSException, EASBizException {
|
|
|
if (dataList != null && dataList.size() > 0) {
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
|
//封装请求参数
|
|
@@ -131,17 +131,17 @@ public class SyncTranForOAFacadeControllerBean extends AbstractSyncTranForOAFaca
|
|
|
logger.error("executeSyncOrgUnitToOA----------------------params" + params);
|
|
|
//封装请求参数
|
|
|
//String syncOrgUnitApiUrl = "/api/hrm/resful/synDepartment";
|
|
|
- String syncOrgUnitApiUrl = this.propt.getProperty("syncOrgUnitApiUrl");
|
|
|
+ //String syncOrgUnitApiUrl = this.propt.getProperty("syncOrgUnitApiUrl");
|
|
|
String url = this.propt.getProperty("url");
|
|
|
- logger.error("executeSyncOrgUnitToOA----------------------syncOrgUnitApiUrl" + syncOrgUnitApiUrl);
|
|
|
- if (StringUtils.isEmpty(syncOrgUnitApiUrl)) {
|
|
|
+ logger.error("executeSyncOrgUnitToOA----------------------syncOrgUnitApiUrl" + syncApiUrl);
|
|
|
+ if (StringUtils.isEmpty(syncApiUrl)) {
|
|
|
throw new BOSException("同步组织到OA接口地址不能为空!");
|
|
|
}
|
|
|
OkHttpClient client = new OkHttpClient();
|
|
|
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
|
|
|
RequestBody body = RequestBody.create(mediaType, params);
|
|
|
Request request = new Request.Builder()
|
|
|
- .url(url + syncOrgUnitApiUrl)
|
|
|
+ .url(url + syncApiUrl)
|
|
|
.post(body)
|
|
|
.addHeader("Content-Type", "application/json")
|
|
|
.addHeader("Accept", "*/*")
|