Package ecar.pojo

Examples of ecar.pojo.AcompReferenciaItemAri


     * @throws ECARException
     */
    public boolean verificarAcompanhamentoEmEdicao(AcompReferenciaAref aref) throws ECARException{
      if(aref.getAcompReferenciaItemAris() != null && !aref.getAcompReferenciaItemAris().isEmpty()){
        for(Iterator it = aref.getAcompReferenciaItemAris().iterator(); it.hasNext();){
          AcompReferenciaItemAri ari = (AcompReferenciaItemAri) it.next();
          //Se existir algum ari em edi��o, retorna true (o acompanhamento est� em edi��o (pode ser liberado).
          if(ari.getStatusRelatorioSrl() == null || (ari.getStatusRelatorioSrl() != null && ari.getStatusRelatorioSrl().getCodSrl().intValue() == STATUS_EM_EDICAO)){
            return true;
          }
        }
         
      }
View Full Code Here


   
    if(listaAcompRef.size() <= 0){
      // N�o existe nenhum AcompReferencia para o m�s e ano
      return false;
    }else{
      AcompReferenciaItemAri acompRefItem = new AcompReferenciaItemAri();
     
      // Buscar o acompRefItem que estou utilizando
      if(acompReferencia.getCodAref() != null){
        acompRefItem = this.getAcompReferenciaItemByItemEstruturaIett(acompReferencia, item);
      }else{
View Full Code Here

     * @return
     * @throws ECARException
     */
    public boolean isAcompanhamentoAlterado(AcompReferenciaAref acompanhamento, ItemEstruturaIett item) throws ECARException{
        try{
            AcompReferenciaItemAri acompReferenciaItem = getAcompReferenciaItemByItemEstruturaIett(acompanhamento, item);
           
            if(acompReferenciaItem != null){
              StringBuilder query = new StringBuilder("select ARF from AcompRealFisicoArf as ARF")
                        .append(" where ARF.qtdRealizadaArf is not null ")
                        .append(" and ARF.itemEstruturaIett.codIett = :codIett")
                        .append(" and ARF.itemEstruturaIett.indAtivoIett = 'S'")
                        .append(" and ARF.mesArf = :mes")
                        .append(" and ARF.anoArf = :ano");
             
              Query q = this.getSession().createQuery(query.toString());
             
              q.setLong("codIett", acompReferenciaItem.getItemEstruturaIett().getCodIett().longValue());
              q.setLong("mes", Long.valueOf(acompReferenciaItem.getAcompReferenciaAref().getMesAref()).longValue());
              q.setLong("ano", Long.valueOf(acompReferenciaItem.getAcompReferenciaAref().getAnoAref()).longValue());
   
              List listArf = q.list();
             
              if(listArf != null && listArf.size() > 0) {
                    return true;
              }
              else {
                    if(this.session.createFilter(acompReferenciaItem.getAcompRelatorioArels(), "where this.dataUltManutArel is not null").list().size() > 0) {
                        return true;
                    }
              }
            }

View Full Code Here

                List listaAris = queryItens.list();
                Iterator itListaAris = listaAris.iterator();
               
              if(usuario == null) { //utilizado para o grafico.jsp - teste de performance
                    while(itListaAris.hasNext()) {
                      AcompReferenciaItemAri ari = (AcompReferenciaItemAri)itListaAris.next();
                       listaItens.add(ari.getItemEstruturaIett());
                    }
              } else {
                  while(itListaAris.hasNext()) {
                    AcompReferenciaItemAri ari = (AcompReferenciaItemAri)itListaAris.next();
                    if(validaPermissao.permissaoLeituraAcompanhamento(ari, usuario, gruposUsuario)) {
                      listaItens.add(ari.getItemEstruturaIett());
                    }
                  }
                }

                List<ItemEstruturaIett> itensGeralComArvore = itemDao.getArvoreItens(listaItens, null);
View Full Code Here

            List listaAris = queryAri.list();
           
            Map map = new HashMap();
           
            for (Iterator itAris = listaAris.iterator(); itAris.hasNext();) {
                AcompReferenciaItemAri ari =  (AcompReferenciaItemAri) itAris.next();
                map.put(ari.getAcompReferenciaAref(), ari);
           
           
            return map;
           
        } catch(HibernateException e){
View Full Code Here


            List listaTemp = new ArrayList();
            List listaAri = new ArrayList();
            for (Iterator it = lista.iterator(); it.hasNext();) {
              AcompReferenciaItemAri ari = (AcompReferenciaItemAri) it.next();
             
              if(!listaTemp.contains(ari.getItemEstruturaIett().getCodIett())){
                listaTemp.add(ari.getItemEstruturaIett().getCodIett());
                listaAri.add(ari);
              }
            }

            lista.clear();
            lista.addAll(listaAri);
           
            Collections.sort(lista,
                  new Comparator() {
                  ItemEstruturaDao iettDaoSort = new ItemEstruturaDao(null);
                  public int compare(Object o1, Object o2) {
                      AcompReferenciaItemAri ari1 = (AcompReferenciaItemAri) o1;
                      AcompReferenciaItemAri ari2 = (AcompReferenciaItemAri) o2;
                     
                      ItemEstruturaIett item1 = ari1.getItemEstruturaIett();
                      ItemEstruturaIett item2 = ari2.getItemEstruturaIett();             
                    if(iettDaoSort.getAscendenteMaximo(item1).equals(iettDaoSort.getAscendenteMaximo(item2))){                                     
                      if(item1.getNivelIett().intValue() == item2.getNivelIett().intValue()){                   
                          return item1.getNomeIett().compareToIgnoreCase(item2.getNomeIett())
                      } else{                   
                          return item1.getNivelIett().intValue() - item2.getNivelIett().intValue();
View Full Code Here

            lista.addAll(queryAri.list());
           
            List listaTemp = new ArrayList();
            List listaAri = new ArrayList();
            for (Iterator it = lista.iterator(); it.hasNext();) {
              AcompReferenciaItemAri ari = (AcompReferenciaItemAri) it.next();
             
              if(!listaTemp.contains(ari.getItemEstruturaIett().getCodIett())){
                //Verifica se possui algum ponto critico
                //Caso n�o exista ele devolve a lista vazia pra instru��o que acionou o m�todo
                if(ari.getItemEstruturaIett().getPontoCriticoPtcs().size() > 0) {
                  listaTemp.add(ari.getItemEstruturaIett().getCodIett());
                  listaAri.add(ari);
                }

              }
            }

            lista.clear();
            lista.addAll(listaAri);
           
            Collections.sort(lista,
                  new Comparator() {
                  ItemEstruturaDao iettDaoSort = new ItemEstruturaDao(null);
                  public int compare(Object o1, Object o2) {
                      AcompReferenciaItemAri ari1 = (AcompReferenciaItemAri) o1;
                      AcompReferenciaItemAri ari2 = (AcompReferenciaItemAri) o2;
                     
                      ItemEstruturaIett item1 = ari1.getItemEstruturaIett();
                      ItemEstruturaIett item2 = ari2.getItemEstruturaIett();             
                    if(iettDaoSort.getAscendenteMaximo(item1).equals(iettDaoSort.getAscendenteMaximo(item2))){                                     
                      if(item1.getNivelIett().intValue() == item2.getNivelIett().intValue()){                   
                          return item1.getNomeIett().compareToIgnoreCase(item2.getNomeIett())
                      } else{                   
                          return item1.getNivelIett().intValue() - item2.getNivelIett().intValue();
View Full Code Here

     */
    public AcompReferenciaItemAri getAriByIett(Collection aris, ItemEstruturaIett iett) throws ECARException {
       
        try{       
          for (Iterator it = aris.iterator(); it.hasNext();) {
        AcompReferenciaItemAri ari = (AcompReferenciaItemAri) it.next();            
              if(ari.getItemEstruturaIett().equals(iett)) {
                return ari;
              }
            }
            return null;
        } catch(Exception e){
View Full Code Here

            if(!map.containsKey(acompReferencia)){
              //N�o foi solicitado acompanhamento
              coresPosicoes.add("N/A");
            }
            else {
              AcompReferenciaItemAri ari = (AcompReferenciaItemAri) map.get(acompReferencia);                   
             
              //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(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"))) {
View Full Code Here

          if(!map.containsKey(acompReferencia)){
            //N�o foi solicitado acompanhamento
            //coresPosicoes.add(Cor.NAO_ACOMPANHADO);
          }
          else {
            AcompReferenciaItemAri ari = (AcompReferenciaItemAri) map.get(acompReferencia);                   
           
            //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)) {
View Full Code Here

TOP

Related Classes of ecar.pojo.AcompReferenciaItemAri

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.