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
03602a20
Commit
03602a20
authored
Feb 01, 2023
by
Mauro Paolo Josue Zuñiga Mallqui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ADD] SE AGREGO EL ENDPOINT REPORTE GENERAL CORREOS
parent
1b820c4c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
0 deletions
+49
-0
Project_Default.xml
.idea/inspectionProfiles/Project_Default.xml
+5
-0
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
+28
-0
ExcelServices.java
...ain/java/pe/so/api/formulario/services/ExcelServices.java
+4
-0
No files found.
.idea/inspectionProfiles/Project_Default.xml
View file @
03602a20
...
...
@@ -9,6 +9,11 @@
<inspection_tool
class=
"AutoCloseableResource"
enabled=
"true"
level=
"WARNING"
enabled_by_default=
"true"
>
<option
name=
"METHOD_MATCHER_CONFIG"
value=
"java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,pe.so.api.formulario.postgresdao.PostgreSqlFactoryDAO,obtenerConexion"
/>
</inspection_tool>
<inspection_tool
class=
"DuplicatedCode"
enabled=
"true"
level=
"WEAK WARNING"
enabled_by_default=
"true"
>
<Languages>
<language
minSize=
"48"
name=
"Java"
/>
</Languages>
</inspection_tool>
<inspection_tool
class=
"SpellCheckingInspection"
enabled=
"false"
level=
"WARNING"
enabled_by_default=
"false"
editorAttributes=
"WARNING_ATTRIBUTES"
>
<option
name=
"processCode"
value=
"true"
/>
<option
name=
"processLiterals"
value=
"true"
/>
...
...
src/main/java/pe/so/api/formulario/api/ExcelApi.java
View file @
03602a20
...
...
@@ -142,6 +142,16 @@ public class ExcelApi {
}
@POST
@Path
(
"/ejecutar_reporte_correos"
)
public
Response
ejecutar_reporte_correos
(
String
json
)
throws
Exception
{
JSONObject
entrada
=
new
JSONObject
(
json
);
ExcelServices
excelServices
=
new
ExcelServices
();
MSJ_RESPUESTA
=
excelServices
.
execute_reporte_correos
(
entrada
);
return
Response
.
status
(
200
).
entity
(
MSJ_RESPUESTA
.
toString
()).
build
();
}
}
src/main/java/pe/so/api/formulario/dao/ExcelDAO.java
View file @
03602a20
...
...
@@ -18,4 +18,6 @@ public interface ExcelDAO{
JSONObject
execute_reporte_sedes
(
JSONObject
json
)
throws
Exception
;
JSONObject
execute_reporte_correos
(
JSONObject
json
)
throws
Exception
;
}
src/main/java/pe/so/api/formulario/postgresdao/PostgreSqlExcel.java
View file @
03602a20
...
...
@@ -328,4 +328,32 @@ public class PostgreSqlExcel implements ExcelDAO{
return
respuesta
;
}
@Override
public
JSONObject
execute_reporte_correos
(
JSONObject
json
)
throws
Exception
{
JSONObject
respuesta
=
new
JSONObject
();
Connection
conexion
=
null
;
conexion
=
PostgreSqlFactoryDAO
.
obtenerConexion
(
"siiaa"
);
try
{
String
sql
=
"select * from matricula.func_reporte_general_correos()"
;
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/services/ExcelServices.java
View file @
03602a20
...
...
@@ -34,4 +34,8 @@ public class ExcelServices{
public
JSONObject
execute_reporte_sedes
(
JSONObject
json
)
throws
Exception
{
return
dao
.
execute_reporte_sedes
(
json
);
}
public
JSONObject
execute_reporte_correos
(
JSONObject
json
)
throws
Exception
{
return
dao
.
execute_reporte_correos
(
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