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
a year ago
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
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
12 deletions
+52
-12
ExcelApi.java
src/main/java/pe/so/api/formulario/api/ExcelApi.java
+28
-5
ExcelDAO.java
src/main/java/pe/so/api/formulario/dao/ExcelDAO.java
+4
-1
PostgreSqlExcel.java
...ava/pe/so/api/formulario/postgresdao/PostgreSqlExcel.java
+11
-3
PostgreSqlFactoryDAO.java
...e/so/api/formulario/postgresdao/PostgreSqlFactoryDAO.java
+2
-1
ExcelServices.java
...ain/java/pe/so/api/formulario/services/ExcelServices.java
+7
-2
No files found.
src/main/java/pe/so/api/formulario/api/ExcelApi.java
View file @
1428f62a
...
...
@@ -534,17 +534,39 @@ public class ExcelApi {
}
}
@POST
@Path
((
"/procedure"
))
public
Response
procedure
(
String
json
)
throws
Exception
{
JSONObject
salida
=
new
JSONObject
();
try
{
JSONObject
entrada
=
new
JSONObject
(
json
);
salida
=
new
ExcelServices
().
procedure
(
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
());
}
}
@POST
@Path
(
"/procedure"
)
public
Response
procedure
(
String
json
){
@Path
(
"/procedure
Array
"
)
public
Response
procedure
Array
(
String
json
){
JSONObject
salida
=
new
JSONObject
();
try
{
JSONObject
entrada
=
new
JSONObject
(
json
);
salida
=
new
ExcelServices
().
procedure
(
entrada
);
salida
=
new
ExcelServices
().
procedure
Array
(
entrada
);
return
Response
.
status
(
200
).
entity
(
salida
.
toString
()).
build
();
}
catch
(
JSONException
ex
)
{
salida
.
put
(
"status"
,
false
);
salida
.
put
(
"message"
,
ex
.
getMessage
());
salida
.
put
(
"message"
,
ex
.
getMessage
());
throw
new
WebApplicationException
(
Response
.
status
(
400
).
entity
(
salida
.
toString
()).
build
());
}
catch
(
BadRequestException
ex
)
{
salida
=
new
JSONObject
(
ex
.
getMessage
());
...
...
@@ -556,4 +578,4 @@ public class ExcelApi {
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/main/java/pe/so/api/formulario/dao/ExcelDAO.java
View file @
1428f62a
...
...
@@ -50,6 +50,8 @@ public interface ExcelDAO{
JSONObject
listar_aniversario_reporte
(
JSONObject
entrada
)
throws
Exception
;
JSONObject
procedureArray
(
JSONObject
entrada
)
throws
Exception
;
JSONObject
procedure
(
JSONObject
entrada
)
throws
Exception
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/main/java/pe/so/api/formulario/postgresdao/PostgreSqlExcel.java
View file @
1428f62a
...
...
@@ -710,7 +710,7 @@ public class PostgreSqlExcel implements ExcelDAO {
}
@Override
public
JSONObject
procedure
(
JSONObject
entrada
)
throws
Exception
{
public
JSONObject
procedure
Array
(
JSONObject
entrada
)
throws
Exception
{
String
sql
=
entrada
.
getString
(
"procedure"
);
JSONArray
array
=
entrada
.
optJSONArray
(
"array"
);
JSONArray
errores
=
new
JSONArray
();
...
...
@@ -732,5 +732,12 @@ public class PostgreSqlExcel implements ExcelDAO {
return
new
JSONObject
().
put
(
"status"
,
true
).
put
(
"message"
,
"ok"
);
}
}
}
@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
This diff is collapsed.
Click to expand it.
src/main/java/pe/so/api/formulario/postgresdao/PostgreSqlFactoryDAO.java
View file @
1428f62a
...
...
@@ -72,4 +72,4 @@ public class PostgreSqlFactoryDAO extends FactoryDAO{
return
new
PostgreSqlTabla
();
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/main/java/pe/so/api/formulario/services/ExcelServices.java
View file @
1428f62a
...
...
@@ -543,8 +543,12 @@ public class ExcelServices {
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
);
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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