Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
etl-service-ccie-mvn
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jose Francisco Montiel Jimenez
etl-service-ccie-mvn
Commits
c9525eb1
Commit
c9525eb1
authored
Mar 06, 2025
by
Jose Francisco Montiel Jimenez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Se agrega insert de pruebas
parent
bcb3bdcf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
3 deletions
+55
-3
src/main/java/amx/ccie/etl/dao/CatalogosDAO.java
src/main/java/amx/ccie/etl/dao/CatalogosDAO.java
+49
-0
src/main/java/amx/ccie/etl/scheduler/CatalogoScheduler.java
src/main/java/amx/ccie/etl/scheduler/CatalogoScheduler.java
+6
-3
No files found.
src/main/java/amx/ccie/etl/dao/CatalogosDAO.java
0 → 100644
View file @
c9525eb1
package
amx.ccie.etl.dao
;
import
amx.ccie.dto.CatalogoDTO
;
import
amx.ccie.etl.util.Conexion
;
import
oracle.jdbc.OracleTypes
;
import
java.sql.*
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
*
* @author montielj
*/
public
class
CatalogosDAO
extends
Conexion
{
// Método genérico para realizar consultas
private
List
<
CatalogoDTO
>
ejecutarConsulta
(
String
store
,
int
id
)
{
List
<
CatalogoDTO
>
data
=
new
ArrayList
<>();
StringBuilder
sql
=
new
StringBuilder
();
sql
.
append
(
"{call "
).
append
(
getEsq_amx
()).
append
(
getPkg_pref
()).
append
(
"CATALOGOS."
).
append
(
store
).
append
(
"(?,?,?,?)}"
);
try
(
Connection
conn
=
getConnection
();
CallableStatement
cs
=
conn
.
prepareCall
(
sql
.
toString
()))
{
cs
.
setString
(
1
,
"Prueba entrada Catalogo"
);
cs
.
setInt
(
2
,
id
);
// ID_IN
cs
.
registerOutParameter
(
3
,
OracleTypes
.
INTEGER
);
// ESTATUS_OUT
cs
.
registerOutParameter
(
4
,
OracleTypes
.
VARCHAR
);
// MSG_OUT
cs
.
execute
();
int
estatus
=
cs
.
getInt
(
3
);
if
(
estatus
!=
1
)
{
// Éxito
throw
new
SQLException
(
cs
.
getString
(
4
));
}
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
// Manejo de errores
}
return
data
;
}
// Métodos específicos para cada tabla
public
List
<
CatalogoDTO
>
crearCanalAtencion
(
int
id
)
{
return
ejecutarConsulta
(
"crear_canal_atencion"
,
id
);
}
}
src/main/java/amx/ccie/etl/scheduler/CatalogoScheduler.java
View file @
c9525eb1
package
amx.ccie.etl.scheduler
;
package
amx.ccie.etl.scheduler
;
import
amx.ccie.etl.dao.BitacoraDAO
;
import
amx.ccie.etl.dao.BitacoraDAO
;
import
amx.ccie.etl.dao.CatalogosDAO
;
import
amx.ccie.etl.httpClient.TestApisEmpleado
;
import
amx.ccie.etl.httpClient.TestApisEmpleado
;
import
amx.ccie.etl.httpClient.TestApisReporte
;
import
amx.ccie.etl.httpClient.TestApisReporte
;
import
amx.ccie.etl.util.BitacoraDTO
;
import
amx.ccie.etl.util.BitacoraDTO
;
...
@@ -25,12 +26,14 @@ public class CatalogoScheduler {
...
@@ -25,12 +26,14 @@ public class CatalogoScheduler {
private
final
Logger
log
=
LogManager
.
getLogger
(
this
.
getClass
());
private
final
Logger
log
=
LogManager
.
getLogger
(
this
.
getClass
());
@Schedule
(
hour
=
"1
3"
,
minute
=
"35
"
,
second
=
"0"
,
persistent
=
false
)
@Schedule
(
hour
=
"1
2"
,
minute
=
"14
"
,
second
=
"0"
,
persistent
=
false
)
public
void
consultarCatalogoServicio
()
{
public
void
consultarCatalogoServicio
()
{
try
{
try
{
List
<
BitacoraDTO
>
bitacora
=
new
BitacoraDAO
().
getBitacora
();
List
<
BitacoraDTO
>
bitacora
=
new
BitacoraDAO
().
getBitacora
();
bitacora
.
stream
().
forEach
(
cat
->
System
.
out
.
println
(
"Hola mundo catalogo: "
+
cat
.
getDescripcion
()));
bitacora
.
stream
().
forEach
(
cat
->
log
.
info
(
"Catalogo a ejecutar: {}"
,
cat
.
getDescripcion
()));
log
.
info
(
"Se inserta en catalogo CCI_CAT_CANAL_ATENCION"
);
new
CatalogosDAO
().
crearCanalAtencion
(
1
);
log
.
info
(
"Inserta en catalogo CCI_CAT_CANAL_ATENCION exitoso."
);
log
.
info
(
"Se ejecuta servicio de empleado."
);
log
.
info
(
"Se ejecuta servicio de empleado."
);
new
TestApisEmpleado
().
getEmpleado
();
new
TestApisEmpleado
().
getEmpleado
();
log
.
info
(
"Se ejecuta servicio de reporte."
);
log
.
info
(
"Se ejecuta servicio de reporte."
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment