|
@@ -199,16 +199,17 @@ public class UnifiedUserCenterServiceImpl implements UnifiedUserCenterService {
|
|
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
|
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
|
|
|
public void updateUserBindStatus(UnifiedUserCenterDTO dto) {
|
|
public void updateUserBindStatus(UnifiedUserCenterDTO dto) {
|
|
|
try {
|
|
try {
|
|
|
- TWxUser wxUser = this.wxUserService.getById(dto.getSourceUserId());
|
|
|
|
|
|
|
+ TWxUser wxUser = this.wxUserService.getById(dto.getTargetUserId());
|
|
|
wxUser.setIsBind(1);
|
|
wxUser.setIsBind(1);
|
|
|
|
|
+ wxUser.setLocalLiveUserId(dto.getSourceUserId());
|
|
|
boolean wxUserBool = this.wxUserService.updateById(wxUser);
|
|
boolean wxUserBool = this.wxUserService.updateById(wxUser);
|
|
|
if (!wxUserBool) {
|
|
if (!wxUserBool) {
|
|
|
- log.error("更新用户绑定状态失败, userId: {}", dto.getSourceUserId());
|
|
|
|
|
|
|
+ log.error("更新用户绑定状态失败, userId: {}", dto.getTargetUserId());
|
|
|
throw new ServiceException("更新用户绑定状态失败");
|
|
throw new ServiceException("更新用户绑定状态失败");
|
|
|
}
|
|
}
|
|
|
- log.info("更新用户绑定一账通信息成功, userId:{}", dto.getSourceUserId());
|
|
|
|
|
|
|
+ log.info("更新用户绑定一账通信息成功, userId:{}", dto.getTargetUserId());
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
- log.error("更新用户绑定状态异常, userId: {}", dto.getSourceUserId(), e);
|
|
|
|
|
|
|
+ log.error("更新用户绑定状态异常, userId: {}", dto.getTargetUserId(), e);
|
|
|
// 如果本地更新失败,异步调用远程解绑接口进行补偿
|
|
// 如果本地更新失败,异步调用远程解绑接口进行补偿
|
|
|
asyncCompensateUnbind(dto);
|
|
asyncCompensateUnbind(dto);
|
|
|
throw e;
|
|
throw e;
|
|
@@ -248,19 +249,19 @@ public class UnifiedUserCenterServiceImpl implements UnifiedUserCenterService {
|
|
|
while (retryCount < maxRetries && !success) {
|
|
while (retryCount < maxRetries && !success) {
|
|
|
retryCount++;
|
|
retryCount++;
|
|
|
try {
|
|
try {
|
|
|
- log.info("异步补偿:尝试解除用户绑定, userId: {}, 重试次数: {}", dto.getSourceUserId(), retryCount);
|
|
|
|
|
|
|
+ log.info("异步补偿:尝试解除用户绑定, userId: {}, 重试次数: {}", dto.getTargetUserId(), retryCount);
|
|
|
executePost(UNBIND_PATH, dto, "补偿:解除用户绑定信息");
|
|
executePost(UNBIND_PATH, dto, "补偿:解除用户绑定信息");
|
|
|
- log.info("异步补偿:成功解除用户绑定, userId: {}", dto.getSourceUserId());
|
|
|
|
|
|
|
+ log.info("异步补偿:成功解除用户绑定, userId: {}", dto.getTargetUserId());
|
|
|
success = true;
|
|
success = true;
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
- log.error("异步补偿:解除用户绑定失败, userId: {}, 重试次数: {}", dto.getSourceUserId(), retryCount, e);
|
|
|
|
|
|
|
+ log.error("异步补偿:解除用户绑定失败, userId: {}, 重试次数: {}", dto.getTargetUserId(), retryCount, e);
|
|
|
if (retryCount < maxRetries) {
|
|
if (retryCount < maxRetries) {
|
|
|
try {
|
|
try {
|
|
|
// 等待一段时间后重试
|
|
// 等待一段时间后重试
|
|
|
Thread.sleep(1000 * retryCount);
|
|
Thread.sleep(1000 * retryCount);
|
|
|
} catch (InterruptedException ie) {
|
|
} catch (InterruptedException ie) {
|
|
|
Thread.currentThread().interrupt();
|
|
Thread.currentThread().interrupt();
|
|
|
- log.error("异步补偿:线程被中断, userId: {}", dto.getSourceUserId(), ie);
|
|
|
|
|
|
|
+ log.error("异步补偿:线程被中断, userId: {}", dto.getTargetUserId(), ie);
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|