Package ecar.pojo

Examples of ecar.pojo.ExercicioExe


    final ItemEstruturaPrevisaoDao prevDao = new ItemEstruturaPrevisaoDao(request);

    ArrayList<BigDecimal> previsao = new ArrayList<BigDecimal>();
    BigDecimal previsaoItem = null;
    for (Iterator iterExer = listaExercicios.iterator(); iterExer.hasNext();) {
      ExercicioExe elementoExerc = (ExercicioExe) iterExer.next();
      previsaoItem =  prevDao.previsaoItemAcao( itemEstrut.getCodIett(), elementoExerc.getCodExe() ) ;
      previsao.add(previsaoItem);
    }
    return previsao.toArray(new BigDecimal[previsao.size()]);

  }
View Full Code Here


    String strAnoInicio = Integer.valueOf(anoInicio).toString();
    String strAnoFim = Integer.valueOf(anoFimProjecao).toString();


    ExercicioExe exercicioInicial = acompReferenciaDao.getExercicio(strAnoInicio, strMesInicio);
    ExercicioExe exercicioFinal = acompReferenciaDao.getExercicio(strAnoFim, strMesFim);
   
    List exerciciosAnteriores = new ArrayList();
    List exerciciosPosteriores = new ArrayList();
    if(exercicioFinal!=null)
      exerciciosAnteriores = exercicioDao.getExerciciosAnteriores(exercicioFinal);
View Full Code Here

     * @return
     * @throws ECARException
     */
    public List getFontesRecursosByExercicio(Long itemEstrutura, Long exercicio) throws ECARException{
        ItemEstruturaIett item = (ItemEstruturaIett) this.buscar(ItemEstruturaIett.class, itemEstrutura);
        ExercicioExe exercicioExe = (ExercicioExe) this.buscar(ExercicioExe.class, exercicio);
        return this.getFontesRecursosByExercicio( item, exercicioExe);
    }   
