コード例 #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
  /**
   * Método que obtiene los ultimos 5 movimientos de una cuenta.
   *
   * @param cliente ClienteBean.
   * @param datosMovimientos Datos para la consulta.
   * @param bitacoraBean Objeto para bitacorizar.
   * @param tipoProducto Tipo de producto a consultar (CC, TC, FI, IV)
   * @throws BusinessException Excepción lanzada si no se puede ejecutar el servicio.
   */
  public Object getUltMvtos(ClienteBean cliente, DatosUltMvtos datos, BitacoraBean bitacoraBean)
      throws BusinessException, ParseException {

    log.debug("*****************ENTRO A CONSULTA ULTIMOS 5 MOVIMIENTOS************");
    if (cliente == null) {
      throw new BusinessException("MOVIMIENTOS");
    }

    String tipoConsulta = datos.getTipoConsulta();
    boolean restaranio = false;

    // Obtencion de fechas inicial y final
    String sdiaFrom = "", smesFrom = "", sanioFrom = "";
    String sdiaTo = "", smesTo = "", sanioTo = "";

    GregorianCalendar gc = new GregorianCalendar();
    Date trialTime = new Date();
    gc.setTime(trialTime);

    // se obtiene fecha inicial
    int idiaTo = gc.get(Calendar.DAY_OF_MONTH);
    int imesTo = gc.get(Calendar.MONTH);
    int ianioTo = gc.get(Calendar.YEAR);

    sdiaTo = Integer.toString(idiaTo);
    sanioTo = Integer.toString(ianioTo);
    smesTo = getMesFromNumber(imesTo);

    if (imesTo <= 2) {
      restaranio = true;
    }

    // Se reduce la fecha tres meses
    gc.roll(Calendar.MONTH, -2);

    // se obtiene la fecha final
    int idiaFrom = gc.get(Calendar.DAY_OF_MONTH);
    int imesFrom = gc.get(Calendar.MONTH);
    int ianioFrom = gc.get(Calendar.YEAR);

    if (restaranio) {
      ianioFrom -= 1;
    }

    sdiaFrom = Integer.toString(idiaFrom);
    sanioFrom = Integer.toString(ianioFrom);
    smesFrom = getMesFromNumber(imesFrom);

    String from = sdiaFrom + "/" + smesFrom + "/" + sanioFrom;
    String to = sdiaTo + "/" + smesTo + "/" + sanioTo;

    System.out.println("From: " + from);
    System.out.println("To: " + to);

    datos.setFecha(to);
    datos.setFechaDia(to);
    datos.setFechaHistorica(from);

    if (tipoConsulta.equals("CC") || tipoConsulta.equals("IV")) {
      log.debug("*********************ENTRA EN CONSULTA DE CUENTA DE CHEQUES*********************");
      DatosConsultaMovimientosBean bean = new DatosConsultaMovimientosBean();

      bean.setCuenta(datos.getCuenta());
      bean.setFechaDia(datos.getFechaDia());
      bean.setFechaHistorica(datos.getFechaHistorica());
      bean.setImporte(datos.getImporte());
      bean.setTipoCuenta(datos.getTipoCuenta());
      bean.setTipoMovimiento(datos.getTipoMovimiento());

      return getMovimientoCuentasChequeras(cliente, bean, bitacoraBean);
    }
    if (tipoConsulta.equals("TC")) {
      log.debug(
          "*********************ENTRA EN CONSULTA DE TARJETAS DE CREDITO*********************");
      DatosEntradaMovimientosBean bean = new DatosEntradaMovimientosBean();

      bean.setCuenta(datos.getCuenta());
      bean.setDespliega(datos.getDespliega());
      bean.setExtracto(datos.getExtracto());
      bean.setFecha(datos.getFecha());
      bean.setFechaHistorica(datos.getFechaHistorica());
      bean.setNumeroExtracto(datos.getNumeroExtracto());
      bean.setTasaAnualizada(datos.getTasaAnualizada());
      bean.setTipoOperacion(datos.getTipoOperacion());
      bean.setTipoProducto(datos.getTipoProducto());

      return getMovimientoTarjetacredito(cliente, bean, bitacoraBean);
    }
    if (tipoConsulta.equals("FI")) {
      log.debug(
          "*********************ENTRA EN CONSULTA DE FONDOS DE INVERSION*********************");

      DatosEntradaMovimientosBean bean = new DatosEntradaMovimientosBean();

      bean.setCuenta(datos.getCuenta());
      bean.setDespliega(datos.getDespliega());
      bean.setExtracto(datos.getExtracto());
      bean.setFecha(datos.getFecha());
      bean.setFechaHistorica(datos.getFechaHistorica());
      bean.setNumeroExtracto(datos.getNumeroExtracto());
      bean.setTasaAnualizada(datos.getTasaAnualizada());
      bean.setTipoOperacion(datos.getTipoOperacion());
      bean.setTipoProducto(datos.getTipoProducto());

      return getMovimientoFondoInversion(cliente, bean, bitacoraBean);
    }
    if (tipoConsulta.equals("IV")) {
      log.debug(
          "*********************ENTRA EN CONSULTA DE INVERSION VISTA*************************");
    }
    return null;
  }
