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
4f27f874
Commit
4f27f874
authored
Jan 20, 2026
by
Mauro Paolo Josue Zuñiga Mallqui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ADD] REGISTRAR ENCUESTA PSICOLOGICA
parent
ddb781fe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
5 deletions
+58
-5
ExcelApi.java
src/main/java/pe/so/api/formulario/api/ExcelApi.java
+36
-1
ExcelDAO.java
src/main/java/pe/so/api/formulario/dao/ExcelDAO.java
+5
-2
PostgreSqlExcel.java
...ava/pe/so/api/formulario/postgresdao/PostgreSqlExcel.java
+10
-2
ExcelServices.java
...ain/java/pe/so/api/formulario/services/ExcelServices.java
+7
-0
No files found.
src/main/java/pe/so/api/formulario/api/ExcelApi.java
View file @
4f27f874
...
...
@@ -613,5 +613,39 @@ public class ExcelApi {
return
Response
.
status
(
200
).
entity
(
salida
.
toString
()).
build
();
}
@POST
@Path
(
"polidocencia/registrar"
)
@Produces
(
"application/json"
)
@Consumes
(
"application/json"
)
public
Response
registrarEncuestaPsicologica
(
String
json
)
{
JSONObject
salida
=
new
JSONObject
();
try
{
JSONObject
entrada
=
new
JSONObject
(
json
);
salida
=
new
ExcelServices
().
registrarEncuestaPsicologica
(
entrada
);
}
catch
(
JSONException
ex
)
{
salida
.
put
(
"status"
,
false
)
.
put
(
"message"
,
ex
.
getMessage
());
throw
new
WebApplicationException
(
Response
.
status
(
400
).
entity
(
salida
.
toString
()).
build
());
}
catch
(
PSQLException
ex
)
{
try
{
assert
ex
.
getServerErrorMessage
()
!=
null
;
salida
=
new
JSONObject
(
ex
.
getServerErrorMessage
().
getMessage
());
}
catch
(
JSONException
ex2
)
{
salida
.
put
(
"status"
,
false
)
.
put
(
"message"
,
ex
.
getMessage
());
}
throw
new
WebApplicationException
(
Response
.
status
(
400
).
entity
(
salida
.
toString
()).
build
());
}
catch
(
Exception
ex
)
{
salida
.
put
(
"status"
,
false
)
.
put
(
"message"
,
ex
.
getMessage
());
throw
new
WebApplicationException
(
Response
.
status
(
500
).
entity
(
salida
.
toString
()).
build
());
}
return
Response
.
status
(
200
).
entity
(
salida
.
toString
()).
build
();
}
}
\ No newline at end of file
src/main/java/pe/so/api/formulario/dao/ExcelDAO.java
View file @
4f27f874
package
pe
.
so
.
api
.
formulario
.
dao
;
import
org.json.JSONArray
;
import
org.json.JSONObject
;
public
interface
ExcelDAO
{
...
...
@@ -54,6 +55,7 @@ public interface ExcelDAO{
JSONObject
procedure
(
JSONObject
entrada
)
throws
Exception
;
public
JSONObject
informeVacacionalActualizar
(
JSONObject
entrada
)
throws
Exception
;
JSONObject
informeVacacionalActualizar
(
JSONObject
entrada
)
throws
Exception
;
JSONObject
registrarEncuestaPsicologica
(
JSONArray
entrada
)
throws
Exception
;
}
\ No newline at end of file
src/main/java/pe/so/api/formulario/postgresdao/PostgreSqlExcel.java
View file @
4f27f874
...
...
@@ -756,7 +756,7 @@ public class PostgreSqlExcel implements ExcelDAO {
errores
.
put
(
new
JSONObject
().
put
(
"status"
,
false
).
put
(
"message"
,
e
.
getMessage
()).
put
(
"fila"
,
obj
.
getInt
(
"fila"
)));
}
}
if
(
errores
.
length
()
>
0
){
if
(
!
errores
.
isEmpty
()
){
return
new
JSONObject
().
put
(
"status"
,
false
).
put
(
"message"
,
"se encontrarón errores"
).
put
(
"errors"
,
errores
);
}
else
{
return
new
JSONObject
().
put
(
"status"
,
true
).
put
(
"message"
,
"ok"
);
...
...
@@ -777,5 +777,12 @@ public class PostgreSqlExcel implements ExcelDAO {
JSONObject
data
=
PostgreSqlFactoryDAO
.
queryPSSingle
(
"siiaa"
,
sql
,
body
.
getJSONArray
(
"params"
));
return
new
JSONObject
(
data
.
getString
(
"json"
));
}
@Override
public
JSONObject
registrarEncuestaPsicologica
(
JSONArray
entrada
)
throws
Exception
{
String
sql
=
"SELECT * FROM matricula.func_registrar_encuesta_psicologica_excel (?::jsonb);"
;
JSONObject
data
=
PostgreSqlFactoryDAO
.
queryPSSingle
(
"siiaa"
,
sql
,
entrada
);
return
new
JSONObject
(
data
.
getString
(
"json"
));
}
}
\ No newline at end of file
src/main/java/pe/so/api/formulario/services/ExcelServices.java
View file @
4f27f874
...
...
@@ -674,5 +674,11 @@ public class ExcelServices {
return
dao
.
informeVacacionalActualizar
(
entrada
.
put
(
"params"
,
params
));
}
public
JSONObject
registrarEncuestaPsicologica
(
JSONObject
entrada
)
throws
Exception
{
JSONArray
params
=
new
JSONArray
();
params
.
put
(
entrada
.
getJSONObject
(
"json"
));
return
dao
.
registrarEncuestaPsicologica
(
params
);
}
}
\ No newline at end of file
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