Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
formulario-api
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Denys Tito Urbano
formulario-api
Commits
b79cf63e
Commit
b79cf63e
authored
Mar 02, 2023
by
Mauro Paolo Josue Zuñiga Mallqui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[
parent
20e7f83f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
1 deletions
+44
-1
ExcelApi.java
src/main/java/pe/so/api/formulario/api/ExcelApi.java
+10
-0
ExcelDAO.java
src/main/java/pe/so/api/formulario/dao/ExcelDAO.java
+2
-0
PostgreSqlExcel.java
...ava/pe/so/api/formulario/postgresdao/PostgreSqlExcel.java
+27
-0
PostgreSqlFactoryDAO.java
...e/so/api/formulario/postgresdao/PostgreSqlFactoryDAO.java
+1
-1
ExcelServices.java
...ain/java/pe/so/api/formulario/services/ExcelServices.java
+4
-0
No files found.
src/main/java/pe/so/api/formulario/api/ExcelApi.java
View file @
b79cf63e
...
...
@@ -165,4 +165,14 @@ public class ExcelApi {
return
Response
.
status
(
200
).
entity
(
MSJ_RESPUESTA
.
toString
()).
build
();
}
@POST
@Path
(
"/ejecutar_reporte_franquicia"
)
public
Response
ejecutar_reporte_franquicia
(
String
json
)
throws
Exception
{
JSONObject
entrada
=
new
JSONObject
(
json
);
ExcelServices
excelServices
=
new
ExcelServices
();
MSJ_RESPUESTA
=
excelServices
.
execute_reporte_franquicias
(
entrada
);
return
Response
.
status
(
200
).
entity
(
MSJ_RESPUESTA
.
toString
()).
build
();
}
}
src/main/java/pe/so/api/formulario/dao/ExcelDAO.java
View file @
b79cf63e
...
...
@@ -22,4 +22,6 @@ public interface ExcelDAO{
JSONObject
execute_avance_encuesta
(
JSONObject
json
)
throws
Exception
;
JSONObject
execute_reporte_franquicia
(
JSONObject
json
)
throws
Exception
;
}
src/main/java/pe/so/api/formulario/postgresdao/PostgreSqlExcel.java
View file @
b79cf63e
...
...
@@ -409,4 +409,31 @@ public class PostgreSqlExcel implements ExcelDAO{
return
respuesta
;
}
public
JSONObject
execute_reporte_franquicia
(
JSONObject
json
)
throws
Exception
{
JSONObject
respuesta
=
new
JSONObject
();
Connection
conexion
=
null
;
conexion
=
PostgreSqlFactoryDAO
.
obtenerConexion
(
"siiaa"
);
try
{
String
sql
=
"select * from matricula.func_reporte_general_franquicia();"
;
ResultSet
rs
=
conexion
.
prepareStatement
(
sql
).
executeQuery
();
if
(
rs
.
next
()){
int
columnCount
=
rs
.
getMetaData
().
getColumnCount
();
for
(
int
i
=
1
;
i
<=
columnCount
;
i
++)
{
respuesta
.
put
(
rs
.
getMetaData
().
getColumnName
(
i
),
rs
.
getObject
(
i
));
}
}
}
catch
(
Exception
e
)
{
respuesta
.
put
(
"error"
,
e
.
getMessage
());
}
finally
{
if
(
conexion
!=
null
){
conexion
.
close
();
}
}
return
respuesta
;
}
}
src/main/java/pe/so/api/formulario/postgresdao/PostgreSqlFactoryDAO.java
View file @
b79cf63e
...
...
@@ -18,7 +18,7 @@ public class PostgreSqlFactoryDAO extends FactoryDAO{
static
{
try
{
Class
.
forName
(
"
org.postgresql.Driver"
);
Class
.
forName
(
"org.postgresql.Driver"
);
}
catch
(
ClassNotFoundException
e
)
{
e
.
printStackTrace
();
}
...
...
src/main/java/pe/so/api/formulario/services/ExcelServices.java
View file @
b79cf63e
...
...
@@ -42,4 +42,8 @@ public class ExcelServices{
public
JSONObject
execute_avance_encuesta
(
JSONObject
json
)
throws
Exception
{
return
dao
.
execute_avance_encuesta
(
json
);
}
public
JSONObject
execute_reporte_franquicias
(
JSONObject
json
)
throws
Exception
{
return
dao
.
execute_reporte_franquicia
(
json
);
}
}
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