ludc
2024-07-09 5acc490fa6f77a9ed7b5976ee6a2e22b070df5bf
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmRoleQueryServiceImpl.java
@@ -1,34 +1,52 @@
package com.vci.frameworkcore.compatibility.impl;
import com.vci.corba.common.PLException;
import com.vci.corba.common.data.UserEntityInfo;
import com.vci.corba.framework.data.RoleInfo;
import com.vci.corba.omd.data.BusinessObject;
import com.vci.frameworkcore.compatibility.SmRoleQueryServiceI;
import com.vci.frameworkcore.constant.FrameWorkBtmTypeConstant;
import com.vci.frameworkcore.dto.SmRoleDTO;
import com.vci.frameworkcore.enumpck.RoleClassifyEnum;
import com.vci.frameworkcore.enumpck.RoleControlAreaEnum;
import com.vci.frameworkcore.model.SmRoleForPlatform1;
import com.vci.frameworkcore.model.dto.SmUserDTO;
import com.vci.frameworkcore.model.po.SmRolePO;
import com.vci.frameworkcore.model.po.SmUserPO;
import com.vci.frameworkcore.pagemodel.OrgDepartmentVO;
import com.vci.frameworkcore.pagemodel.SmRoleVO;
import com.vci.frameworkcore.pagemodel.SmUserVO;
import com.vci.frameworkcore.properties.ConfigReader;
import com.vci.omd.utils.ObjectTool;
import com.vci.starter.poi.bo.ReadExcelOption;
import com.vci.starter.poi.constant.ExcelLangCodeConstant;
import com.vci.starter.poi.util.ExcelUtil;
import com.vci.starter.web.constant.QueryOptionConstant;
import com.vci.starter.web.enumpck.UserSecretEnum;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.DataGrid;
import com.vci.starter.web.pagemodel.PageHelper;
import com.vci.starter.web.pagemodel.Tree;
import com.vci.starter.web.pagemodel.TreeQueryObject;
import com.vci.starter.web.pagemodel.*;
import com.vci.starter.web.util.LangBaseUtil;
import com.vci.web.util.BeanUtil;
import com.vci.starter.web.util.VciBaseUtil;
import com.vci.starter.web.util.WebThreadLocalUtil;
import com.vci.starter.web.wrapper.VciQueryWrapperForDO;
import com.vci.web.properties.WebProperties;
import com.vci.web.enumpck.UserTypeEnum;
import com.vci.web.service.WebBoServiceI;
import com.vci.web.util.Func;
import com.vci.web.util.PlatformClientUtil;
import com.vci.web.util.WebUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.io.File;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import static com.vci.frameworkcore.constant.FrameWorkBusLangCodeConstant.DATA_OID_NOT_EXIST;
/**
 * 角色的查询服务,兼容来平台,素有的接口都返回新的角色显示对象
@@ -45,22 +63,38 @@
   private WebBoServiceI boService;
   /**
    * 平台调用客户端
    */
   @Autowired
   private PlatformClientUtil platformClientUtil;
   private final Integer QUERY_IN_LIMIT = 1000;
   /**
    * 日志
    */
   private Logger logger = LoggerFactory.getLogger(getClass());
   /**
     * 根据角色主键获取角色的信息
     * @param roleOid 角色主键
     * @param conditionMap 角色主键
     * @return 角色的显示对象,如果角色不存在则返回null,不会抛出异常
     * @throws VciBaseException 参数为空或者数据库存在问题的时候会抛出异常
     */
   @Override
   public SmRoleVO getRoleByRoleOid(String roleOid) throws VciBaseException {
      if(StringUtils.isBlank(roleOid)){
   public SmRoleVO getRoleByConditionMap(Map<String,String> conditionMap) throws VciBaseException {
      if(Func.isEmpty(conditionMap)){
         return null;
      }
      SmRoleForPlatform1 role = boService.selectByOid(roleOid, SmRoleForPlatform1.class);
      if(role == null || StringUtils.isBlank(role.getPluid())){
         throw new VciBaseException(DATA_OID_NOT_EXIST);
      VciQueryWrapperForDO queryWrapper = new VciQueryWrapperForDO(conditionMap,SmRoleForPlatform1.class);
      List<SmRoleForPlatform1> smRoleForPlatform1s = boService.selectByQueryWrapper(queryWrapper, SmRoleForPlatform1.class);
      if(Func.isNotEmpty(smRoleForPlatform1s) && Func.isNotBlank(smRoleForPlatform1s.get(0).getPluid())){
         //角色名不能重复所以直接取第一个元素
         return platformRole2SmRoleVO(smRoleForPlatform1s.get(0));
      }
      return platformRole2SmRoleVO(role);
      return null;
   }
   /**
     * 批量获取角色的信息 (根据角色主键)
     * @param roleOidCollections 角色主键的集合,可以超过1000个
@@ -84,6 +118,7 @@
      });
      return    platformRole2SmRoleVOs(roles);
   }
   /**
     * 获取角色的列表,默认会以角色名升序排列,角色的编辑页面列表不要使用这个接口
     * @param queryMap 查询条件
@@ -92,15 +127,12 @@
     * @throws VciBaseException 参数为空的时候会抛出异常
     */
   @Override
   public DataGrid<SmRoleVO> gridRoles(Map<String, String> queryMap,
                              PageHelper pageHelper) throws VciBaseException {
   public DataGrid<SmRoleVO> gridRoles(Map<String, String> queryMap, PageHelper pageHelper) throws VciBaseException {
      if(pageHelper == null){
         pageHelper = new PageHelper(-1);
      }
      pageHelper.addDefaultAsc("plname");
      VciQueryWrapperForDO queryWrapper = new VciQueryWrapperForDO(queryMap,SmRoleForPlatform1.class,pageHelper);
      //我们不能显示三员和管理员的角色
      queryWrapper.eq("pltype","2");
      List<SmRoleForPlatform1> roleForPlatform1s = boService.selectByQueryWrapper(queryWrapper, SmRoleForPlatform1.class);
      DataGrid<SmRoleVO> dataGrid = new DataGrid<>();
      if(!CollectionUtils.isEmpty(roleForPlatform1s)){
@@ -109,6 +141,7 @@
      }
      return dataGrid;
   }
    /**
     * 根据角色主键获取角色的姓名
     * @param roleOid 角色主键
@@ -117,9 +150,52 @@
   @Override
   public String getRoleNameByRoleOid(String roleOid) {
      WebUtil.alertNotNull(roleOid,"角色主键");
      return getRoleByRoleOid(roleOid).getName();
      Map<String, String> conditionMap = new HashMap<>();
      conditionMap.put("pluid",roleOid);
      return getRoleByConditionMap(conditionMap).getName();
   }
    /**
   /**
    * 根据角色名查询角色信息
    * @param roleNameList
    * @param queryMap
    * @return
    */
   @Override
   public List<SmRoleVO> listRoleByRoleName(Collection<String> roleNameList, Map<String, String> queryMap) {
      if(Func.isEmpty(roleNameList)){
         return new ArrayList<>();
      }
      if(queryMap == null){
         queryMap = new HashMap<>();
      }
      List<SmRoleForPlatform1> roles = new ArrayList<>();
      if(roleNameList.size() > QUERY_IN_LIMIT){
         Map<String, String> finalQueryMap = queryMap;
         WebUtil.switchCollectionForOracleIn(roleNameList).stream().forEach(roleNames->{
            Map<String,String> conditionMap = new HashMap<>();
            finalQueryMap.forEach((key,value)->{
               conditionMap.put(key,value);
            });
            conditionMap.put("plname", QueryOptionConstant.IN + WebUtil.toInSql(roleNames.toArray(new String[0])));
            VciQueryWrapperForDO queryWrapper = new VciQueryWrapperForDO(conditionMap,SmRoleForPlatform1.class);
            List<SmRoleForPlatform1> roleForPlatform1s = boService.selectByQueryWrapper(queryWrapper, SmRoleForPlatform1.class);
            if(!CollectionUtils.isEmpty(roleForPlatform1s)){
               roles.addAll(roleForPlatform1s);
            }
         });
      }else{
         queryMap.put("plname", QueryOptionConstant.IN + WebUtil.toInSql(roleNameList.toArray(new String[0])));
      }
      VciQueryWrapperForDO queryWrapper = new VciQueryWrapperForDO(queryMap,SmRoleForPlatform1.class);
      List<SmRoleForPlatform1> roleForPlatform1s = boService.selectByQueryWrapper(queryWrapper, SmRoleForPlatform1.class);
      if(!CollectionUtils.isEmpty(roleForPlatform1s)){
         roles.addAll(roleForPlatform1s);
      }
      return platformRole2SmRoleVOs(roles);
   }
   /**
     * 根据用户主键获取关联的角色
     * @param userOid 用户主键
     * @param queryMap 查询条件,如果需要使用用户的属性来查询可以使用pkUser.xxxx
@@ -170,6 +246,7 @@
      }
      return platformRole2SmRoleVOs(roles);
   }
     /**
     * 根据用户主键获取关联的角色
     * @param userOid 用户主键
@@ -210,6 +287,7 @@
      }
      return gridRoles(queryMap,pageHelper);
   }
    /**
     * 获取未关联某个用户的角色
     * @param userOid 用户主键
@@ -219,20 +297,10 @@
   @Override
   public List<SmRoleVO> listRoleUnInUserOid(String userOid,
         Map<String, String> queryMap) {
      return listRoleByUserOid(userOid,queryMap,true);
   }
   /**
     * 获取未关联某个用户的角色
     * @param userOid 用户主键
     * @param queryMap 查询条件,如果需要使用用户的属性来查询可以使用pkUser.xxxx
     * @param pageHelper 分页和排序对象,老平台不支持使用角色编号来排序
     * @return 角色的显示对象
     */
   @Override
   public DataGrid<SmRoleVO> gridRoleUninUserOid(String userOid,
         Map<String, String> queryMap, PageHelper pageHelper) {
      return gridRoleByUserOid(userOid,queryMap,pageHelper,true);
   }
     /**
     * 批量根据用户的主键来获取角色
     * @param userOidCollection 用户主键集合
@@ -255,16 +323,19 @@
            List<BusinessObject> cbos = boService.queryBySql(sql, null);
            if(!CollectionUtils.isEmpty(cbos)){
               cbos.stream().forEach(cbo->{
                  String userOid = ObjectTool.getBOAttributeValue(cbo,"pluseruid");
                  String userOid = ObjectTool.getNewBOAttributeValue(cbo,"pluseruid");
                  List<String> roleOids = userRoleOidMap.getOrDefault(userOid,new ArrayList<>());
                  roleOids.add(ObjectTool.getBOAttributeValue(cbo,"plroleuid"));
                  roleOids.add(ObjectTool.getNewBOAttributeValue(cbo,"plroleuid"));
                  userRoleOidMap.put(userOid,roleOids);
               });
            }
         }
      });
      if(!CollectionUtils.isEmpty(roleVOList)){
         Map<String, SmRoleVO> roleVOMap = roleVOList.stream().collect(Collectors.toMap(s -> s.getOid(), t -> t));
         //这儿应该对roleVOList做一次去重处理,因为肯定会有重复的角色被查出来
         Map<String, SmRoleVO> roleVOMap = roleVOList.stream()
               .collect(Collectors.toMap(SmRoleVO::getOid, Function.identity(), (existing, replacement) -> existing));
         //Map<String, SmRoleVO> roleVOMap = roleVOList.stream().collect(Collectors.toMap(s -> s.getOid(), t -> t));
         Map<String, List<SmRoleVO>> userRoleVOMap = new HashMap<>();
         userRoleOidMap.forEach((userOid,roleOids)->{
            List<SmRoleVO> roleVOS = new ArrayList<>();
@@ -279,6 +350,7 @@
      }
      return new HashMap<>();
   }
    /**
     * 根据权限主键获取关联的角色
     * @param functionOid 权限主键
@@ -444,8 +516,9 @@
      }
      return new HashMap<>();
   }
    /**
     * 参照角色的列表,三员管理的三个角色不会显示
     * 参照角色的列表,超管查全部,其他的都是查普通的(不包含三员)
     * @param queryMap 查询条件
     * @param pageHelper 分页和排序的信息,在兼容老平台的时候会自动兼容,如果属性不存在会自动忽略
     * @return 角色的显示对象列表
@@ -455,8 +528,14 @@
   public DataGrid<SmRoleVO> refGridRoles(Map<String, String> queryMap,
         PageHelper pageHelper) throws VciBaseException {
      //老平台没有生效状态
      //根据当前用户来决定能查那些角色:普通用户只能查普通角色,管理员和普通用户只能查普通角色
      String usertype = WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUsertype();
      if(!UserTypeEnum.SUPPER_ADMIN.getValue().equals(usertype)){
         queryMap.put("pltype","2");
      }
      return gridRoles(queryMap, pageHelper);
   }
     /**
     * 角色的树形展示,常用于角色选择用户的页面使用
     * @param treeQueryObject 树查询对象
@@ -488,6 +567,227 @@
   }
   /**
    * 成员管理分配角色调用,保存用户角色关联关系
    * @param userOids
    * @param roleIds
    * @return
    */
   @Override
   public boolean saveRights(String[] userOids, String[] roleIds) throws PLException {
      VciBaseUtil.alertNotNull(userOids,"用户主键");
      //roleIds允许为空,为空时清空当前用户的权限
      UserEntityInfo userEntityInfo = new UserEntityInfo(WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId(),null);
      return platformClientUtil.getFrameworkService().saveRights(roleIds,userOids,userEntityInfo);
   }
   /**
    * 角色管理分配成员接口调用
    * @param userOids
    * @param roleId
    * @return
    * @throws PLException
    */
   @Override
   public boolean saveRight(String[] userOids, String roleId) throws PLException {
      VciBaseUtil.alertNotNull(roleId,"角色主键");
      //roleIds允许为空,为空时清空当前用户的权限
      UserEntityInfo userEntityInfo = new UserEntityInfo(WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId(),null);
      return platformClientUtil.getFrameworkService().saveRight(roleId,userOids,userEntityInfo);
   }
   /**
    * 新增角色
    * @param smRoleDTO
    * @return true成功,false失败
    */
   @Override
   public boolean addRole(SmRoleDTO smRoleDTO) throws PLException {
      //判空
      VciBaseUtil.alertNotNull(
            smRoleDTO,"添加的角色对象",
            smRoleDTO.getName(),"角色名");
      //角色名判重
      Map<String, String> conditionMap = new HashMap<>();
      conditionMap.put("plname",smRoleDTO.getName());
      SmRoleVO dbSmRoleVO = getRoleByConditionMap(conditionMap);
      if(Func.isNotEmpty(dbSmRoleVO)){
         throw new VciBaseException("该角色名称已经存在,请修改!");
      }
      SessionInfo loginUser = WebThreadLocalUtil.getCurrentUserSessionInfoInThread();
      String userId = loginUser.getUserId();
      //角色类型,这里设置了会在changeRoleObjectToRoleInfo中转换
      if(UserTypeEnum.SUPPER_ADMIN.getValue().equals(loginUser.getUsertype())){
         smRoleDTO.setRoleClassify(RoleClassifyEnum.MANAGE.getValue());
      }else {
         smRoleDTO.setRoleClassify(RoleClassifyEnum.BUSINESS.getValue());
      }
      //生成存储的corba对象
      Date date = new Date();
      smRoleDTO.setCreateTime(date);
      smRoleDTO.setCreator(userId);
      smRoleDTO.setLastModifier(userId);
      RoleInfo roleInfo = changeSmRoleDTOToRoleInfo(smRoleDTO);
      UserEntityInfo userEntityInfo = new UserEntityInfo(userId, "");
      String oid = platformClientUtil.getFrameworkService().saveRole(roleInfo, userEntityInfo,null);
      if (Func.isEmpty(oid)) {
         return false;
      }
      return true;
   }
   /**
    * 修改角色
    * @param smRoleDTO
    * @return
    */
   @Override
   public boolean updateRole(SmRoleDTO smRoleDTO) throws PLException {
      //判空
      VciBaseUtil.alertNotNull(
            smRoleDTO,"添加的角色对象",
            smRoleDTO.getName(),"角色名");
      //查询数据库中的,根据角色名查
      Map<String, String> conditionMap = new HashMap<>();
      conditionMap.put("plname",smRoleDTO.getName());
      SmRoleVO dbSmRoleVO = getRoleByConditionMap(conditionMap);
      //根据主键没查询到了用户
      if(Func.isEmpty(dbSmRoleVO) || Func.isBlank(dbSmRoleVO.getOid())){
         throw new PLException("500", new String[] { "当前修改的角色不存在!"});
      }
      //角色名相等,但是主键不相等,说明修改为的角色名已存在,不能重复
      if(dbSmRoleVO.getName().equals(smRoleDTO.getName()) && !dbSmRoleVO.getOid().equals(smRoleDTO.getOid())){
         throw new PLException("500", new String[] { "该角色名称已经存在,请修改!"});
      }
      SmRoleDTO smRoleDTO1 = new SmRoleDTO();
      BeanUtil.copy(dbSmRoleVO,smRoleDTO1);
      smRoleDTO1.setName(smRoleDTO.getName());
      smRoleDTO1.setDescription(smRoleDTO.getDescription());
      String loginUserId = WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId();; //"developer"
      smRoleDTO.setLastModifier(loginUserId);
      RoleInfo roleInfo = changeSmRoleDTOToRoleInfo(smRoleDTO1);
      boolean updateBoolean = platformClientUtil.getFrameworkService().updateRole(roleInfo, new UserEntityInfo(loginUserId, null));
      return updateBoolean;
   }
   /**
    * 删除角色
    * @param ids
    * @return
    * @throws PLException
    */
   @Override
   public boolean deleteRole(String[] ids) throws PLException {
      VciBaseUtil.alertNotNull(ids,"要删除的角色主键");
      //具备连带删除的功能,如角色菜单授权表里面的授权信息
      return platformClientUtil.getFrameworkService().deleteRole(
            ids,
            new UserEntityInfo(WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId(), null)
      );
   }
   /**
    * 导入角色
    * @param file
    * @return
    * @throws VciBaseException
    */
   @Override
   public BaseResult importRole(File file) throws VciBaseException {
      VciBaseUtil.alertNotNull(file,"excel文件");
      if(!file.exists()){
         throw new VciBaseException("导入的excel文件不存在,{0}",new String[]{file.getPath()});
      }
      try{
         //1、读取excel中的数据,组成对象
         ReadExcelOption excelOption = new ReadExcelOption();
         //读取excel转换为po对象
         List<SmRolePO> poList = ExcelUtil.readDataObjectFromExcel(file, SmRolePO.class,excelOption,(value, po, fieldName)->{});
         //去除都是空的情况
         if(CollectionUtils.isEmpty(poList)){
            return BaseResult.fail(ExcelLangCodeConstant.IMPORT_CONTENT_NULL,new String[]{});
         }
         //数据库查询是否有已存在的角色名,方便后续做判重处理
         List<SmRoleVO> smRoleVOList = this.listRoleByRoleName(poList.stream().map(SmRolePO::getName).collect(Collectors.toSet()),null);
         List<String> repeatRoleName = new ArrayList<>();
         if(Func.isNotEmpty(smRoleVOList)){
            repeatRoleName = smRoleVOList.stream().map(SmRoleVO::getName).collect(Collectors.toList());
         }
         //当前excel中是否重复用的判重Map:(key:账号,value:行号)
         Map<String, String> excelReapeat = new HashMap<>();
         //判断必填属性是否为空,角色是否已存在,以及表格内是否重复
         List<String> finalRepeatroleName = repeatRoleName;
         poList.stream().forEach(smRolePO -> {
            //先对必填属性判空处理
            if(Func.isBlank(smRolePO.getName())){
               throw new VciBaseException("第【"+smRolePO.getRowIndex()+"】行,rolenameerror");
            }else if(finalRepeatroleName.contains(smRolePO.getName())){//判断角色名是否与库中重复
               throw new VciBaseException("第【"+smRolePO.getRowIndex()+"】行,角色名在系统中已经存在,请修改!");
            }else if(excelReapeat.containsKey(smRolePO.getName())){//表格中判重
               throw new VciBaseException("第【"+excelReapeat.get(smRolePO.getName())+"】行和第【"+smRolePO.getRowIndex()+"】行数据,角色名重复");
            }
            excelReapeat.put(smRolePO.getName(),smRolePO.getRowIndex());
         });
         //保存逻辑
         poList.stream().forEach(smRolePO->{
            try {
               SmRoleDTO smRoleDTO = new SmRoleDTO();
               BeanUtil.copy(smRolePO,smRoleDTO);
               //SessionInfo loginUser = WebThreadLocalUtil.getCurrentUserSessionInfoInThread();
               String userId = "developer";//loginUser.getUserId();
               //角色类型,这里设置了会在changeRoleObjectToRoleInfo中转换
               if(UserTypeEnum.SUPPER_ADMIN.getValue().equals("0")){
                  smRoleDTO.setRoleClassify(RoleClassifyEnum.MANAGE.getValue());
               }else {
                  smRoleDTO.setRoleClassify(RoleClassifyEnum.BUSINESS.getValue());
               }
               //生成存储的corba对象
               Date date = new Date();
               smRoleDTO.setCreateTime(date);
               smRoleDTO.setCreator(userId);
               smRoleDTO.setLastModifier(userId);
               RoleInfo roleInfo = changeSmRoleDTOToRoleInfo(smRoleDTO);
               UserEntityInfo userEntityInfo = new UserEntityInfo(userId, "");
               //执行保存
               platformClientUtil.getFrameworkService().saveRole(roleInfo, userEntityInfo);
            } catch (PLException e) {
               e.printStackTrace();
               throw new VciBaseException("执行到第【"+smRolePO.getRowIndex()+"】行保存逻辑时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e));
            }
         });
      }catch (Exception e){
         if(logger.isErrorEnabled()){
            logger.error("读取excel内容时或保存角色信息时出现了错误,具体原因:",e.getMessage());
         }
         e.printStackTrace();
         return BaseResult.fail(LangBaseUtil.getErrorMsg(e),new String[]{},e);
      }
      return BaseResult.success("角色导入成功!");
   }
   /**
    * 角色DTO对象转corba对象
    * @param role
    * @return
    */
   public RoleInfo changeSmRoleDTOToRoleInfo(SmRoleDTO role) {
      RoleInfo roleInfo = new RoleInfo();
      roleInfo.id = role.getOid() == null ? "" : role.getOid();
      roleInfo.name = role.getName();
      roleInfo.description = role.getDescription() == null ? "" : role.getDescription();
      //管理员角色默认为1,普通角色默认为2,但是都需要设置小一个,因为后台判断当type<2时会拿type+1
      if(RoleClassifyEnum.MANAGE.getValue().equals(role.getRoleClassify())){
         roleInfo.type = 0;
      }else{
         roleInfo.type = 1;
      }
      roleInfo.createTime = role.getCreateTime().getTime();
      roleInfo.createUser = role.getCreator() == null ? "" : role.getCreator();
      roleInfo.updateTime = System.currentTimeMillis();
      roleInfo.updateUser = role.getLastModifier() == null ? "" : role.getLastModifier();
      return roleInfo;
   }
   /**
    * 角色的转换,默认全部是bs控制的角色
    * @param roleForPlatform1List 原平台的角色
    * @return 角色的显示对象
@@ -496,7 +796,7 @@
      List<SmRoleVO> roleVOList = new ArrayList<>();
      if(!CollectionUtils.isEmpty(roleForPlatform1List)){
         roleForPlatform1List.stream().forEach(s -> {
            roleVOList.add( platformRole2SmRoleVO(s));
            roleVOList.add(platformRole2SmRoleVO(s));
         });
      }
      return roleVOList;
@@ -519,11 +819,12 @@
      }
      roleVO.setRoleClassifyText(RoleClassifyEnum.getTextByValue(roleVO.getRoleClassify()));
      roleVO.setRoleControlArea(RoleControlAreaEnum.BS.getValue());
      roleVO.setRoleClassifyText(RoleControlAreaEnum.BS.getText());
      roleVO.setCreateTime(roleForPlatform1.getPlcreatetime());
      roleVO.setRoleControlAreaText(RoleControlAreaEnum.BS.getText());
      roleVO.setDescription(roleForPlatform1.getPldesc());
      roleVO.setCreateTime(new Date(roleForPlatform1.getPlcreatetime()));
      roleVO.setCreator(roleForPlatform1.getPlcreateuser());
      roleVO.setLastModifier(roleForPlatform1.getPlupdateuser());
      roleVO.setLastModifyTime(roleForPlatform1.getPlupdatetime());
      roleVO.setLastModifyTime(new Date(roleForPlatform1.getPlupdatetime()));
      roleVO.setBtmname(FrameWorkBtmTypeConstant.SM_ROLE_BTM_TYPE);
      roleVO.setOwner(roleVO.getCreator());
      roleVO.setTs(roleVO.getLastModifyTime());