org.jeecg.modules.system.entity.SysRole Java Examples

The following examples show how to use org.jeecg.modules.system.entity.SysRole. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SysRoleController.java    From teaching with Apache License 2.0 6 votes vote down vote up
/**
 * 导出excel
 * @param request
 */
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(SysRole sysRole,HttpServletRequest request) {
	// Step.1 组装查询条件
	QueryWrapper<SysRole> queryWrapper = QueryGenerator.initQueryWrapper(sysRole, request.getParameterMap());
	//Step.2 AutoPoi 导出Excel
	ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
	List<SysRole> pageList = sysRoleService.list(queryWrapper);
	//导出文件名称
	mv.addObject(NormalExcelConstants.FILE_NAME,"角色列表");
	mv.addObject(NormalExcelConstants.CLASS,SysRole.class);
	LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
	mv.addObject(NormalExcelConstants.PARAMS,new ExportParams("角色列表数据","导出人:"+user.getRealname(),"导出信息"));
	mv.addObject(NormalExcelConstants.DATA_LIST,pageList);
	return mv;
}
 
Example #2
Source File: SysUserRoleServiceImpl.java    From teaching with Apache License 2.0 6 votes vote down vote up
/**
 * 查询所有用户对应的角色信息
 */
@Override
public Map<String,String> queryUserRole() {
	List<SysUserRole> uRoleList = this.list();
	List<SysUser> userList = userService.list();
	List<SysRole> roleList = roleService.list();
	Map<String,String> map = new IdentityHashMap<>();
	String userId = "";
	String roleId = "";
	String roleName = "";
	if(uRoleList != null && uRoleList.size() > 0) {
		for(SysUserRole uRole : uRoleList) {
			roleId = uRole.getRoleId();
			for(SysUser user : userList) {
				userId = user.getId();
				if(uRole.getUserId().equals(userId)) {
					roleName = this.searchByRoleId(roleList,roleId);
					map.put(userId, roleName);
				}
			}
		}
		return map;
	}
	return map;
}
 
Example #3
Source File: SysRoleController.java    From jeecg-boot-with-activiti with MIT License 6 votes vote down vote up
/**
 * 导出excel
 * @param request
 * @param response
 */
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(SysRole sysRole,HttpServletRequest request) {
	// Step.1 组装查询条件
	QueryWrapper<SysRole> queryWrapper = QueryGenerator.initQueryWrapper(sysRole, request.getParameterMap());
	//Step.2 AutoPoi 导出Excel
	ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
	List<SysRole> pageList = sysRoleService.list(queryWrapper);
	//导出文件名称
	mv.addObject(NormalExcelConstants.FILE_NAME,"角色列表");
	mv.addObject(NormalExcelConstants.CLASS,SysRole.class);
	LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
	mv.addObject(NormalExcelConstants.PARAMS,new ExportParams("角色列表数据","导出人:"+user.getRealname(),"导出信息"));
	mv.addObject(NormalExcelConstants.DATA_LIST,pageList);
	return mv;
}
 
Example #4
Source File: SysLogController.java    From jeecg-boot-with-activiti with MIT License 6 votes vote down vote up
/**
 * @功能:批量,全部清空日志记录
 * @param ids
 * @return
 */
@RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
public Result<SysRole> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
	Result<SysRole> result = new Result<SysRole>();
	if(ids==null || "".equals(ids.trim())) {
		result.error500("参数不识别!");
	}else {
		if("allclear".equals(ids)) {
			this.sysLogService.removeAll();
			result.success("清除成功!");
		}
		this.sysLogService.removeByIds(Arrays.asList(ids.split(",")));
		result.success("删除成功!");
	}
	return result;
}
 
Example #5
Source File: SysUserRoleServiceImpl.java    From jeecg-boot-with-activiti with MIT License 6 votes vote down vote up
/**
 * 查询所有用户对应的角色信息
 */
