|
|
@@ -16,6 +16,7 @@ import com.uas.sso.logging.LoggerManager;
|
|
|
import com.uas.sso.logging.SyncBufferedLogger;
|
|
|
import com.uas.sso.logging.UserBufferedLogger;
|
|
|
import com.uas.sso.service.*;
|
|
|
+import com.uas.sso.support.SyncFail;
|
|
|
import com.uas.sso.util.AccountTypeUtils;
|
|
|
import com.uas.sso.util.ExecuteUtils;
|
|
|
import com.uas.sso.util.PasswordLevelUtils;
|
|
|
@@ -62,9 +63,9 @@ public class UserServiceImpl implements UserService {
|
|
|
@Autowired
|
|
|
private UserQuestionService userQuestionService;
|
|
|
|
|
|
- private UserBufferedLogger userLog = LoggerManager.getLogger(UserBufferedLogger.class);
|
|
|
+ private UserBufferedLogger userLogger = LoggerManager.getLogger(UserBufferedLogger.class);
|
|
|
|
|
|
- private SyncBufferedLogger syncLog = LoggerManager.getLogger(SyncBufferedLogger.class);
|
|
|
+ private SyncBufferedLogger syncLogger = LoggerManager.getLogger(SyncBufferedLogger.class);
|
|
|
|
|
|
@Override
|
|
|
public User findByMobile(String mobile, String mobileArea) {
|
|
|
@@ -125,7 +126,7 @@ public class UserServiceImpl implements UserService {
|
|
|
user.getUserRecord().setUserUU(user.getUserUU());
|
|
|
|
|
|
userDao.save(user);
|
|
|
- userLog.info(user, Type.UPDATE_REGISTER.getValue());
|
|
|
+ userLogger.info(user, Type.UPDATE_REGISTER.getValue());
|
|
|
|
|
|
// 同步到各个应用
|
|
|
return syncUserInfo(user.getUserUU(), noEncryPwd, "个人注册");
|
|
|
@@ -311,7 +312,7 @@ public class UserServiceImpl implements UserService {
|
|
|
userDao.save(user);
|
|
|
|
|
|
// 保存日志
|
|
|
- userLog.info(user, Type.UPDATE_MOBILE.getValue());
|
|
|
+ userLogger.info(user, Type.UPDATE_MOBILE.getValue());
|
|
|
|
|
|
// 同步到各个应用
|
|
|
syncUserInfo(user.getUserUU(), null, "修改手机号");
|
|
|
@@ -333,7 +334,7 @@ public class UserServiceImpl implements UserService {
|
|
|
userDao.save(user);
|
|
|
|
|
|
// 保存日志
|
|
|
- userLog.info(user, Type.UPDATE_EMAIL.getValue());
|
|
|
+ userLogger.info(user, Type.UPDATE_EMAIL.getValue());
|
|
|
|
|
|
// 同步信息到各应用
|
|
|
syncUserInfo(user.getUserUU(), null, "修改邮箱");
|
|
|
@@ -375,7 +376,7 @@ public class UserServiceImpl implements UserService {
|
|
|
syncUserBindSpace(userUU, spaceUU);
|
|
|
|
|
|
// 保存日志
|
|
|
- userLog.info(user, Type.BIND_USERSPACE.getValue()+spaceUU);
|
|
|
+ userLogger.info(user, Type.BIND_USERSPACE.getValue()+spaceUU);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -421,12 +422,13 @@ public class UserServiceImpl implements UserService {
|
|
|
try {
|
|
|
res = HttpUtil.doPost(url, formData, 10000);
|
|
|
if (!res.isSuccess()) {
|
|
|
- syncLog.error(appId, "同步绑定信息失败", JSON.toJSONString(formData), res.getContent());
|
|
|
+ SyncLog syncLog = syncLogger.error(appId, "同步绑定信息失败", JSON.toJSONString(formData), res.getContent());
|
|
|
+ SyncFail.add(syncLog.getId(), formData, url, appId);
|
|
|
} else {
|
|
|
- syncLog.info(appId, "同步绑定信息成功", JSON.toJSONString(formData));
|
|
|
+ syncLogger.info(appId, "同步绑定信息成功", JSON.toJSONString(formData));
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- syncLog.error(appId, "同步绑定信息失败", JSON.toJSONString(formData), e.getMessage());
|
|
|
+ syncLogger.error(appId, "同步绑定信息失败", JSON.toJSONString(formData), e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
return null;
|
|
|
@@ -460,7 +462,7 @@ public class UserServiceImpl implements UserService {
|
|
|
syncUserUnbindSpace(userUU, spaceUU);
|
|
|
|
|
|
// 保存日志
|
|
|
- userLog.info(user, Type.UNBIND_USERSPACE.getValue()+spaceUU);
|
|
|
+ userLogger.info(user, Type.UNBIND_USERSPACE.getValue()+spaceUU);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -487,7 +489,7 @@ public class UserServiceImpl implements UserService {
|
|
|
// 保存并添加日志
|
|
|
user = userDao.save(user);
|
|
|
syncUserInfo(user, null, "修改密保");
|
|
|
- userLog.info(user, Type.UPDATE_QUESTION.getValue(), JSON.toJSONString(user.getQuestions()));
|
|
|
+ userLogger.info(user, Type.UPDATE_QUESTION.getValue(), JSON.toJSONString(user.getQuestions()));
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -657,12 +659,13 @@ public class UserServiceImpl implements UserService {
|
|
|
try {
|
|
|
res = HttpUtil.doPost(url, formData, 10000);
|
|
|
if (!res.isSuccess()) {
|
|
|
- syncLog.error(appId, msg + ",同步用户信息失败", JSON.toJSONString(formData), res.getContent());
|
|
|
+ SyncLog syncLog = syncLogger.error(appId, msg + ",同步用户信息失败", JSON.toJSONString(formData), res.getContent());
|
|
|
+ SyncFail.add(syncLog.getId(), formData, url, appId);
|
|
|
} else {
|
|
|
- syncLog.info(appId, msg + ",同步用户信息成功", JSON.toJSONString(formData));
|
|
|
+ syncLogger.info(appId, msg + ",同步用户信息成功", JSON.toJSONString(formData));
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- syncLog.error(appId, msg + ",同步用户信息失败", JSON.toJSONString(formData), e.getMessage());
|
|
|
+ syncLogger.error(appId, msg + ",同步用户信息失败", JSON.toJSONString(formData), e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
return null;
|
|
|
@@ -685,14 +688,14 @@ public class UserServiceImpl implements UserService {
|
|
|
formData.put("mobile", user.getMobile());
|
|
|
res = HttpUtil.doPost(url, formData, 10000);
|
|
|
if (!res.isSuccess()) {
|
|
|
- syncLog.error(appId, msg + ",同步用户信息失败", formData.toString(), res.getContent());
|
|
|
+ syncLogger.error(appId, msg + ",同步用户信息失败", formData.toString(), res.getContent());
|
|
|
throw new Exception(res.getContent());
|
|
|
} else {
|
|
|
JSONObject obj = JSON.parseObject(res.getContent());
|
|
|
if (obj.getString("resultMsg") != null) {
|
|
|
- syncLog.error(appId, msg + ",同步用户信息失败", formData.toString(), res.getContent());
|
|
|
+ syncLogger.error(appId, msg + ",同步用户信息失败", formData.toString(), res.getContent());
|
|
|
}
|
|
|
- syncLog.info(appId, msg + ",同步用户信息成功", formData.toString(), res.getContent());
|
|
|
+ syncLogger.info(appId, msg + ",同步用户信息成功", formData.toString(), res.getContent());
|
|
|
return obj.getString("dialectUID");
|
|
|
}
|
|
|
}
|