Package ecar.pojo

Examples of ecar.pojo.UsuarioUsu


        boolean permissaoLapis = false;
        boolean permissaoAdministradorAcompanhamento = false;
        Iterator itPeriodosAcao = null;
        Map mapAcao = null;

        UsuarioUsu usuario = seguranca.getUsuario(  );

        try
        {
            try
            {
                if ( ( codTipoAcompanhamento != null ) && ! codTipoAcompanhamento.equals( "" ) )
                {
                    tipoAcompanhamento =
                        (TipoAcompanhamentoTa) taDao.buscar( TipoAcompanhamentoTa.class,
                                                             Long.valueOf( codTipoAcompanhamento ) );
                    permissaoAdministradorAcompanhamento =
                        estruturaAcessoDao.temPermissoesAcessoAcomp( tipoAcompanhamento,
                                                                     seguranca.getGruposAcesso(  ) );
                }
            } catch ( Exception e )
            {
                //NAO EXISTE O TIPO DE ACOMPANHAMENTO;
                throw new PermissaoAcessoLinkException( ErroPermissaoAcessoLinkEnum.TIPO_DE_ACOMPANHAMENTO_INEXISTENTE );
            }

            try
            {
                if ( ( referencia_hidden != null ) && ! referencia_hidden.equals( "" ) )
                {
                    periodosConsiderados =
                        acompReferenciaDao.getPeriodosAnterioresOrdenado( Long.valueOf( referencia_hidden ),
                                                                          qtdePeriodosAnteriores,
                                                                          Long.valueOf( codTipoAcompanhamento ),
                                                                          false );
                }
            } catch ( Exception e )
            {
                //NAO EXISTE A REFERENCIA;
                throw new PermissaoAcessoLinkException( ErroPermissaoAcessoLinkEnum.REFERENCIA_INEXISTENTE );
            }

            try
            {
                // Busca cole��o com o per�odo a ser considereado
                if ( ( codAri != null ) && ! codAri.equals( "" ) )
                {
                    ari = (AcompReferenciaItemAri) ariDao.buscar( AcompReferenciaItemAri.class,
                                                                  Long.valueOf( codAri ) );
                    item = ari.getItemEstruturaIett(  );
                }
            } catch ( Exception e )
            {
                //NAO EXISTE O ACOMPANHAMENTO;
                throw new PermissaoAcessoLinkException( ErroPermissaoAcessoLinkEnum.ACOMPANHAMENTO_INEXISTENTE );
            }

            if ( ( item.getIndAtivoIett(  ) == null ) ||
                     "".equals( item.getIndAtivoIett(  ).trim(  ) ) ||
                     "N".equals( item.getIndAtivoIett(  ).toUpperCase(  ) ) )
            {
                //O ITEM EST� INATIVO;
                throw new PermissaoAcessoLinkException( ErroPermissaoAcessoLinkEnum.ITEM_INATIVO );

                //verifica se o usu�rio pode "Gerar Per�odo de Acompanhamento"
            } else if ( permissaoAdministradorAcompanhamento )
            {
                permissaoLapis = true;
            } else
            {
                itPeriodosAcao = periodosConsiderados.iterator(  );
                mapAcao = acompReferenciaItemDao.criarMapPeriodoAri( periodosConsiderados, item );
                tpfaOrdenadosPorEstrutura = tipoFuncAcompDao.getFuncaoAcompOrderByEstruturas(  );

                if ( ( itPeriodosAcao != null ) && itPeriodosAcao.hasNext(  ) )
                {
                    //Pega s� o per�odo selecionado (Aref), que � o primeiro
                    acompReferencia = (AcompReferenciaAref) itPeriodosAcao.next(  );

                    if ( ! mapAcao.isEmpty(  ) && mapAcao.containsKey( acompReferencia ) )
                    {
                        AcompReferenciaItemAri ariAcao = (AcompReferenciaItemAri) mapAcao.get( acompReferencia );

                        //Pega os Arels do Ari selecionado
                        List relatorios =
                            acompReferenciaItemDao.getAcompRelatorioArelOrderByFuncaoAcomp( ariAcao,
                                                                                            tpfaOrdenadosPorEstrutura );
                        Iterator itRelatorios = relatorios.iterator(  );

                        if ( itRelatorios != null )
                        {
                            while ( itRelatorios.hasNext(  ) )
                            {
                                AcompRelatorioArel relatorio = (AcompRelatorioArel) itRelatorios.next(  );

                                ItemEstUsutpfuacIettutfa itemEstUsu =
                                    itemEstUsuDao.buscar( item.getCodIett(  ),
                                                          relatorio.getTipoFuncAcompTpfa(  ).getCodTpfa(  ) );

                                //Verifica se a permiss�o � de grupo ou usu�rio
                                if ( ( itemEstUsu != null ) && ( usuario != null ) )
                                {
                                    if ( itemEstUsu.getUsuarioUsu(  ) != null )
                                    {
                                        usuarioLogadoEmiteParecer = itemEstUsu.getUsuarioUsu(  ).getCodUsu(  )
                                                                              .equals( usuario.getCodUsu(  ) );
                                    } else if ( itemEstUsu.getSisAtributoSatb(  ) != null )
                                    {
                                        if ( itemEstUsu.getSisAtributoSatb(  ).getUsuarioAtributoUsuas(  ) != null )
                                        {
                                            Iterator itUsuarios =
                                                itemEstUsu.getSisAtributoSatb(  ).getUsuarioAtributoUsuas(  ).iterator(  );

                                            if ( itUsuarios != null )
                                            {
                                                while ( itUsuarios.hasNext(  ) )
                                                {
                                                    UsuarioAtributoUsua usuarioAtributoUsua =
                                                        (UsuarioAtributoUsua) itUsuarios.next(  );

                                                    if ( ( usuarioAtributoUsua != null ) &&
                                                             ( usuarioAtributoUsua.getUsuarioUsu(  ) != null ) &&
                                                             usuarioAtributoUsua.getUsuarioUsu(  ).getCodUsu(  )
                                                                                    .equals( usuario.getCodUsu(  ) ) )
                                                    {
                                                        usuarioLogadoEmiteParecer = true;

                                                        break;
                                                    }
View Full Code Here


        boolean permissaoLapis = false;
        boolean permissaoAdministradorAcompanhamento = false;
        Iterator itPeriodosAcao = null;
        Map mapAcao = null;

        UsuarioUsu usuario = seguranca.getUsuario(  );

        try
        {
            try
            {
                if ( ( codTipoAcompanhamento != null ) && ! codTipoAcompanhamento.equals( "" ) )
                {
                    tipoAcompanhamento =
                        (TipoAcompanhamentoTa) taDao.buscar( TipoAcompanhamentoTa.class,
                                                             Long.valueOf( codTipoAcompanhamento ) );
                    permissaoAdministradorAcompanhamento =
                        estruturaAcessoDao.temPermissoesAcessoAcomp( tipoAcompanhamento,
                                                                     seguranca.getGruposAcesso(  ) );
                }
            } catch ( Exception e )
            {
                //NAO EXISTE O TIPO DE ACOMPANHAMENTO;
                throw new PermissaoAcessoLinkException( ErroPermissaoAcessoLinkEnum.TIPO_DE_ACOMPANHAMENTO_INEXISTENTE );
            }

            try
            {
                if ( ( referencia_hidden != null ) && ! referencia_hidden.equals( "" ) )
                {
                    periodosConsiderados =
                        acompReferenciaDao.getPeriodosAnterioresOrdenado( Long.valueOf( referencia_hidden ),
                                                                          qtdePeriodosAnteriores,
                                                                          Long.valueOf( codTipoAcompanhamento ),
                                                                          false );
                }
            } catch ( Exception e )
            {
                //NAO EXISTE A REFERENCIA;
                throw new PermissaoAcessoLinkException( ErroPermissaoAcessoLinkEnum.REFERENCIA_INEXISTENTE );
            }

            try
            {
                // Busca cole��o com o per�odo a ser considereado
                if ( ( codAri != null ) && ! codAri.equals( "" ) )
                {
                    ari = (AcompReferenciaItemAri) ariDao.buscar( AcompReferenciaItemAri.class,
                                                                  Long.valueOf( codAri ) );
                    item = ari.getItemEstruturaIett(  );
                }
            } catch ( Exception e )
            {
                //NAO EXISTE O ACOMPANHAMENTO;
                throw new PermissaoAcessoLinkException( ErroPermissaoAcessoLinkEnum.ACOMPANHAMENTO_INEXISTENTE );
            }

            if ( ( item.getIndAtivoIett(  ) == null ) ||
                     "".equals( item.getIndAtivoIett(  ).trim(  ) ) ||
                     "N".equals( item.getIndAtivoIett(  ).toUpperCase(  ) ) )
            {
                //O ITEM EST� INATIVO;
                throw new PermissaoAcessoLinkException( ErroPermissaoAcessoLinkEnum.ITEM_INATIVO );

                //verifica se o usu�rio pode "Gerar Per�odo de Acompanhamento"
            } else if ( permissaoAdministradorAcompanhamento )
            {
                permissaoLapis = true;
            } else
            {
                itPeriodosAcao = periodosConsiderados.iterator(  );
                mapAcao = acompReferenciaItemDao.criarMapPeriodoAri( periodosConsiderados, item );
                tpfaOrdenadosPorEstrutura = tipoFuncAcompDao.getFuncaoAcompOrderByEstruturas(  );

                if ( ( itPeriodosAcao != null ) && itPeriodosAcao.hasNext(  ) )
                {
                    //Pega s� o per�odo selecionado (Aref), que � o primeiro
                    acompReferencia = (AcompReferenciaAref) itPeriodosAcao.next(  );

                    if ( ! mapAcao.isEmpty(  ) && mapAcao.containsKey( acompReferencia ) )
                    {
                        AcompReferenciaItemAri ariAcao = (AcompReferenciaItemAri) mapAcao.get( acompReferencia );

                        //Pega os Arels do Ari selecionado
                        List relatorios =
                            acompReferenciaItemDao.getAcompRelatorioArelOrderByFuncaoAcomp( ariAcao,
                                                                                            tpfaOrdenadosPorEstrutura );
                        Iterator itRelatorios = relatorios.iterator(  );

                        if ( itRelatorios != null )
                        {
                            while ( itRelatorios.hasNext(  ) )
                            {
                                AcompRelatorioArel relatorio = (AcompRelatorioArel) itRelatorios.next(  );

                                ItemEstUsutpfuacIettutfa itemEstUsu =
                                    itemEstUsuDao.buscar( item.getCodIett(  ),
                                                          relatorio.getTipoFuncAcompTpfa(  ).getCodTpfa(  ) );

                                //Verifica se a permiss�o � de grupo ou usu�rio
                                if ( ( itemEstUsu != null ) && ( usuario != null ) )
                                {
                                    if ( itemEstUsu.getUsuarioUsu(  ) != null )
                                    {
                                        usuarioLogadoEmiteParecer = itemEstUsu.getUsuarioUsu(  ).getCodUsu(  )
                                                                              .equals( usuario.getCodUsu(  ) );
                                    } else if ( itemEstUsu.getSisAtributoSatb(  ) != null )
                                    {
                                        if ( itemEstUsu.getSisAtributoSatb(  ).getUsuarioAtributoUsuas(  ) != null )
                                        {
                                            Iterator itUsuarios =
                                                itemEstUsu.getSisAtributoSatb(  ).getUsuarioAtributoUsuas(  ).iterator(  );

                                            if ( itUsuarios != null )
                                            {
                                                while ( itUsuarios.hasNext(  ) )
                                                {
                                                    UsuarioAtributoUsua usuarioAtributoUsua =
                                                        (UsuarioAtributoUsua) itUsuarios.next(  );

                                                    if ( ( usuarioAtributoUsua != null ) &&
                                                             ( usuarioAtributoUsua.getUsuarioUsu(  ) != null ) &&
                                                             usuarioAtributoUsua.getUsuarioUsu(  ).getCodUsu(  )
                                                                                    .equals( usuario.getCodUsu(  ) ) )
                                                    {
                                                        usuarioLogadoEmiteParecer = true;

                                                        break;
                                                    }
View Full Code Here

                    break
                  }
                } else if (itemEst.getSisAtributoSatb() != null) {
                Iterator itUsuarios = new UsuarioDao().getUsuariosBySisAtributoSatb(itemEst.getSisAtributoSatb()).iterator();
                    while (itUsuarios.hasNext()){
                      UsuarioUsu usu = (UsuarioUsu) itUsuarios.next();
                      if (usu.equals(usuario)){
                        usuarioSemPermissao = false;
                        break;
                      }
                    }                   
                  }
                  }
            }        
            } else if (itemEstUsutpfuacIettutfa.getSisAtributoSatb() != null){
              Iterator itUsuarios = new UsuarioDao().getUsuariosBySisAtributoSatb(itemEstUsutpfuacIettutfa.getSisAtributoSatb()).iterator();
              while (itUsuarios.hasNext()){
                UsuarioUsu usu = (UsuarioUsu) itUsuarios.next();
                if (usu.equals(usuario)){
                  usuarioSemPermissao = false;
                }
              }
             
            if(usuarioSemPermissao){
View Full Code Here

                    break
                  }
                } else if (itemEst.getSisAtributoSatb() != null) {
                Iterator itUsuarios = new UsuarioDao().getUsuariosBySisAtributoSatb(itemEst.getSisAtributoSatb()).iterator();
                    while (itUsuarios.hasNext()){
                      UsuarioUsu usu = (UsuarioUsu) itUsuarios.next();
                      if (usu.equals(usuario)){
                        usuarioSemPermissao = false;
                        break;
                      }
                    }                   
                  }
                  }
            } 
            } else if (itemEstUsutpfuacIettutfa.getSisAtributoSatb() != null){
              Iterator itUsuarios = new UsuarioDao().getUsuariosBySisAtributoSatb(itemEstUsutpfuacIettutfa.getSisAtributoSatb()).iterator();
              while (itUsuarios.hasNext()){
                UsuarioUsu usu = (UsuarioUsu) itUsuarios.next();
                if (usu.equals(usuario)){
                  usuarioSemPermissao = false;
                }
              }
             
            if(usuarioSemPermissao){
View Full Code Here

                    break
                  }
                } else if (itemEst.getSisAtributoSatb() != null) {
                Iterator itUsuarios = new UsuarioDao().getUsuariosBySisAtributoSatb(itemEst.getSisAtributoSatb()).iterator();
                    while (itUsuarios.hasNext()){
                      UsuarioUsu usu = (UsuarioUsu) itUsuarios.next();
                      if (usu.equals(usuario)){
                        usuarioSemPermissao = false;
                        break;
                      }
                    }                   
                  }
                  }
            }     
            } else if (itemEstUsutpfuacIettutfa.getSisAtributoSatb() != null){
              Iterator itUsuarios = new UsuarioDao().getUsuariosBySisAtributoSatb(itemEstUsutpfuacIettutfa.getSisAtributoSatb()).iterator();
              while (itUsuarios.hasNext()){
                UsuarioUsu usu = (UsuarioUsu) itUsuarios.next();
                if (usu.equals(usuario)){
                  usuarioSemPermissao = false;
                }
              }
             
            if(usuarioSemPermissao){
View Full Code Here

              acompReferenciaItem.getItemEstruturaIett().setSituacaoSit(s);
              System.out.println("Mudar situa��o em Cadastro");
            }
        }       
       
        UsuarioUsu usuario = (UsuarioUsu)this.buscar(UsuarioUsu.class, Long.valueOf(codUsuario));               
        acompRelatorio.setUsuarioUsuUltimaManutencao(usuario);
       
        acompRelatorio.setTipoFuncAcompTpfa(funcaoAcomp);
        acompRelatorio.setAcompReferenciaItemAri(acompReferenciaItem);
        acompRelatorio.setDescricaoArel(Util.normalizaQuebraDeLinha(descricaoArel));
View Full Code Here

                        if (itemEstUsutpfuacIettutfa.getUsuarioUsu() != null && itemEstUsutpfuacIettutfa.getUsuarioUsu().equals(usuario)){
                          usuarioSemPermissao = false;
                        } else if (itemEstUsutpfuacIettutfa.getSisAtributoSatb() != null){
                          Iterator itUsuarios = new UsuarioDao().getUsuariosBySisAtributoSatb(itemEstUsutpfuacIettutfa.getSisAtributoSatb()).iterator();
                          while (itUsuarios.hasNext()){
                            UsuarioUsu usu = (UsuarioUsu) itUsuarios.next();
                            if (usu.equals(usuario)){
                              usuarioSemPermissao = false;
                            }
                          }
                        }
                      }
View Full Code Here

      boolean permissaoLapis = false;
      boolean permissaoAdministradorAcompanhamento = false;
      Iterator itPeriodosAcao = null;
      Map  mapAcao = null;
     
      UsuarioUsu usuario = seguranca.getUsuario();
     
       
      try {
       
        try {
         
          if(codTipoAcompanhamento != null && !codTipoAcompanhamento.equals("")) {
            tipoAcompanhamento = (TipoAcompanhamentoTa) taDao.buscar(TipoAcompanhamentoTa.class, Long.valueOf(codTipoAcompanhamento));
            permissaoAdministradorAcompanhamento = estruturaAcessoDao.temPermissoesAcessoAcomp(tipoAcompanhamento, seguranca.getGruposAcesso());
         
        } catch(Exception e) {
          //NAO EXISTE O TIPO DE ACOMPANHAMENTO;
          throw new PermissaoAcessoLinkException(ErroPermissaoAcessoLinkEnum.TIPO_DE_ACOMPANHAMENTO_INEXISTENTE);
        }
       
       
        try {

          if(referencia_hidden != null && !referencia_hidden.equals("")) {
            periodosConsiderados = acompReferenciaDao.getPeriodosAnterioresOrdenado(Long.valueOf(referencia_hidden), qtdePeriodosAnteriores, 
                    Long.valueOf(codTipoAcompanhamento), false);
          }   
         
        } catch(Exception e) {
          //NAO EXISTE A REFERENCIA;
          throw new PermissaoAcessoLinkException(ErroPermissaoAcessoLinkEnum.REFERENCIA_INEXISTENTE);
        }
       
       
        try{
          // Busca cole��o com o per�odo a ser considereado
          if(codAri != null && !codAri.equals("")) {
            ari = (AcompReferenciaItemAri) ariDao.buscar(AcompReferenciaItemAri.class, Long.valueOf(codAri));
            item = ari.getItemEstruturaIett();
         
        } catch(Exception e) {
          //NAO EXISTE O ACOMPANHAMENTO;
          throw new PermissaoAcessoLinkException(ErroPermissaoAcessoLinkEnum.ACOMPANHAMENTO_INEXISTENTE);
        }
       
       
        if (item.getIndAtivoIett() == null || "".equals(item.getIndAtivoIett().trim()) || "N".equals(item.getIndAtivoIett().toUpperCase())) {
         
          //O ITEM EST� INATIVO;
          throw new PermissaoAcessoLinkException(ErroPermissaoAcessoLinkEnum.ITEM_INATIVO);
       
        //verifica se o usu�rio pode "Gerar Per�odo de Acompanhamento"
        } else if(permissaoAdministradorAcompanhamento) {
          permissaoLapis = true;
         
        } else
         
         
          itPeriodosAcao = periodosConsiderados.iterator();
          mapAcao = acompReferenciaItemDao.criarMapPeriodoAri(periodosConsiderados, item);
          tpfaOrdenadosPorEstrutura = tipoFuncAcompDao.getFuncaoAcompOrderByEstruturas();
         
     
          if(itPeriodosAcao != null && itPeriodosAcao.hasNext()) {
            //Pega s� o per�odo selecionado (Aref), que � o primeiro
            acompReferencia = (AcompReferenciaAref) itPeriodosAcao.next();
            if(!mapAcao.isEmpty() && mapAcao.containsKey(acompReferencia)) {
              AcompReferenciaItemAri ariAcao = (AcompReferenciaItemAri) mapAcao.get(acompReferencia);
                     
              //Pega os Arels do Ari selecionado
              List relatorios = acompReferenciaItemDao.getAcompRelatorioArelOrderByFuncaoAcomp(ariAcao, tpfaOrdenadosPorEstrutura);
              Iterator itRelatorios = relatorios.iterator();
             
              if(itRelatorios != null) {
                while(itRelatorios.hasNext()){                       
                  AcompRelatorioArel relatorio = (AcompRelatorioArel) itRelatorios.next();                   
                         
                  ItemEstUsutpfuacIettutfa itemEstUsu
                            = itemEstUsuDao.buscar(item.getCodIett(), relatorio.getTipoFuncAcompTpfa().getCodTpfa());
                          
                  //Verifica se a permiss�o � de grupo ou usu�rio
                  if(itemEstUsu!=null && usuario != null) {                            
                    if (itemEstUsu.getUsuarioUsu() != null) {
                      usuarioLogadoEmiteParecer = itemEstUsu.getUsuarioUsu().getCodUsu().equals(usuario.getCodUsu());
                    } else if (itemEstUsu.getSisAtributoSatb() != null) {
                      if (itemEstUsu.getSisAtributoSatb().getUsuarioAtributoUsuas() != null) {
                        Iterator itUsuarios = itemEstUsu.getSisAtributoSatb().getUsuarioAtributoUsuas().iterator();
                        if(itUsuarios != null) {
                          while (itUsuarios.hasNext()) {
                            UsuarioAtributoUsua usuarioAtributoUsua = (UsuarioAtributoUsua) itUsuarios.next();
                              if (usuarioAtributoUsua!=null && usuarioAtributoUsua.getUsuarioUsu()!=null &&
                                  usuarioAtributoUsua.getUsuarioUsu().getCodUsu().equals(usuario.getCodUsu())){
                                usuarioLogadoEmiteParecer = true;
                                break;
                              }
                          }
                        } 
View Full Code Here

        boolean permissaoLapis = false;
        boolean permissaoAdministradorAcompanhamento = false;
        Iterator itPeriodosAcao = null;
        Map mapAcao = null;

        UsuarioUsu usuario = seguranca.getUsuario(  );

        try
        {
            try
            {
                if ( ( codTipoAcompanhamento != null ) && ! codTipoAcompanhamento.equals( "" ) )
                {
                    tipoAcompanhamento =
                        (TipoAcompanhamentoTa) taDao.buscar( TipoAcompanhamentoTa.class,
                                                             Long.valueOf( codTipoAcompanhamento ) );
                    permissaoAdministradorAcompanhamento =
                        estruturaAcessoDao.temPermissoesAcessoAcomp( tipoAcompanhamento,
                                                                     seguranca.getGruposAcesso(  ) );
                }
            } catch ( Exception e )
            {
                //NAO EXISTE O TIPO DE ACOMPANHAMENTO;
                throw new PermissaoAcessoLinkException( ErroPermissaoAcessoLinkEnum.TIPO_DE_ACOMPANHAMENTO_INEXISTENTE );
            }

            try
            {
                if ( ( referencia_hidden != null ) && ! referencia_hidden.equals( "" ) )
                {
                    periodosConsiderados =
                        acompReferenciaDao.getPeriodosAnterioresOrdenado( Long.valueOf( referencia_hidden ),
                                                                          qtdePeriodosAnteriores,
                                                                          Long.valueOf( codTipoAcompanhamento ),
                                                                          false );
                }
            } catch ( Exception e )
            {
                //NAO EXISTE A REFERENCIA;
                throw new PermissaoAcessoLinkException( ErroPermissaoAcessoLinkEnum.REFERENCIA_INEXISTENTE );
            }

            try
            {
                // Busca cole��o com o per�odo a ser considereado
                if ( ( codAri != null ) && ! codAri.equals( "" ) )
                {
                    ari = (AcompReferenciaItemAri) ariDao.buscar( AcompReferenciaItemAri.class,
                                                                  Long.valueOf( codAri ) );
                    item = ari.getItemEstruturaIett(  );
                }
            } catch ( Exception e )
            {
                //NAO EXISTE O ACOMPANHAMENTO;
                throw new PermissaoAcessoLinkException( ErroPermissaoAcessoLinkEnum.ACOMPANHAMENTO_INEXISTENTE );
            }

            //verifica se o usu�rio pode "Gerar Per�odo de Acompanhamento"
            if ( permissaoAdministradorAcompanhamento )
            {
                permissaoLapis = true;
            } else
            {
                itPeriodosAcao = periodosConsiderados.iterator(  );
                mapAcao = acompReferenciaItemDao.criarMapPeriodoAri( periodosConsiderados, item );
                tpfaOrdenadosPorEstrutura = tipoFuncAcompDao.getFuncaoAcompOrderByEstruturas(  );

                if ( ( itPeriodosAcao != null ) && itPeriodosAcao.hasNext(  ) )
                {
                    //Pega s� o per�odo selecionado (Aref), que � o primeiro
                    acompReferencia = (AcompReferenciaAref) itPeriodosAcao.next(  );

                    if ( ! mapAcao.isEmpty(  ) && mapAcao.containsKey( acompReferencia ) )
                    {
                        AcompReferenciaItemAri ariAcao = (AcompReferenciaItemAri) mapAcao.get( acompReferencia );

                        //Pega os Arels do Ari selecionado
                        List relatorios =
                            acompReferenciaItemDao.getAcompRelatorioArelOrderByFuncaoAcomp( ariAcao,
                                                                                            tpfaOrdenadosPorEstrutura );
                        Iterator itRelatorios = relatorios.iterator(  );

                        if ( itRelatorios != null )
                        {
                            while ( itRelatorios.hasNext(  ) )
                            {
                                AcompRelatorioArel relatorio = (AcompRelatorioArel) itRelatorios.next(  );

                                ItemEstUsutpfuacIettutfa itemEstUsu =
                                    itemEstUsuDao.buscar( item.getCodIett(  ),
                                                          relatorio.getTipoFuncAcompTpfa(  ).getCodTpfa(  ) );

                                //Verifica se a permiss�o � de grupo ou usu�rio
                                if ( ( itemEstUsu != null ) && ( usuario != null ) )
                                {
                                    if ( itemEstUsu.getUsuarioUsu(  ) != null )
                                    {
                                        usuarioLogadoEmiteParecer = itemEstUsu.getUsuarioUsu(  ).getCodUsu(  )
                                                                              .equals( usuario.getCodUsu(  ) );
                                    } else if ( itemEstUsu.getSisAtributoSatb(  ) != null )
                                    {
                                        if ( itemEstUsu.getSisAtributoSatb(  ).getUsuarioAtributoUsuas(  ) != null )
                                        {
                                            Iterator itUsuarios =
                                                itemEstUsu.getSisAtributoSatb(  ).getUsuarioAtributoUsuas(  ).iterator(  );

                                            if ( itUsuarios != null )
                                            {
                                                while ( itUsuarios.hasNext(  ) )
                                                {
                                                    UsuarioAtributoUsua usuarioAtributoUsua =
                                                        (UsuarioAtributoUsua) itUsuarios.next(  );

                                                    if ( ( usuarioAtributoUsua != null ) &&
                                                             ( usuarioAtributoUsua.getUsuarioUsu(  ) != null ) &&
                                                             usuarioAtributoUsua.getUsuarioUsu(  ).getCodUsu(  )
                                                                                    .equals( usuario.getCodUsu(  ) ) )
                                                    {
                                                        usuarioLogadoEmiteParecer = true;

                                                        break;
                                                    }
View Full Code Here

        boolean permissaoLapis = false;
        boolean permissaoAdministradorAcompanhamento = false;
        Iterator itPeriodosAcao = null;
        Map mapAcao = null;

        UsuarioUsu usuario = seguranca.getUsuario(  );

        try
        {
            try
            {
                if ( ( codTipoAcompanhamento != null ) && ! codTipoAcompanhamento.equals( "" ) )
                {
                    tipoAcompanhamento =
                        (TipoAcompanhamentoTa) taDao.buscar( TipoAcompanhamentoTa.class,
                                                             Long.valueOf( codTipoAcompanhamento ) );
                    permissaoAdministradorAcompanhamento =
                        estruturaAcessoDao.temPermissoesAcessoAcomp( tipoAcompanhamento,
                                                                     seguranca.getGruposAcesso(  ) );
                }
            } catch ( Exception e )
            {
                //NAO EXISTE O TIPO DE ACOMPANHAMENTO;
                throw new PermissaoAcessoLinkException( ErroPermissaoAcessoLinkEnum.TIPO_DE_ACOMPANHAMENTO_INEXISTENTE );
            }

            try
            {
                if ( ( referencia_hidden != null ) && ! referencia_hidden.equals( "" ) )
                {
                    periodosConsiderados =
                        acompReferenciaDao.getPeriodosAnterioresOrdenado( Long.valueOf( referencia_hidden ),
                                                                          qtdePeriodosAnteriores,
                                                                          Long.valueOf( codTipoAcompanhamento ),
                                                                          false );
                }
            } catch ( Exception e )
            {
                //NAO EXISTE A REFERENCIA;
                throw new PermissaoAcessoLinkException( ErroPermissaoAcessoLinkEnum.REFERENCIA_INEXISTENTE );
            }

            try
            {
                // Busca cole��o com o per�odo a ser considereado
                if ( ( codAri != null ) && ! codAri.equals( "" ) )
                {
                    ari = (AcompReferenciaItemAri) ariDao.buscar( AcompReferenciaItemAri.class,
                                                                  Long.valueOf( codAri ) );
                    item = ari.getItemEstruturaIett(  );
                }
            } catch ( Exception e )
            {
                //NAO EXISTE O ACOMPANHAMENTO;
                throw new PermissaoAcessoLinkException( ErroPermissaoAcessoLinkEnum.ACOMPANHAMENTO_INEXISTENTE );
            }

            //verifica se o usu�rio pode "Gerar Per�odo de Acompanhamento"
            if ( permissaoAdministradorAcompanhamento )
            {
                permissaoLapis = true;
            } else
            {
                itPeriodosAcao = periodosConsiderados.iterator(  );
                mapAcao = acompReferenciaItemDao.criarMapPeriodoAri( periodosConsiderados, item );
                tpfaOrdenadosPorEstrutura = tipoFuncAcompDao.getFuncaoAcompOrderByEstruturas(  );

                if ( ( itPeriodosAcao != null ) && itPeriodosAcao.hasNext(  ) )
                {
                    //Pega s� o per�odo selecionado (Aref), que � o primeiro
                    acompReferencia = (AcompReferenciaAref) itPeriodosAcao.next(  );

                    if ( ! mapAcao.isEmpty(  ) && mapAcao.containsKey( acompReferencia ) )
                    {
                        AcompReferenciaItemAri ariAcao = (AcompReferenciaItemAri) mapAcao.get( acompReferencia );

                        //Pega os Arels do Ari selecionado
                        List relatorios =
                            acompReferenciaItemDao.getAcompRelatorioArelOrderByFuncaoAcomp( ariAcao,
                                                                                            tpfaOrdenadosPorEstrutura );
                        Iterator itRelatorios = relatorios.iterator(  );

                        if ( itRelatorios != null )
                        {
                            while ( itRelatorios.hasNext(  ) )
                            {
                                AcompRelatorioArel relatorio = (AcompRelatorioArel) itRelatorios.next(  );

                                ItemEstUsutpfuacIettutfa itemEstUsu =
                                    itemEstUsuDao.buscar( item.getCodIett(  ),
                                                          relatorio.getTipoFuncAcompTpfa(  ).getCodTpfa(  ) );

                                //Verifica se a permiss�o � de grupo ou usu�rio
                                if ( ( itemEstUsu != null ) && ( usuario != null ) )
                                {
                                    if ( itemEstUsu.getUsuarioUsu(  ) != null )
                                    {
                                        usuarioLogadoEmiteParecer = itemEstUsu.getUsuarioUsu(  ).getCodUsu(  )
                                                                              .equals( usuario.getCodUsu(  ) );
                                    } else if ( itemEstUsu.getSisAtributoSatb(  ) != null )
                                    {
                                        if ( itemEstUsu.getSisAtributoSatb(  ).getUsuarioAtributoUsuas(  ) != null )
                                        {
                                            Iterator itUsuarios =
                                                itemEstUsu.getSisAtributoSatb(  ).getUsuarioAtributoUsuas(  ).iterator(  );

                                            if ( itUsuarios != null )
                                            {
                                                while ( itUsuarios.hasNext(  ) )
                                                {
                                                    UsuarioAtributoUsua usuarioAtributoUsua =
                                                        (UsuarioAtributoUsua) itUsuarios.next(  );

                                                    if ( ( usuarioAtributoUsua != null ) &&
                                                             ( usuarioAtributoUsua.getUsuarioUsu(  ) != null ) &&
                                                             usuarioAtributoUsua.getUsuarioUsu(  ).getCodUsu(  )
                                                                                    .equals( usuario.getCodUsu(  ) ) )
                                                    {
                                                        usuarioLogadoEmiteParecer = true;

                                                        break;
                                                    }
View Full Code Here

TOP

Related Classes of ecar.pojo.UsuarioUsu

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.