use of com.zyd.blog.persistence.beans.SysRole in project OneBlog by zhangyd-c.
the class SysRoleServiceImpl method insertList.
@Override
public void insertList(List<Role> entities) {
Assert.notNull(entities, "entities不可为空!");
List<SysRole> sysRole = new ArrayList<>();
for (Role role : entities) {
role.setUpdateTime(new Date());
role.setCreateTime(new Date());
sysRole.add(role.getSysRole());
}
roleMapper.insertList(sysRole);
}
use of com.zyd.blog.persistence.beans.SysRole in project OneBlog by zhangyd-c.
the class SysRoleServiceImpl method queryRoleListWithSelected.
/**
* 获取ztree使用的角色列表
*
* @param userId
* @return
*/
@Override
public List<Map<String, Object>> queryRoleListWithSelected(Integer userId) {
List<SysRole> sysRole = roleMapper.queryRoleListWithSelected(userId);
if (CollectionUtils.isEmpty(sysRole)) {
return null;
}
List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>();
Map<String, Object> map = null;
for (SysRole role : sysRole) {
map = new HashMap<String, Object>(3);
map.put("id", role.getId());
map.put("pId", 0);
map.put("checked", role.getSelected() != null && role.getSelected() == 1);
map.put("name", role.getDescription());
mapList.add(map);
}
return mapList;
}
use of com.zyd.blog.persistence.beans.SysRole in project OneBlog by zhangyd-c.
the class SysRoleServiceImpl method getByPrimaryKey.
@Override
public Role getByPrimaryKey(Long primaryKey) {
Assert.notNull(primaryKey, "PrimaryKey不可为空!");
SysRole sysRole = roleMapper.selectByPrimaryKey(primaryKey);
return null == sysRole ? null : new Role(sysRole);
}
use of com.zyd.blog.persistence.beans.SysRole in project OneBlog by zhangyd-c.
the class SysRoleServiceImpl method findPageBreakByCondition.
@Override
public PageInfo<Role> findPageBreakByCondition(RoleConditionVO vo) {
PageHelper.startPage(vo.getPageNumber(), vo.getPageSize());
List<SysRole> sysRoles = roleMapper.findPageBreakByCondition(vo);
if (CollectionUtils.isEmpty(sysRoles)) {
return null;
}
List<Role> roles = this.getRole(sysRoles);
PageInfo bean = new PageInfo<SysRole>(sysRoles);
bean.setList(roles);
return bean;
}