Merge branch 'develop' of http://139.196.179.195:3000/chenxudong/electromagnetic-data-new into develop
This commit is contained in:
commit
952efbd78d
|
|
@ -6,6 +6,7 @@ import com.electromagnetic.industry.software.manage.pojo.models.Role;
|
||||||
import com.electromagnetic.industry.software.manage.pojo.req.RoleDTO;
|
import com.electromagnetic.industry.software.manage.pojo.req.RoleDTO;
|
||||||
import com.electromagnetic.industry.software.manage.pojo.req.RolePageDTO;
|
import com.electromagnetic.industry.software.manage.pojo.req.RolePageDTO;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface RoleService extends IService<Role> {
|
public interface RoleService extends IService<Role> {
|
||||||
|
|
@ -55,7 +56,7 @@ public interface RoleService extends IService<Role> {
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<String> getAllRoleNames();
|
List<HashMap<String, String>> getAllRoleNames();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过角色名称查看角色权限
|
* 通过角色名称查看角色权限
|
||||||
|
|
|
||||||
|
|
@ -235,11 +235,20 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
||||||
*/
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public List<String> getAllRoleNames() {
|
public List<HashMap<String, String>> getAllRoleNames() {
|
||||||
LambdaQueryWrapper<Role> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Role> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.select(Role::getRoleName)
|
queryWrapper.select(Role::getRoleName)
|
||||||
.eq(Role::getEffectFlag, EffectFlagEnum.EFFECT.code);
|
.eq(Role::getEffectFlag, EffectFlagEnum.EFFECT.code);
|
||||||
return this.listObjs(queryWrapper).stream().map(Object::toString).collect(Collectors.toList());
|
|
||||||
|
List<String> roleNames = this.listObjs(queryWrapper).stream().map(Object::toString).collect(Collectors.toList());
|
||||||
|
List<HashMap<String,String>> result = new ArrayList<>();
|
||||||
|
for (String roleName : roleNames) {
|
||||||
|
HashMap<String, String> map = new HashMap<>();
|
||||||
|
map.put("value", roleName);
|
||||||
|
map.put("label", roleName);
|
||||||
|
result.add(map);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue