feat: 新增了资产授权时,给父级授权同时也会给子级部门以及用户授权
parent
a098a62a6b
commit
fa6963552a
|
@ -3,12 +3,15 @@ package com.muyu.common.system.remote;
|
|||
import com.muyu.common.core.constant.SecurityConstants;
|
||||
import com.muyu.common.core.constant.ServiceNameConstants;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.common.system.remote.factory.RemoteUserFallbackFactory;
|
||||
import com.muyu.common.system.domain.LoginUser;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户服务
|
||||
*
|
||||
|
@ -16,6 +19,12 @@ import org.springframework.web.bind.annotation.*;
|
|||
*/
|
||||
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
|
||||
public interface RemoteUserService {
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
*/
|
||||
@PostMapping("/user/UserList")
|
||||
public Result<List<SysUser>> userList (@RequestBody SysUser user);
|
||||
/**
|
||||
* 通过用户名查询用户信息
|
||||
*
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.muyu.common.system.remote.factory;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.system.remote.RemoteUserService;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.common.system.domain.LoginUser;
|
||||
|
@ -9,6 +10,8 @@ import org.slf4j.LoggerFactory;
|
|||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户服务降级处理
|
||||
*
|
||||
|
@ -22,6 +25,13 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
|
|||
public RemoteUserService create (Throwable throwable) {
|
||||
log.error("用户服务调用失败:{}", throwable.getMessage());
|
||||
return new RemoteUserService() {
|
||||
|
||||
|
||||
@Override
|
||||
public Result<List<SysUser>> userList(SysUser user) {
|
||||
return Result.error("获取用户列表失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<LoginUser> getUserInfo (String username, String source) {
|
||||
return Result.error("获取用户失败:" + throwable.getMessage());
|
||||
|
|
|
@ -24,7 +24,7 @@ import com.muyu.common.core.utils.poi.ExcelUtil;
|
|||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Controller
|
||||
* 数据接入Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-20
|
||||
|
@ -37,7 +37,7 @@ public class DataSourceController extends BaseController
|
|||
private IDataSourceService dataSourceService;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
* 查询数据接入列表
|
||||
*/
|
||||
@RequiresPermissions("system:source:list")
|
||||
@GetMapping("/list")
|
||||
|
@ -48,29 +48,36 @@ public class DataSourceController extends BaseController
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
//获取数据源中表的数据(KVT结构)
|
||||
@PostMapping("/AssetsList")
|
||||
public Result assetsList(@RequestBody DataSource dataSource)
|
||||
{
|
||||
return dataSourceService.assetsList(dataSource);
|
||||
}
|
||||
|
||||
|
||||
//数据接入同步资产结构
|
||||
@PostMapping("/SynchronousData")
|
||||
public Result synchronousData(@RequestBody DataSource dataSource)
|
||||
{
|
||||
return dataSourceService.synchronousData(dataSource);
|
||||
}
|
||||
|
||||
//根据数据接入信息获取资产表列表信息
|
||||
@PostMapping("/DataAssetList")
|
||||
public Result dataAssetList(@RequestBody DataSource dataSource)
|
||||
{
|
||||
return dataSourceService.dataAssetList(dataSource);
|
||||
}
|
||||
|
||||
//统计选中数据接入的数据(数据接入量 数据接入表中字段量 数据接入表中数据量)
|
||||
@GetMapping("/Statistics")
|
||||
public Result statistics(){
|
||||
return dataSourceService.statistics();
|
||||
}
|
||||
|
||||
//根据数据表信息获取资产模型字段列表信息
|
||||
@PostMapping("/AssetModelList")
|
||||
public Result assetModelList(@RequestBody DataAsset dataAsset)
|
||||
{
|
||||
|
|
|
@ -70,4 +70,6 @@ public interface AssetAccreditMapper
|
|||
void deleteAssetAccreditByDeptUser(@Param("deptIds") List<Long> deptIds, @Param("userId") Long userId, @Param("dataAssetId") Long dataAssetId);
|
||||
|
||||
void insertBatchAssetAccredit(@Param("assetAccredits") List<AssetAccredit> assetAccredits);
|
||||
|
||||
void deleteAssetAccreditByUser(@Param("userIds") List<Long> userIds, @Param("dataAssetId") Long dataAssetId);
|
||||
}
|
||||
|
|
|
@ -69,4 +69,6 @@ public interface SourceAccreditMapper
|
|||
void insertBatchSourceAccredit(@Param("sourceAccredits") List<SourceAccredit> sourceAccredits);
|
||||
|
||||
void deleteSourceAccreditByDeptUser(@Param("deptIds") List<Long> deptIds, @Param("userId") Long userId, @Param("dataSourceId") Long dataSourceId);
|
||||
|
||||
void deleteSourceAccreditByUser(@Param("userIds") List<Long> userIds, @Param("dataSourceId") Long dataSourceId);
|
||||
}
|
||||
|
|
|
@ -8,6 +8,8 @@ import java.util.Objects;
|
|||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.common.system.remote.RemoteUserService;
|
||||
import com.muyu.etl.domain.SourceAccredit;
|
||||
import com.muyu.etl.domain.model.AccreditModel;
|
||||
import com.muyu.etl.domain.req.AssetAccreditReq;
|
||||
|
@ -29,6 +31,9 @@ public class AssetAccreditServiceImpl implements IAssetAccreditService
|
|||
@Autowired
|
||||
private AssetAccreditMapper assetAccreditMapper;
|
||||
|
||||
@Autowired
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
|
@ -72,14 +77,25 @@ public class AssetAccreditServiceImpl implements IAssetAccreditService
|
|||
assetAccredit.setCreateTime(new Date());
|
||||
assetAccredits.add(assetAccredit);
|
||||
}else{
|
||||
assetAccredits=assetAccreditReq.getDeptIds().stream().map(deptId -> {
|
||||
assetAccredits.addAll(assetAccreditReq.getDeptIds().stream().map(deptId -> {
|
||||
AssetAccredit assetAccredit = new AssetAccredit();
|
||||
assetAccredit.setDataAssetId(assetAccreditReq.getDataAssetId());
|
||||
assetAccredit.setDeptId(deptId);
|
||||
assetAccredit.setCreateBy(SecurityUtils.getUsername());
|
||||
assetAccredit.setCreateTime(new Date());
|
||||
return assetAccredit;
|
||||
}).toList();
|
||||
}).toList());
|
||||
List<Long> deptIds = assetAccreditReq.getDeptIds();
|
||||
Result<List<SysUser>> list = remoteUserService.userList(new SysUser());
|
||||
List<SysUser> sysUsers = list.getData();
|
||||
assetAccredits.addAll(sysUsers.stream().filter(sysUser -> deptIds.contains(sysUser.getDeptId())).toList().stream().map(sysUser -> {
|
||||
AssetAccredit assetAccredit = new AssetAccredit();
|
||||
assetAccredit.setDataAssetId(assetAccreditReq.getDataAssetId());
|
||||
assetAccredit.setUserId(sysUser.getUserId());
|
||||
assetAccredit.setCreateBy(SecurityUtils.getUsername());
|
||||
assetAccredit.setCreateTime(new Date());
|
||||
return assetAccredit;
|
||||
}).toList());
|
||||
}
|
||||
assetAccreditMapper.insertBatchAssetAccredit(assetAccredits);
|
||||
return Result.success();
|
||||
|
@ -138,6 +154,14 @@ public class AssetAccreditServiceImpl implements IAssetAccreditService
|
|||
if (assetAccreditReq.getUserId() != null){
|
||||
assetAccreditMapper.deleteAssetAccreditByDeptUser(null,assetAccreditReq.getUserId(),assetAccreditReq.getDataAssetId());
|
||||
}else{
|
||||
List<Long> deptIds = assetAccreditReq.getDeptIds();
|
||||
Result<List<SysUser>> list = remoteUserService.userList(new SysUser());
|
||||
List<SysUser> sysUsers = list.getData();
|
||||
List<Long> userIds = sysUsers.stream()
|
||||
.filter(sysUser -> deptIds.contains(sysUser.getDeptId())).toList().stream()
|
||||
.filter(sysUser -> deptIds.contains(sysUser.getDeptId())).toList().stream()
|
||||
.map(SysUser::getUserId).toList();
|
||||
assetAccreditMapper.deleteAssetAccreditByUser(userIds,assetAccreditReq.getDataAssetId());
|
||||
assetAccreditMapper.deleteAssetAccreditByDeptUser(assetAccreditReq.getDeptIds(),null,assetAccreditReq.getDataAssetId());
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -60,7 +60,7 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
private final ExecutorService executorService = Executors.newFixedThreadPool(6);
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
* 根据id查询数据接入集合
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
|
@ -73,7 +73,7 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
* 查询数据接入列表
|
||||
*
|
||||
* @param dataSource 【请填写功能名称】
|
||||
* @return 【请填写功能名称】
|
||||
|
@ -84,24 +84,32 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
List<DataSource> dataSourceList = new ArrayList<DataSource>();
|
||||
List<DataSource> dataSources = dataSourceMapper.selectDataSourceList(dataSource);
|
||||
List<SysRole> roles = SecurityUtils.getLoginUser().getSysUser().getRoles();
|
||||
//判断登录人是否为管理员,不是则需要过滤掉未授权的信息
|
||||
if (roles.get(0).getRoleId()==1){
|
||||
dataSourceList = dataSources;
|
||||
}else{
|
||||
//数据接入过滤完的主键id集合
|
||||
ArrayList<Long> longs1 = new ArrayList<>();
|
||||
//已授权的数据接入id集合
|
||||
List<Long> sourceIds = sourceAccreditMapper.getSourceAccreditByUserId(SecurityUtils.getUserId()).stream().map(SourceAccredit::getDataSourceId).filter(Objects::nonNull).toList();
|
||||
//已授权数据模型表的主键id集合
|
||||
List<Long> assetIds = assetAccreditMapper.getAssetAccreditByUserId(SecurityUtils.getUserId()).stream().map(AssetAccredit::getDataAssetId).filter(Objects::nonNull).toList();
|
||||
//判断已授权数据模型表的主键id集合是否为空
|
||||
if (!assetIds.isEmpty()){
|
||||
//获取已授权的数据模型表的数据源id集合
|
||||
List<Long> longs = dataAssetMapper.getDataAssetByAssetId(assetIds).stream().map(DataAsset::getDataSourceId).toList();
|
||||
//添加到已授权的数据源id集合中
|
||||
longs1.addAll(longs);
|
||||
}
|
||||
longs1.addAll(sourceIds);
|
||||
//从所有的数据源信息集合中过滤掉未授权的数据源信息
|
||||
dataSourceList = dataSources.stream().filter(dataSourceInfo -> longs1.contains(dataSourceInfo.getId())).toList();
|
||||
}
|
||||
return dataSourceList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
* 新增数据接入信息
|
||||
*
|
||||
* @param dataSource 【请填写功能名称】
|
||||
* @return 结果
|
||||
|
@ -111,6 +119,7 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
{
|
||||
dataSource.setCreateTime(DateUtils.getNowDate());
|
||||
dataSource.setCreateBy(SecurityUtils.getUsername());
|
||||
//判断添加的数据源数据库类型
|
||||
if ("MySql".equals(dataSource.getType())){
|
||||
dataSource.setJdbcDriver("com.mysql.cj.jdbc.Driver");
|
||||
}else{
|
||||
|
@ -120,7 +129,7 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
}
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
* 修改数据接入信息
|
||||
*
|
||||
* @param dataSource 【请填写功能名称】
|
||||
* @return 结果
|
||||
|
@ -130,6 +139,7 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
{
|
||||
dataSource.setUpdateTime(DateUtils.getNowDate());
|
||||
dataSource.setUpdateBy(SecurityUtils.getUsername());
|
||||
//判断修改的数据源数据库类型
|
||||
if ("MySql".equals(dataSource.getType())){
|
||||
dataSource.setJdbcDriver("com.mysql.cj.jdbc.Driver");
|
||||
}else{
|
||||
|
@ -139,7 +149,7 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
}
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
* 批量删除数据接入
|
||||
*
|
||||
* @param ids 需要删除的【请填写功能名称】主键
|
||||
* @return 结果
|
||||
|
@ -148,31 +158,43 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
@Transactional
|
||||
public int deleteDataSourceByIds(Long[] ids)
|
||||
{
|
||||
//删除数据接入的数据模型表及关联数据
|
||||
deleteChildLevel(ids,"delete");
|
||||
return dataSourceMapper.deleteDataSourceByIds(ids);
|
||||
}
|
||||
|
||||
//删除数据接入的用户授权数据
|
||||
public void deleteAccredit(List<Long> sourceIds,List<Long> assetIds){
|
||||
//删除数据接入的用户授权数据
|
||||
if (!sourceIds.isEmpty()){
|
||||
sourceAccreditMapper.deleteSourceAccreditBySourceIds(sourceIds);
|
||||
}
|
||||
//删除数据接入的数据模型表及关联数据
|
||||
if (!assetIds.isEmpty()){
|
||||
assetAccreditMapper.deleteAssetAccreditByAssetIds(assetIds);
|
||||
}
|
||||
}
|
||||
|
||||
//删除数据接入相关信息(数据表,数据表中字段,关联字典)
|
||||
public void deleteChildLevel(Long[] ids,String type){
|
||||
//获取数据模型表
|
||||
List<DataAsset> dataAssetList=dataAssetMapper.getDataAssetList(ids);
|
||||
//数据模型表主键id集合
|
||||
List<Long> dataAssetIds = new ArrayList<>();
|
||||
if (!dataAssetList.isEmpty()){
|
||||
//获取数据模型表主键id集合
|
||||
dataAssetIds = dataAssetList.stream().map(DataAsset::getId).toList();
|
||||
//获取数据模型表关联的字典表
|
||||
List<AssetModel> assetModelList=assetModelMapper.getAssetModelList(dataAssetIds);
|
||||
//根据数据模型表id删除数据模型表信息
|
||||
dataAssetMapper.deleteDataAssetByIds(dataAssetIds.toArray(Long[]::new));
|
||||
//根据数据模型表id删除数据模型表的字段信息
|
||||
if (!assetModelList.isEmpty()){
|
||||
List<Long> assetModelIds = assetModelList.stream().map(AssetModel::getId).toList();
|
||||
assetModelMapper.deleteAssetModelByIds(assetModelIds.toArray(Long[]::new));
|
||||
}
|
||||
}
|
||||
//删除数据接入的用户授权数据
|
||||
if ("delete".equals(type)){
|
||||
deleteAccredit(Arrays.stream(ids).toList(),dataAssetIds);
|
||||
}else{
|
||||
|
@ -182,7 +204,7 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
}
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】信息
|
||||
* 删除数据接入信息
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
|
@ -193,6 +215,8 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
return dataSourceMapper.deleteDataSourceById(id);
|
||||
}
|
||||
|
||||
//测试连接
|
||||
|
||||
@Override
|
||||
public Result testConnection(DataSource dataSource) {
|
||||
String jdbcUrl = "jdbc:"+dataSource.getType().toLowerCase()+"://"+dataSource.getLinkAddress()+":"+dataSource.getPort()+"/"+dataSource.getDatabaseName();
|
||||
|
@ -215,6 +239,7 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
return Result.success("连接成功");
|
||||
}
|
||||
|
||||
//获取数据模型的数据(KVT结构)
|
||||
public AssetsModule getStructure(DataSource dataSource){
|
||||
String jdbcUrl = "jdbc:"+dataSource.getType().toLowerCase()+"://"+dataSource.getLinkAddress()+":"+dataSource.getPort()+"/"+dataSource.getDatabaseName();
|
||||
if (dataSource.getConnectionParam()!=null && dataSource.getConnectionParam()!=""){
|
||||
|
@ -266,6 +291,7 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
return new AssetsModule().assetsModuleBuilder(kvtList,map);
|
||||
}
|
||||
|
||||
//获取数据模型表内字段信息的映射类型map集合
|
||||
public Map<String,String> getTypeMap(DataSource dataSource, String tableName){
|
||||
String jdbcUrl="";
|
||||
String sql="";
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.muyu.common.core.utils.DateUtils;
|
|||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.common.system.remote.RemoteUserService;
|
||||
import com.muyu.etl.domain.model.AccreditModel;
|
||||
import com.muyu.etl.domain.req.SourceAccreditReq;
|
||||
import com.muyu.etl.feign.SysUserFeignService;
|
||||
|
@ -18,6 +19,7 @@ import org.springframework.stereotype.Service;
|
|||
import com.muyu.etl.mapper.SourceAccreditMapper;
|
||||
import com.muyu.etl.domain.SourceAccredit;
|
||||
import com.muyu.etl.service.ISourceAccreditService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service业务层处理
|
||||
|
@ -31,6 +33,9 @@ public class SourceAccreditServiceImpl implements ISourceAccreditService
|
|||
@Autowired
|
||||
private SourceAccreditMapper sourceAccreditMapper;
|
||||
|
||||
@Autowired
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
|
@ -62,11 +67,13 @@ public class SourceAccreditServiceImpl implements ISourceAccreditService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public Result insertSourceAccredit(SourceAccreditReq sourceAccreditReq)
|
||||
{
|
||||
deleteSourceAccreditBySourceIds(sourceAccreditReq);
|
||||
List<SourceAccredit> sourceAccredits = new ArrayList<>();
|
||||
List<SourceAccredit> sourceAccredits;
|
||||
if (sourceAccreditReq.getUserId() != null){
|
||||
sourceAccredits = new ArrayList<>();
|
||||
SourceAccredit sourceAccredit = new SourceAccredit();
|
||||
sourceAccredit.setDataSourceId(sourceAccreditReq.getDataSourceId());
|
||||
sourceAccredit.setUserId(sourceAccreditReq.getUserId());
|
||||
|
@ -74,14 +81,26 @@ public class SourceAccreditServiceImpl implements ISourceAccreditService
|
|||
sourceAccredit.setCreateTime(new Date());
|
||||
sourceAccredits.add(sourceAccredit);
|
||||
}else{
|
||||
sourceAccredits=sourceAccreditReq.getDeptIds().stream().map(deptId -> {
|
||||
|
||||
sourceAccredits = new ArrayList<>(sourceAccreditReq.getDeptIds().stream().map(deptId -> {
|
||||
SourceAccredit sourceAccredit = new SourceAccredit();
|
||||
sourceAccredit.setDataSourceId(sourceAccreditReq.getDataSourceId());
|
||||
sourceAccredit.setDeptId(deptId);
|
||||
sourceAccredit.setCreateBy(SecurityUtils.getUsername());
|
||||
sourceAccredit.setCreateTime(new Date());
|
||||
return sourceAccredit;
|
||||
}).toList();
|
||||
}).toList());
|
||||
List<Long> deptIds = sourceAccreditReq.getDeptIds();
|
||||
Result<List<SysUser>> list = remoteUserService.userList(new SysUser());
|
||||
List<SysUser> sysUsers = list.getData();
|
||||
sourceAccredits.addAll(sysUsers.stream().filter(sysUser -> deptIds.contains(sysUser.getDeptId())).toList().stream().map(sysUser -> {
|
||||
SourceAccredit sourceAccredit = new SourceAccredit();
|
||||
sourceAccredit.setDataSourceId(sourceAccreditReq.getDataSourceId());
|
||||
sourceAccredit.setUserId(sysUser.getUserId());
|
||||
sourceAccredit.setCreateBy(SecurityUtils.getUsername());
|
||||
sourceAccredit.setCreateTime(new Date());
|
||||
return sourceAccredit;
|
||||
}).toList());
|
||||
}
|
||||
sourceAccreditMapper.insertBatchSourceAccredit(sourceAccredits);
|
||||
return Result.success();
|
||||
|
@ -140,6 +159,14 @@ public class SourceAccreditServiceImpl implements ISourceAccreditService
|
|||
if (sourceAccreditReq.getUserId() != null){
|
||||
sourceAccreditMapper.deleteSourceAccreditByDeptUser(null,sourceAccreditReq.getUserId(),sourceAccreditReq.getDataSourceId());
|
||||
}else{
|
||||
List<Long> deptIds = sourceAccreditReq.getDeptIds();
|
||||
Result<List<SysUser>> list = remoteUserService.userList(new SysUser());
|
||||
List<SysUser> sysUsers = list.getData();
|
||||
List<Long> userIds = sysUsers.stream()
|
||||
.filter(sysUser -> deptIds.contains(sysUser.getDeptId())).toList().stream()
|
||||
.filter(sysUser -> deptIds.contains(sysUser.getDeptId())).toList().stream()
|
||||
.map(SysUser::getUserId).toList();
|
||||
sourceAccreditMapper.deleteSourceAccreditByUser(userIds,sourceAccreditReq.getDataSourceId());
|
||||
sourceAccreditMapper.deleteSourceAccreditByDeptUser(sourceAccreditReq.getDeptIds(),null,sourceAccreditReq.getDataSourceId());
|
||||
}
|
||||
return Result.success();
|
||||
|
|
|
@ -136,4 +136,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</if>
|
||||
</delete>
|
||||
<delete id="deleteAssetAccreditByUser">
|
||||
delete from asset_accredit where data_asset_id = #{dataAssetId}
|
||||
and user_id in (
|
||||
<foreach collection="userIds" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</delete>
|
||||
</mapper>
|
|
@ -136,4 +136,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</if>
|
||||
</delete>
|
||||
<delete id="deleteSourceAccreditByUser">
|
||||
delete from source_accredit where
|
||||
data_source_id = #{dataSourceId}
|
||||
and user_id in (
|
||||
<foreach collection="userIds" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</delete>
|
||||
</mapper>
|
|
@ -66,6 +66,16 @@ public class SysUserController extends BaseController {
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
@PostMapping("/UserList")
|
||||
public Result<List<SysUser>> userList (@RequestBody SysUser user) {
|
||||
startPage();
|
||||
List<SysUser> list = userService.selectUserList(user);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("system:user:export")
|
||||
@PostMapping("/export")
|
||||
|
|
Loading…
Reference in New Issue