@Override
public Map<String,String> queryUserRole() {
	List<SysUserRole> uRoleList = this.list();
	List<SysUser> userList = userService.list();
	List<SysRole> roleList = roleService.list();
	Map<String,String> map = new IdentityHashMap<>();
	String userId = "";
	String roleId = "";
	String roleName = "";
	if(uRoleList != null && uRoleList.size() > 0) {
		for(SysUserRole uRole : uRoleList) {
			roleId = uRole.getRoleId();
			for(SysUser user : userList) {
				userId = user.getId();
				if(uRole.getUserId().equals(userId)) {
					roleName = this.searchByRoleId(roleList,roleId);
					map.put(userId, roleName);
				}
			}
		}
		return map;
	}
	return map;
}
 
Example #6
Source File: SysRoleController.java    From jeecg-boot-with-activiti with MIT License 6 votes vote down vote up
/**
  *   通过id删除
 * @param id
 * @return
 */
@RequestMapping(value = "/delete", method = RequestMethod.DELETE)
public Result<SysRole> delete(@RequestParam(name="id",required=true) String id) {
	Result<SysRole> result = new Result<SysRole>();
	SysRole sysrole = sysRoleService.getById(id);
	if(sysrole==null) {
		result.error500("未找到对应实体");
	}else {
		boolean ok = sysRoleService.removeById(id);
		if(ok) {
			result.success("删除成功!");
		}
	}
	
	return result;
}
 
Example #7
Source File: SysRoleController.java    From jeecg-boot-with-activiti with MIT License 6 votes vote down vote up
/**
  *  编辑
 * @param role
 * @return
 */
@RequestMapping(value = "/edit", method = RequestMethod.PUT)
public Result<SysRole> edit(@RequestBody SysRole role) {
	Result<SysRole> result = new Result<SysRole>();
	SysRole sysrole = sysRoleService.getById(role.getId());
	if(sysrole==null) {
		result.error500("未找到对应实体");
	}else {
		role.setUpdateTime(new Date());
		boolean ok = sysRoleService.updateById(role);
		//TODO 返回false说明什么?
		if(ok) {
			result.success("修改成功!");
		}
	}
	
	return result;
}
 
Example #8
Source File: SysRoleController.java    From jeecg-boot with Apache License 2.0 6 votes vote down vote up
/**
  *  编辑
 * @param role
 * @return
 */
//@RequiresRoles({"admin"})
@RequestMapping(value = "/edit", method = RequestMethod.PUT)
public Result<SysRole> edit(@RequestBody SysRole role) {
	Result<SysRole> result = new Result<SysRole>();
	SysRole sysrole = sysRoleService.getById(role.getId());
	if(sysrole==null) {
		result.error500("未找到对应实体");
	}else {
		role.setUpdateTime(new Date());
		boolean ok = sysRoleService.updateById(role);
		//TODO 返回false说明什么?
		if(ok) {
			result.success("修改成功!");
		}
	}
	
	return result;
}
 
Example #9
Source File: SysLogController.java    From teaching with Apache License 2.0 6 votes vote down vote up
/**
 * @功能:批量,全部清空日志记录
 * @param ids
 * @return
 */
@RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
public Result<SysRole> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
	Result<SysRole> result = new Result<SysRole>();
	if(ids==null || "".equals(ids.trim())) {
		result.error500("参数不识别!");
	}else {
		if("allclear".equals(ids)) {
			this.sysLogService.removeAll();
			result.success("清除成功!");
		}
		this.sysLogService.removeByIds(Arrays.asList(ids.split(",")));
		result.success("删除成功!");
	}
	return result;
}
 
Example #10
Source File: SysLogController.java    From jeecg-cloud with Apache License 2.0 6 votes vote down vote up
/**
 * @功能:批量,全部清空日志记录
 * @param ids
 * @return
 */
@RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
public Result<SysRole> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
	Result<SysRole> result = new Result<SysRole>();
	if(ids==null || "".equals(ids.trim())) {
		result.error500("参数不识别!");
	}else {
		if("allclear".equals(ids)) {
			this.sysLogService.removeAll();
			result.success("清除成功!");
		}
		this.sysLogService.removeByIds(Arrays.asList(ids.split(",")));
		result.success("删除成功!");
	}
	return result;
}
 
