1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package com.lightinit.hsdataportal.common;
- import com.lightinit.hsdataportal.json.pojo.RoleAttributesEntity;
- import com.lightinit.hsdataportal.json.pojo.RoleComboEntity;
- import com.lightinit.hsdataportal.entity.SentryRole;
- import java.util.ArrayList;
- import java.util.List;
- /**
- * Created by Mr.Yao on 2017/4/24.
- */
- public class RoleComboUtils {
- public static RoleComboEntity RoleComboxConverter(SentryRole role) {
- RoleComboEntity entity=new RoleComboEntity();
- if (role!=null)
- {
- List<RoleComboEntity> tmpList=new ArrayList<RoleComboEntity>();
- List<SentryRole> list=role.getChildren();
- if(list!=null && list.size()>0){
- for (SentryRole _item:list) {
- RoleComboEntity _entity=RoleComboxConverter(_item);
- if (_entity!=null)
- tmpList.add(_entity);
- }
- entity.setIconCls("fi-page-copy");
- entity.setChildren(tmpList);
- }else {
- entity.setIconCls("fi-page");
- entity.setChildren(null);
- }
- entity.setId(role.getId());
- entity.setText(role.getRolename());
- RoleAttributesEntity roleAttributesEntity=new RoleAttributesEntity();
- if (role.getParentid()!=null) {
- roleAttributesEntity.setParentid(role.getParentid());
- }
- }
- return entity;
- }
- }
|