예제 #1
0
  /**
   * Metodo que obtiene los movimientos de fondo de inversion
   *
   * @param cliente Bean de cliente
   * @param datosFondos Bean con los datos de fondos
   * @param bitacoraBean Bean de bitacora
   * @return Regresa los movimientos de fondos de inversion
   * @throws BusinessException Excepcion de negocio
   */
  public MovimientosFondosInversionBean getMovimientoFondoInversion(
      ClienteBean cliente, DatosEntradaMovimientosBean datosFondos, BitacoraBean bitacoraBean)
      throws BusinessException {

    MovimientosFondosInversionBean movimientos = new MovimientosFondosInversionBean();

    movimientos =
        MovimientosServiceReusableFunctions.txn390(datosFondos, bitacoraBean.getNombreClase());

    SantanderReferenciaService referencia =
        commonService.getReferencia(bitacoraBean.getNombreClase());
    bitacoraBean.setNumeroReferencia(referencia.getNumReferencia());
    bitacoraBean.setClaveUsuario(cliente.getClaveCliente());
    bitacoraBean.setNumeroCuenta(datosFondos.getCuenta());
    int estatus = movimientos.getCodigoStatus();
    if (estatus == 0) {
      bitacoraBean.setMensaje(
          SantanderConstantesService.MOVF + "0000CONSULTA DE MOVIMIENTOS INVERSION");
    } else {
      bitacoraBean.setMensaje(SantanderConstantesService.MOVF + estatus);
    }

    bitacoraBean.setClaveConcepto(SantanderConstantesService.CMFONDOS);
    commonService.registrarBitacora(bitacoraBean);
    if (movimientos.getMovimientosFondos() == null
        || movimientos.getMovimientosFondos().isEmpty()) {

      throw new BusinessException("MOVFON-1");
    }
    return movimientos;
  }
예제 #2
0
  /**
   * Registra la informacion de cuenta 123 de cliente
   *
   * @param cliente Bean de datos de cliente
   * @param cuenta Cuenta dar de alta de tipo String
   * @param vista Cuenta vista a asociar al programa de tipo String
   * @param tipo Tipo de registro de tipo String
   * @param bitacora Objeto de bitacora de tipo BitacoraBean
   * @param token Token a validar de tipo String
   * @return respuesta de actualizacion de cuenta 123
   * @throws Excepcion de negocio si falla la operacion
   */
  public String registraCuenta123(
      ClienteBean cliente,
      String cuenta,
      String vista,
      String tipo,
      BitacoraBean bitacora,
      String token)
      throws BusinessException {

    SantanderReferenciaService srs = null;
    CuentaBean cuentaCheques = new CuentaBean();
    Validator.valida(cliente, "A123", token, bitacora);

    cuentaCheques.setNumeroCuenta(cuenta);
    boolean isCuentaCliente = Validator.isCuentaCliente(cuentaCheques, cliente.getCuentasPropias());

    if (!isCuentaCliente) {
      throw new BusinessException("EBL-06");
    }

    srs = commonService.getReferencia(bitacora.getNombreClase());

    SantanderMttoPrograma123 programa123 = new SantanderMttoPrograma123();

    programa123.setCliente(cliente.getClaveCliente());
    programa123.setCuenta(cuenta);
    programa123.setCuentaVista(vista);
    programa123.setTipoOper("A");

    programa123.ejecuta();

    bitacora.setNumeroReferencia(srs.getNumReferencia());
    bitacora.setClaveUsuario(cliente.getClaveCliente());
    bitacora.setCuentaOrigen(cuentaCheques.getNumeroCuenta());
    bitacora.setCuentaDestino(vista);
    bitacora.setClaveConcepto("A123");
    bitacora.setEdoProgramada(programa123.getCodStatus() == 0 ? "A" : "R");
    bitacora.setTipoCuentaDestino("PR");
    bitacora.setMensaje("A123" + programa123.getMsgStatus().substring(4));

    commonService.registrarBitacora(bitacora);

    if (programa123.getCodStatus() == 0) {
      notificaAlta(cliente, srs, "altaP123", cuenta);
    } else {
      int[] estatusValidos = {9, 11, 14, 20, 29, 35, 36, 39, 112, 114, 115, 132, 133};

      if (ArrayUtils.contains(estatusValidos, programa123.getCodStatus())) {
        throw new BusinessException("A123-" + programa123.getCodStatus());
      }
    }
    return String.valueOf(srs.getNumReferencia());
  }
예제 #3
0
 private void registraBitacoraCP(
     BitacoraBean bitacoraBean, String numCuenta, String importe, String msg)
     throws BusinessException {
   ServiciosDAOMQ serviciosDAOMQ = new ServiciosDAOMQ();
   SantanderReferenciaService referencia = null;
   referencia = commonService.getReferencia(SaldosServiceImpl.class.toString());
   referencia.ejecuta();
   final String clave = "MVCP";
   bitacoraBean.setClaveConcepto(clave);
   bitacoraBean.setNumeroReferencia(referencia.getNumReferencia());
   bitacoraBean.setNumeroCuenta(numCuenta);
   bitacoraBean.setImporte(importe);
   bitacoraBean.setMensaje(clave + msg);
   commonService.registrarBitacora(bitacoraBean, serviciosDAOMQ);
   serviciosDAOMQ.cerrarConexion();
 }