Example #11
Source File: SysRoleController.java    From jeecg-cloud with Apache License 2.0 6 votes vote down vote up
/**
 * 导出excel
 * @param request
 */
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(SysRole sysRole,HttpServletRequest request) {
	// Step.1 组装查询条件
	QueryWrapper<SysRole> queryWrapper = QueryGenerator.initQueryWrapper(sysRole, request.getParameterMap());
	//Step.2 AutoPoi 导出Excel
	ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
	List<SysRole> pageList = sysRoleService.list(queryWrapper);
	//导出文件名称
	mv.addObject(NormalExcelConstants.FILE_NAME,"角色列表");
	mv.addObject(NormalExcelConstants.CLASS,SysRole.class);
	LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
	mv.addObject(NormalExcelConstants.PARAMS,new ExportParams("角色列表数据","导出人:"+user.getRealname(),"导出信息"));
	mv.addObject(NormalExcelConstants.DATA_LIST,pageList);
	return mv;
}
 
Example #12
Source File: SysRoleController.java    From teaching with Apache License 2.0 6 votes vote down vote up
/**
  *  编辑
 * @param role
 * @return
 */
@RequestMapping(value = "/edit", method = RequestMethod.PUT)
public Result<SysRole> edit(@RequestBody SysRole role) {
	Result<SysRole> result = new Result<SysRole>();
	SysRole sysrole = sysRoleService.getById(role.getId());
	if(sysrole==null) {
		result.error500("未找到对应实体");
	}else {
		role.setUpdateTime(new Date());
		boolean ok = sysRoleService.updateById(role);
		//TODO 返回false说明什么?
		if(ok) {
			result.success("修改成功!");
		}
	}
	
	return result;
}
 
Example #13
Source File: SysRoleController.java    From jeecg-boot with Apache License 2.0 6 votes vote down vote up
/**
 * 导出excel
 * @param request
 */
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(SysRole sysRole,HttpServletRequest request) {
	// Step.1 组装查询条件
	QueryWrapper<SysRole> queryWrapper = QueryGenerator.initQueryWrapper(sysRole, request.getParameterMap());
	//Step.2 AutoPoi 导出Excel
	ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
	List<SysRole> pageList = sysRoleService.list(queryWrapper);
	//导出文件名称
	mv.addObject(NormalExcelConstants.FILE_NAME,"角色列表");
	mv.addObject(NormalExcelConstants.CLASS,SysRole.class);
	LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
	mv.addObject(NormalExcelConstants.PARAMS,new ExportParams("角色列表数据","导出人:"+user.getRealname(),"导出信息"));
	mv.addObject(NormalExcelConstants.DATA_LIST,pageList);
	return mv;
}
 
Example #14
Source File: SysLogController.java    From jeecg-boot with Apache License 2.0 6 votes vote down vote up
/**
 * @功能:批量,全部清空日志记录
 * @param ids
 * @return
 */
@RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
public Result<SysRole> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
	Result<SysRole> result = new Result<SysRole>();
	if(ids==null || "".equals(ids.trim())) {
		result.error500("参数不识别!");
	}else {
		if("allclear".equals(ids)) {
			this.sysLogService.removeAll();
			result.success("清除成功!");
		}
		this.sysLogService.removeByIds(Arrays.asList(ids.split(",")));
		result.success("删除成功!");
	}
	return result;
}
 
Example #15
Source File: SysRoleController.java    From jeecg-cloud with Apache License 2.0 6 votes vote down vote up
/**
  *  编辑
 * @param role
 * @return
 */
