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
c343daa3
Commit
c343daa3
authored
Nov 20, 2025
by
Denys Tito Urbano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CREATE] Endpoint de actualizar informe vacacional
parent
bb31baa7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
162 additions
and
0 deletions
+162
-0
ExcelApi.java
src/main/java/pe/so/api/formulario/api/ExcelApi.java
+37
-0
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
-0
ExcelServices.java
...ain/java/pe/so/api/formulario/services/ExcelServices.java
+113
-0
No files found.
src/main/java/pe/so/api/formulario/api/ExcelApi.java
View file @
c343daa3
...
@@ -12,6 +12,7 @@ import java.util.ArrayList;
...
@@ -12,6 +12,7 @@ import java.util.ArrayList;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
org.json.JSONException
;
import
org.json.JSONException
;
import
org.postgresql.util.PSQLException
;
@Provider
@Provider
@Path
(
"excel"
)
@Path
(
"excel"
)
...
@@ -578,4 +579,39 @@ public class ExcelApi {
...
@@ -578,4 +579,39 @@ public class ExcelApi {
}
}
}
}
@POST
@Path
(
"vacacional/informe"
)
@Produces
(
"application/json"
)
@Consumes
(
"application/json"
)
public
Response
informeVacacionalActualizar
(
String
json
)
{
JSONObject
salida
=
new
JSONObject
();
try
{
JSONObject
entrada
=
new
JSONObject
(
json
);
salida
=
new
ExcelServices
().
informeVacacionalActualizar
(
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
{
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 @
c343daa3
...
@@ -54,4 +54,6 @@ public interface ExcelDAO{
...
@@ -54,4 +54,6 @@ public interface ExcelDAO{
JSONObject
procedure
(
JSONObject
entrada
)
throws
Exception
;
JSONObject
procedure
(
JSONObject
entrada
)
throws
Exception
;
public
JSONObject
informeVacacionalActualizar
(
JSONObject
entrada
)
throws
Exception
;
}
}
\ No newline at end of file
src/main/java/pe/so/api/formulario/postgresdao/PostgreSqlExcel.java
View file @
c343daa3
...
@@ -766,4 +766,12 @@ public class PostgreSqlExcel implements ExcelDAO {
...
@@ -766,4 +766,12 @@ public class PostgreSqlExcel implements ExcelDAO {
JSONObject
json
=
new
JSONObject
(
response
.
getString
(
"json"
));
JSONObject
json
=
new
JSONObject
(
response
.
getString
(
"json"
));
return
json
;
return
json
;
}
}
@Override
public
JSONObject
informeVacacionalActualizar
(
JSONObject
body
)
throws
Exception
{
String
sql
=
"SELECT * FROM matricula.func_informe_vacacional_actualizar ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? );"
;
JSONObject
data
=
PostgreSqlFactoryDAO
.
queryPSSingle
(
"siiaa"
,
sql
,
body
.
getJSONArray
(
"params"
));
return
new
JSONObject
(
data
.
getString
(
"json"
));
}
}
}
\ No newline at end of file
src/main/java/pe/so/api/formulario/services/ExcelServices.java
View file @
c343daa3
...
@@ -562,5 +562,117 @@ public class ExcelServices {
...
@@ -562,5 +562,117 @@ public class ExcelServices {
public
JSONObject
procedure
(
JSONObject
json
)
throws
Exception
{
public
JSONObject
procedure
(
JSONObject
json
)
throws
Exception
{
return
dao
.
procedure
(
json
);
return
dao
.
procedure
(
json
);
}
}
public
JSONObject
informeVacacionalActualizar
(
JSONObject
entrada
)
throws
JSONException
,
Exception
{
JSONArray
params
=
new
JSONArray
();
params
.
put
(
1
,
entrada
.
getString
(
"tipo_operacion"
));
if
(!
entrada
.
isNull
(
"informe_id"
))
{
params
.
put
(
2
,
entrada
.
getInt
(
"informe_id"
));
}
if
(!
entrada
.
isNull
(
"persona_id"
))
{
params
.
put
(
3
,
entrada
.
getInt
(
"persona_id"
));
}
if
(!
entrada
.
isNull
(
"parentesco_id"
))
{
params
.
put
(
4
,
entrada
.
getInt
(
"parentesco_id"
));
}
if
(!
entrada
.
isNull
(
"contacto_telefono"
))
{
params
.
put
(
5
,
entrada
.
getString
(
"contacto_telefono"
));
}
if
(!
entrada
.
isNull
(
"contacto_correo"
))
{
params
.
put
(
6
,
entrada
.
getString
(
"contacto_correo"
));
}
if
(!
entrada
.
isNull
(
"ubigeo_id"
))
{
params
.
put
(
7
,
entrada
.
getInt
(
"ubigeo_id"
));
}
if
(!
entrada
.
isNull
(
"ubigeo_nombre"
))
{
params
.
put
(
8
,
entrada
.
getString
(
"ubigeo_nombre"
));
}
if
(!
entrada
.
isNull
(
"medio_difusion_id"
))
{
params
.
put
(
9
,
entrada
.
getInt
(
"medio_difusion_id"
));
}
if
(!
entrada
.
isNull
(
"medio_atencion_id"
))
{
params
.
put
(
10
,
entrada
.
getInt
(
"medio_atencion_id"
));
}
if
(!
entrada
.
isNull
(
"apertura_id"
))
{
params
.
put
(
11
,
entrada
.
getInt
(
"apertura_id"
));
}
if
(!
entrada
.
isNull
(
"origen_id"
))
{
params
.
put
(
12
,
entrada
.
getInt
(
"origen_id"
));
}
if
(!
entrada
.
isNull
(
"fecha_registro"
))
{
params
.
put
(
13
,
entrada
.
getString
(
"fecha_registro"
));
}
if
(!
entrada
.
isNull
(
"estado_id"
))
{
params
.
put
(
14
,
entrada
.
getInt
(
"estado_id"
));
}
if
(!
entrada
.
isNull
(
"colegio_procedencia_nombre"
))
{
params
.
put
(
15
,
entrada
.
getString
(
"colegio_procedencia_nombre"
));
}
if
(!
entrada
.
isNull
(
"drive_origen"
))
{
params
.
put
(
16
,
entrada
.
getString
(
"drive_origen"
));
}
if
(!
entrada
.
isNull
(
"drive_fila"
))
{
params
.
put
(
17
,
entrada
.
getInt
(
"drive_fila"
));
}
if
(!
entrada
.
isNull
(
"informe_observacion"
))
{
params
.
put
(
18
,
entrada
.
getString
(
"informe_observacion"
));
}
if
(!
entrada
.
isNull
(
"tipo_documento_id"
))
{
params
.
put
(
19
,
entrada
.
getInt
(
"tipo_documento_id"
));
}
if
(!
entrada
.
isNull
(
"numero_documento_identidad"
))
{
params
.
put
(
20
,
entrada
.
getString
(
"numero_documento_identidad"
));
}
if
(!
entrada
.
isNull
(
"nombres"
))
{
params
.
put
(
21
,
entrada
.
getString
(
"nombres"
));
}
if
(!
entrada
.
isNull
(
"apellido_paterno"
))
{
params
.
put
(
22
,
entrada
.
getString
(
"apellido_paterno"
));
}
if
(!
entrada
.
isNull
(
"apellido_materno"
))
{
params
.
put
(
23
,
entrada
.
getString
(
"apellido_materno"
));
}
if
(!
entrada
.
isNull
(
"sede_id"
))
{
params
.
put
(
24
,
entrada
.
getInt
(
"sede_id"
));
}
if
(!
entrada
.
isNull
(
"sede_nombre"
))
{
params
.
put
(
25
,
entrada
.
getString
(
"sede_nombre"
));
}
if
(!
entrada
.
isNull
(
"grado_nombre"
))
{
params
.
put
(
26
,
entrada
.
getString
(
"grado_nombre"
));
}
if
(!
entrada
.
isNull
(
"matricula_id"
))
{
params
.
put
(
27
,
entrada
.
getInt
(
"matricula_id"
));
}
return
dao
.
informeVacacionalActualizar
(
entrada
.
put
(
"params"
,
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