Ejemplo n.º 1
0
  public void ejecuta() {

    try {
      while (ObtenerDatos()) ;
    } catch (Exception e) {
      codStatus = 99;
      msgStatus =
          "LB44"
              + SantanderUtileriasService.rellenar(String.valueOf(codStatus), 4, '0', 'I')
              + " ERROR AL EJECUTAR SERVICIO:"
              + e.getMessage();
      SantanderConstantesService.escribeAlLog(
          SantanderConstantesService.NIVEL2,
          "390",
          "LB44",
          codStatus,
          nombClase,
          "Instanciando Objeto Socket 390",
          msgStatus);
    } finally {
      try {
        if (daomq != null && cerrarMQ) {
          daomq.cerrarConexion();
          daomq = null;
        }
      } catch (Exception e) {
        org.apache.log4j.Logger.getLogger(this.getClass())
            .debug(
                "Ocurrio una excepcion al intentar cerrar la conexion ServicioLB44.."
                    + e.getMessage());
      }
    }
  }
 /**
  * Establece el código y mensage de estatus de la operación
  *
  * @param cod_status
  * @param msg_error
  * @param trama_entrada
  */
 public void procesaEstatus(int cod_status, String msg_error, StringBuffer trama_entrada) {
   this.cod_status = cod_status;
   this.msg_status =
       SantanderConstantesService.LZ80
           + SantanderUtileriasService.rellenar(String.valueOf(this.cod_status), 4, '0', 'I')
           + msg_error;
   SantanderConstantesService.escribeAlLog(
       SantanderConstantesService.NIVEL2,
       "390",
       SantanderConstantesService.LZ80,
       this.cod_status,
       this.nombre_clase,
       "Enviando la trama: " + trama_entrada.toString(),
       this.msg_status);
 }
  public void ejecuta() {
    try {
      envia = new Socket390c(nombreClase, "LB54");

      if (!ObtenerDatos()) {
        this.exito = false;
        return;
      }
    } catch (Exception e) {
      this.codStatus = 99;
      this.msgStatus =
          "LB54"
              + SantanderUtileriasService.rellenar("" + this.codStatus, 4, '0', 'I')
              + " ERROR AL EJECUTAR SERVICIO: "
              + e.getMessage();
      SantanderConstantesService.escribeAlLog(
          SantanderConstantesService.NIVEL2,
          "390",
          "LB54",
          this.codStatus,
          this.nombreClase,
          "Instanciando Objeto Socket 390",
          this.msgStatus);
      return;
    } finally {
      try {
        String canalMQ = ConfiguracionMQ.getInstance().getCANAL();
        if (!canalMQ.equals("MQ")) {
          if (!envia.disconnect())
            org.apache.log4j.Logger.getLogger(this.getClass())
                .debug("No se pudo realizar la desconexion..Servicio LB54");
        } else {
          if (daomq != null && cerrarMQ) {
            daomq.cerrarConexion();
            daomq = null;
          }
        }

      } catch (Exception e) {
        org.apache.log4j.Logger.getLogger(this.getClass())
            .debug(
                "Ocurrio una excepcion al intentar cerrar la conexion Servicio LB54.."
                    + e.getMessage());
      }
    }
  }
 /**
  * Arma la trama de entrada para la transacción LZ80
  *
  * @param trama_entrada
  */
 private void obtenerTramaEntrada(StringBuffer trama_entrada) {
   if (importe.indexOf(".") > -1)
     importe =
         importe.substring(0, importe.indexOf(".")) + importe.substring(importe.indexOf(".") + 1);
   // trama_entrada.append( SantanderUtileriasService.armaCabeceraPS7(canal,"LZ80", "NZ80", 150,
   // "00"));
   trama_entrada.append(SantanderUtileriasService.armaCabeceraPS7("LZ80", "NZ80", 165, "00"));
   trama_entrada.append(SantanderUtileriasService.rellenar(modo_operacion, 1, 'A', 'D'));
   trama_entrada.append(SantanderUtileriasService.rellenar(cta_origen, 23, ' ', 'D'));
   trama_entrada.append(SantanderUtileriasService.rellenar(cve_cargo, 4, ' ', 'I'));
   trama_entrada.append(SantanderUtileriasService.rellenar(cta_destino, 23, ' ', 'D'));
   trama_entrada.append(SantanderUtileriasService.rellenar(cve_abono, 4, ' ', 'I'));
   trama_entrada.append(SantanderUtileriasService.rellenar(importe, 15, '0', 'I'));
   trama_entrada.append(SantanderUtileriasService.rellenar(reference_No, 20, ' ', 'D'));
   trama_entrada.append(SantanderUtileriasService.rellenar(transaction_id, 8, '0', 'I'));
   trama_entrada.append(SantanderUtileriasService.rellenar(folio_o_cheque, 9, ' ', 'I'));
   trama_entrada.append(SantanderUtileriasService.rellenar(" ", 6, ' ', 'I'));
   // trama_entrada.append( SantanderUtileriasService.rellenar(folio_o_cheque , 15, '0', 'I'));
   trama_entrada.append(SantanderUtileriasService.rellenar("", 8, ' ', 'I'));
   trama_entrada.append(SantanderUtileriasService.rellenar("", 25, ' ', 'I'));
   trama_entrada.append(SantanderUtileriasService.rellenar(num_Mov_Cargo, 9, ' ', 'I'));
   trama_entrada.append(SantanderUtileriasService.rellenar(num_Mov_Abono, 9, ' ', 'I'));
   System.out.println("Enviando la trama: [" + trama_entrada.toString().replace(' ', '~') + "]");
 }
  /**
   * Efectúa el llamado a la transacción LZ80 como prioridad, utiliza conexión vía MQ y en su
   * defecto lo hace por socket
   */
  public void ejecuta() {
    StringBuffer commArea = new StringBuffer();
    String sResp = "";
    boolean cerrarMQ = false;
    try {
      if (sat_clacon.trim().equals("SI")) {
        cve_cargo = SantanderConstantesService.U321PS_CVE_CARGO; // "0990";
        cve_abono = SantanderConstantesService.U321PS_CVE_ABONO; // "0490";
      } else if (pagoser.trim().equals("SI")) {
        cve_cargo = "0687";
        cve_abono = "0187";
      } else if (modo_operacion.equalsIgnoreCase("A")) {
        cve_cargo = SantanderConstantesService.LZ80_CVE_CARGO;
        cve_abono = SantanderConstantesService.LZ80_CVE_ABONO;
      } else {
        cve_cargo = SantanderConstantesService.LZ80_CVE_CARGO_ANULACION;
        cve_abono = SantanderConstantesService.LZ80_CVE_ABONO_ANULACION;
      }

      /*
       * Autor:		Andrés Reyes Zamorategui
       * Empresa:		Stefanini IT Solutions
       * Comentario:	Se agraga el flujo en caso de Offline, se emplea Tuxedo por Oflisrvr
       * Proyecto:	SuperNet Offline 200616800
       */

      /*
       *  => AERZ :: Stefanini - 29/10/2007
       */
      if (SantanderConstantesService.estaEnLinea()) {
        if (daomq == null) {
          daomq = new ServiciosDAOMQ();
          cerrarMQ = true;
        }
        obtenerTramaEntrada(commArea);
        System.out.println("!ENVIA[" + commArea.toString().replace(' ', '~') + "]");
        sResp = daomq.obtenerTrama(commArea.toString());
        System.out.println("°°°ServicioLZ80 Salida = " + sResp);
      } else {
        SantanderOFFLISRVRService oflisrvr = new SantanderOFFLISRVRService();
        if (modo_operacion.equalsIgnoreCase("A")) {
          oflisrvr.setCuentaOrigen(this.cta_origen); // Cuenta 1
          oflisrvr.setCuentaDestino(this.cta_destino); // Cuenta 2           	
        } else {
          oflisrvr.setCuentaOrigen(this.cta_destino); // Cuenta 2
          oflisrvr.setCuentaDestino(this.cta_origen); // Cuenta 1
        }
        oflisrvr.setImporte(this.importe); // Importe
        oflisrvr.setCveOperacion(cve_cargo); // Clave de Cargo
        oflisrvr.setCveOperacion2(cve_abono); // Clave de Abono
        oflisrvr.setProcedencia(this.reference_No);
        oflisrvr.setNumeroReferencia(
            this.folio_o_cheque); // Referencia  - Se calcula automáticamente

        oflisrvr.ejecuta();

        org.apache.log4j.Logger.getLogger(this.getClass())
            .debug("el codigo de error es : " + oflisrvr.getCodigoEstatus());
        org.apache.log4j.Logger.getLogger(this.getClass())
            .debug("el mensaje de estatus : " + oflisrvr.getMensajeEstatus());

        if (oflisrvr.getCodigoEstatus() == 0) {
          this.cod_status = 0;
          this.msg_status =
              SantanderConstantesService.U321
                  + SantanderUtileriasService.rellenar("" + this.cod_status, 4, '0', 'I')
                  + " "
                  + SantanderConstantesService.RESPUESTA_SOCKET;
          SantanderConstantesService.escribeAlLog(
              SantanderConstantesService.NIVEL2,
              "TUXE",
              SantanderConstantesService.LZ80_OFLISRVR,
              this.cod_status,
              this.nombre_clase,
              "Recibiendo de Tuxedo: ",
              this.msg_status);
          return;
        } else {
          this.cod_status = oflisrvr.getCodigoEstatus();
          this.msg_status = oflisrvr.getMensajeEstatus();
          SantanderConstantesService.escribeAlLog(
              SantanderConstantesService.NIVEL2,
              "TUXE",
              SantanderConstantesService.LZ80_OFLISRVR,
              this.cod_status,
              this.nombre_clase,
              "Recibiendo de Tuxedo: ",
              this.msg_status);
          return;
        }
      }
      /*
       *  <= AERZ :: Stefanini - 28/10/2007
       */

      if (sResp.trim().equals("")) {
        System.out.println("*****Error 99 0");
        procesaEstatus(99, " SIN RESPUESTA 390", commArea);
        return;
      } else if (sResp.indexOf("NO EXISTE  TERMINAL ACTIVO") > -1) {
        procesaEstatus(99, " NO HAY TERMINALES 390 PARA ATENDER LA PETICION", commArea);
        return;
      } else if (sResp.indexOf("ABEND CICS") > -1 || sResp.indexOf("failed with abend") > -1) {
        procesaEstatus(99, " TRANSACTION WITH ABEND", commArea);
        return;
      } else if (sResp.indexOf("@ER") > -1) {
        System.out.println(
            "***************************Sucedio un error en el servicio ERR****************************");
        if (sResp.indexOf("REFERENCIA SAF-T-PAY PAGADA CON ANTERIORIDAD") > -1) {
          procesaEstatus(144, " REFERENCIA SAF-T-PAY PAGADA CON ANTERIORIDAD", commArea);
        } else if ((sResp.indexOf("EL CAMPO") > -1)
            && (sResp.indexOf("DEBE ESTAR TOTALMENTE INFORMADO") > -1)) {
          procesaEstatus(141, traeCodError(sResp), commArea);
        } else if (sResp.indexOf("CLAVE DE OPERACION INCORRECTA") > -1) {
          procesaEstatus(141, " CLAVE DE OPERACION INCORRECTA", commArea);
        } else if (sResp.indexOf("ERROR DB2 EN ACCESO A TABLAS CORPORATIVAS") > -1) {
          procesaEstatus(141, " ERROR DB2 EN ACCESO A TABLAS CORPORATIVAS", commArea);
        } else if (sResp.indexOf("CLAVE DE OPERACION DE CARGO INCORRECTA") > -1) {
          procesaEstatus(141, " CLAVE DE OPERACION DE CARGO INCORRECTA", commArea);
        } else if (sResp.indexOf("CLAVE DE OPERACION DE ABONO INCORRECTA") > -1) {
          procesaEstatus(141, " CLAVE DE OPERACION DE ABONO INCORRECTA", commArea);
        } else if (sResp.indexOf("CUENTA DE CARGO Y CUENTA DE ABONO NO PUEDEN SER IGUALES") > -1) {
          procesaEstatus(141, " CUENTA DE CARGO Y CUENTA DE ABONO NO PUEDEN SER IGUALES", commArea);
        } else if (sResp.indexOf("CUENTA DE CARGO Y CUENTA DE ABONO NO PUEDEN SER IGUALES") > -1) {
          procesaEstatus(141, " CUENTA DE CARGO Y CUENTA DE ABONO NO PUEDEN SER IGUALES", commArea);
        } else if (sResp.indexOf("MOVIMIENTO A ANULAR NO EXISTE") > -1) {
          procesaEstatus(36, " MOVIMIENTO A ANULAR NO EXISTE", commArea);
        } else if (sResp.indexOf("EL MOVIMIENTO A ANULAR YA ESTA ANULADO") > -1) {
          procesaEstatus(36, " EL MOVIMIENTO A ANULAR YA ESTA ANULADO", commArea);
        } else if ((sResp.indexOf("PROBLEMAS EN ACCESO AL MODULO DE") > -1)
            && (sResp.indexOf("AVISE AL C.P.D.") > -1)) {
          procesaEstatus(36, traeCodError(sResp), commArea);
        } else if (sResp.indexOf("APLICACION NO DISPONIBLE") > -1) {
          procesaEstatus(36, " APLICACION NO DISPONIBLE", commArea);
        } else if (sResp.indexOf("CODIGO DE DIVISA INEXISTENTE") > -1) {
          procesaEstatus(36, " CODIGO DE DIVISA INEXISTENTE", commArea);
        } else if (sResp.indexOf("LA DIVISA DE LA CUENTA HA SIDO DADA DE BAJA") > -1) {
          procesaEstatus(36, " LA DIVISA DE LA CUENTA HA SIDO DADA DE BAJA", commArea);
        } else if (sResp.indexOf(
                "LAS DIVISAS ABONO/CARGO DEBEN SER IGUALES PARA REALIZAR EL TRASPASO")
            > -1) {
          procesaEstatus(
              36, " LAS DIVISAS ABONO/CARGO DEBEN SER IGUALES PARA REALIZAR EL TRASPASO", commArea);
        } else if (sResp.indexOf("SAF-T-PAY UNICAMENTE ACEPTA PAGOS POR SUPERNET") > -1) {
          procesaEstatus(36, " SAF-T-PAY UNICAMENTE ACEPTA PAGOS POR SUPERNET", commArea);
        } else if (sResp.indexOf(
                "LA CUENTA DE CARGO RECIBIDA NO COINCIDE CON LA REGISTRADA ANTERIORMENTE")
            > -1) {
          procesaEstatus(
              36,
              " LA CUENTA DE CARGO RECIBIDA NO COINCIDE CON LA REGISTRADA ANTERIORMENTE",
              commArea);
        } else if (sResp.indexOf(
                "LA CUENTA DE CARGO ES CUENTA DE ESPERA, NO ACEPTA PAGO A SAF-T-PAY")
            > -1) {
          procesaEstatus(
              36, " LA CUENTA DE CARGO ES CUENTA DE ESPERA, NO ACEPTA PAGO A SAF-T-PAY", commArea);
        } else if (sResp.indexOf(
                "LA CUENTA DE ABONO RECIBIDA NO COINCIDE CON LA REGISTRADA ANTERIORMENTE")
            > -1) {
          procesaEstatus(
              36,
              " LA CUENTA DE ABONO RECIBIDA NO COINCIDE CON LA REGISTRADA ANTERIORMENTE",
              commArea);
        } else if (sResp.indexOf("USUARIO NO AUTORIZADO") > -1) {
          procesaEstatus(36, traeCodError(sResp), commArea);
        } else if (sResp.indexOf("NO EXISTE EN TABLAS CORPORATIVAS") > -1) {
          procesaEstatus(36, traeCodError(sResp), commArea);
        } else if (sResp.indexOf("PARA CARGAR EN UNA CTA. CONJUNTA SE DEBERE UTILIZAR VENTANILLA")
            > -1) {
          procesaEstatus(
              36, " PARA CARGAR EN UNA CTA. CONJUNTA SE DEBERE UTILIZAR VENTANILLA", commArea);
        } else if (sResp.indexOf("CUENTA NO EXISTE") > -1) {
          procesaEstatus(14, " LA CUENTA NO EXISTE EN LA TABLA MAESTRA", commArea);
        } else if (sResp.indexOf("BGE0040 ERROR EN DIGITO") > -1) {
          System.out.println("*****cayo en el error de digito*********");
          procesaEstatus(274, " ERROR EN EL MONTO", commArea);
        } else if (sResp.indexOf("ABEND CICS") > -1) {
          procesaEstatus(141, " EL SERVICIO EN EL CICS TIENE ERRORES DE EJECUCION", commArea);
        } else if (sResp.indexOf("FECHA OPERACION ANTERIOR A APERTURA") > -1) {
          procesaEstatus(29, " FECHA OPERACION ANTERIOR A APERTURA", commArea);
        } else if (sResp.indexOf("CLAVE DE CONCEPTO INVALIDA PARA EL PRODUCTO") > -1) {
          procesaEstatus(35, " CLAVE DE CONCEPTO INVALIDA PARA EL PRODUCTO", commArea);
        } else if (sResp.indexOf("LA CLAVE DE CONCEPTO ES ERRONEA O NO FUE INFORMADA") > -1) {
          procesaEstatus(36, " LA CLAVE DE CONCEPTO ES ERRONEA O NO FUE INFORMADA", commArea);
        } else if (sResp.indexOf("ERROR DE SISTEMA") > -1) {
          procesaEstatus(37, " ERROR DE SISTEMA", commArea);
        } else if (sResp.indexOf("MOVIMIENTO DUPLICADO, NO SE PUEDE REGISTRAR NUEVAMENTE") > -1) {
          procesaEstatus(39, " MOVIMIENTO DUPLICADO, NO SE PUEDE REGISTRAR NUEVAMENTE", commArea);
        } else if (sResp.indexOf("OFICINA OPERANTE NO VALIDA") > -1) {
          procesaEstatus(9, " OFICINA OPERANTE NO VALIDA", commArea);
        } else if (sResp.indexOf("RFC ERRONEO EN LA REFERENCIA") > -1) {
          procesaEstatus(248, " CONSULTE CON TRANSACCION QG60", commArea);
        } else if (sResp.indexOf("BLOQUEO DE CUENTA POR DEFUNCION DEL TITULAR") > -1) {
          procesaEstatus(114, " BLOQUEO DE CUENTA POR DEFUNCION DEL TITULAR", commArea);
        } else if (sResp.indexOf("NO ACEPTA PAGOS VIA INTERNET") > -1) {
          procesaEstatus(174, "NO ACEPTA PAGOS VIA INTERNET", commArea);
        } else if (sResp.indexOf(
                "TIPO MONEDA DE LA CUENTA ABONO-CARGO NO COINCIDE CON EL DE ESTA CUENTA")
            > -1) {
          procesaEstatus(
              115,
              " TIPO MONEDA DE LA CUENTA ABONO-CARGO NO COINCIDE CON EL DE ESTA CUENTA",
              commArea);
        } else if (sResp.indexOf("IMPORTE A DEPOSITAR FUERA DE POLITICAS") > -1) {
          procesaEstatus(254, "IMPORTE A DEPOSITAR FUERA DE POLITICAS", commArea);
        } else if (sResp.indexOf("OPCION CHEQUES NO DISP. POR EL MOMENTO") > -1) {
          procesaEstatus(
              99,
              " TIPO MONEDA DE LA CUENTA ABONO-CARGO NO COINCIDE CON EL DE ESTA CUENTA",
              commArea);
        } else if (sResp.indexOf("CUENTA DE CARGO CANCELADA") > -1) {
          procesaEstatus(
              250,
              " TIPO MONEDA DE LA CUENTA ABONO-CARGO NO COINCIDE CON EL DE ESTA CUENTA",
              commArea);
        } else if (sResp.indexOf("DIGITO DE CONTROL DEL NUMERO DE REFERENCIA ERRONEO") > -1) {
          procesaEstatus(
              251,
              " TIPO MONEDA DE LA CUENTA ABONO-CARGO NO COINCIDE CON EL DE ESTA CUENTA",
              commArea);
        } else if (sResp.indexOf("USUARIO NO AUTORIZADO .  IMPORTE DEL CARGO EXCEDE DEL MAXIMO")
            > -1) {
          procesaEstatus(
              252,
              " TIPO MONEDA DE LA CUENTA ABONO-CARGO NO COINCIDE CON EL DE ESTA CUENTA",
              commArea);
        } else if (sResp.indexOf("CLAVE DE OPERACI") > -1
            && sResp.indexOf("BLOQUEADA. PARA CARGOS") > -1) {
          procesaEstatus(132, " CLAVE DE OPERACION BLOQUEADA PARA CARGOS", commArea);
        } else if (sResp.indexOf("ERROR EN DIGITO") > -1) {
          System.out.println("*****callo en el error de digito");
          procesaEstatus(274, " ERROR EN EL MONTO", commArea);
        } else if (sResp.indexOf("CUENTA DE ABONO CANCELADA") > -1) {
          procesaEstatus(133, " CUENTA DE ABONO CANCELADA", commArea);
        } else if (sResp.indexOf("DISPONIBLE INSUF") > -1
            || sResp.indexOf("OPERACION NO PERMITIDA") > -1
            || sResp.indexOf("DISPONIBLE INSUF. EN CUENTA") > -1) {
          procesaEstatus(112, " DISPONIBLE INSUF. EN CUENTA", commArea);
        } else if (sResp.indexOf("LINEA DE CAPTURA YA OPERADA Y ACEPTAD") > -1) {
          procesaEstatus(401, " LINEA DE CAPTURA YA OPERADA.", commArea);
        } else if (sResp.indexOf("LA REFER.NO ESTA EN LONG. MIN. Y MAX") > -1) {
          procesaEstatus(402, " LA REFER.NO ESTA EN LONG.", commArea);
        } else if (sResp.indexOf("CANAL NO PERMITIDO") > -1) {
          procesaEstatus(403, " CANAL NO PERMITIDO.", commArea);
        } else if (sResp.indexOf("TIPO DE VALIDACION DEBE SER 2 O 4") > -1) {
          procesaEstatus(404, " TIPO DE VALIDACION 2 O 4.", commArea);
        } else if (sResp.indexOf("TIPO DE PAGO ERRONEO") > -1) {
          procesaEstatus(405, " TIPO DE PAGO ERRONEO.", commArea);
        } else if (sResp.indexOf("LINEA CAPTURA CON CARACTER ESP") > -1) {
          procesaEstatus(406, " LINEA CAPT CON CARACTER ESP.", commArea);
        } else if (sResp.indexOf("DIGITO GLOBAL ERRONEO") > -1) {
          procesaEstatus(407, " DIGITO GLOBAL   ERRONEO.", commArea);
        } else if (sResp.indexOf("MONTO DE IMPORTE ERRONEO") > -1) {
          procesaEstatus(408, " MONTO DE IMPORTE ERRONEO.", commArea);
        } else if (sResp.indexOf("LINEA  VENCIDA") > -1) {
          procesaEstatus(409, " LINEA  VENCIDA.", commArea);
        } else if (sResp.indexOf("CUENTA ERRONEA") > -1) {
          procesaEstatus(410, " CUENTA ERRONEA.", commArea);
        } else if (sResp.indexOf("ERAHE0802") > -1) {
          procesaEstatus(411, " LINEA DE CAPTURA NO VALIDA.", commArea);
        } else if (sResp.indexOf("LA REFER.NO ESTA EN LONG") > -1) {
          procesaEstatus(226, " " + traeCodError(sResp), commArea);
        } else {
          procesaEstatus(99, " " + traeCodError(sResp), commArea);
        }
      } else if (sResp.trim().equals("")) {
        procesaEstatus(99, " TIMEOUT: SIN RESPUESTA 390", commArea);
      } else if (sResp.indexOf("ABEND CICS") > -1 || sResp.indexOf("failed with abend") > -1) {
        procesaEstatus(99, " " + traeCodError(sResp), commArea);
      } else {
        setNumsMov(sResp);
        procesaEstatus(0, " " + SantanderConstantesService.RESPUESTA_SOCKET, commArea);
      }
    } catch (Exception exception) {
      procesaEstatus(99, " ERROR FATAL " + exception.getMessage(), commArea);
    } finally {
      try {
        if (daomq != null && cerrarMQ) {
          daomq.cerrarConexion();
          daomq = null;
        }
      } catch (Exception e) {
        System.out.println(
            "Ocurrio una excepcion al intentar cerrar la conexion ServicioLZ80.." + e.getMessage());
      }
    }
  }
