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
1428f62a
Commit
1428f62a
authored
Dec 19, 2023
by
Mauro Paolo Josue Zuñiga Mallqui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ADD] SE AGREGO UN ENDPOINT MAS PARA FICHA PRE DATOS
parent
6272171f
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
4 deletions
+42
-4
ExcelApi.java
src/main/java/pe/so/api/formulario/api/ExcelApi.java
+25
-2
ExcelDAO.java
src/main/java/pe/so/api/formulario/dao/ExcelDAO.java
+3
-0
PostgreSqlExcel.java
...ava/pe/so/api/formulario/postgresdao/PostgreSqlExcel.java
+9
-1
PostgreSqlFactoryDAO.java
...e/so/api/formulario/postgresdao/PostgreSqlFactoryDAO.java
+0
-0
ExcelServices.java
...ain/java/pe/so/api/formulario/services/ExcelServices.java
+5
-1
No files found.
src/main/java/pe/so/api/formulario/api/ExcelApi.java
View file @
1428f62a
...
@@ -535,8 +535,8 @@ public class ExcelApi {
...
@@ -535,8 +535,8 @@ public class ExcelApi {
}
}
@POST
@POST
@Path
(
"/procedure"
)
@Path
((
"/procedure"
)
)
public
Response
procedure
(
String
json
)
{
public
Response
procedure
(
String
json
)
throws
Exception
{
JSONObject
salida
=
new
JSONObject
();
JSONObject
salida
=
new
JSONObject
();
try
{
try
{
JSONObject
entrada
=
new
JSONObject
(
json
);
JSONObject
entrada
=
new
JSONObject
(
json
);
...
@@ -556,4 +556,26 @@ public class ExcelApi {
...
@@ -556,4 +556,26 @@ public class ExcelApi {
}
}
}
}
@POST
@Path
(
"/procedureArray"
)
public
Response
procedureArray
(
String
json
){
JSONObject
salida
=
new
JSONObject
();
try
{
JSONObject
entrada
=
new
JSONObject
(
json
);
salida
=
new
ExcelServices
().
procedureArray
(
entrada
);
return
Response
.
status
(
200
).
entity
(
salida
.
toString
()).
build
();
}
catch
(
JSONException
ex
)
{
salida
.
put
(
"status"
,
false
);
salida
.
put
(
"message"
,
ex
.
getMessage
());
throw
new
WebApplicationException
(
Response
.
status
(
400
).
entity
(
salida
.
toString
()).
build
());
}
catch
(
BadRequestException
ex
)
{
salida
=
new
JSONObject
(
ex
.
getMessage
());
throw
new
WebApplicationException
(
Response
.
status
(
500
).
entity
(
salida
.
toString
()).
build
());
}
catch
(
Exception
ex
)
{
salida
.
put
(
"status"
,
false
);
salida
.
put
(
"message"
,
ex
.
getMessage
());
throw
new
WebApplicationException
(
Response
.
status
(
500
).
entity
(
salida
.
toString
()).
build
());
}
}
}
}
\ No newline at end of file
src/main/java/pe/so/api/formulario/dao/ExcelDAO.java
View file @
1428f62a
...
@@ -50,6 +50,8 @@ public interface ExcelDAO{
...
@@ -50,6 +50,8 @@ public interface ExcelDAO{
JSONObject
listar_aniversario_reporte
(
JSONObject
entrada
)
throws
Exception
;
JSONObject
listar_aniversario_reporte
(
JSONObject
entrada
)
throws
Exception
;
JSONObject
procedureArray
(
JSONObject
entrada
)
throws
Exception
;
JSONObject
procedure
(
JSONObject
entrada
)
throws
Exception
;
JSONObject
procedure
(
JSONObject
entrada
)
throws
Exception
;
}
}
\ No newline at end of file
src/main/java/pe/so/api/formulario/postgresdao/PostgreSqlExcel.java
View file @
1428f62a
...
@@ -710,7 +710,7 @@ public class PostgreSqlExcel implements ExcelDAO {
...
@@ -710,7 +710,7 @@ public class PostgreSqlExcel implements ExcelDAO {
}
}
@Override
@Override
public
JSONObject
procedure
(
JSONObject
entrada
)
throws
Exception
{
public
JSONObject
procedure
Array
(
JSONObject
entrada
)
throws
Exception
{
String
sql
=
entrada
.
getString
(
"procedure"
);
String
sql
=
entrada
.
getString
(
"procedure"
);
JSONArray
array
=
entrada
.
optJSONArray
(
"array"
);
JSONArray
array
=
entrada
.
optJSONArray
(
"array"
);
JSONArray
errores
=
new
JSONArray
();
JSONArray
errores
=
new
JSONArray
();
...
@@ -733,4 +733,11 @@ public class PostgreSqlExcel implements ExcelDAO {
...
@@ -733,4 +733,11 @@ public class PostgreSqlExcel implements ExcelDAO {
}
}
}
}
@Override
public
JSONObject
procedure
(
JSONObject
entrada
)
throws
Exception
{
String
sql
=
entrada
.
getString
(
"procedure"
);
JSONObject
response
=
PostgreSqlFactoryDAO
.
queryPSSingle
(
"siiaa"
,
sql
,
entrada
.
getJSONArray
(
"params"
));
JSONObject
json
=
new
JSONObject
(
response
.
getString
(
"json"
));
return
json
;
}
}
}
\ No newline at end of file
src/main/java/pe/so/api/formulario/postgresdao/PostgreSqlFactoryDAO.java
View file @
1428f62a
src/main/java/pe/so/api/formulario/services/ExcelServices.java
View file @
1428f62a
...
@@ -543,7 +543,11 @@ public class ExcelServices {
...
@@ -543,7 +543,11 @@ public class ExcelServices {
return
dao
.
listar_aniversario_reporte
(
entrada
);
return
dao
.
listar_aniversario_reporte
(
entrada
);
}
}
public
JSONObject
procedure
(
JSONObject
json
)
throws
Exception
{
public
JSONObject
procedureArray
(
JSONObject
json
)
throws
Exception
{
return
dao
.
procedureArray
(
json
);
}
public
JSONObject
procedure
(
JSONObject
json
)
throws
Exception
{
return
dao
.
procedure
(
json
);
return
dao
.
procedure
(
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