예제 #4
0
 /**
  * Realiza el registro en bitacora
  *
  * @param cliente codigo de cliente
  * @param servicio SantanderCuenta123
  * @param btaBean bean de bitacora
  * @param mp Map<String,String>
  * @param cuenta String
  * @throws Excepcion de negocio si falla la operacion al registrar baja en bitacora
  */
 private void registraBajaBita(
     BitacoraBean btaBean,
     ClienteBean cliente,
     SantanderCuenta123 servicio,
     Map<String, String> mp,
     String cuenta)
     throws BusinessException {
   ConsultaBitacoraBean beanB = new ConsultaBitacoraBean();
   SantanderReferenciaService srs = commonService.getReferencia(btaBean.getNombreClase());
   btaBean.setClaveUsuario(cliente.getClaveCliente());
   btaBean.setMensaje("BAJA CUENTA 123");
   btaBean.setCuentaDestino(cuenta);
   btaBean.setNumeroReferencia(srs.getNumReferencia());
   btaBean.setClaveConcepto("B123" + servicio.getMsgStatus().substring(4));
   commonService.registrarBitacora(btaBean);
   LOG.info("insertaBajaCuentas123: Error Codigoddd: " + servicio.getMsgStatus().substring(4));
   Date fechaOperacion = new Date();
   UtilsFormateaFechas util = new UtilsFormateaFechas();
   beanB.setFecha(util.fechaToString("dd/MM/yyyy", fechaOperacion));
   beanB.setHora(util.fechaToString("HH:mm", fechaOperacion));
   mp.put("horaOP", beanB.getHora());
   mp.put("refSuper", Integer.toString(btaBean.getNumeroReferencia()));
   mp.put("fechaOP", beanB.getFecha());
 }
예제 #5
0
  /**
   * Metodo que obtiene los movimientos realizados por cada cuenta o chequera del cliente.
   *
   * @param cliente Bean del Cliente
   * @param datosMovimientos Bean de los datos con mivimeintos
   * @param bitacoraBean Bean de bitacora
   * @return MovimientosBean Bean con los movimientos
   * @author Igor Mejia
   * @throws ParseException Excepxion al parsear
   * @throws BusinessException Excepcion de negocio
   */
  public MovimientosBean getMovimientoCuentasChequeras(
      ClienteBean cliente, DatosConsultaMovimientosBean datosMovimientos, BitacoraBean bitacoraBean)
      throws BusinessException, ParseException {

    boolean autorizadoPesos = false;
    boolean autorizadoDolares = false;

    Validator.valida(cliente, CLAVE_MODULO_MOVIMIENTO_CUENTA);
    log.debug("*****************ENTRO A MOVIMIENTOS CUENTAS CHEQUERAS************");
    if (cliente == null) {
      throw new BusinessException("MOVIMIENTOS");
    }
    Iterator itera = (Iterator) cuentaService.getCuentasPropias(cliente).iterator();
    while (itera.hasNext()) {
      CuentaBean cuenta = (CuentaBean) itera.next();
      String cuentaVista =
          MovimientosServiceReusableFunctions.getCuentaVista(
              cliente.getClaveCliente(),
              cuenta.getNumeroCuenta(),
              cuenta.getSucursal(),
              NOMBRE_CALSE);
      if (cuenta.getNumeroCuenta().equalsIgnoreCase(datosMovimientos.getCuenta())
          || datosMovimientos.getCuenta().equalsIgnoreCase(cuentaVista)) {
        autorizadoPesos = true;
        break;
      }
    }
    if (cliente.isDolares()) {
      Iterator iter = (Iterator) cuentaService.getCuentasPropiasDolares(cliente).iterator();

      while (iter.hasNext()) {
        CuentaBean cuentaDolares = (CuentaBean) iter.next();
        String cuentaVistaDolares =
            MovimientosServiceReusableFunctions.getCuentaVista(
                cliente.getClaveCliente(),
                cuentaDolares.getNumeroCuenta(),
                cuentaDolares.getSucursal(),
                NOMBRE_CALSE);

        if (!cuentaDolares.getNumeroCuenta().equalsIgnoreCase(datosMovimientos.getCuenta())
            && datosMovimientos.getCuenta().equalsIgnoreCase(cuentaVistaDolares)) {
          autorizadoDolares = true;
          break;
        }
      }
    }

    if (!autorizadoPesos && !autorizadoDolares) {
      if (datosMovimientos.getTipoCuenta().equals(TIPO_CUENTA_VISTA)) {
        throw new BusinessException("MOVC-MCC-1");
      } else throw new BusinessException("MOVC-MCC-1");
    }

    SantanderReferenciaService referencia =
        commonService.getReferencia(bitacoraBean.getNombreClase());

    MovimientosBean movimientosBean =
        obtenerMovimientosCheques(
            datosMovimientos,
            cliente.getClaveCliente(),
            String.valueOf(referencia.getNumReferencia()),
            bitacoraBean.getNombreClase());

    if (movimientosBean.getListaMovimientos() == null
        && movimientosBean.getMensajeStatus() == null
        && movimientosBean.getImporte() == null) {

      throw new BusinessException("MOVIMIENTOS");
    }

    String mensaje =
        SantanderConstantesService.MOVC + movimientosBean.getMensajeStatus().substring(4);

    bitacoraBean.setNumeroReferencia(referencia.getNumReferencia());
    bitacoraBean.setNumeroCuenta(datosMovimientos.getCuenta());
    bitacoraBean.setImporte(movimientosBean.getImporte());
    bitacoraBean.setClaveUsuario(cliente.getClaveCliente());
    bitacoraBean.setMensaje(mensaje);
    bitacoraBean.setClaveConcepto(SantanderConstantesService.CMCHEQUES);
    commonService.registrarBitacora(bitacoraBean);

    return movimientosBean;
  }