//@RequiresRoles({"admin"})
@RequestMapping(value = "/edit", method = RequestMethod.PUT)
public Result<SysRole> edit(@RequestBody SysRole role) {
	Result<SysRole> result = new Result<SysRole>();
	SysRole sysrole = sysRoleService.getById(role.getId());
	if(sysrole==null) {
		result.error500("未找到对应实体");
	}else {
		role.setUpdateTime(new Date());
		boolean ok = sysRoleService.updateById(role);
		//TODO 返回false说明什么?
		if(ok) {
			result.success("修改成功!");
		}
	}
	
	return result;
}
 
Example #16
Source File: SysRoleController.java    From teaching with Apache License 2.0 5 votes vote down vote up
@RequestMapping(value = "/queryall", method = RequestMethod.GET)
public Result<List<SysRole>> queryall() {
	Result<List<SysRole>> result = new Result<>();
	List<SysRole> list = sysRoleService.list();
	if(list==null||list.size()<=0) {
		result.error500("未找到角色信息");
	}else {
		result.setResult(list);
		result.setSuccess(true);
	}
	return result;
}
 
Example #17
Source File: SysRoleController.java    From teaching with Apache License 2.0 5 votes vote down vote up
/**
  * 校验角色编码唯一
 */
@RequestMapping(value = "/checkRoleCode", method = RequestMethod.GET)
public Result<Boolean> checkUsername(String id,String roleCode) {
	Result<Boolean> result = new Result<>();
	result.setResult(true);//如果此参数为false则程序发生异常
	log.info("--验证角色编码是否唯一---id:"+id+"--roleCode:"+roleCode);
	try {
		SysRole role = null;
		if(oConvertUtils.isNotEmpty(id)) {
			role = sysRoleService.getById(id);
		}
		SysRole newRole = sysRoleService.getOne(new QueryWrapper<SysRole>().lambda().eq(SysRole::getRoleCode, roleCode));
		if(newRole!=null) {
			//如果根据传入的roleCode查询到信息了,那么就需要做校验了。
			if(role==null) {
				//role为空=>新增模式=>只要roleCode存在则返回false
				result.setSuccess(false);
				result.setMessage("角色编码已存在");
				return result;
			}else if(!id.equals(newRole.getId())) {
				//否则=>编辑模式=>判断两者ID是否一致-
				result.setSuccess(false);
				result.setMessage("角色编码已存在");
				return result;
			}
		}
	} catch (Exception e) {
		result.setSuccess(false);
		result.setResult(false);
		result.setMessage(e.getMessage());
		return result;
	}
	result.setSuccess(true);
	return result;
}
 
Example #18
Source File: SysUserRoleServiceImpl.java    From jeecg-boot-with-activiti with MIT License 5 votes vote down vote up
/**
 * queryUserRole调用的方法
 * @param roleList
 * @param roleId
 * @return
 */
private String searchByRoleId(List<SysRole> roleList, String roleId) {
	while(true) {
		for(SysRole role : roleList) {
			if(roleId.equals(role.getId())) {
				return role.getRoleName();
			}
		}
	}
}
 
Example #19
Source File: SysUserRoleServiceImpl.java    From teaching with Apache License 2.0 5 votes vote down vote up
/**
 * queryUserRole调用的方法
 * @param roleList
 * @param roleId
 * @return
 */
private String searchByRoleId(List<SysRole> roleList, String roleId) {
	while(true) {
		for(SysRole role : roleList) {
			if(roleId.equals(role.getId())) {
				return role.getRoleName();
			}
		}
	}
}
 
Example #20
Source File: SysRoleController.java    From jeecg-boot with Apache License 2.0 5 votes vote down vote up
/**
  * 分页列表查询
 * @param role
 * @param pageNo
 * @param pageSize
 * @param req
 * @return
 */
@RequestMapping(value = "/list", method = RequestMethod.GET)
public Result<IPage<SysRole>> queryPageList(SysRole role,
								  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
								  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
								  HttpServletRequest req) {
	Result<IPage<SysRole>> result = new Result<IPage<SysRole>>();
	QueryWrapper<SysRole> queryWrapper = QueryGenerator.initQueryWrapper(role, req.getParameterMap());
	Page<SysRole> page = new Page<SysRole>(pageNo, pageSize);
	IPage<SysRole> pageList = sysRoleService.page(page, queryWrapper);
	result.setSuccess(true);
	result.setResult(pageList);
	return result;
}
 
