예제 #1
0
 /**
  * * 修改角色信息
  *
  * @param role
  * @param menus
  */
 @Transactional
 public void updateRole(IpavroleEntity role, String[] menus) {
   roleMapper.updateRole(role);
   roleMapper.delRoleMenu(role.getRoleno());
   if (menus != null && menus.length > 0) {
     for (int i = 0; i < menus.length; i++) {
       String menuid = menus[i];
       Map parm = new HashMap();
       parm.put("menuid", menuid);
       parm.put("roleno", role.getRoleno());
       roleMapper.addRoleMenu(parm);
     }
   }
 }
예제 #2
0
 /**
  * * 新增角色
  *
  * @param role
  * @param menus
  */
 @Transactional
 public void addRole(IpavroleEntity role, String[] menus) {
   role.setValflg(ContentUtil.DEFUAL_VALDLF_YES);
   roleMapper.addRole(role);
   if (menus != null) {
     for (int i = 0; i < menus.length; i++) {
       String menuid = menus[i];
       Map parm = new HashMap();
       parm.put("menuid", menuid);
       parm.put("roleno", role.getRoleno());
       roleMapper.addRoleMenu(parm);
     }
   }
 }