|
|
@@ -7,6 +7,7 @@ import com.uas.sso.core.ICallable;
|
|
|
import com.uas.sso.crawler.service.CrawlerUserSpaceService;
|
|
|
import com.uas.sso.entity.App;
|
|
|
import com.uas.sso.entity.SyncLog;
|
|
|
+import com.uas.sso.entity.User;
|
|
|
import com.uas.sso.entity.Userspace;
|
|
|
import com.uas.sso.logging.LoggerManager;
|
|
|
import com.uas.sso.logging.SyncBufferedLogger;
|
|
|
@@ -103,22 +104,26 @@ public class CrawlerUserSpaceServiceImpl implements CrawlerUserSpaceService {
|
|
|
private void syncUserspaceInfo(List<Userspace> userspaceList, String msg) {
|
|
|
List<App> apps = appService.findDefaultUseApp();
|
|
|
for (Userspace userspace : userspaceList) {
|
|
|
+ User admin = userspace.getAdmin();
|
|
|
+ userspace.setAdminUU(userspace.getAdmin().getUserUU());
|
|
|
+ userspace.setAdmin(null);
|
|
|
+ JSONObject formData = JSON.parseObject(JSON.toJSONString(userspace));
|
|
|
+ formData.putAll(JSON.parseObject(JSON.toJSONString(admin)));
|
|
|
ExecuteUtils.execute((ICallable<Void, App>) app -> {
|
|
|
- String url, appId, spaceStr;
|
|
|
+ String url, appId;
|
|
|
HttpUtil.ResponseWrap res;
|
|
|
if (app != null && !StringUtils.isEmpty(url = app.getBackSpaceUrl())) {
|
|
|
appId = app.getUid();
|
|
|
- JSONObject formData = JSON.parseObject(spaceStr = JSON.toJSONString(userspace));
|
|
|
try {
|
|
|
res = HttpUtil.doPost(url, formData, 30000);
|
|
|
if (!res.isSuccess()) {
|
|
|
- SyncLog syncLog = syncLogger.error(appId, msg + ",同步企业信息失败", spaceStr, res.getContent());
|
|
|
+ SyncLog syncLog = syncLogger.error(appId, msg + ",同步企业信息失败", JSON.toJSONString(formData), res.getContent());
|
|
|
SyncFail.add(syncLog.getId(), formData, url, app.getUid());
|
|
|
} else {
|
|
|
- syncLogger.info(appId, msg + ",同步企业信息成功", spaceStr);
|
|
|
+ syncLogger.info(appId, msg + ",同步企业信息成功", JSON.toJSONString(formData));
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- syncLogger.error(appId, msg + ",同步企业信息失败", spaceStr, e.getMessage());
|
|
|
+ syncLogger.error(appId, msg + ",同步企业信息失败", JSON.toJSONString(formData), e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
return null;
|