Ejemplo n.º 6
0
  public boolean ObtenerDatos() {
    String sResp = "";
    String commArea = "";
    boolean bandera = false;
    try {
      if (daomq == null) {
        daomq = new ServiciosDAOMQ();
        cerrarMQ = true;
      }
      commArea = SantanderUtileriasService.armaCabeceraPS7("LB44", "NB44", 56, "00");
      commArea = commArea + SantanderUtileriasService.rellenar(stBine, 6, ' ', 'D');
      org.apache.log4j.Logger.getLogger(this.getClass())
          .debug("!ENVIA[" + commArea.replace(' ', '~') + "]");

      sResp = daomq.obtenerTrama(commArea);

      if (sResp.trim().equals("")) {
        codStatus = 99;
        msgStatus =
            "LB44"
                + SantanderUtileriasService.rellenar(String.valueOf(codStatus), 4, '0', 'I')
                + " SIN RESPUESTA 390";
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "390",
            "LB44",
            codStatus,
            nombClase,
            "Enviando la trama: " + commArea,
            msgStatus);
        return false;
      }

      if (sResp.indexOf("NO EXISTE  TERMINAL ACTIVO") > -1) {
        codStatus = 99;
        msgStatus =
            "LB44"
                + SantanderUtileriasService.rellenar(String.valueOf(codStatus), 4, '0', 'I')
                + " NO HAY TERMINALES 390 PARA ATENDER LA PETICION";
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "390",
            "LB44",
            codStatus,
            nombClase,
            "Enviando la trama: " + commArea,
            msgStatus);
        return false;
      }

      if (sResp.indexOf("ABEND CICS") > -1 || sResp.indexOf("failed with abend") > -1) {
        codStatus = 99;
        msgStatus =
            "LB44"
                + SantanderUtileriasService.rellenar(String.valueOf(codStatus), 4, '0', 'I')
                + " TRANSACTION WITH ABEND";
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "390",
            "LB44",
            codStatus,
            nombClase,
            "Enviando la trama: " + commArea,
            msgStatus);
        return false;
      }

      if (sResp.indexOf("ERROR") > -1) {
        codStatus = 99;
        msgStatus =
            "LB44"
                + SantanderUtileriasService.rellenar(String.valueOf(codStatus), 4, '0', 'I')
                + " ERROR EN ACCESO A LA TABLA";
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "390",
            "LB44",
            codStatus,
            nombClase,
            "Enviando la trama: " + commArea,
            msgStatus);
        return false;
      }

      if (sResp.indexOf("NO EXISTE") > -1) {
        codStatus = 5092;
        msgStatus =
            "LB44"
                + SantanderUtileriasService.rellenar(String.valueOf(codStatus), 4, '0', 'I')
                + " NO EXISTEN FONDOS A OPERAR";
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "390",
            "LB44",
            codStatus,
            nombClase,
            "Enviando la trama: " + commArea,
            msgStatus);
        return false;
      }

      if (sResp.indexOf("EXISTEN MAS DATOS") > -1) bandera = true;
      else if (sResp.indexOf("FIN DE DATOS") > -1) bandera = false;

      if (sResp.indexOf("DCLBM0044") > -1) {
        int posIni = 0;

        posIni = sResp.indexOf("@DCLBM0044");

        try {
          org.apache.log4j.Logger.getLogger(this.getClass()).debug("°°°Transaccion OK °°°");
          // Desentramar datos
          // org.apache.log4j.Logger.getLogger(this.getClass()).debug("°°°°Posision inicial:" +
          // posIni + "°°°");
          String stTemp = sResp.substring(posIni);
          // org.apache.log4j.Logger.getLogger(this.getClass()).debug("°°°°Cadena recibida:\n°°°°" +
          // stTemp + "°°°");
          // org.apache.log4j.Logger.getLogger(this.getClass()).debug("°°°°Longitud de la cadena:" +
          // stTemp.length() + "°°°");
          stDescripcion = stTemp.substring(18);
          stDescripcion = stDescripcion.trim();
          // org.apache.log4j.Logger.getLogger(this.getClass()).debug("Descripcion:" +
          // stDescripcion);
          codStatus = 0;

        } catch (Exception _ex) {
          org.apache.log4j.Logger.getLogger(this.getClass()).debug(_ex.getMessage());
          _ex.printStackTrace();
          codStatus = 99;
        }
      }
    } catch (Exception e) {

      codStatus = 99;
      msgStatus =
          "LB44"
              + SantanderUtileriasService.rellenar(String.valueOf(codStatus), 4, '0', 'I')
              + " ERROR AL EJECUTAR SERVICIO:"
              + e.getMessage();
      SantanderConstantesService.escribeAlLog(
          SantanderConstantesService.NIVEL2,
          "390",
          "LB44",
          codStatus,
          nombClase,
          "Instanciando Objeto Socket 390",
          msgStatus);
      return false;
    }
    return bandera;
  }
  public void ejecuta() {
    String sResp = "";
    String commArea = "";
    boolean cerrarMQ = false;
    try {
      if (daomq == null) {
        daomq = new ServiciosDAOMQ();
        cerrarMQ = true;
      }
      commArea = SantanderUtileriasService.armaCabeceraPS7("LF92", "NF92", 30, "00");
      commArea += SantanderUtileriasService.rellenar(this.empresa, 4, ' ', 'D');
      commArea += SantanderUtileriasService.rellenar(this.numCuenta, 16, ' ', 'D');
      commArea += SantanderUtileriasService.rellenar(this.fchConsulta, 10, ' ', 'D');
      org.apache.log4j.Logger.getLogger(this.getClass())
          .debug("!ENVIA[" + commArea.replace(' ', '~') + "]");

      sResp = daomq.obtenerTrama(commArea);

      if (sResp.trim().equals("")) {
        this.codStatus = 99;
        this.msgStatus =
            "LF92"
                + SantanderUtileriasService.rellenar("" + this.codStatus, 4, '0', 'I')
                + " SIN RESPUESTA 390";
      } else if (sResp.indexOf("NO EXISTE  TERMINAL ACTIVO") > -1) {
        this.codStatus = 99;
        this.msgStatus =
            "LF92"
                + SantanderUtileriasService.rellenar("" + this.codStatus, 4, '0', 'I')
                + " NO HAY TERMINALES 390 PARA ATENDER LA PETICION";
      } else if (sResp.indexOf("ABEND CICS") > -1 || sResp.indexOf("failed with abend") > -1) {
        this.codStatus = 99;
        this.msgStatus =
            "LF92"
                + SantanderUtileriasService.rellenar("" + this.codStatus, 4, '0', 'I')
                + " TRANSACTION WITH ABEND";
      } else if (sResp.indexOf("NO EXISTE CONTRATO BME") > -1) {
        this.codStatus = 94;
        this.msgStatus =
            "LF92"
                + SantanderUtileriasService.rellenar("" + this.codStatus, 4, '0', 'I')
                + " NO EXISTE EL CONTRATO BME";
      } else if (sResp.indexOf("NO EXISTEN DATOS A CONSULTAR EN EL PORTAFOLIO DE FONDOS") > -1) {
        this.codStatus = 47;
        this.msgStatus =
            "LF92"
                + SantanderUtileriasService.rellenar("" + this.codStatus, 4, '0', 'I')
                + " NO EXISTEN DATOS A CONSULTAR";
      } else if (sResp.indexOf("@DCLF2S920") > -1) {
        ObtenerPosicion(sResp);
        this.codStatus = 0;
        this.msgStatus =
            "LF92"
                + SantanderUtileriasService.rellenar("" + this.codStatus, 4, '0', 'I')
                + " CONSULTA SALDOS FONDO INVERSION EFECTUADA";
      }
    } catch (Exception e) {
      this.codStatus = 99;
      this.msgStatus =
          "LF92"
              + SantanderUtileriasService.rellenar("" + this.codStatus, 4, '0', 'I')
              + " ERROR CONSULTA SALDOS FONDO INVERSION "
              + e.getMessage();
      SantanderConstantesService.escribeAlLog(
          SantanderConstantesService.NIVEL2,
          "390",
          "LF92",
          this.codStatus,
          this.nombClase,
          "Instanciando Objeto Socket 390",
          this.msgStatus);
      return;
    } finally {
      if (daomq != null && cerrarMQ) {
        daomq.cerrarConexion();
        daomq = null;
      }
    }

    // -------COMENZAR Codigo para desplegar Contrato en Cero-------//
    if (this.detalle.isEmpty() && (this.codStatus == 47 || this.codStatus == 0)) {
      // Inicio modificación CONSYS 13-Mayo-2005//
      String[] saldoFondos = new String[5];
      saldoFondos[0] = ""; // 8 Emisora
      saldoFondos[1] = ""; // 8 Serie
      saldoFondos[2] =
          (new BigDecimal("0")).setScale(0, BigDecimal.ROUND_DOWN).toString(); // 12 Titulos
      saldoFondos[3] = "0"; // 13 Precio
      saldoFondos[4] =
          (new BigDecimal("0")).setScale(2, BigDecimal.ROUND_DOWN).toString(); // 15 Monto
      // Fin modificación CONSYS 13-Mayo-2005//
      detalle.addElement(saldoFondos);
      this.codStatus = 0;
      this.msgStatus =
          "LF92"
              + SantanderUtileriasService.rellenar("" + this.codStatus, 4, '0', 'I')
              + " CONSULTA SALDOS FONDO INVERSION EFECTUADA";
    }
    // -------TERMINAR Codigo para desplegar Contrato en Cero-------//
    SantanderConstantesService.escribeAlLog(
        SantanderConstantesService.NIVEL2,
        "390",
        "LF92",
        this.codStatus,
        this.nombClase,
        "Enviando la trama: " + commArea,
        this.msgStatus);
  }
