feat: 剔除岗位
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.adc.da.sys.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
|
||||
/**
|
||||
@@ -9,6 +10,7 @@ import com.adc.da.base.entity.BaseEntity;
|
||||
* <b>日期:</b> 2018-09-03 <br>
|
||||
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
|
||||
*/
|
||||
@TableName("TS_USER_ROLE")
|
||||
public class UserRoleEO extends BaseEntity {
|
||||
|
||||
private String roleId;
|
||||
|
||||
@@ -3,5 +3,9 @@ package com.adc.da.sys.service;
|
||||
import com.adc.da.sys.entity.UserRoleEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IUserRoleEOService extends IService<UserRoleEO> {
|
||||
|
||||
List<String> getRoleIdsByUserId(String userId);
|
||||
}
|
||||
|
||||
@@ -3,11 +3,16 @@ package com.adc.da.sys.service.impl;
|
||||
import com.adc.da.sys.dao.UserRoleEODao;
|
||||
import com.adc.da.sys.entity.UserRoleEO;
|
||||
import com.adc.da.sys.service.IUserRoleEOService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -21,4 +26,10 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class UserRoleEOServiceImpl extends ServiceImpl<UserRoleEODao, UserRoleEO> implements IUserRoleEOService {
|
||||
|
||||
@Override
|
||||
public List<String> getRoleIdsByUserId(String userId) {
|
||||
return this.list(new LambdaQueryWrapper<UserRoleEO>()
|
||||
.eq(UserRoleEO::getUserId, userId))
|
||||
.stream().map(UserRoleEO::getRoleId).distinct().collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user