Information

0
Story Points

Technologies

Decompiled Java File
package mx.com.bcm.banamex.ae.negocio.catalogo.bo.impl;

import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import mx.com.bcm.banamex.ae.negocio.catalogo.bo.CatalogoMensajeAewebBOBeanLocal;
import mx.com.bcm.banamex.ae.persistencia.assambler.MensajeAssambler;
import mx.com.bcm.banamex.ae.persistencia.constantes.CatalogoErrorType;
import mx.com.bcm.banamex.ae.persistencia.dao.CatalogoMensajeAewebDAOBeanLocal;
import mx.com.bcm.banamex.ae.persistencia.exception.EfectivoAplicacionBOException;
import mx.com.bcm.banamex.ae.persistencia.exception.EfectivoAplicacionDAOException;
import mx.com.bcm.banamex.ae.persistencia.modelo.CatMensajesAeweb;
import mx.com.bcm.banamex.ae.persistencia.vo.MensajeAewebVO;

@Stateless
public class CatalogoMensajeAewebBOImpBean implements CatalogoMensajeAewebBOBeanLocal {
   @EJB
   private CatalogoMensajeAewebDAOBeanLocal mensajeAewebDAO;

   public MensajeAewebVO consultaCatalogoMensajePorCodigo(Integer codigoMensaje) throws EfectivoAplicacionBOException {
      CatMensajesAeweb mensaje;
      MensajeAewebVO mensajeVO;
      if(codigoMensaje == null) {
         mensaje = (CatMensajesAeweb)this.mensajeAewebDAO.findById(Integer.valueOf(CatalogoErrorType.VALOR_NULO.getValue()));
         mensajeVO = MensajeAssambler.getMensajeVO(mensaje);
         throw new EfectivoAplicacionBOException(mensajeVO.getMensajeNombre());
      } else {
         mensaje = (CatMensajesAeweb)this.mensajeAewebDAO.findById(codigoMensaje);
         mensajeVO = MensajeAssambler.getMensajeVO(mensaje);
         return mensajeVO;
      }
   }

   public Map consultaMensajeAewebPorNum(List listaMensajeCodigo) throws EfectivoAplicacionBOException {
      HashMap mapaMensaje = new HashMap();
      List listaMensaje = null;
      if(listaMensajeCodigo == null) {
         CatMensajesAeweb e1 = (CatMensajesAeweb)this.mensajeAewebDAO.findById(Integer.valueOf(CatalogoErrorType.VALOR_NULO.getValue()));
         throw new EfectivoAplicacionBOException(e1.getMensajeNombre());
      } else {
         CatMensajesAeweb elemento;
         try {
            listaMensaje = this.mensajeAewebDAO.consultaCatalogoMensjaePorListaDeId(listaMensajeCodigo);
         } catch (EfectivoAplicacionDAOException var7) {
            elemento = (CatMensajesAeweb)this.mensajeAewebDAO.findById(Integer.valueOf(CatalogoErrorType.VALOR_NO_ENCONTRADO.getValue()));
            throw new EfectivoAplicacionBOException(elemento.getMensajeNombre());
         }

         Iterator e = listaMensaje.iterator();

         while(e.hasNext()) {
            elemento = (CatMensajesAeweb)e.next();
            MensajeAewebVO mensajeVO = MensajeAssambler.getMensajeVO(elemento);
            mapaMensaje.put(mensajeVO.getMensajeCodigo(), mensajeVO);
         }

         return mapaMensaje;
      }
   }
}
Page generated: Oct 19, 2017 2:34:27 PM