Package ecar.pojo

Examples of ecar.pojo.AcompRelatorioArel


              if(ari.getStatusRelatorioSrl().equals(statusLiberado) || acompReferencia.getTipoAcompanhamentoTa().getIndLiberarAcompTa().equals(Pagina.NAO) ) {
                List relatorios = acompReferenciaItemDao.getAcompRelatorioArelOrderByFuncaoAcomp(ari, tpfaOrdenadosEstrutura);
               
                for (Iterator itRelatorios = relatorios.iterator(); itRelatorios
                    .hasNext();) {                     
                  AcompRelatorioArel relatorio = (AcompRelatorioArel) itRelatorios.next();
 
                  if(relatorio.getTipoFuncAcompTpfa().getCodTpfa().toString().equals(Pagina.getParamStr(request, "tipoFuncAcompTpfa"))) {
                    if(relatorio.getCor() != null && "S".equals(relatorio.getIndLiberadoArel())){
                      coresPosicoes.add(relatorio.getCor().getCodCor().toString());
                    }
                    else {
                      TipoAcompFuncAcompTafc tafc = new TipoAcompFuncAcompTafc();
                      TipoAcompFuncAcompDao tafcDao = new TipoAcompFuncAcompDao(request);                   
                      tafc = tafcDao.buscar(acompReferencia.getTipoAcompanhamentoTa().getCodTa(), relatorio.getTipoFuncAcompTpfa().getCodTpfa());
                      //Verifica se � obrigat�rio
                      if(tafc.getIndRegistroPosicaoTafc() != null && tafc.getIndRegistroPosicaoTafc().equals("O")){
                        coresPosicoes.add("BRANCO");
                      }
                    }
                  }
                }
              }
              // Se Exige Liberar Acompanhamento
              else {
                List relatorios = acompReferenciaItemDao.getAcompRelatorioArelOrderByFuncaoAcomp(ari, tpfaOrdenadosEstrutura);
               
                if(ari.getAcompRelatorioArels() != null && ari.getAcompRelatorioArels().size() > 0) {             
                  for (Iterator itRelatorios = relatorios.iterator(); itRelatorios
                      .hasNext();) {                     
                    AcompRelatorioArel relatorio = (AcompRelatorioArel) itRelatorios.next();
   
                    if(relatorio.getTipoFuncAcompTpfa().getCodTpfa().toString().equals(Pagina.getParamStr(request, "tipoFuncAcompTpfa"))) {
                      TipoAcompFuncAcompTafc tafc = new TipoAcompFuncAcompTafc();
                      TipoAcompFuncAcompDao tafcDao = new TipoAcompFuncAcompDao(request);                   
                      tafc = tafcDao.buscar(acompReferencia.getTipoAcompanhamentoTa().getCodTa(), relatorio.getTipoFuncAcompTpfa().getCodTpfa());
                      //Conta como n�o liberados apenas os pareceres obrigat�rios e n�o informados
                      if(tafc.getIndRegistroPosicaoTafc() != null && tafc.getIndRegistroPosicaoTafc().equals("O") &&
                          (relatorio.getIndLiberadoArel()==null ||
                          relatorio.getIndLiberadoArel().equals(Pagina.NAO)) ){
                        //N�o foi liberado acompanhamento
                        coresPosicoes.add("N/L");
                      }
                    }
                  }
View Full Code Here


            //entra se o ARI t� liberado ou se n�o exige liberar acompanhamento
            if(ari.getStatusRelatorioSrl().equals(statusLiberado) || acompReferencia.getTipoAcompanhamentoTa().getIndLiberarAcompTa().equals(Pagina.NAO) ) {
              List relatorios = acompReferenciaItemDao.getAcompRelatorioArelOrderByFuncaoAcomp(ari, tpfaOrdenadosEstrutura);
             
              for (Iterator itRelatorios = relatorios.iterator(); itRelatorios.hasNext();) {                     
                AcompRelatorioArel relatorio = (AcompRelatorioArel) itRelatorios.next();

                if(relatorio.getTipoFuncAcompTpfa().getCodTpfa().toString().equals(tipoFuncAcompTpfa)) {
                  if(relatorio.getCor() != null && "S".equals(relatorio.getIndLiberadoArel())){
                    coresPosicoes.add(relatorio.getCor().getCodCor().toString());
                  }
                  else {
                    TipoAcompFuncAcompTafc tafc = new TipoAcompFuncAcompTafc();
                    TipoAcompFuncAcompDao tafcDao = new TipoAcompFuncAcompDao(request);                   
                    tafc = tafcDao.buscar(acompReferencia.getTipoAcompanhamentoTa().getCodTa(), relatorio.getTipoFuncAcompTpfa().getCodTpfa());
                    //Verifica se � obrigat�rio
                    if(tafc.getIndRegistroPosicaoTafc() != null && tafc.getIndRegistroPosicaoTafc().equals("O")){
                      coresPosicoes.add(Cor.BRANCO);
                    }
                  }
                }
              }
            }
            // Se Exige Liberar Acompanhamento
            else {
              List relatorios = acompReferenciaItemDao.getAcompRelatorioArelOrderByFuncaoAcomp(ari, tpfaOrdenadosEstrutura);
             
              if(ari.getAcompRelatorioArels() != null && ari.getAcompRelatorioArels().size() > 0) {             
                for (Iterator itRelatorios = relatorios.iterator(); itRelatorios
                    .hasNext();) {                     
                  AcompRelatorioArel relatorio = (AcompRelatorioArel) itRelatorios.next();
 
                  if(relatorio.getTipoFuncAcompTpfa().getCodTpfa().toString().equals(tipoFuncAcompTpfa)) {
                    TipoAcompFuncAcompTafc tafc = new TipoAcompFuncAcompTafc();
                    TipoAcompFuncAcompDao tafcDao = new TipoAcompFuncAcompDao(request);                   
                    tafc = tafcDao.buscar(acompReferencia.getTipoAcompanhamentoTa().getCodTa(), relatorio.getTipoFuncAcompTpfa().getCodTpfa());
                    //Conta como n�o liberados apenas os pareceres obrigat�rios e n�o informados
                    if(tafc.getIndRegistroPosicaoTafc() != null && tafc.getIndRegistroPosicaoTafc().equals("O") &&
                        (relatorio.getIndLiberadoArel()==null ||
                        relatorio.getIndLiberadoArel().equals(Pagina.NAO)) ){
                      //N�o foi liberado acompanhamento
                      coresPosicoes.add(Cor.NAO_LIBERADO);
                    }
                  }
                }
View Full Code Here

       * vers�o PPA, quando a emiss�o solicitada � por �rg�o, deve classificar
       * por �rg�o e tamb�m por "sigla" do item (em ordem crescente).
       */
      boolean ppa = false;
      if(lista != null && !lista.isEmpty()){
        AcompRelatorioArel arel = (AcompRelatorioArel) lista.get(0);
        ppa = arel.getAcompReferenciaItemAri().getAcompReferenciaAref().getTipoAcompanhamentoTa().getDescricaoTa().contains("PPA");
      }
     
      if(!ppa){
        ordenarArelsPorIettsConfigurados(lista);
      }
      else {
          Collections.sort(lista, new Comparator(){
          public int compare(Object arg1, Object arg2) {
           
            AcompRelatorioArel arel1 = (AcompRelatorioArel) arg1;
            AcompRelatorioArel arel2 = (AcompRelatorioArel) arg2;
           
            ItemEstruturaIett iett1 = arel1.getAcompReferenciaItemAri().getItemEstruturaIett();
            ItemEstruturaIett iett2 = arel2.getAcompReferenciaItemAri().getItemEstruturaIett();
           
            return iett1.getSiglaIett().compareTo(iett2.getSiglaIett());
          }
           
          });
      }
     
        Collections.sort(lista, new Comparator(){
        public int compare(Object arg1, Object arg2) {
         
          AcompRelatorioArel arel1 = (AcompRelatorioArel) arg1;
          AcompRelatorioArel arel2 = (AcompRelatorioArel) arg2;
         
          OrgaoOrg org1 = arel1.getAcompReferenciaItemAri().getItemEstruturaIett().getOrgaoOrgByCodOrgaoResponsavel1Iett();
          OrgaoOrg org2 = arel2.getAcompReferenciaItemAri().getItemEstruturaIett().getOrgaoOrgByCodOrgaoResponsavel1Iett();
         
          if(org1 == null && org2 == null)
            return 0;
          if(org1 != null && org2 == null)
            return 1;
          if(org1 == null && org2 != null)
            return -1;
         
          return org1.getSiglaOrg().compareTo(org2.getSiglaOrg());
        }
         
        });
    }
    // Se opcaoModelo == RELATORIO_ORGAO_ESPECIFICO os itens ser�o de 1 �rg�o espec�fico, portanto s� ordeno por situa��o.
    else if(RELATORIO_ORGAO_ESPECIFICO.equals(opcaoModelo)){
        Collections.sort(lista, new Comparator(){
        public int compare(Object arg1, Object arg2) {
         
          AcompRelatorioArel arel1 = (AcompRelatorioArel) arg1;
          AcompRelatorioArel arel2 = (AcompRelatorioArel) arg2;
         
          Cor cor1 = arel1.getCor();
          Cor cor2 = arel2.getCor();
         
          if(cor1 == null && cor2 == null)
            return 0;
          if(cor1 != null && cor2 == null)
            return 1;
          if(cor1 == null && cor2 != null)
            return -1;
         
          return cor1.getOrdemCor().compareTo(cor2.getOrdemCor());
        }
         
        });

        ordenarArelsPorIettsConfigurados(lista);
       
    }
    //opcaoModelo == RELATORIO_SITUACAO_ESPECIFICO os itens s�o s� de 1 situa��o, s� ordeno por �rg�o.
    else if(RELATORIO_SITUACAO_ESPECIFICO.equals(opcaoModelo)){

      ordenarArelsPorIettsConfigurados(lista);
       
      Collections.sort(lista, new Comparator(){
        public int compare(Object arg1, Object arg2) {
         
          AcompRelatorioArel arel1 = (AcompRelatorioArel) arg1;
          AcompRelatorioArel arel2 = (AcompRelatorioArel) arg2;
         
          OrgaoOrg org1 = arel1.getAcompReferenciaItemAri().getItemEstruturaIett().getOrgaoOrgByCodOrgaoResponsavel1Iett();
          OrgaoOrg org2 = arel2.getAcompReferenciaItemAri().getItemEstruturaIett().getOrgaoOrgByCodOrgaoResponsavel1Iett();
         
          if(org1 == null && org2 == null)
            return 0;
          if(org1 != null && org2 == null)
            return 1;
          if(org1 == null && org2 != null)
            return -1;
         
          return org1.getSiglaOrg().compareTo(org2.getSiglaOrg());
        }
         
        });
    }
    // Se opcaoModelo == RELATORIO_SITUACAO, primeiro ordeno por �rg�o e depois por situa��o para ficar ordenado por "Situa��o e Org�o".
    else if(RELATORIO_SITUACAO.equals(opcaoModelo)){
        //Situa��o e �rg�o

      ordenarArelsPorIettsConfigurados(lista);

      Collections.sort(lista, new Comparator(){
        public int compare(Object arg1, Object arg2) {
         
          AcompRelatorioArel arel1 = (AcompRelatorioArel) arg1;
          AcompRelatorioArel arel2 = (AcompRelatorioArel) arg2;
         
          OrgaoOrg org1 = arel1.getAcompReferenciaItemAri().getItemEstruturaIett().getOrgaoOrgByCodOrgaoResponsavel1Iett();
          OrgaoOrg org2 = arel2.getAcompReferenciaItemAri().getItemEstruturaIett().getOrgaoOrgByCodOrgaoResponsavel1Iett();
         
          if(org1 == null && org2 == null)
            return 0;
          if(org1 != null && org2 == null)
            return 1;
          if(org1 == null && org2 != null)
            return -1;
         
          return org1.getSiglaOrg().compareTo(org2.getSiglaOrg());
        }
         
        });

        Collections.sort(lista, new Comparator(){
        public int compare(Object arg1, Object arg2) {
         
          AcompRelatorioArel arel1 = (AcompRelatorioArel) arg1;
          AcompRelatorioArel arel2 = (AcompRelatorioArel) arg2;
         
          Cor cor1 = arel1.getCor();
          Cor cor2 = arel2.getCor();
         
          if(cor1 == null && cor2 == null)
            return 0;
          if(cor1 != null && cor2 == null)
            return 1;
View Full Code Here

      List ietts = new ArrayList();
      TipoAcompanhamentoTa tipoAcomp = null;

     
      for (Iterator itAcomps = lista.iterator(); itAcomps.hasNext();) {
      AcompRelatorioArel arel = (AcompRelatorioArel) itAcomps.next();
       
        if(tipoAcomp == null){
          tipoAcomp = arel.getAcompReferenciaItemAri().getAcompReferenciaAref().getTipoAcompanhamentoTa();
        }
        if(!ietts.contains(arel.getAcompReferenciaItemAri().getItemEstruturaIett())){
          ietts.add(arel.getAcompReferenciaItemAri().getItemEstruturaIett());
        }
      }
     
      List aeList = new ItemEstruturaDao(null).getItensOrdenados(ietts, tipoAcomp);
      List arels = new ArrayList();
     
      for (Iterator itAe = aeList.iterator(); itAe.hasNext();) {
        AtributoEstruturaListagemItens ae = (AtributoEstruturaListagemItens) itAe.next();
       
        for (Iterator itArels = lista.iterator(); itArels.hasNext();) {
          AcompRelatorioArel arel = (AcompRelatorioArel) itArels.next();

          if(!arels.contains(arel) && arel.getAcompReferenciaItemAri().getItemEstruturaIett().equals(ae.getItem())){
            arels.add(arel);
          }
        }
      }
     
View Full Code Here

            for (Iterator itAris = listaAris.iterator(); itAris.hasNext();) {
              AcompReferenciaItemAri ari =  (AcompReferenciaItemAri) itAris.next();
                Set arels =  ari.getAcompRelatorioArels() ;
               
                for(Iterator itArels = arels.iterator(); itArels.hasNext();){
                  AcompRelatorioArel arel = (AcompRelatorioArel) itArels.next();
                 
                  /*if (!mapTpfaReferenciaRelatorio .containsKey(arel.getTipoFuncAcompTpfa().getLabelPosicaoTpfa() ) ){
                    mapTpfaReferenciaRelatorio .put(arel.getTipoFuncAcompTpfa().getLabelPosicaoTpfa(), new HashMap< Long ,AcompRelatorioArel>(numPeriodos) );
                  }*/
                  if (!mapTpfaReferenciaRelatorio .containsKey(arel.getTipoFuncAcompTpfa() ) ){
                    mapTpfaReferenciaRelatorio .put(arel.getTipoFuncAcompTpfa(), new HashMap< Long ,AcompRelatorioArel>(numPeriodos) );
                  }
                 
                  Map mapTpfaRef = (Map) mapTpfaReferenciaRelatorio.get(arel.getTipoFuncAcompTpfa());
                   
                  if (mapTpfaRef!=null && !mapTpfaRef.containsKey(arel.getAcompReferenciaItemAri().getAcompReferenciaAref() ) ){
                    mapTpfaRef.put(arel.getAcompReferenciaItemAri().getAcompReferenciaAref(), arel);
          }
                 
                }
            }
            return mapTpfaReferenciaRelatorio ;
View Full Code Here

            //Pega os Arels do Ari selecionado
            List relatorios = getAcompRelatorioArelOrderByFuncaoAcomp(acompAri, tpfaOrdenadosPorEstrutura);
            Iterator itRelatorios = relatorios.iterator();
           
            while(itRelatorios.hasNext()){                       
              AcompRelatorioArel relatorio = (AcompRelatorioArel) itRelatorios.next();                   
             
              ItemEstUsutpfuacIettutfa itemEstUsu = null;
             
              if (relatorio.getTipoFuncAcompTpfa() != null){
               
                try{
                itemEstUsu
                    = itemEstUsuDao.buscar(itemEstrutura.getCodIett(), relatorio.getTipoFuncAcompTpfa().getCodTpfa());
                }
                catch(ECARException e){
                  Logger.getLogger(this.getClass()).error(e);
          //        e.printStackTrace();
                }
                //Verifica se a permiss�o � de grupo ou usu�rio                            
                if (itemEstUsu != null && itemEstUsu.getUsuarioUsu() != null) {
                  usuarioLogadoEmiteParecer = itemEstUsu.getUsuarioUsu().getCodUsu().equals(usuario.getCodUsu());
                 
                  if (usuarioLogadoEmiteParecer && !"S".equals(relatorio.getIndLiberadoArel())){
                    usuarioLogadoEmiteParecerNaoLiberado = true;
                    break;
                  }
                }
                else if (itemEstUsu != null && itemEstUsu.getSisAtributoSatb() != null) {
                  if (itemEstUsu.getSisAtributoSatb().getUsuarioAtributoUsuas() != null) {
                    Iterator itUsuarios = itemEstUsu.getSisAtributoSatb().getUsuarioAtributoUsuas().iterator();
                    while (itUsuarios.hasNext()) {
                      UsuarioAtributoUsua usuarioAtributoUsua = (UsuarioAtributoUsua) itUsuarios.next();
                      if (usuarioAtributoUsua.getUsuarioUsu().getCodUsu().equals(usuario.getCodUsu())){
                       
                        if(!"S".equals(relatorio.getIndLiberadoArel())){
                            usuarioLogadoEmiteParecerNaoLiberado = true;
                            break;
                            }
                                         
                      }
View Full Code Here

            //Pega os Arels do Ari selecionado
            List relatorios = getAcompRelatorioArelOrderByFuncaoAcomp(acompAri, tpfaOrdenadosPorEstrutura);
            Iterator itRelatorios = relatorios.iterator();
           
            while(itRelatorios.hasNext()){                       
              AcompRelatorioArel relatorio = (AcompRelatorioArel) itRelatorios.next();                   
             
              ItemEstUsutpfuacIettutfa itemEstUsu;
             
             
              if (relatorio.getTipoFuncAcompTpfa() != null){
                itemEstUsu
                    = itemEstUsuDao.buscar(itemEstrutura.getCodIett(), relatorio.getTipoFuncAcompTpfa().getCodTpfa());
             
              
              //Verifica se a permiss�o � de grupo ou usu�rio                            
              if (itemEstUsu.getUsuarioUsu() != null) {
                usuarioLogadoEmiteParecer = itemEstUsu.getUsuarioUsu().getCodUsu().equals(usuario.getCodUsu());
View Full Code Here

        public List ordenaRelatorioFuncaoAcompByDataLimite(List arels) throws ECARException{

          List arelsOrdenados = new ArrayList();
         
          if (arels != null && arels.size() > 0){
        AcompRelatorioArel relatorioOrdenar = (AcompRelatorioArel) arels.get(0);
        Set setDatasLimites = relatorioOrdenar.getAcompReferenciaItemAri().getAcompRefItemLimitesArlis();
        List listaDatasLimites = new ArrayList(setDatasLimites);
       
        //Ordena os AcompRefItemLimitesArli por datas limites.
        Collections.sort(listaDatasLimites,
          new Comparator(){
              public int compare(Object o1, Object o2) {
                  AcompRefItemLimitesArli a1 = (AcompRefItemLimitesArli) o1;
                  AcompRefItemLimitesArli a2 = (AcompRefItemLimitesArli) o2;
                  if (a1.getDataLimiteArli()!=null && a2.getDataLimiteArli()!=null)
                    return a1.getDataLimiteArli().compareTo(a2.getDataLimiteArli());
                  else
                    return -1;
              }
          }
        );
           
        Iterator itAcompRefItemLimitesOrdenados = listaDatasLimites.iterator();
        AcompRefItemLimitesArli acompRef = null;

        //Compara com os Arels passados como par�metro com a lista ordenada de AcompRefItemLimitesArli e adiciona os Arels ordenados
        //na lista de retorno.
        while (itAcompRefItemLimitesOrdenados.hasNext()){
          acompRef = (AcompRefItemLimitesArli) itAcompRefItemLimitesOrdenados.next();
          Iterator itRelatorios = arels.iterator();
         
          while (itRelatorios.hasNext()){
            AcompRelatorioArel relatorio = (AcompRelatorioArel) itRelatorios.next();
           
            if (relatorio.getTipoFuncAcompTpfa().equals(acompRef.getTipoFuncAcompTpfa())){
              arelsOrdenados.add(relatorio);
            }
          }
        }
      }     
View Full Code Here

TOP

Related Classes of ecar.pojo.AcompRelatorioArel

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.