Package ecar.bean

Examples of ecar.bean.MudarPaiItensTempBean


  public void mudarPaiItens(HttpServletRequest request) throws ECARException {
    Transaction tx = null;
    try {
      List listItens = new ArrayList();
     
      MudarPaiItensTempBean bean = new MudarPaiItensTempBean(Long.valueOf("1533"), Long.valueOf("521"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1523"), Long.valueOf("1593"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1186"), Long.valueOf("521"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1520"), Long.valueOf("521"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1532"), Long.valueOf("521"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1322"), Long.valueOf("1593"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1429"), Long.valueOf("1593"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1519"), Long.valueOf("521"));
     
      listItens.add(bean);
     
      /*
      // SITES
      bean = new MudarPaiItensTempBean(Long.valueOf("1522"), Long.valueOf("457"));
     
      listItens.add(bean);     
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1710"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1583"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1329"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1457"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1581"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1535"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1212"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1196"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("453"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("452"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("437"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("484"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1187"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1660"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("481"), Long.valueOf("457"));
     
      listItens.add(bean);   
     
      bean = new MudarPaiItensTempBean(Long.valueOf("483"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("484"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("479"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1184"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("465"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("466"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1204"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1334"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1524"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("482"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("448"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("449"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1213"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1193"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("477"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1730"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("464"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("469"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1454"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("468"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1184"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("467"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1444"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("451"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1211"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1208"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1447"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1245"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1330"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1446"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1490"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1621"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1700"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1701"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1734"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1215"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1666"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1349"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1416"), Long.valueOf("457"));
     
      listItens.add(bean);
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1362"), Long.valueOf("457"));
     
      listItens.add(bean);     
     
      bean = new MudarPaiItensTempBean(Long.valueOf("1184"), Long.valueOf("457"));
     
      listItens.add(bean);     
       */
     
     
            tx = session.beginTransaction();
        ControlePermissao controlePermissao = new ControlePermissao();
     
            Iterator it = listItens.iterator();
           
            while (it.hasNext()) {
             
              MudarPaiItensTempBean itemBean = (MudarPaiItensTempBean) it.next();
        ItemEstruturaIett itemEstrutura = (ItemEstruturaIett) this.buscar(ItemEstruturaIett.class, itemBean.getCodItem());
        Set Iettus = itemEstrutura.getItemEstrutUsuarioIettusesByCodIett();
       
        Iterator itIettus = Iettus.iterator();
       
        while (itIettus.hasNext()) {
         
          ItemEstrutUsuarioIettus itemEstrutUsuario = (ItemEstrutUsuarioIettus) itIettus.next();
         
                /******** Historico *********/
               
                HistoricoIettus historico = new HistoricoIettus(itemEstrutUsuario,
                                        HistoricoIettus.excluirPermissoes,
                                        session,
                                        new ConfiguracaoDao(request),
                                        request);
                historico.gerarHistorico();
               
              /******** Historico *********/
     
              //
              // controlar as permissoes
              //
              //if(!ControlePermissao.PERMISSAO_FUNCAO_ACOMPANHAMENTO.equals(itemEstrutUsuario.getCodTpPermIettus())){
                session.delete(itemEstrutUsuario);
              //}
       
            //mudar o pai
            itemEstrutura.setItemEstruturaIett((ItemEstruturaIett) this.buscar(ItemEstruturaIett.class, itemBean.getCodPai()));          
                   
        //
              // controlar as permissoes
              //
                          
View Full Code Here


    try {
            tx = session.beginTransaction();

            List listItens = new ArrayList();
     
      MudarPaiItensTempBean bean = new MudarPaiItensTempBean(Long.valueOf("1795"), Long.valueOf("1980"));
     
      listItens.add(bean);
     
        ControlePermissao controlePermissao = new ControlePermissao();
     
            Iterator it = listItens.iterator();
           
            while (it.hasNext()) {
              MudarPaiItensTempBean itemBean = (MudarPaiItensTempBean) it.next();
        ItemEstruturaIett itemEstrutura = (ItemEstruturaIett) this.buscar(ItemEstruturaIett.class, itemBean.getCodItem());
        Set iettus = itemEstrutura.getItemEstrutUsuarioIettusesByCodIett();
       
        Iterator itIettus = iettus.iterator();
       
        while (itIettus.hasNext()) {
          ItemEstrutUsuarioIettus itemEstrutUsuario = (ItemEstrutUsuarioIettus) itIettus.next();
         
                /******** Historico *********/
              ConfiguracaoDao dao = new ConfiguracaoDao(request);
              ConfiguracaoCfg config = dao.getConfiguracao();
         
              HistoricoMaster historicoMaster = new HistoricoMaster();
             
              if("S".equals(config.getIndGerarHistoricoCfg())) {
             
            historicoMaster.setDataHoraHistorico(new Date());
            historicoMaster.setUsuManutencao(itemEstrutUsuario.getUsuManutencao());
            historicoMaster.setCodReferenciaGeral(itemEstrutUsuario.getItemEstruturaIett().getCodIett());
            historicoMaster.setHistoricoMotivo((HistoricoMotivo)super.buscar(HistoricoMotivo.class, Long.valueOf(28)));
            session.save(historicoMaster);
           
            HistoricoIettusH iettush = new HistoricoIettusH();
                   
            iettush.setCod_atb((itemEstrutUsuario.getSisAtributoSatb() != null?itemEstrutUsuario.getSisAtributoSatb().getCodSatb():null));
            iettush.setCodTpPermIettus(itemEstrutUsuario.getCodTpPermIettus());
            iettush.setDataInclusaoIettus(itemEstrutUsuario.getDataInclusaoIettus());
            iettush.setIndAtivMonitIettus(itemEstrutUsuario.getIndAtivMonitIettus());
            iettush.setIndBloqPlanIettus(itemEstrutUsuario.getIndBloqPlanIettus());
            iettush.setIndDesatMonitIettus(itemEstrutUsuario.getIndDesatMonitIettus());
            iettush.setIndDesblPlanIettus(itemEstrutUsuario.getIndDesblPlanIettus());
            iettush.setIndEdicaoIettus(itemEstrutUsuario.getIndEdicaoIettus());
            iettush.setIndEmitePosIettus(itemEstrutUsuario.getIndEmitePosIettus());
            iettush.setIndExcluirIettus(itemEstrutUsuario.getIndExcluirIettus());
            iettush.setIndInfAndamentoIettus(itemEstrutUsuario.getIndInfAndamentoIettus());
            iettush.setIndLeituraIettus(itemEstrutUsuario.getIndLeituraIettus());
            iettush.setIndProxNivelIettus(itemEstrutUsuario.getIndProxNivelIettus());
            iettush.setItemEstruturaIett(itemEstrutUsuario.getItemEstruturaIett());
            iettush.setItemEstruturaIettOrigem(itemEstrutUsuario.getItemEstruturaIettOrigem());
            iettush.setTipoFuncAcompTpfa(itemEstrutUsuario.getTipoFuncAcompTpfa());
            iettush.setUsuarioUsu(itemEstrutUsuario.getUsuarioUsu());
            iettush.setUsuManutencao(itemEstrutUsuario.getUsuManutencao())
            iettush.setHistoricoMaster(historicoMaster);
           
            session.save(iettush);
              }
              /******** Historico *********/
                       
         
              session.delete(itemEstrutUsuario);
       

        //mudar o pai
            itemEstrutura.setItemEstruturaIett((ItemEstruturaIett) this.buscar(ItemEstruturaIett.class, itemBean.getCodPai()));          
                   
          controlePermissao.atualizarPermissoesItemEstrutura(itemEstrutura, null, session, true, request);
            }          
     
      System.out.println("Commit...");
View Full Code Here

TOP

Related Classes of ecar.bean.MudarPaiItensTempBean

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.