View Full Code Here

      ExercicioDao exercicioDao = new ExercicioDao(request);
    Collection listaExercicios = exercicioDao.getExerciciosValidos(itemEstruturaFonteRecurso.getItemEstruturaIett().getCodIett());
    Iterator itExerc = listaExercicios.iterator();
   
    while (itExerc.hasNext()) {
      ExercicioExe exercicio = (ExercicioExe) itExerc.next();
     
      if (!"".equals(Pagina.getParamStr(request, "recursoRec" + exercicio.getCodExe().toString()))) {
        EfItemEstPrevisaoEfiep recurso = new EfItemEstPrevisaoEfiep();
       
        recurso.setExercicioExe(exercicio);
        recurso.setFonteRecursoFonr(itemEstruturaFonteRecurso.getFonteRecursoFonr());
        recurso.setItemEstruturaIett(itemEstruturaFonteRecurso.getItemEstruturaIett());
        recurso.setRecursoRec((RecursoRec) super.buscar(RecursoRec.class, Long.valueOf(Pagina.getParamStr(request, "recursoRec" + exercicio.getCodExe().toString()))));
        recurso.setValorAprovadoEfiep(new BigDecimal(Double.valueOf(Util.formataNumero(Pagina.getParamStr(request, "valorAprovadoEfiep" + exercicio.getCodExe().toString()))).doubleValue()));
        recurso.setValorRevisadoEfiep(new BigDecimal(Double.valueOf(Util.formataNumero(Pagina.getParamStr(request, "valorRevisadoEfiep" + exercicio.getCodExe().toString()))).doubleValue()));
       
            recurso.setIndAtivoEfiep("S");
          recurso.setDataInclusaoEfiep(Data.getDataAtual());

          /*
 
View Full Code Here

      nomeCombo = "recursoRec" + i;
      //System.out.println(nomeCombo +" numeroRecursos: "+ numRecursos);
      Iterator itExerc = listaExercicios.iterator();
     
      while (itExerc.hasNext()) {
        ExercicioExe exercicio = (ExercicioExe) itExerc.next();
       
        nomeCampoVlRev = "valorRevisadoEfiep" + i + "e" + exercicio.getCodExe().toString();
        nomeCampoVlAprov = "valorAprovadoEfiep" + i + "e" + exercicio.getCodExe().toString();
        nomeCampoAtivo = "ativo" + i + "e" + exercicio.getCodExe().toString();
       
        if (!"".equals(Pagina.getParamStr(request, nomeCampoVlRev)) ||
              !"".equals(Pagina.getParamStr(request, nomeCampoVlAprov))) {
          EfItemEstPrevisaoEfiep recurso = new EfItemEstPrevisaoEfiep();
View Full Code Here

        }
       
       
        Iterator itExe = listaExercicios.iterator();
        while(itExe.hasNext()){
          ExercicioExe exercicio = (ExercicioExe) itExe.next();
          String exercicioDesc = exercicio.getDescricaoExe();
          String exercicioDescTotal = exercicioDesc;
          double totExeAprovado = 0, totExeRevisado = 0;
          double[] totExeValor = new double[6];
         
          /*Inicializar os valores...*/
 
View Full Code Here

            //deve ter valores previstos, se n�o tiver gerar� um null pointer
            if("S".equals(indicador.getItemEstrtIndResulIettr().getIndProjecaoIettr()) && totalRealizado > 0 &&
                indicador.getItemEstrtIndResulIettr().getItemEstrutFisicoIettfs().size() > 0){
             
              double resultado = acompReferenciaItemDao.calculoProjecao(indicador.getItemEstrtIndResulIettr(), itemAri);
              ExercicioExe exercicioPrevisto = itemEstrtIndResulDao.getMaiorExercicioIndicador(indicador.getItemEstrtIndResulIettr());
              double qtdePrevista = itemEstrtIndResulDao.getQtdPrevistoExercicio(indicador.getItemEstrtIndResulIettr(), exercicioPrevisto);
             
              Mensagem msg = new Mensagem(this.request.getSession().getServletContext());

              if(resultado == qtdePrevista){
View Full Code Here

        // Inserindo os t�tulos Local, exerc�cios e Total por Local 
        responseHTML.append( "  <tr> ");
        responseHTML.append( "    <td width=" + larguraLocal + " style='font-size: 14px;color: #003366;font-weight: bold;'  align='center' >Local</td> ");         
        for (Iterator iterator = listaExercicios.iterator(); iterator.hasNext();) {
          ExercicioExe exe = (ExercicioExe) iterator.next();
          responseHTML.append( "  <td width=" + larguraCampo + " style=\"font-size: 14px;color: #003366;font-weight: bold;\"  align=\"center\" > ");
          responseHTML.append(exe.getDescricaoExe().toUpperCase() );
          responseHTML.append( "  </td> ");
       
        responseHTML.append( "    <td width=" + larguraTotal + " style='font-size: 14px;color: #003366;font-weight: bold;'  align='center' >Total por Local</td> ");
        responseHTML.append( "  <tr> ");

        // Inserindo a caixa de sele��o
        Set subgrupo = localGrupoItem.getLocalGrupoHierarquiaLgphsByCodLgpPai();
        if ( subgrupo!=null && !subgrupo.isEmpty()){
          responseHTML.append( "  <tr> ");
          responseHTML.append( "    <td width=" + larguraLocal + " style='font-size: 12px;color: #003366;'  align='left' > ");
          responseHTML.append( "    <table width='90%'> ");
          responseHTML.append( "      <tr>" );
          responseHTML.append( "        <td width='25%' align='right'>" );
          responseHTML.append( "          <img src='../../images/icon_seta_ident.gif'/>" );
          responseHTML.append( "        </td>" );
          responseHTML.append( "        <td width='75%'>" );
          responseHTML.append( "          <select name='subgrupo' id='subgrupo' onchange='carregarlocal();'  > ");
         
          int indice = 1;
          responseHTML.append( "            <option value=" + localGrupoItem.getCodLgp() + " >Selecione</option> ");
          for (Iterator itGrupo = subgrupo.iterator(); itGrupo.hasNext();) {
            LocalGrupoLgp grupo = (LocalGrupoLgp) itGrupo.next();
            if(indice == itemSelecionado){
              responseHTML.append( "        <option value='" + grupo.getCodLgp() + "' selected='true'>" + grupo.getIdentificacaoLgp() + "</option>" );
            }
            else {
              responseHTML.append( "        <option value='" + grupo.getCodLgp() + "' >" + grupo.getIdentificacaoLgp() + "</option>" );
            }
            indice++;
          }
          responseHTML.append( "          </select> ");
          responseHTML.append( "          </td>" );
          responseHTML.append( "        </tr>" );
          responseHTML.append( "      </table>" );
         
          responseHTML.append( "    </td> ");         
          responseHTML.append( "     <td colspan=" + (cont +1) + "valign='top' height='25px'> &nbsp; </td> ");
          responseHTML.append( "  </tr> ");
        }
   
       
        // Inserindo o conte�do da tabela
        String strTdSeta = null;
        String strTdCampo = null;
        String strTdTotalPorLocal = null;
       
        Double totalLocal = 0.0;
        Double totalExercicio[] = new Double [listaExercicios.size()];
        Double totalGeral = 0.0;
        int i = 0;
        for(i = 0; i < totalExercicio.length; i++){
          totalExercicio[i] = 0.0;
        }
       
       
        // Para cada local
        for (Iterator iter = localList.iterator(); iter.hasNext();) {
          LocalItemLit local = (LocalItemLit) iter.next();
         
          // Criar uma c�lula com a seta e o nome do local
          strTdSeta = new String (
                "<td align='rigth' width='" + larguraLocal + "' height='25px' valign='top'>" +
                "  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
                "  <table width='100%'> " +
                "    <tr>" +
                "      <td width='25%' align='right'>" +
                "        <img src='../../images/icon_seta_ident.gif'/>" +
                "      </td>" +
                "      <td width='75%'>" +
                "        " + local.getIdentificacaoLit() +
                "        &nbsp;" +
                "      </td>" +
                "    </tr>" +
                "  </table>" +
                "</td>"
          );
          responseHTML.append("<tr>");
          responseHTML.append(strTdSeta);
         
          totalLocal = 0.0;
          i = 0;
          // Para cada exerc�cio
          for (Iterator iterator = listaExercicios.iterator(); iterator.hasNext();) {
            ExercicioExe exe = (ExercicioExe) iterator.next();
            ItemEstrtIndResulLocalIettirl itemEstrtIndResulLocalIettirl = dao.getQtdePrevistaByLocal( codIettir, exe.getCodExe(), local.getCodLit() );
   
            totalLocal += itemEstrtIndResulLocalIettirl.getQtdPrevistaIettirl().doubleValue();
            totalExercicio [i] += itemEstrtIndResulLocalIettirl.getQtdPrevistaIettirl().doubleValue();
            i++;
           
            //if (local.getCodLit().intValue() == 418){
             
             
            // Criar uma c�lula contendo um campo e uma imagem de informa��o.
            strTdCampo = new String (
                  "<td width=\"" + larguraCampo + "\" align=\"center\" >" +
                  "  <input " +
                  "    type=\"text\"" +
                  "    size=\"" + (larguraCaixaTexto - 3) + "\"" +
                  "    onblur=\"" +
                  "      copiarExercicio('" + local.getCodLit().toString() + "'); " +
                  "      calcularTotalLocal('" + local.getCodLit().toString() + "');" +
                  "      calcularTotalExercicio('"+exe.getCodExe().toString() + "');" +
                  "    \"" +
                  "    id=\"cmp|" + local.getCodLit().toString() + "|" + exe.getCodExe().toString() + "\"" +
                  "    name=\"cmp|" + local.getCodLit().toString() + "|" + exe.getCodExe().toString() + "\"" +
                  "    value=\"" + formatBrasil.format(itemEstrtIndResulLocalIettirl.getQtdPrevistaIettirl().doubleValue()) + "\"" +
                  "  />" +
                  "  " +
                  "  <label " +
                  "    id=\"label|" + local.getCodLit().toString() + "|" + exe.getCodExe().toString() + "\"" +
                  "     class=\"dica\" " +
                  "    onmouseover=\"" +
                  "      montaTooltipMouseOver(this,\'"+ exe.getCodExe().toString() "\',\'" + exe.getDescricaoExe() +"\',\'"+ local.getCodLit().toString() "\',\'" + local.getIdentificacaoLit() +"\');" +
                  "    \"" +
                  "    onmouseout=\"" +
                  "      montaTooltipMouseOut(\'"+ exe.getCodExe().toString() "\',\'" + local.getCodLit().toString() +"\');" +
                  "    \"" +
                  "  />" +
                  "    <img " +
                  "      src=\"" + request.getContextPath() + "/images/dica.png\" " +
                  "      align=\"absmiddle\" " +
                  "      border=\"0\" " +
                  "      onclick=\"" +
                  "        montaTooltipMouseClick(\'"+ exe.getCodExe().toString() "\',\'" + exe.getDescricaoExe() +"\',\'"+ local.getCodLit().toString() "\',\'" + local.getIdentificacaoLit() +"\');" +
                  "      \" " +
                  "    /> " +
                  "    " +
                  "    <span id=\"span|" + local.getCodLit().toString() + "|" + exe.getCodExe().toString() + "\" ></span>" +
                  "    " +
                  "  </label>" +
                  "</td>"
            );
            responseHTML.append(strTdCampo);
          }
         
          // Criar uma c�lula de total por local
          strTdTotalPorLocal = new String(
              "<td align=\"center\" width=\"" + larguraTotal + "\" >" +
              "  <input " +
              "    type=\"text\"" +
              "    size=\"12\"" +
              "    readonly=\"true\"" +
              "    id=\"cmp|" + local.getCodLit().toString() + "|total\"" +
              "    name=\"cmp|" + local.getCodLit().toString() + "|total\"" +
              "    value=\"" + formatBrasil.format(totalLocal) + "\"" +
              "       style=\"background-color:#FFF9DC;\"" +
              "  />" +
              "</td>"
          );
          responseHTML.append(strTdTotalPorLocal);
          responseHTML.append("</tr>");
         
          //}// if 418

        }

        responseHTML.append( "  <tr> ");
        responseHTML.append( "    <td width=" + larguraLocal + " style='font-size: 14px;color: #003366;font-weight: bold;'  align='center' >Total por Exerc�cio</td> ");   

        // Inserindo os totais por exerc�cio e o total geral
        i = 0;
        for (Iterator iterator = listaExercicios.iterator(); iterator.hasNext();) {
          ExercicioExe exe = (ExercicioExe) iterator.next();
          //responseHTML.append( "  <td width=" + larguraCampo + " align=\"center\"><input type=\"text\" style=\"background-color:#FFF9DC;\"  size=\"" + larguraCaixaTexto + "\" id=\"total"+exe.getCodExe().toString() +"\" name=\"total"+exe.getCodExe()+"\" value=" + formatBrasil.format(totalExercicio[i]) + " readonly=\"true\" /></td>");
          responseHTML.append( "  <td width=" + larguraCampo + " align=\"center\"><input type=\"text\" style=\"background-color:#FFF9DC;\"  size=\"" + larguraCaixaTexto + "\" id=\"qtdPrevistaIettf"+exe.getCodExe().toString() +"\" name=\"qtdPrevistaIettf"+exe.getCodExe()+"\" value=" + formatBrasil.format(totalExercicio[i]) + " readonly=\"true\" /></td>");
         
          totalGeral += totalExercicio[i];
          i++;
       
        responseHTML.append( "    <td widht=" + larguraTotal + " align='center'><input type=\"text\" style=\"background-color:#FFF9DC;\"    size='12'  id='totalGeral' style='background-color:#FFF9DC;' name='totalGeral' value='" + formatBrasil.format(totalGeral) + "' readonly='true' /></td> ");
View Full Code Here

    final ItemEstruturaPrevisaoDao prevDao = new ItemEstruturaPrevisaoDao(request);

    ArrayList<BigDecimal> previsao = new ArrayList<BigDecimal>();
    BigDecimal previsaoItem = null;
    for (Iterator iterExer = listaExercicios.iterator(); iterExer.hasNext();) {
      ExercicioExe elementoExerc = (ExercicioExe) iterExer.next();
      previsaoItem =  prevDao.previsaoItemAcao( itemEstrut.getCodIett(), elementoExerc.getCodExe() ) ;
      previsao.add(previsaoItem);
    }
    return previsao.toArray(new BigDecimal[previsao.size()]);

  }
View Full Code Here

      List qtdesPrevistas = new ArrayList();
     
      List exerciciosValidos = exercicioDao.listar(ExercicioExe.class, new String[]{"descricaoExe","desc"});
      Iterator itExe = exerciciosValidos.iterator();
      while(itExe.hasNext()){
        ExercicioExe exe = (ExercicioExe) itExe.next();
        if(exe.getDataInicialExe() != null && exe.getDataFinalExe() != null){
        int exeAnoIni = Data.getAno(exe.getDataInicialExe());
        int exeAnoFim = Data.getAno(exe.getDataFinalExe());
       
        //Verifica se o exerc�cio est� dentro do per�odo informado
        if(exeAnoIni >= Integer.parseInt(periodoIni) && exeAnoFim <= Integer.parseInt(periodoFim)){
         
          boolean possuiExercicioNaRevisao = false;
         
          //Procura valor do exerc�cio nas metas f�sicas de revis�o
          if(metaRevisao.getItemEstFisicoRevIettfrs() != null && metaRevisao.getItemEstFisicoRevIettfrs().size() > 0){
            Iterator itEstRev = metaRevisao.getItemEstFisicoRevIettfrs().iterator();
            while(itEstRev.hasNext()){
              ItemEstFisicoRevIettfr estRev = (ItemEstFisicoRevIettfr) itEstRev.next();
              if(exe.equals(estRev.getExercicioExe()) && "S".equals(estRev.getIndAtivoIettfr())){
                possuiExercicioNaRevisao = true;
                IndResulExercicioBean indResulExeBean = new IndResulExercicioBean();
                indResulExeBean.setCodExe(estRev.getExercicioExe().getCodExe());
                indResulExeBean.setValor(estRev.getQtdPrevistaIettfr());
               
                qtdesPrevistas.add(indResulExeBean);
                break;
              }
            }
          }
         
          if(!possuiExercicioNaRevisao){
            //Procura valor do exerc�cio nas metas f�sicas do item
            Iterator itEstItem = metaRevisao.getItemEstrtIndResulIettr().getItemEstrutFisicoIettfs().iterator();
            while(itEstItem.hasNext()){
              ItemEstrutFisicoIettf estItem = (ItemEstrutFisicoIettf) itEstItem.next();
              //Mantis 0010128 - Qtd prevista n�o � mais informado por exerc�cio
              /*
              if(exe.equals(estItem.getExercicioExe()) && "S".equals(estItem.getIndAtivoIettf())){
                IndResulExercicioBean indResulExeBean = new IndResulExercicioBean();
                indResulExeBean.setCodExe(estItem.getExercicioExe().getCodExe());
                indResulExeBean.setValor(estItem.getQtdPrevistaIettf());
               
                qtdesPrevistas.add(indResulExeBean);
                break;
              }
              */
            }
          }
         
        }//if validacao periodo exe
        } //if validacao exe
      } //while exe
     
      //Verificar na lista de totais as regras do indicador...
      String retorno = "0";
      String indAcumulavel = metaRevisao.getItemEstrtIndResulIettr().getIndAcumulavelIettr();
      String indValorFinal = metaRevisao.getItemEstrtIndResulIettr().getIndValorFinalIettr();
     
      /* =========== Verifica��o das regras de totaliza��o ============== */
        double total = 0;
       
        if ("S".equals(indAcumulavel)){
            Iterator it = qtdesPrevistas.iterator();
            while (it.hasNext()) {
              IndResulExercicioBean valor = (IndResulExercicioBean) it.next();
               total += valor.getValor().doubleValue();
            }
            retorno = Util.formataNumeroSemDecimal(total);
        }else{
         
          /*
           * Anota��o ref. Mantis 5016:
           * - Maior: obter o maior valor de ItemEstrutFisicoIettf
           * - �ltimo: obter valor do �ltimo exerc�cio informado de ItemEstrutFisicoIettf
           * - N�o se aplica: soma total ItemEstrutFisicoIettf
           */
         
          if("M".equals(indValorFinal)){ //Maior
                 Iterator it = qtdesPrevistas.iterator();
              double maior = 0;
              while (it.hasNext()) {
                IndResulExercicioBean valor = (IndResulExercicioBean) it.next();
                if(valor.getValor().doubleValue() > maior){
                  maior = valor.getValor().doubleValue();
                }
                total = maior;
              }
              retorno = Util.formataNumeroSemDecimal(total);
          }
          else if("U".equals(indValorFinal)){ //Ultimo
              double ultimo = 0;
            ExercicioExe ultimoExe = indResulDao.getMaiorExercicioIndicador(metaRevisao.getItemEstrtIndResulIettr());
           
                 Iterator it = qtdesPrevistas.iterator();
              while (it.hasNext()) {
                IndResulExercicioBean valor = (IndResulExercicioBean) it.next();
                if(valor.getCodExe().equals(ultimoExe.getCodExe())){
                  ultimo = valor.getValor().doubleValue();
                  break;
                }
              }
              retorno = Util.formataNumeroSemDecimal(ultimo);
View Full Code Here

TOP

Related Classes of ecar.pojo.ExercicioExe

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.