Package ecar.pojo

Examples of ecar.pojo.PontocriticoCorPtccor


   * @return PontocriticoCorPtccor
   * @throws ECARException
   */
  public PontocriticoCorPtccor buscar(Cor cor, PontoCriticoPtc ptc) throws ECARException {
   
    PontocriticoCorPtccor ptcCor = new PontocriticoCorPtccor();
    try{
      if(ptc.getCodPtc() != null){
        Query q = session.createQuery("from PontocriticoCorPtccor ptcCor where " +
             " ptcCor.id.codCor = :cor" +
             " and ptcCor.id.codPtc = :codPtc");
View Full Code Here


      s.append("          <td valign=\"middle\" colspan=\"2\" class=\"form_label\" align=\"center\">Nenhuma A��o</td>");
      s.append("          <td valign=\"middle\" class=\"form_label\" align=\"center\">&nbsp;</td>");
      s.append("        </tr>");
      s.append("        -->");
     
      PontocriticoCorPtccor ptcCor = null;
      ConfigMailCfgm configMailVencto = (ConfigMailCfgm) new ConfigMailCfgmDAO(request).buscar(ConfigMailCfgm.class, Dominios.CFG_MAIL_VENCIMENTO_LIMITE_PONTO_CRITICO);
      List setCores = new CorDao(request).listar(Cor.class, new String[]{"ordemCor","asc"});
      Cor cor = null;
      PontocriticoCorPtccorPK id = null;
      Iterator itCores = null;
      if (setCores != null)
        itCores = setCores.iterator();
     
      String imagePath = "";
      CorDao cDao = new CorDao(request);
     
      while (itCores.hasNext())
      {
        cor = (Cor) itCores.next();      
        id = new PontocriticoCorPtccorPK(pontoCritico.getCodPtc(), cor.getCodCor());
        ptcCor = (PontocriticoCorPtccor)new PontocriticoCorPtccorDAO(request).buscar(cor, pontoCritico);
       
        if(cor.getIndPontoCriticoCor().equals("S")){
          s.append("<tr>");
          s.append("<td valign=\"middle\"  class=\"form_label\" align=\"center\">");
          // Por Rog�rio (06/03/2007)
          // Modificada a forma de obten��o da imagem.
          // Referente ao Mantis #7442
          imagePath = cDao.getImagemPersonalizada(cor, null, null);
          if( imagePath != null ) {
            /* -- As tags do CSS "max-width" e "max-height" n�o funcionam no IE6 ou menor -- */
            s.append("<!--<img border=\"0\" src=\""+request.getContextPath()+"/DownloadFile?tipo=open&RemoteFile="+imagePath+"\" style=\"width: 23px; height: 23px;\" title=\""+cor.getSignificadoCor()+"\"> -->");
              s.append("<img border=\"0\" src=\""+request.getContextPath()+"/DownloadFile?tipo=open&RemoteFile="+imagePath+"\" title=\""+cor.getSignificadoCor()+"\">");
          } else {
            if( cor.getCodCor() != null ) {
              s.append("<img src=\"../../images/pc"+cor.getNomeCor()+"1.png\" title=\""+cor.getSignificadoCor()+"\">");
            }
          }
          s.append("</td>");
          s.append("<td valign=\"middle\" class=\"form_label\" align=\"center\">");
          String idInputCont = "";
          if(idInput != null && !idInput.equals(""))
            idInputCont = idInput + "i";
          s.append("  <input type=\"text\" name=\"ant_"+idInputCont+cor.getCodCor()+"\" id=\"ant_"+idInputCont+cor.getCodCor()+"\" value=\""+Pagina.trocaNull(ptcCor.getAntecedenciaPrimEmailPtccor())+"\" size=\"4\" "+disabled + " >");
          if ( !disabled.equals("disabled") && !disabledCampo.equals("disabled")) { 
            if(getIndice() != null && !getIndice().equals("")) {
              s.append("<img class=\"posicao\" title=\"Selecione a data\" src=\"../../images/icone_calendar.gif\" onclick=\"open_calendar('difDias', document.forms[1].ant_"+idInputCont+cor.getCodCor()+", document.forms[1].dataLimitePtc"+getIndice()+".value)\">");
            } else {
              s.append("<img class=\"posicao\" title=\"Selecione a data\" src=\"../../images/icone_calendar.gif\" onclick=\"open_calendar('difDias', document.forms[0].ant_"+cor.getCodCor()+", document.forms[0].dataLimitePtc.value)\">");             
            }
          }
          s.append("</td>");
          s.append("<td valign=\"middle\" class=\"form_label\" align=\"center\">");
          s.append("<input type=\"text\" name=\"freq_"+idInputCont+cor.getCodCor()+"\" id=\"freq_"+idInputCont+cor.getCodCor()+"\" value=\""+Pagina.trocaNull(ptcCor.getFrequenciaEnvioEmailPtccor())+"\" size=\"4\" " + disabled + ">");
          s.append("</td>");
          s.append("<td valign=\"middle\" class=\"form_label\" align=\"center\">");
          s.append("<input type=\"checkBox\" class=\"form_check_radio\" value=\"S\" name=\"ativo"+idInput+"["+cor.getCodCor()+"]\" id=\"ativo"+idInput+"["+cor.getCodCor()+"]\"");
//          if (!"N".equals(ptcCor.getIndAtivoEnvioEmailPtccor())) {
//            s.append(" checked");
View Full Code Here

   
    //percorre a tabela de cores
    if(pontoCriticoCorPtccores != null) {
      Iterator it = pontoCriticoCorPtccores.iterator();
      while(it.hasNext()) {
        PontocriticoCorPtccor pontocriticoCorPtccor = (PontocriticoCorPtccor) it.next();
       
        this.historicoCorPtcH = new HistoricoCorPtcH();
       
        //seta os dados para criar o historico
        if(pontocriticoCorPtccor.getCor().getIndPontoCriticoCor().equals("S")) {
          historicoCorPtcH.setHistoricoPtcH(historicoPtcH);
          historicoCorPtcH.setPontoCriticoPtc(pontocriticoCorPtccor.getPontoCriticoPtc());
          historicoCorPtcH.setCor(pontocriticoCorPtccor.getCor());
          historicoCorPtcH.setAntecedenciaPrimEmailPtccor(pontocriticoCorPtccor.getAntecedenciaPrimEmailPtccor());
          historicoCorPtcH.setFrequenciaEnvioEmailPtccor(pontocriticoCorPtccor.getFrequenciaEnvioEmailPtccor());
          historicoCorPtcH.setIndAtivoEnvioEmailPtccor(pontocriticoCorPtccor.getIndAtivoEnvioEmailPtccor());
         
          session.save(historicoCorPtcH);
        }
      }
    }   
View Full Code Here

          PontoCriticoPtc ptc = (PontoCriticoPtc)objetoNegocio;
         
          Set<PontocriticoCorPtccor> listaPtcCor = ptc.getPontoCriticoCorPtccores();
         
          for (Cor cor : listaCoresTotal) {
            PontocriticoCorPtccor ptcCor = identificarCorListaCorPontoCritico(cor,listaPtcCor);
           
            if (ptcCor != null && ptcCor.getIndAtivoEnvioEmailPtccor().equals(Dominios.SIM)){
              objetoNegocioStr.append (configuracao.getSeparadorArqTXT());
              objetoNegocioStr.append(ptcCor.getCor().getNomeCor());
              objetoNegocioStr.append (configuracao.getSeparadorArqTXT());
              objetoNegocioStr.append (ptcCor.getAntecedenciaPrimEmailPtccor());
              objetoNegocioStr.append (configuracao.getSeparadorArqTXT());
              objetoNegocioStr.append (ptcCor.getFrequenciaEnvioEmailPtccor());
              objetoNegocioStr.append (configuracao.getSeparadorArqTXT());
              objetoNegocioStr.append (ptcCor.getIndAtivoEnvioEmailPtccor());
            } else {
              objetoNegocioStr.append (configuracao.getSeparadorArqTXT());
              objetoNegocioStr.append(ConstantesECAR.HIFEN);
              objetoNegocioStr.append (configuracao.getSeparadorArqTXT());
              objetoNegocioStr.append (ConstantesECAR.HIFEN);
View Full Code Here

   * @param listaPtcCor
   * @return
   */
  private PontocriticoCorPtccor identificarCorListaCorPontoCritico(Cor cor, Set<PontocriticoCorPtccor> listaPtcCor) {
   
    PontocriticoCorPtccor corPtc = null;
   
    for (PontocriticoCorPtccor pontocriticoCorPtccor : listaPtcCor) {
      if (cor.equals(pontocriticoCorPtccor.getCor())){
        corPtc = pontocriticoCorPtccor;
        break;
View Full Code Here

      s.append("          </td>");
      s.append("          <td valign=\"middle\" colspan=\"2\" class=\"form_label\" align=\"center\">Nenhuma A��o</td>");
      s.append("          <td valign=\"middle\" class=\"form_label\" align=\"center\">&nbsp;</td>");
      s.append("        </tr>");
      s.append("        -->");
      PontocriticoCorPtccor ptcCor = null;
      // ConfigMailCfgm configMailVencto = (ConfigMailCfgm) new
      // ConfigMailCfgmDAO(getRequest()).buscar(ConfigMailCfgm.class,
      // Dominios.CFG_MAIL_VENCIMENTO_LIMITE_PONTO_CRITICO);
      // List<Cor> setCores = pontoCriticoPtc.getCores();
      Cor cor = null;
      // PontocriticoCorPtccorPK id = null;
      Iterator itCores = pontoCriticoPtc.getPontoCriticoCorPtccores().iterator();
      // if (setCores != null)
      String imagePath = "";
      CorDao cDao = new CorDao(getRequest());
      while (itCores.hasNext()) {
        ptcCor = (PontocriticoCorPtccor) itCores.next();
        cor = ptcCor.getCor();
        if (cor.getIndPontoCriticoCor().equals("S")) {
          s.append("<tr>");
          s.append("<td valign=\"middle\"  class=\"form_label\" align=\"center\">");
          imagePath = cDao.getImagemPersonalizada(cor, null, null);
          if (imagePath != null) {
               String hashNomeArquivo = null;
               UsuarioUsu usuarioImagem = null;
              
               String pathRaiz = new ecar.dao.ConfiguracaoDao(request).getConfiguracao().getRaizUpload();
               imagePath = imagePath.substring(pathRaiz.length());
           
               hashNomeArquivo = Util.calcularHashNomeArquivo(pathRaiz, imagePath);
            usuarioImagem = ((ecar.login.SegurancaECAR)request.getSession().getAttribute("seguranca")).getUsuario()
            Util.adicionarMapArquivosAtuaisUsuarios(usuarioImagem, hashNomeArquivo, pathRaiz, imagePath);              
           
            /*
             * -- As tags do CSS "max-width" e "max-height" n�o
             * funcionam no IE6 ou menor --
             */
            s.append("<img border=\"0\" src=\"" + getRequest().getContextPath() + "/DownloadFile?tipo=open&RemoteFile=" + hashNomeArquivo + "\" title=\""
                    + cor.getSignificadoCor() + "\">");
          }
          else {
            if (cor.getCodCor() != null) {
              s.append("<img src=\"../../images/pc" + cor.getNomeCor() + "1.png\" title=\"" + cor.getSignificadoCor() + "\">");
            }
          }
          s.append("</td>");
          s.append("<td valign=\"middle\" class=\"form_label\" align=\"center\">");
          s.append("  <input type=\"text\" name=\"ant_" + cor.getCodCor() + "\" id=\"ant_" + cor.getCodCor() + "\" value=\""
                  + Pagina.trocaNull(ptcCor.getAntecedenciaPrimEmailPtccor()) + "\" size=\"4\" " + (getDesabilitar() ? "disabled" : "") + " >");
          if (!getDesabilitar()) {
            s
                    .append("<img class=\"posicao\" title=\"Selecione a data\" src=\"../../images/icone_calendar.gif\" onclick=\"open_calendar('difDias', document.forms[0].ant_"
                            + cor.getCodCor() + ", document.forms[0].dataLimitePtc.value)\">");
          }
          s.append("</td>");
          s.append("<td valign=\"middle\" class=\"form_label\" align=\"center\">");
          s.append("<input type=\"text\" name=\"freq_" + cor.getCodCor() + "\" id=\"freq_" + cor.getCodCor() + "\" value=\""
                  + Pagina.trocaNull(ptcCor.getFrequenciaEnvioEmailPtccor()) + "\" size=\"4\" " + (getDesabilitar() ? "disabled" : "") + ">");
          s.append("</td>");
          s.append("<td valign=\"middle\" class=\"form_label\" align=\"center\">");
          s.append("<input type=\"checkBox\" class=\"form_check_radio\" value=\"S\" name=\"ativo_" + cor.getCodCor() + "\" id=\"ativo_"
                  + cor.getCodCor() + "\"");
//          if (!"N".equals(ptcCor.getIndAtivoEnvioEmailPtccor())) {
View Full Code Here

      s.append("          <td valign=\"middle\" colspan=\"2\" class=\"form_label\" align=\"center\">Nenhuma A��o</td>");
      s.append("          <td valign=\"middle\" class=\"form_label\" align=\"center\">&nbsp;</td>");
      s.append("        </tr>");
      s.append("        -->");
     
      PontocriticoCorPtccor ptcCor = null;
      ConfigMailCfgm configMailVencto = (ConfigMailCfgm) new ConfigMailCfgmDAO(getRequest()).buscar(ConfigMailCfgm.class, Dominios.CFG_MAIL_VENCIMENTO_LIMITE_PONTO_CRITICO);
      List setCores = new CorDao(getRequest()).listar(Cor.class, new String[]{"ordemCor","asc"});
      Cor cor = null;
      PontocriticoCorPtccorPK id = null;
      Iterator itCores = null;
      if (setCores != null)
        itCores = setCores.iterator();
     
      String imagePath = "";
      CorDao cDao = new CorDao(getRequest());
     
      while (itCores.hasNext())
      {
        cor = (Cor) itCores.next();      
        id = new PontocriticoCorPtccorPK(getPontoCriticoPtc().getCodPtc(), cor.getCodCor());
        ptcCor = (PontocriticoCorPtccor)new PontocriticoCorPtccorDAO(getRequest()).buscar(cor, getPontoCriticoPtc());
       
        if(cor.getIndPontoCriticoCor().equals("S")){
          s.append("<tr>");
          s.append("<td valign=\"middle\"  class=\"form_label\" align=\"center\">");
          // Por Rog�rio (06/03/2007)
          // Modificada a forma de obten��o da imagem.
          // Referente ao Mantis #7442
          imagePath = cDao.getImagemPersonalizada(cor, null, null);
          if( imagePath != null ) {
           
               String hashNomeArquivo = null;
               UsuarioUsu usuarioImagem = null;
              
               String pathRaiz = new ecar.dao.ConfiguracaoDao(request).getConfiguracao().getRaizUpload();
               imagePath = imagePath.substring(pathRaiz.length());
           
               hashNomeArquivo = Util.calcularHashNomeArquivo(pathRaiz, imagePath);
            usuarioImagem = ((ecar.login.SegurancaECAR)request.getSession().getAttribute("seguranca")).getUsuario()
            Util.adicionarMapArquivosAtuaisUsuarios(usuarioImagem, hashNomeArquivo, pathRaiz, imagePath);
           
            /* -- As tags do CSS "max-width" e "max-height" n�o funcionam no IE6 ou menor -- */
              s.append("<img border=\"0\" src=\""+getRequest().getContextPath()+"/DownloadFile?tipo=open&RemoteFile="+hashNomeArquivo+"\" title=\""+cor.getSignificadoCor()+"\">");
          } else {
            if( cor.getCodCor() != null ) {
              s.append("<img src=\"../../images/pc"+cor.getNomeCor()+"1.png\" title=\""+cor.getSignificadoCor()+"\">");
            }
          }
          s.append("</td>");
          s.append("<td valign=\"middle\" class=\"form_label\" align=\"center\">");
         
          s.append("  <input type=\"text\" onkeypress=\"javascript:return(digitaNumero(this, event));\" maxlength=\"5\" name=\"ant_"+cor.getCodCor()+"\" id=\"ant_"+cor.getCodCor()+"\" value=\""+Pagina.trocaNull(ptcCor.getAntecedenciaPrimEmailPtccor())+"\" size=\"4\" "+ (getBloquearCampo() ? "disabled":"") + " >");
          if ( !getBloquearCampo()) { 
            //s.append("<img class=\"posicao\" title=\"Selecione a data\" src=\"../../images/icone_calendar.gif\" onclick=\"alert ('teste');open_calendar('difDias', document.forms[0].ant_"+cor.getCodCor()+", document.forms[0].dataLimitePtc.value)\">");             
            s.append("<img class=\"posicao\" title=\"Selecione a data\" src=\"../../images/icone_calendar.gif\" onclick=\"javascript:return(validarCampo('difDias',document.forms[0].ant_"+cor.getCodCor()+", document.forms[0].ativo_"+cor.getCodCor()+"));\">");
          }
          s.append("</td>");
          s.append("<td valign=\"middle\" class=\"form_label\" align=\"center\">");
          s.append("<input type=\"text\" onkeypress=\"javascript:return(digitaNumero(this, event));\" maxlength=\"5\" name=\"freq_"+cor.getCodCor()+"\" id=\"freq_"+cor.getCodCor()+"\" value=\""+Pagina.trocaNull(ptcCor.getFrequenciaEnvioEmailPtccor())+"\" size=\"4\" " + (getBloquearCampo() ? "disabled":"") + ">");
          s.append("</td>");
          s.append("<td valign=\"middle\" class=\"form_label\" align=\"center\">");
          s.append("<input type=\"checkBox\" class=\"form_check_radio\" value=\"S\" name=\"ativo_"+cor.getCodCor()+"\" id=\"ativo_"+cor.getCodCor()+"\"   onclick=\"validaPontoCritico("+cor.getCodCor()+");\"  ");

          if (!"N".equals(ptcCor.getIndAtivoEnvioEmailPtccor()) && getNovoPontoCritico() == false) {
            s.append(" checked");
          }

          s.append(" " + (getBloquearCampo() ? "disabled=\"true\"":"") + ">");
          s.append("</td>");
View Full Code Here

            itPtcCor = listPtcCor.iterator();
          boolean encontrouLimite = false;
          while(( itPtcCor != null && itPtcCor.hasNext()) && (!encontrouLimite))
          { 
           
            PontocriticoCorPtccor ptcCor = (PontocriticoCorPtccor) itPtcCor.next();       
           
            // Caso a antecedencia seja nula, define-se como 0 (zero)
            if (ptcCor.getAntecedenciaPrimEmailPtccor() == null)
              diasAntecedencia = 0;
            else
              diasAntecedencia = ptcCor.getAntecedenciaPrimEmailPtccor().intValue();
 
            // Caso a frequencia seja nula, define-se como 0 (zero)
            if (ptcCor.getFrequenciaEnvioEmailPtccor() == null)
              frequencia = 0;
            else
              frequencia = ptcCor.getFrequenciaEnvioEmailPtccor().intValue();
           
            Date dataLimite = Data.addDias(diasAntecedencia, dataCorrente);
            String dataLimStr = Data.parseDate(dataLimite);
           
            // Ap�s definir qual � a data que ser� comparada, verifica-se
            // se esta se enquadra no PtcCor atual. Caso positivo, define-se a data
            // e as subsequentes (de acordo com a frequencia)
            // O loop while � interrompido quando isto � feito.
            if ( (dataLimite != null && dataComparacao != null && dataLimStr != null && dataCompStr != null) &&
                (dataLimite.after(dataComparacao)) || (dataLimStr.equals(dataCompStr)))
            {
              datasLimite = new HashSet();
              if (diasAntecedencia > 0)
              {
                if ("S".equals(ptcCor.getIndAtivoEnvioEmailPtccor()))
                {
                 
                  datasLimite.add(dataLimStr);
                  if (frequencia > 0)
                  {
                    while (diasAntecedencia > 0)
                    {
                      diasAntecedencia = diasAntecedencia - frequencia;
                      dataLimStr =  new String(Data.parseDate(Data.addDias(diasAntecedencia, dataCorrente)));
                      datasLimite.add(dataLimStr);
                    }
                  }
                  corRelogio = ptcCor.getCor().getNomeCor();
                }
                encontrouLimite = true;
              }
            }
          }
View Full Code Here

      /*** Historico ***/
      /* apaga os filhos para serem gravados novamente */
      if (pontoCritico.getPontoCriticoCorPtccores() != null) {
        Iterator itAtb = pontoCritico.getPontoCriticoCorPtccores().iterator();
        while (itAtb.hasNext()) {
          PontocriticoCorPtccor ptcCor = (PontocriticoCorPtccor) itAtb.next();
          session.delete(ptcCor);
          objetos.add(ptcCor);
        }
      }
      else
View Full Code Here

   * @param request
   * @param pontoCritico
   * @throws ECARException
   */
  public void setPontoCriticoCor(HttpServletRequest request, PontoCriticoPtc pontoCritico) throws ECARException {
    PontocriticoCorPtccor ptcCor = null;
    List setCores = new CorDao(request).listar(Cor.class, new String[] { "ordemCor", "asc" });
    Cor cor = null;
    Iterator itCores = null;
    if (setCores != null)
      itCores = setCores.iterator();
    while (itCores.hasNext()) {
      cor = (Cor) itCores.next();
      ptcCor = new PontocriticoCorPtccor();
      ptcCor.setCor(cor);
      ptcCor.setPontoCriticoPtc(pontoCritico);
      if(request.getParameter("ant_" + cor.getCodCor() )!=null && !"".equals(request.getParameter("ant_" + cor.getCodCor() ))){
        ptcCor.setAntecedenciaPrimEmailPtccor(Integer.valueOf(Pagina.getParamInt(request, "ant_" + cor.getCodCor())));
      }
      if(request.getParameter("freq_" + cor.getCodCor())!=null && !"".equals(request.getParameter("freq_" + cor.getCodCor()))){
        ptcCor.setFrequenciaEnvioEmailPtccor(Integer.valueOf(Pagina.getParamInt(request, "freq_" + cor.getCodCor())));
      }
     
      ptcCor.setIndAtivoEnvioEmailPtccor("S".equals(Pagina.getParamStr(request, "ativo_" + cor.getCodCor()).trim()) ? "S" : "N");
      if (pontoCritico.getPontoCriticoCorPtccores() == null)
        pontoCritico.setPontoCriticoCorPtccores(new HashSet());
      pontoCritico.getPontoCriticoCorPtccores().add(ptcCor);
    }
  }
View Full Code Here

TOP

Related Classes of ecar.pojo.PontocriticoCorPtccor

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.