Example #21
Source File: SysRoleController.java    From jeecg-boot with Apache License 2.0 5 votes vote down vote up
/**
  *   添加
 * @param role
 * @return
 */
@RequestMapping(value = "/add", method = RequestMethod.POST)
//@RequiresRoles({"admin"})
public Result<SysRole> add(@RequestBody SysRole role) {
	Result<SysRole> result = new Result<SysRole>();
	try {
		role.setCreateTime(new Date());
		sysRoleService.save(role);
		result.success("添加成功!");
	} catch (Exception e) {
		log.error(e.getMessage(), e);
		result.error500("操作失败");
	}
	return result;
}
 
Example #22
Source File: SysRoleController.java    From jeecg-boot with Apache License 2.0 5 votes vote down vote up
/**
  *  批量删除
 * @param ids
 * @return
 */
//@RequiresRoles({"admin"})
@RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
public Result<SysRole> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
	Result<SysRole> result = new Result<SysRole>();
	if(oConvertUtils.isEmpty(ids)) {
		result.error500("未选中角色!");
	}else {
		sysRoleService.deleteBatchRole(ids.split(","));
		result.success("删除角色成功!");
	}
	return result;
}
 
Example #23
Source File: SysRoleController.java    From jeecg-boot with Apache License 2.0 5 votes vote down vote up
/**
  * 通过id查询
 * @param id
 * @return
 */
@RequestMapping(value = "/queryById", method = RequestMethod.GET)
public Result<SysRole> queryById(@RequestParam(name="id",required=true) String id) {
	Result<SysRole> result = new Result<SysRole>();
	SysRole sysrole = sysRoleService.getById(id);
	if(sysrole==null) {
		result.error500("未找到对应实体");
	}else {
		result.setResult(sysrole);
		result.setSuccess(true);
	}
	return result;
}
 
Example #24
Source File: SysRoleController.java    From jeecg-boot with Apache License 2.0 5 votes vote down vote up
@RequestMapping(value = "/queryall", method = RequestMethod.GET)
public Result<List<SysRole>> queryall() {
	Result<List<SysRole>> result = new Result<>();
	List<SysRole> list = sysRoleService.list();
	if(list==null||list.size()<=0) {
		result.error500("未找到角色信息");
	}else {
		result.setResult(list);
		result.setSuccess(true);
	}
	return result;
}
 
Example #25
Source File: SysRoleController.java    From jeecg-boot with Apache License 2.0 5 votes vote down vote up
/**
  * 校验角色编码唯一
 */
@RequestMapping(value = "/checkRoleCode", method = RequestMethod.GET)
public Result<Boolean> checkUsername(String id,String roleCode) {
	Result<Boolean> result = new Result<>();
	result.setResult(true);//如果此参数为false则程序发生异常
	log.info("--验证角色编码是否唯一---id:"+id+"--roleCode:"+roleCode);
	try {
		SysRole role = null;
		if(oConvertUtils.isNotEmpty(id)) {
			role = sysRoleService.getById(id);
		}
		SysRole newRole = sysRoleService.getOne(new QueryWrapper<SysRole>().lambda().eq(SysRole::getRoleCode, roleCode));
		if(newRole!=null) {
			//如果根据传入的roleCode查询到信息了,那么就需要做校验了。
			if(role==null) {
				//role为空=>新增模式=>只要roleCode存在则返回false
				result.setSuccess(false);
				result.setMessage("角色编码已存在");
				return result;
			}else if(!id.equals(newRole.getId())) {
				//否则=>编辑模式=>判断两者ID是否一致-
				result.setSuccess(false);
				result.setMessage("角色编码已存在");
				return result;
			}
		}
	} catch (Exception e) {
		result.setSuccess(false);
		result.setResult(false);
		result.setMessage(e.getMessage());
		return result;
	}
	result.setSuccess(true);
	return result;
}
 