예제 #6
0
  /**
   * Obtiene informacion de cuenta 123 de cliente
   *
   * @param cliente Bean de datos de cliente
   * @param beanCte Bean de programa 123 asociado al cliente
   * @param tipoOper Tipo Operacion a registrar
   * @param btaBean bean de bitacora
   * @return bean de cuenta 123
   * @throws Excepcion de negocio si falla la operacion
   */
  public Map<String, String> insertaActualizaCuentas123(
      ClienteBean cliente, Cuenta123Bean beanCte, String tipoOper, BitacoraBean btaBean)
      throws BusinessException {
    Map<String, String> mp = new HashMap<String, String>();
    ConsultaBitacoraBean beanB = new ConsultaBitacoraBean();
    String resp = "";
    String cuenta = beanCte.getCuenta();
    SantanderCuenta123 servicio =
        new SantanderCuenta123(
            Santander123ConstantesService.BEA0,
            Santander123ConstantesService.E_BEA0,
            Santander123ConstantesService.L_BEA0);
    StringBuffer tramArea = new StringBuffer("");
    servicio.obtenerTramaEntrada(tramArea);
    try {
      tramArea.append(SantanderUtileriasService.rellenar("0014", 4, ' ', 'I'));
      tramArea.append(SantanderUtileriasService.rellenar("SN", 2, ' ', 'I'));
      tramArea.append(SantanderUtileriasService.rellenar("SN", 2, ' ', 'I'));
      tramArea.append(
          SantanderUtileriasService.rellenar(
              Santander123ConstantesService.PROGRAMA123, 4, ' ', 'I'));
      tramArea.append(SantanderUtileriasService.rellenar(cliente.getClaveCliente(), 8, ' ', 'I'));
      tramArea.append(SantanderUtileriasService.rellenar(tipoOper, 1, ' ', 'I'));
      tramArea.append(SantanderUtileriasService.rellenar(cuenta, 23, ' ', 'D'));
      tramArea.append(SantanderUtileriasService.rellenar(beanCte.getCtaInv(), 23, ' ', 'D'));
      tramArea.append(SantanderUtileriasService.rellenar(" ", 80, ' ', 'I'));

      servicio.setTrama(tramArea.toString());
      servicio.ejecuta("@DCBEMSA01", false);
      if (servicio.getCodStatus() != 0) {
        LOG.info("insertaActualizaCuentas123: Error Codigo: " + servicio.getCodStatus());
        int[] estatusValidos = {19};

        if (ArrayUtils.contains(estatusValidos, servicio.getCodStatus())) {
          throw new BusinessException("SAN123-" + servicio.getCodStatus());
        }
      }

      resp = servicio.getRespuesta();

      if (!resp.isEmpty()) {
        SantanderReferenciaService srs = commonService.getReferencia(btaBean.getNombreClase());
        btaBean.setClaveUsuario(cliente.getClaveCliente());
        btaBean.setMensaje("MODIFICACION CUENTA 123");
        btaBean.setCuentaDestino(cuenta);
        btaBean.setNumeroReferencia(srs.getNumReferencia());
        btaBean.setClaveConcepto("M123" + servicio.getMsgStatus().substring(4));
        commonService.registrarBitacora(btaBean);

        Date fechaOperacion = new Date();
        UtilsFormateaFechas util = new UtilsFormateaFechas();
        beanB.setFecha(util.fechaToString("dd/MM/yyyy", fechaOperacion));
        beanB.setHora(util.fechaToString("HH:mm", fechaOperacion));

        mp.put("horaOP", beanB.getHora());
        mp.put("refSuper", Integer.toString(btaBean.getNumeroReferencia()));
        mp.put("fechaOP", beanB.getFecha());

        notificaModificacion(cliente, srs, "modificacionP123", cuenta);
      } else {
        throw new BusinessException("BEA0-ERR", servicio.getMsgStatus());
      }
    } catch (BusinessException e) {
      LOG.error("error: " + e.getMessage());
      throw e;
    }
    return mp;
  }