コード例 #3
0
  /**
   * Metodo que obtiene los movimientos de la tarjeta de credito
   *
   * @param cliente Bean de cliente
   * @param datosTarjeta Bien de los datos de la tarjeta
   * @param bitacoraBean Bean de bitacora
   * @return Regresa los movimeintos de las tarjetas de credito
   * @throws BusinessException Excepcion de negocio
   */
  public MovimientosTarjetasCreditoBean getMovimientoTarjetacredito(
      ClienteBean cliente, DatosEntradaMovimientosBean datosTarjeta, BitacoraBean bitacoraBean)
      throws BusinessException {

    Validator.valida(cliente, CLAVE_MODULO_MOVIMIENTO_TARJETA);
    String tramaDiasInhabil;
    String diasInhabiles[];
    TramaDiasInhabiles tramaSiasInhabiles = new TramaDiasInhabiles();
    tramaDiasInhabil = tramaSiasInhabiles.getTramaDiasInhabiles();
    diasInhabiles = SantanderUtileriasService.desentrama(tramaDiasInhabil, '|');

    MovimientosTarjetasCreditoBean movimientoTarjetaBean = null;

    String[] fechas = null;

    if (StringUtils.equals(datosTarjeta.getTipoOperacion(), "Fechas")) {

      fechas = new String[4];
      fechas[3] = tramaDiasInhabil;
      fechas[0] = MovimientosServiceReusableFunctions.AnteriorDiaHabil(2, diasInhabiles);
      fechas[2] = MovimientosServiceReusableFunctions.AnteriorDiaHabil(1, diasInhabiles);
      fechas[1] = MovimientosServiceReusableFunctions.InicioDelMes(fechas[2]);

      if (cliente.getTarjetas() == null) {
        throw new BusinessException("MOVT-MT-2");
      }
      movimientoTarjetaBean = new MovimientosTarjetasCreditoBean();
      if (StringUtils.equals(datosTarjeta.getCuenta(), "-1")) {
        movimientoTarjetaBean.setFechas(fechas);
        movimientoTarjetaBean.setCuenta(datosTarjeta.getCuenta());
        return movimientoTarjetaBean;
      } else {
        boolean esTarjetaTitular = false;
        Iterator itera = (Iterator) cliente.getTarjetas().iterator();
        while (itera.hasNext()) {
          TarjetaBean tarjetaPropia = (TarjetaBean) itera.next();

          if (tarjetaPropia.getNumeroTarjeta().equals(datosTarjeta.getCuenta())) {
            if (tarjetaPropia.getParticipacion().equals("TI")) {
              esTarjetaTitular = true;
              break;
            }
          }
        }
        log.debug("VALOR DE TITULAR****** " + esTarjetaTitular);
        if (!esTarjetaTitular) { // si NO es Titular - SE DESPLEGARAN
          // EXTRACTOS
          SantanderReferenciaService referencia =
              commonService.getReferencia(bitacoraBean.getNombreClase());

          MovimientosBean extractos =
              MovimientosServiceReusableFunctions.obtenerExtractoTarjetasPAMPA(
                  datosTarjeta.getCuenta(), bitacoraBean.getNombreClase(), referencia);
          if (Integer.parseInt(extractos.getMensajeStatus()) != 0) {
            throw new BusinessException("MOVIMIENTOS");
          } else {
            movimientoTarjetaBean = new MovimientosTarjetasCreditoBean();
            movimientoTarjetaBean.setExtractos(extractos);
            movimientoTarjetaBean.setCuenta(datosTarjeta.getCuenta());
            movimientoTarjetaBean.setFechas(fechas);
          }

        } else { // si ES Titular - SE DESPLEGARAN FECHAS

          movimientoTarjetaBean = new MovimientosTarjetasCreditoBean();
          movimientoTarjetaBean.setCuenta(datosTarjeta.getCuenta());
          movimientoTarjetaBean.setFechas(fechas);
        }
        return movimientoTarjetaBean;
      }
    }

    if (StringUtils.equals(datosTarjeta.getTipoOperacion(), "TarjetaCredito")) {

      boolean aurizado = false;
      movimientoTarjetaBean = new MovimientosTarjetasCreditoBean();
      try {
        Iterator itera = (Iterator) cliente.getTarjetas().iterator();

        while (itera.hasNext()) {
          TarjetaBean tarjeta = (TarjetaBean) itera.next();
          if (tarjeta.getNumeroTarjeta().equalsIgnoreCase(datosTarjeta.getCuenta())) {
            aurizado = true;
            break;
          }
        }
        log.debug("VALOR de autorizado*********** " + aurizado);
        if (!aurizado) {
          log.debug("Se trato de hacer una operacion invalida...");
          throw new BusinessException("MOVT-MT-3");
        }
      } catch (Exception e) {
        throw new BusinessException("MOVIMIENTOS");
      }

      MovimientosFinalesContainerBean movimientosTarjeta = null;

      log.debug("entro en obtener movimientos***********");
      boolean estaBloqueada =
          MovimientosServiceReusableFunctions.ServicioValidaBloqueo(
              datosTarjeta.getCuenta(), bitacoraBean.getNombreClase());
      SantanderReferenciaService referencia =
          commonService.getReferencia(bitacoraBean.getNombreClase());
      log.debug("Valor de bloqueada********" + estaBloqueada);
      if (!estaBloqueada) {
        // String tasaAnualizada = null;
        log.debug("ENTRO en !esBloquedada");
        if (StringUtils.equals(datosTarjeta.getDespliega(), "extractos")) {

          log.debug("ENTro en extractos!!!!!");
          movimientosTarjeta =
              MovimientosServiceReusableFunctions.obtenerMovimientosExtracto(
                  datosTarjeta.getNumeroExtracto(),
                  datosTarjeta.getExtracto().getMonedaExtracto(),
                  datosTarjeta.getCuenta(),
                  datosTarjeta.getExtracto().getTasaAnualizada(),
                  bitacoraBean,
                  String.valueOf(referencia.getNumReferencia()));
          log.debug("MOVIMIENTOS TARJETA" + movimientosTarjeta.toString());

        } else { // Si viene de Fechas consulta por MPV3
          log.debug("Sin extractos!!!!!");
          movimientosTarjeta =
              MovimientosServiceReusableFunctions.obtenerMovsTarjetaPAMPA(
                  datosTarjeta.getFechaHistorica(),
                  datosTarjeta.getFecha(),
                  datosTarjeta.getCuenta(),
                  bitacoraBean,
                  String.valueOf(referencia.getNumReferencia())); // PAMPAIII
        }
      }

      if (movimientosTarjeta.getListaMovimientos() == null) {
        throw new BusinessException("MOVT-MT-3");
      }
      if (estaBloqueada) {
        throw new BusinessException("MOVT-MT-4");
      }

      bitacoraBean.setNumeroReferencia(referencia.getNumReferencia());
      bitacoraBean.setNumeroCuenta(datosTarjeta.getCuenta());
      String mensajeStatus = SantanderConstantesService.MOVT; // +
      // movimientosTarjeta.getMensajeStatus().substring(4);
      bitacoraBean.setMensaje(mensajeStatus);
      bitacoraBean.setClaveUsuario(cliente.getClaveCliente());
      commonService.registrarBitacora(bitacoraBean);

      movimientoTarjetaBean.setMovimientos(movimientosTarjeta);
      movimientoTarjetaBean.setCuenta(datosTarjeta.getCuenta());
      movimientoTarjetaBean.setFechaHistorica(datosTarjeta.getFechaHistorica());
      movimientoTarjetaBean.setFecha(datosTarjeta.getFecha());
    }
    if (movimientoTarjetaBean == null) {
      throw new BusinessException("MOVIMIENTOS");
    }
    return movimientoTarjetaBean;
  }