|
@@ -17,10 +17,7 @@ import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.dromara.backstage.api.RemotePtParameterService;
|
|
import org.dromara.backstage.api.RemotePtParameterService;
|
|
|
import org.dromara.backstage.api.RemoteUserAccountService;
|
|
import org.dromara.backstage.api.RemoteUserAccountService;
|
|
|
import org.dromara.backstage.api.domain.bo.RemoteUserAccountBo;
|
|
import org.dromara.backstage.api.domain.bo.RemoteUserAccountBo;
|
|
|
-import org.dromara.common.core.constant.CacheNames;
|
|
|
|
|
-import org.dromara.common.core.constant.Constants;
|
|
|
|
|
-import org.dromara.common.core.constant.HttpStatus;
|
|
|
|
|
-import org.dromara.common.core.constant.UserConstants;
|
|
|
|
|
|
|
+import org.dromara.common.core.constant.*;
|
|
|
import org.dromara.common.core.domain.R;
|
|
import org.dromara.common.core.domain.R;
|
|
|
import org.dromara.common.core.exception.ServiceException;
|
|
import org.dromara.common.core.exception.ServiceException;
|
|
|
import org.dromara.common.core.exception.user.UserException;
|
|
import org.dromara.common.core.exception.user.UserException;
|
|
@@ -30,6 +27,8 @@ import org.dromara.common.core.utils.StreamUtils;
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
import org.dromara.common.encrypt.interceptor.MybatisDecryptInterceptor;
|
|
import org.dromara.common.encrypt.interceptor.MybatisDecryptInterceptor;
|
|
|
import org.dromara.common.encrypt.interceptor.MybatisEncryptInterceptor;
|
|
import org.dromara.common.encrypt.interceptor.MybatisEncryptInterceptor;
|
|
|
|
|
+import org.dromara.common.message.kafka.domain.KafkaHeader;
|
|
|
|
|
+import org.dromara.common.message.kafka.domain.KafkaMessage;
|
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
import org.dromara.common.mybatis.helper.DataBaseHelper;
|
|
import org.dromara.common.mybatis.helper.DataBaseHelper;
|
|
@@ -39,11 +38,9 @@ import org.dromara.system.domain.SysUser;
|
|
|
import org.dromara.system.domain.SysUserRole;
|
|
import org.dromara.system.domain.SysUserRole;
|
|
|
import org.dromara.system.domain.bo.SysUserBo;
|
|
import org.dromara.system.domain.bo.SysUserBo;
|
|
|
import org.dromara.system.domain.bo.UserDeptBo;
|
|
import org.dromara.system.domain.bo.UserDeptBo;
|
|
|
-import org.dromara.system.domain.vo.SysPostVo;
|
|
|
|
|
-import org.dromara.system.domain.vo.SysRoleVo;
|
|
|
|
|
-import org.dromara.system.domain.vo.SysUserExportVo;
|
|
|
|
|
-import org.dromara.system.domain.vo.SysUserVo;
|
|
|
|
|
|
|
+import org.dromara.system.domain.vo.*;
|
|
|
import org.dromara.system.mapper.*;
|
|
import org.dromara.system.mapper.*;
|
|
|
|
|
+import org.dromara.system.mq.KafkaNormalProducer;
|
|
|
import org.dromara.system.service.ISysUserService;
|
|
import org.dromara.system.service.ISysUserService;
|
|
|
import org.dromara.system.service.IUserDeptService;
|
|
import org.dromara.system.service.IUserDeptService;
|
|
|
import org.springframework.cache.annotation.CacheEvict;
|
|
import org.springframework.cache.annotation.CacheEvict;
|
|
@@ -71,6 +68,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
|
|
private final SysPostMapper postMapper;
|
|
private final SysPostMapper postMapper;
|
|
|
private final SysUserRoleMapper userRoleMapper;
|
|
private final SysUserRoleMapper userRoleMapper;
|
|
|
private final IUserDeptService userDeptService;
|
|
private final IUserDeptService userDeptService;
|
|
|
|
|
+ private final KafkaNormalProducer kafkaNormalProducer;
|
|
|
|
|
|
|
|
@DubboReference
|
|
@DubboReference
|
|
|
private final RemotePtParameterService remotePtParameterService;
|
|
private final RemotePtParameterService remotePtParameterService;
|
|
@@ -384,6 +382,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
|
|
remoteUserAccountBo.setAccountStatus("0");
|
|
remoteUserAccountBo.setAccountStatus("0");
|
|
|
remoteUserAccountService.insertByBo(remoteUserAccountBo);
|
|
remoteUserAccountService.insertByBo(remoteUserAccountBo);
|
|
|
}
|
|
}
|
|
|
|
|
+ sendCloudConsume(baseMapper.selectVoById(user.getUserId()));
|
|
|
return rows;
|
|
return rows;
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error(e.getMessage(), e);
|
|
log.error(e.getMessage(), e);
|
|
@@ -734,4 +733,21 @@ public class SysUserServiceImpl implements ISysUserService {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ private void sendCloudConsume(SysUserVo vo) {
|
|
|
|
|
+ String pushData = remotePtParameterService.getPtParameterByKey("PUSH_MQ_DATA");
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(pushData) && ObjectUtil.equals(pushData, "1")) {
|
|
|
|
|
+ KafkaMessage<SysUserVo> message = new KafkaMessage<>();
|
|
|
|
|
+ KafkaHeader header = message.getHeader();
|
|
|
|
|
+ header.setTimestamp(System.currentTimeMillis());
|
|
|
|
|
+ header.setEventId(CloudMqEventConstants.USER);
|
|
|
|
|
+ header.setEventType(CloudMqEventConstants.USER);
|
|
|
|
|
+ header.setSender(CloudMqEventConstants.SENDER);
|
|
|
|
|
+
|
|
|
|
|
+ message.setHeader(header);
|
|
|
|
|
+ message.setBody(vo);
|
|
|
|
|
+
|
|
|
|
|
+ kafkaNormalProducer.sendKafkaMessage(CloudMqEventConstants.TOPIC, message);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|