RoleChange rc = this.roleChangeManager.get(roleChange);
if( rc == null )
throw new ApplicationException("角色变更信息["+roleChange.getId()+"]不存在!");
Role db_role = roleManager.get(roleChange.getRole());
Role newRole = null;
byte[] newObject = rc.getNewObject();
if( newObject != null )
newRole = (Role)IoSerialUtil.deserialize(newObject);
if( newObject == null || newRole == null )
throw new ApplicationException("数据异常,变更角色信息为空!");
boolean passed = AuditResult.LAST_AUDIT_PASSED.equals(ra.getResult());
if( passed && EntityChange.Type.DELETE.equals(rc.getType()) ){//删除
db_role.setStatus( AuditStatus.DELETE );
}else if( passed && AuditStatus.EFFECTIVE.equals(newRole.getStatus())){
db_role.setName( newRole.getName() );
db_role.setDescription( newRole.getDescription() );
db_role.setPermissions( newRole.getPermissions() );
}else if( passed ){
db_role.setStatus( AuditStatus.EFFECTIVE );
}else if( !passed && AuditStatus.NEW.equals( newRole.getStatus() )){
db_role.setStatus( AuditStatus.AUDIT_REJECT );
}
roleManager.update(db_role);
//dao.create(ra); TODO