管理员列表优化,权限优化
This commit is contained in:
@@ -3,6 +3,7 @@ package com.zbkj.crmeb.system.controller;
|
||||
import com.common.CommonPage;
|
||||
import com.common.CommonResult;
|
||||
import com.common.PageParamRequest;
|
||||
import com.utils.CrmebUtil;
|
||||
import com.zbkj.crmeb.category.vo.CategoryTreeVo;
|
||||
import com.zbkj.crmeb.system.model.SystemRole;
|
||||
import com.zbkj.crmeb.system.request.SystemRoleRequest;
|
||||
@@ -112,14 +113,15 @@ public class SystemRoleController {
|
||||
|
||||
/**
|
||||
* 查询身份管理表信息
|
||||
* @param id Integer
|
||||
* @param ids String
|
||||
* @author Mr.Zhang
|
||||
* @since 2020-04-18
|
||||
*/
|
||||
@ApiOperation(value = "详情")
|
||||
@RequestMapping(value = "/info", method = RequestMethod.GET)
|
||||
public CommonResult<SystemRole> info(@RequestParam(value = "id") Integer id){
|
||||
SystemRole systemRole = systemRoleService.getById(id);
|
||||
public CommonResult<List<SystemRole>> info(@RequestParam(value = "ids") String ids){
|
||||
// SystemRole systemRole = systemRoleService.getById(CrmebUtil.stringToArray(ids));
|
||||
List<SystemRole> systemRole = systemRoleService.getListInIds(CrmebUtil.stringToArray(ids));
|
||||
return CommonResult.success(systemRole);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author stivepeim
|
||||
@@ -30,7 +31,7 @@ public class SystemAdminResponse implements Serializable {
|
||||
|
||||
private String lastIp;
|
||||
|
||||
private Integer lastTime;
|
||||
private Date lastTime;
|
||||
|
||||
private Integer addTime;
|
||||
|
||||
|
||||
@@ -17,6 +17,13 @@ public interface SystemRoleService extends IService<SystemRole> {
|
||||
|
||||
List<SystemRole> getList(SystemRoleSearchRequest request, PageParamRequest pageParamRequest);
|
||||
|
||||
/**
|
||||
* 根据id集合获取对应权限列表
|
||||
* @param ids id集合
|
||||
* @return 对应的权限列表
|
||||
*/
|
||||
List<SystemRole> getListInIds(List<Integer> ids);
|
||||
|
||||
Boolean checkAuth(String uri);
|
||||
|
||||
List<CategoryTreeVo> menu();
|
||||
|
||||
@@ -93,6 +93,7 @@ public class SystemAdminServiceImpl extends ServiceImpl<SystemAdminDao, SystemAd
|
||||
for (SystemAdmin admin : systemAdmins) {
|
||||
SystemAdminResponse sar = new SystemAdminResponse();
|
||||
BeanUtils.copyProperties(admin, sar);
|
||||
sar.setLastTime(admin.getUpdateTime());
|
||||
if(StringUtils.isBlank(admin.getRoles())) continue;
|
||||
List<Integer> roleIds = CrmebUtil.stringToArrayInt(admin.getRoles());
|
||||
List<String> roleNames = new ArrayList<>();
|
||||
|
||||
@@ -63,6 +63,18 @@ public class SystemRoleServiceImpl extends ServiceImpl<SystemRoleDao, SystemRole
|
||||
return dao.selectList(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id集合获取对应权限列表
|
||||
* @param ids id集合
|
||||
* @return 对应的权限列表
|
||||
*/
|
||||
@Override
|
||||
public List<SystemRole> getListInIds(List<Integer> ids) {
|
||||
// LambdaQueryWrapper<SystemRole> lqw = new LambdaQueryWrapper<>();
|
||||
// lqw.in(SystemRole::getId, ids);
|
||||
return dao.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测是否有访问菜单接口取的权限
|
||||
* @param uri String 请求参数
|
||||
|
||||
Reference in New Issue
Block a user