Example #26
Source File: SysRoleServiceImpl.java    From jeecg-boot with Apache License 2.0 5 votes vote down vote up
@Override
public Result importExcelCheckRoleCode(MultipartFile file, ImportParams params) throws Exception {
    List<Object> listSysRoles = ExcelImportUtil.importExcel(file.getInputStream(), SysRole.class, params);
    int totalCount = listSysRoles.size();
    List<String> errorStrs = new ArrayList<>();

    // 去除 listSysRoles 中重复的数据
    for (int i = 0; i < listSysRoles.size(); i++) {
        String roleCodeI =((SysRole)listSysRoles.get(i)).getRoleCode();
        for (int j = i + 1; j < listSysRoles.size(); j++) {
            String roleCodeJ =((SysRole)listSysRoles.get(j)).getRoleCode();
            // 发现重复数据
            if (roleCodeI.equals(roleCodeJ)) {
                errorStrs.add("第 " + (j + 1) + " 行的 roleCode 值:" + roleCodeI + " 已存在,忽略导入");
                listSysRoles.remove(j);
                break;
            }
        }
    }
    // 去掉 sql 中的重复数据
    Integer errorLines=0;
    Integer successLines=0;
    List<String> list = ImportExcelUtil.importDateSave(listSysRoles, ISysRoleService.class, errorStrs, CommonConstant.SQL_INDEX_UNIQ_SYS_ROLE_CODE);
     errorLines+=list.size();
     successLines+=(listSysRoles.size()-errorLines);
    return ImportExcelUtil.imporReturnRes(errorLines,successLines,list);
}
 
Example #27
Source File: SysRoleController.java    From jeecg-boot-with-activiti with MIT License 5 votes vote down vote up
/**
  *  批量删除
 * @param ids
 * @return
 */
@RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
public Result<SysRole> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
	Result<SysRole> result = new Result<SysRole>();
	if(ids==null || "".equals(ids.trim())) {
		result.error500("参数不识别!");
	}else {
		this.sysRoleService.removeByIds(Arrays.asList(ids.split(",")));
		result.success("删除成功!");
	}
	return result;
}
 
Example #28
Source File: SysRoleController.java    From jeecg-cloud with Apache License 2.0 5 votes vote down vote up
/**
  *   添加
 * @param role
 * @return
 */
@RequestMapping(value = "/add", method = RequestMethod.POST)
//@RequiresRoles({"admin"})
public Result<SysRole> add(@RequestBody SysRole role) {
	Result<SysRole> result = new Result<SysRole>();
	try {
		role.setCreateTime(new Date());
		sysRoleService.save(role);
		result.success("添加成功!");
	} catch (Exception e) {
		log.error(e.getMessage(), e);
		result.error500("操作失败");
	}
	return result;
}
 
Example #29
Source File: SysRoleController.java    From jeecg-cloud with Apache License 2.0 5 votes vote down vote up
/**
  *  批量删除
 * @param ids
 * @return
 */
//@RequiresRoles({"admin"})
@RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
public Result<SysRole> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
	Result<SysRole> result = new Result<SysRole>();
	if(oConvertUtils.isEmpty(ids)) {
		result.error500("未选中角色!");
	}else {
		sysRoleService.deleteBatchRole(ids.split(","));
		result.success("删除角色成功!");
	}
	return result;
}
 
Example #30
Source File: SysRoleController.java    From jeecg-cloud with Apache License 2.0 5 votes vote down vote up
/**
  * 通过id查询
 * @param id
 * @return
 */
@RequestMapping(value = "/queryById", method = RequestMethod.GET)
public Result<SysRole> queryById(@RequestParam(name="id",required=true) String id) {
	Result<SysRole> result = new Result<SysRole>();
	SysRole sysrole = sysRoleService.getById(id);
	if(sysrole==null) {
		result.error500("未找到对应实体");
	}else {
		result.setResult(sysrole);
		result.setSuccess(true);
	}
	return result;
}