Ejemplo n.º 8
0
  public void ejecuta() {
    //        codError  = "BACO9999 Error: exception catch Servicio DB2_BASI_CON tuxedo";
    //        msgStatus = "BACO9999 Error al ejecutar el servicio de tuxedo BasiCon";
    try {
      // String     codeError  = "";
      org.apache.log4j.Logger.getLogger(this.getClass()).debug("");
      String buffer = "";
      char separador = '|';
      int location = 0;
      StringBuffer msb = new StringBuffer();

      //			mPrueba1();//

      /*msb.append("transfer");
      			msb.append(separador);
      			msb.append(this.suc_opera);
      			msb.append(separador);
      			msb.append(this.referencia);
      			msb.append(separador);
      			msb.append(this.importe1);
      			msb.append(separador);
      			msb.append(this.tipo_operacion);
      			msb.append(separador);
      			msb.append(this.cuenta);
      			msb.append(separador);
      			msb.append(this.cuenta2);
      			msb.append(separador);
      			msb.append(this.medio_entrega);
      			msb.append(separador);
      			msb.append(this.cve_operacion);
      			msb.append(separador);
      			msb.append(this.cve_operacion2);
      			msb.append(separador);
      */

      try {
        msb.append("transfer");
        msb.append(separador);
        msb.append(this.ruta);
        msb.append(separador);
        msb.append(this.suc_opera);
        msb.append(separador);
        referencia = ejecServicioObtNumReferencia();
        msb.append(this.referencia);
        msb.append(separador);
        msb.append(this.importe1);
        msb.append(separador);
        msb.append(this.tipo_operacion);
        msb.append(separador);
        msb.append(this.cod_error);
        msb.append(separador);
        msb.append(this.fecha);
        msb.append(separador);
        msb.append(this.cuenta);
        msb.append(separador);
        msb.append(this.cuenta2);
        msb.append(separador);
        msb.append(this.plaza_origen);
        msb.append(separador);
        msb.append(this.plaza_destino);
        msb.append(separador);
        msb.append(this.medio_entrega);
        msb.append(separador);
        msb.append(this.plaza_enlace);
        msb.append(separador);
        msb.append(this.version);
        msb.append(separador);
        msb.append(this.cve_operacion);
        msb.append(separador);
        msb.append(this.cve_operacion2);
        msb.append(separador);
        msb.append(this.procedencia);
        msb.append(separador);
        msb.append(this.tipo_soc);
        msb.append(separador);
      } catch (Exception e) {
        org.apache.log4j.Logger.getLogger(this.getClass())
            .debug("No se pudoformatr la trama, un parametro viene en null");
      }

      // Llamado al Socket Tuxedo
      // Globales.escribeAlLog (Globales.NIVEL2, "TUX", Globales.BACO, 0, nombreClase, "Ejecutando,
      // datos: " + msb, "");
      org.apache.log4j.Logger.getLogger(this.getClass())
          .debug("buffer a enviar a tuxedo: " + msb.toString());
      buffer = sendTuxedo(msb, "", "");
      org.apache.log4j.Logger.getLogger(this.getClass())
          .debug("buffer recibido de texudeo: " + buffer);
      if (buffer.trim().length() == 0) {
        codigo_estatus = 127;
        msgStatus =
            SantanderConstantesService.BASI
                + SantanderConstantesService.MEN_ERROR
                + "ERROR AL EJECUTAR EL SERVICIO DE TUXEDO : El buffer de respuesta recibido viene vacio "
                + codigo_estatus;
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "TUX",
            "TRAN",
            43,
            "ServicioTransfer",
            "ERROR AL EJECUTAR EL SERVICIO DE TUXEDO TUBO: El buffer de respuesta recibido viene vacio + ",
            codigo_estatus + "");
        return;
      } else org.apache.log4j.Logger.getLogger(this.getClass()).debug("buffer " + buffer);

      location = buffer.indexOf('|');

      if (buffer.length() > 0) {

        cod_error = buffer.substring(0, location);
        buffer = buffer.substring(location + 1);
      }

      org.apache.log4j.Logger.getLogger(this.getClass()).debug("cod_error " + cod_error);
      org.apache.log4j.Logger.getLogger(this.getClass()).debug(buffer);

      if (cod_error.equals("COMU9009")) {

        codigo_estatus = 6;
        msgStatus =
            "TUX"
                + SantanderConstantesService.MEN_ERROR
                + "ERROR AL EJECUTAR SERVICIO AL EJECUTAR EL SERVICIO DE TUXEDO  TUBO , El Codigo de Cliente No Existe o El servicios Tuxedo no esta en servicio, datos: "
                + this.cuenta
                + "|F ";
        //            Globales.escribeAlLog (Globales.NIVEL2, "TUX", Globales.BACO, 121,
        // "ServicioTransfer", "Ejecutando, datos: " + this.cuenta+"|F", "ERROR AL EJECUTAR EL
        // SERVICIO DE TUXEDO TUBO : El CODIGO DEL CLIENTE NO EXISTE O NO ESTA DISPONIBLE EL
        // SERVICIO ");
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "TUX",
            "TUBO",
            codigo_estatus,
            "ServicioTransfer",
            "Ejecutando, datos: " + this.cuenta + "|F",
            "ERROR AL EJECUTAR EL SERVICIO DE TUXEDO TUBO : NO HAY DATOS CON ESE PRODUCTO O NO ESTA DISPONIBLE EL SERVICIO ");
        return;
      } else if (cod_error.equals("TUBO0040")) {
        codigo_estatus = 9009;
        msgStatus =
            "TUX"
                + SantanderConstantesService.MEN_ERROR
                + "ERROR AL EJECUTAR SERVICIO AL EJECUTAR EL SERVICIO DE TUXEDO  TUBO , EL CAMPO CTA-ABONO-DIV ES OBLIGATORIO  Y EL EL CAMPO CTA-CARGO-DIV ES OBLIGATORIO, datos: "
                + this.cuenta
                + "|F ";
        //            Globales.escribeAlLog (Globales.NIVEL2, "TUX", Globales.BACO, 121,
        // "ServicioTransfer", "Ejecutando, datos: " + this.cuenta+"|F", "ERROR AL EJECUTAR EL
        // SERVICIO DE TUXEDO TUBO : El CODIGO DEL CLIENTE NO EXISTE O NO ESTA DISPONIBLE EL
        // SERVICIO ");
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "TUX",
            "TUBO",
            codigo_estatus,
            "ServicioTransfer",
            "Ejecutando, datos: " + this.cuenta + "|F",
            "ERROR AL EJECUTAR EL SERVICIO DE TUXEDO TUBO : EL CAMPO CTA-ABONO-DIV ES OBLIGATORIO Y EL CAMPO CTA-CARGO-DIV ES OBLIGATORIO");
        return;
      } else if (cod_error.equals("TUBO0258")) {
        codigo_estatus = 9009;
        msgStatus =
            "TUX"
                + SantanderConstantesService.MEN_ERROR
                + "ERROR AL EJECUTAR SERVICIO AL EJECUTAR EL SERVICIO DE TUXEDO  TUBO , IMPORTE INCORRECTO O NO INFORMADO., datos: "
                + this.cuenta
                + "|F ";
        //            Globales.escribeAlLog (Globales.NIVEL2, "TUX", Globales.BACO, 121,
        // "ServicioTransfer", "Ejecutando, datos: " + this.cuenta+"|F", "ERROR AL EJECUTAR EL
        // SERVICIO DE TUXEDO TUBO : El CODIGO DEL CLIENTE NO EXISTE O NO ESTA DISPONIBLE EL
        // SERVICIO ");
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "TUX",
            "TUBO",
            codigo_estatus,
            "ServicioTransfer",
            "Ejecutando, datos: " + this.cuenta + "|F",
            "ERROR AL EJECUTAR EL SERVICIO DE TUXEDO TUBO : IMPORTE INCORRECTO O NO INFORMADO.");
        return;
      } else if (cod_error.equals("TUBO0122")) {

        codigo_estatus = 13;
        msgStatus =
            "TUX"
                + SantanderConstantesService.MEN_ERROR
                + "el servicio tuxedo no responde, consulte a soporte tecnico: "
                + this.cuenta
                + "|F ";
        //            Globales.escribeAlLog (Globales.NIVEL2, "TUX", Globales.BACO, 121,
        // "ServicioSaldos", "Ejecutando, datos: " + this.cuenta+"|F", "ERROR AL EJECUTAR EL
        // SERVICIO DE TUXEDO SALDO ");
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "TUX",
            "TUBO",
            codigo_estatus,
            "SrevicioTransfer",
            "Ejecutando, datos: " + this.cuenta + "|F",
            "ERROR AL EJECUTAR EL SERVICIO DE TUXEDO SALDOS: Transaction with Abend");
        return;
      } else if (cod_error.equals("TUBO0013")) {
        codigo_estatus = 9999;
        msgStatus =
            "TUX"
                + SantanderConstantesService.MEN_ERROR
                + "ERROR AL EJECUTAR SERVICIO AL EJECUTAR EL SERVICIO DE TUXEDO SALDOS: Transaction with Abend: "
                + this.cuenta
                + "|F ";
        //            Globales.escribeAlLog (Globales.NIVEL2, "TUX", Globales.BACO, 121,
        // "ServicioSaldos", "Ejecutando, datos: " + this.cuenta+"|F", "ERROR AL EJECUTAR EL
        // SERVICIO DE TUXEDO SALDO ");
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "TUX",
            "TUBO",
            codigo_estatus,
            "SrevicioTransfer",
            "Ejecutando, datos: " + this.cuenta + "|F",
            "ERROR AL EJECUTAR EL SERVICIO DE TUXEDO SALDOS: Transaction with Abend");
        return;
      } else if (cod_error.indexOf("TUBO9999") > -1) {
        org.apache.log4j.Logger.getLogger(this.getClass()).debug("nel pastel" + cod_error + "|");
        if (buffer.indexOf("SALDO INSUFICIENTE") > -1) codigo_estatus = 112;
        else if (buffer.indexOf("ERROR CUENTA NO EXISTE") > -1) codigo_estatus = 14;
        else if (buffer.indexOf("CUENTA BLOQUEADA") > -1) codigo_estatus = 401;
        else codigo_estatus = 99;
        msgStatus =
            "TUX"
                + SantanderConstantesService.MEN_ERROR
                + "ERROR AL EJECUTAR SERVICIO AL EJECUTAR EL SERVICIO DE TUXEDO SALDOS: La cuenta no existe: "
                + this.cuenta
                + "|F ";
        //            Globales.escribeAlLog (Globales.NIVEL2, "TUX", Globales.BACO, 121,
        // "ServicioSaldos", "Ejecutando, datos: " + this.cuenta+"|F", "ERROR AL EJECUTAR EL
        // SERVICIO DE TUXEDO SALDO ");
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "TUX",
            "TUBO",
            codigo_estatus,
            "SrevicioTransfer",
            "Ejecutando, datos: " + this.cuenta + "|F",
            "ERROR AL EJECUTAR EL SERVICIO DE TUXEDO SALDOS:" + buffer);
        return;
      } else if (cod_error.equals("TUBO0038")) {
        codigo_estatus = 22;
        msgStatus =
            SantanderConstantesService.BACO
                + SantanderConstantesService.MEN_ERROR
                + "ERROR AL EJECUTAR SERVICIO AL EJECUTAR EL SERVICIO DE TUXEDO SALDOS: Cuenta no existe en tabla maestra de cuentas: "
                + this.cuenta
                + "|F ";
        //            Globales.escribeAlLog (Globales.NIVEL2, "TUX", Globales.BACO, 121,
        // "ServicioSaldos", "Ejecutando, datos: " + this.cuenta+"|F", "ERROR AL EJECUTAR EL
        // SERVICIO DE TUXEDO SALDO ");
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "TUX",
            "SALD",
            codigo_estatus,
            "ServicioSaldos",
            "Ejecutando, datos: " + this.cuenta + "|F",
            "ERROR AL EJECUTAR EL SERVICIO DE TUXEDO SALDOS: Cuenta no existe en tabla maestra de cuentas");
        return;
      } else if (cod_error.equals("TUBO2122")) {
        codigo_estatus = 112;
        msgStatus =
            SantanderConstantesService.BACO
                + SantanderConstantesService.MEN_ERROR
                + "ERROR AL EJECUTAR SERVICIO AL EJECUTAR EL SERVICIO DE TUXEDO SALDOS: Disponible insufucuente en Cuentas "
                + this.cuenta
                + "|F ";
        //          Globales.escribeAlLog (Globales.NIVEL2, "TUX", Globales.BACO, 121,
        // "ServicioSaldos", "Ejecutando, datos: " + this.cuenta+"|F", "ERROR AL EJECUTAR EL
        // SERVICIO DE TUXEDO SALDO ");
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "TUX",
            "SALD",
            codigo_estatus,
            "ServicioSaldos",
            "Ejecutando, datos: " + this.cuenta + "|F",
            "ERROR AL EJECUTAR EL SERVICIO DE TUXEDO SALDOS: Disponible insufuciente en cuentas");
        return;
      } else if (cod_error.equals("TUBO0000")) {
        org.apache.log4j.Logger.getLogger(this.getClass()).debug("paso");
        codigo_estatus = 0;
        this.msgStatus =
            "TUBO"
                + SantanderUtileriasService.rellenar("" + this.codigo_estatus, 4, '0', 'I')
                + " "
                + SantanderConstantesService.RESPUESTA_SOCKET;
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "TUX",
            "TUBO",
            this.codigo_estatus,
            "ServicioTransfer",
            "Respuesta: " + buffer,
            this.msgStatus);
        return;
      } else {

        codigo_estatus = 99;
        msgStatus =
            "TUX"
                + SantanderConstantesService.MEN_ERROR
                + "ERROR AL EJECUTAR SERVICIO AL EJECUTAR EL SERVICIO DE TUXEDO  TUBO , El Codigo de Cliente No Existe o El servicios Tuxedo no esta en servicio, datos: "
                + this.cuenta
                + "|F ";
        //            Globales.escribeAlLog (Globales.NIVEL2, "TUX", Globales.BACO, 121,
        // "ServicioTransfer", "Ejecutando, datos: " + this.cuenta+"|F", "ERROR AL EJECUTAR EL
        // SERVICIO DE TUXEDO TUBO : El CODIGO DEL CLIENTE NO EXISTE O NO ESTA DISPONIBLE EL
        // SERVICIO ");
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "TUX",
            "TUBO",
            codigo_estatus,
            "ServicioTransfer",
            "Ejecutando, datos: " + this.cuenta + "|F",
            "ERROR AL EJECUTAR EL SERVICIO DE TUXEDO TUBO : NO HAY DATOS CON ESE PRODUCTO O NO ESTA DISPONIBLE EL SERVICIO ");
        return;
      }
      /*			if( buffer.indexOf("") )
      {
       codigo_estatus = 0;

      }*/

      // Globales.escribeAlLog (Globales.NIVEL2, "TUX", Globales.BACO, 0, nombreClase, "Datos
      // leidos: " + buffer, "");
      // Tomamos el codigo de error
      /* if( buffer.trim().length()==0 )
        buffer = "DB2S9999|DB2S9999|";
      location = buffer.indexOf ('|');
      if( buffer.length()>0 )
      {
        codError = buffer.substring (0, location);
        buffer   = buffer.substring(location+1);
      }
      else
      {
        buffer ="DB2S9999";
        if( codError.substring(5).trim().equals("") )
          codError = "121";
        Globales.escribeAlLog (Globales.NIVEL2, "TUX", Globales.BACO, 00, nombreClase, "Se ejecuto el ServicioBasiCon con errores", "Error al ejecutar el servicio" );
      }
      if( codError.equals("DB2S0000") )
        this.codStatus = 0;
      else
        this.codStatus = 121;
      if( codStatus ==0 ) // || this.codStatus==73 )
      {
        msgStatus = "BACO0000 Ejecucion exitosa con Tuxedo";
        String[] resultTrama   = desentrama( buffer , '|');
        //for(int i=0; i<resultTrama.length ;i++)
        //  org.apache.log4j.Logger.getLogger(this.getClass()).debug("\t"+ i +")\t["+ resultTrama[i] +"]");
        // diagonal asteristico >>> this.tramaOut          = buffer;
        this.datoRFC           = resultTrama[1];  //Ok
        this.apellidoPaterno   = resultTrama[4];  //Ok
        this.apellidoMaterno   = resultTrama[5];  //Ok
        this.soloNombre        = resultTrama[6];  //Ok
        this.fechaNacimiento   = resultTrama[8];  //Ok
        this.sexo              = resultTrama[9];  //Ok
        this.nacionalidad      = resultTrama[11]; //Ok
        this.direccion         = resultTrama[12]; //Ok
        this.codigoPostal      = resultTrama[13]; //Ok
        this.colonia           = resultTrama[14]; //Ok
        this.datoDelMun        = resultTrama[15]; //Ok
        this.ciudad            = resultTrama[16]; //Ok29
        this.estado            = resultTrama[18]; //Ok
        this.telefonoCasa      = resultTrama[40] +""+ resultTrama[41]; //Ok
        this.numSucursalCuenta = resultTrama[51]; //Ok
        this.nombre = ""+ this.soloNombre +" "+ this.apellidoPaterno +" "+ this.apellidoMaterno;
        this.nombre = this.nombre.trim();
        Globales.escribeAlLog (Globales.NIVEL2, "TUX", Globales.BACO, 00, nombreClase, "Se ejecuto el ServicioBasiCon exitosamente", "Servicio ejecutado con  Exito" );*/

      //            }
    } catch (Exception e) {
      /*e.printStackTrace();
      codStatus = 121;
      msgStatus = Globales.BACO + Globales.MEN_ERROR + "ERROR AL EJECUTAR SERVICIO AL EJECUTAR EL SERVICIO DE TUXEDO DB2_BASI_CON, datos: " + this.claveUsuario + "|F " +e.getMessage();
      Globales.escribeAlLog (Globales.NIVEL2, "TUX", Globales.BACO, 121, nombreClase, "Ejecutando, datos: " + this.claveUsuario+"|F", "ERROR AL EJECUTAR EL SERVICIO DE TUXEDO DB2_BASI_CON: " + e.getMessage());*/
    }
  }
  private boolean ObtenerDatos() {
    String commArea = null;
    String sResp = null;
    String tramaResp = null;
    boolean bandera = false;
    String canal = ""; // art52 24-01-2007
    try {

      canal = ConfiguracionMQ.getInstance().getCANAL();
      /* Revisamos si el canal por el cual se esta invocando la peticion */
      if (canal.equals("MQ")) {

        if (daomq == null) {

          daomq = new ServiciosDAOMQ();
          cerrarMQ = true;
        }

        /* Se arma trama de envio con los parametros de entrada, en la cabecesa se considera
         * 01 como tecla de funcion para Bloqueos */
        commArea =
            SantanderUtileriasService.armaCabeceraPS7(canal, "LB54", "NB54", 10, this.teclaFunc);
        commArea += SantanderUtileriasService.rellenar(this.cliente, 8, ' ', 'I');
        commArea += SantanderUtileriasService.rellenar(this.estatusToken, 2, '0', 'I');
        org.apache.log4j.Logger.getLogger(this.getClass()).debug("TRAMA ENVIA [" + commArea + "]");
        sResp = daomq.obtenerTrama(commArea);
        tramaResp = sResp;

      } else {
        if (!envia.connect()) {
          this.codStatus = envia.getCodigoEstatus();
          this.msgStatus =
              "LB54"
                  + SantanderUtileriasService.rellenar("" + this.codStatus, 4, '0', 'I')
                  + " "
                  + envia.getMensajeEstatus();
          SantanderConstantesService.escribeAlLog(
              SantanderConstantesService.NIVEL2,
              "390",
              "LB54",
              this.codStatus,
              this.nombreClase,
              "Enviando la trama: " + commArea,
              this.msgStatus);
          return false;
        }
        commArea = SantanderUtileriasService.armaCabeceraPS7(canal, "LB54", "NB54", 10, "00");
        commArea += SantanderUtileriasService.rellenar(this.cliente, 8, ' ', 'I');
        commArea += SantanderUtileriasService.rellenar(this.estatusToken, 2, '0', 'I');
        org.apache.log4j.Logger.getLogger(this.getClass()).debug("TRAMA ENVIA [" + commArea + "]");
        envia.setStrIn(commArea);
        if (!envia.send()) {
          this.codStatus = envia.getCodigoEstatus();
          this.msgStatus =
              "LB54 "
                  + SantanderUtileriasService.rellenar("" + this.codStatus, 4, '0', 'I')
                  + " "
                  + envia.getMensajeEstatus();
          SantanderConstantesService.escribeAlLog(
              SantanderConstantesService.NIVEL2,
              "390",
              "LB54",
              this.codStatus,
              this.nombreClase,
              "Enviando la trama: " + commArea,
              this.msgStatus);
          return false;
        }
        sResp = (envia.getStrOut() == null) ? "" : envia.getStrOut();
        tramaResp = sResp;
      }

      org.apache.log4j.Logger.getLogger(this.getClass()).debug("TRAMA RECIBE [" + sResp + "]");
      if (sResp.trim().equals("")) {
        this.codStatus = 99;
        this.msgStatus =
            "LB54 "
                + SantanderUtileriasService.rellenar("" + this.codStatus, 4, '0', 'I')
                + " SIN RESPUESTA 390";
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "390",
            "LB54",
            this.codStatus,
            this.nombreClase,
            "Enviando la trama: " + commArea,
            this.msgStatus);
        return false;
      } else if (sResp.indexOf("NO EXISTE  TERMINAL ACTIVO") > -1) {
        this.codStatus = 99;
        this.msgStatus =
            "LB54 "
                + SantanderUtileriasService.rellenar("" + this.codStatus, 4, '0', 'I')
                + " NO HAY TERMINALES 390 PARA ATENDER LA PETICION";
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "390",
            "LB54",
            this.codStatus,
            this.nombreClase,
            "Enviando la trama: " + commArea,
            this.msgStatus);
        return false;
      } else if (sResp.indexOf("ABEND CICS") > -1 || sResp.indexOf("failed with abend") > -1) {
        this.codStatus = 99;
        this.msgStatus =
            "LB54 "
                + SantanderUtileriasService.rellenar("" + this.codStatus, 4, '0', 'I')
                + " TRANSACTION WITH ABEND";
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "390",
            "LB54",
            this.codStatus,
            this.nombreClase,
            "Enviando la trama: " + commArea,
            this.msgStatus);
        return false;
      } else if (sResp.indexOf("NO EXISTEN DATOS PARA LA CONSULTA SOLICITADA") > -1) {
        this.codStatus = 99;
        this.msgStatus =
            "LB54 "
                + SantanderUtileriasService.rellenar("" + this.codStatus, 4, '0', 'I')
                + " NO EXISTEN DATOS PARA LA CONSULTA SOLICITADA";
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "390",
            "LB54",
            this.codStatus,
            this.nombreClase,
            "Enviando la trama: " + commArea,
            this.msgStatus);
        return false;
      } else if (sResp.indexOf("NO HAY MOVIMIENTOS") > -1) {
        this.codStatus = 97;
        this.msgStatus =
            "LB54 "
                + SantanderUtileriasService.rellenar("" + this.codStatus, 4, '0', 'I')
                + " NO HAY MOVIMIENTOS";
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "390",
            "LB54",
            this.codStatus,
            this.nombreClase,
            "Enviando la trama: " + commArea,
            this.msgStatus);
        return false;
      } else if (sResp.indexOf("Transaction '' is not recognized") > -1) {
        this.codStatus = 99;
        this.msgStatus =
            "LB54 "
                + SantanderUtileriasService.rellenar("" + this.codStatus, 4, '0', 'I')
                + " NO HAY MOVIMIENTOS";
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "390",
            "LB54",
            this.codStatus,
            this.nombreClase,
            "Enviando la trama: " + commArea,
            this.msgStatus);
        return false;
      } else if (sResp.indexOf("MENSAJE RECIBIDO DEL PS7 ES ERRONEA") > -1) {
        this.codStatus = 99;
        this.msgStatus =
            "LB54 "
                + SantanderUtileriasService.rellenar("" + this.codStatus, 4, '0', 'I')
                + " FORMATO PS7 INCORRECTO PARA REALIZAR CONSULTA";
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "390",
            "LB54",
            this.codStatus,
            this.nombreClase,
            "Enviando la trama: " + commArea,
            this.msgStatus);
        return false;
      } else if (sResp.indexOf("@AVLBA") > -1) {
        org.apache.log4j.Logger.getLogger(this.getClass())
            .debug(
                "---------------------------------------------------------------------------------");
        org.apache.log4j.Logger.getLogger(this.getClass())
            .debug("ESTA ES LA TRAMA DE RESPUESTA DESDE 390 <<<" + sResp + ">>>");
        try {
          sResp = sResp.substring(sResp.indexOf("P") + 1);
        } catch (Exception e) {
        }
        org.apache.log4j.Logger.getLogger(this.getClass())
            .debug("ESTA ES LA TRAMA DE RESPUESTA DESDE 390 DESPUES DEL SUBS <<<" + sResp + ">>>");
        org.apache.log4j.Logger.getLogger(this.getClass())
            .debug(
                "---------------------------------------------------------------------------------");

        this.codStatus = 0;
        bandera = true;
        this.msgStatus =
            "LB54"
                + SantanderUtileriasService.rellenar("" + this.codStatus, 4, '0', 'I')
                + " "
                + SantanderConstantesService.RESPUESTA_SOCKET;
      } else {
        this.codStatus = 99;
        this.msgStatus =
            "LB54 "
                + SantanderUtileriasService.rellenar("" + this.codStatus, 4, '0', 'I')
                + " ERROR DESCONOCIDO";
        SantanderConstantesService.escribeAlLog(
            SantanderConstantesService.NIVEL2,
            "390",
            "LB54",
            this.codStatus,
            this.nombreClase,
            "Enviando la trama: " + commArea,
            this.msgStatus);
        return false;
      }
      SantanderConstantesService.escribeAlLog(
          SantanderConstantesService.NIVEL2,
          "390",
          "LB54",
          this.codStatus,
          this.nombreClase,
          "Enviando la trama: " + commArea,
          this.msgStatus);
    } catch (Exception e) {
      this.codStatus = 99;
      this.msgStatus =
          "LB54"
              + SantanderUtileriasService.rellenar("" + this.codStatus, 4, '0', 'I')
              + " ERROR AL EJECUTAR SERVICIO: "
              + e.getMessage();
      SantanderConstantesService.escribeAlLog(
          SantanderConstantesService.NIVEL2,
          "390",
          "LB54",
          this.codStatus,
          this.nombreClase,
          "Enviando la trama: " + commArea,
          "ERROR AL EJECUTAR SERVICIO: " + e.getMessage());
      return false;
    }
    if (this.codStatus == -1) {
      this.codStatus = 99;
      SantanderConstantesService.escribeAlLog(
          SantanderConstantesService.NIVEL2,
          "390",
          "LB54",
          this.codStatus,
          this.nombreClase,
          "Enviando la trama: " + commArea,
          this.msgStatus);
    }
    return bandera;
  }