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
36b5b902
Commit
36b5b902
authored
Mar 08, 2023
by
Mauro Paolo Josue Zuñiga Mallqui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ADD] SE AGREGO UN NUEVO ENDPOINT PARA MATRICULAS
parent
b79cf63e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
2 deletions
+50
-2
misc.xml
.idea/misc.xml
+1
-1
ExcelApi.java
src/main/java/pe/so/api/formulario/api/ExcelApi.java
+40
-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
+0
-0
ExcelServices.java
...ain/java/pe/so/api/formulario/services/ExcelServices.java
+7
-1
No files found.
.idea/misc.xml
View file @
36b5b902
...
...
@@ -11,7 +11,7 @@
</list>
</option>
</component>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1
1"
default=
"true"
project-jdk-name=
"corretto-11
"
project-jdk-type=
"JavaSDK"
/>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1
_8"
default=
"true"
project-jdk-name=
"corretto-1.8
"
project-jdk-type=
"JavaSDK"
/>
<component
name=
"ProjectType"
>
<option
name=
"id"
value=
"jpab"
/>
</component>
...
...
src/main/java/pe/so/api/formulario/api/ExcelApi.java
View file @
36b5b902
...
...
@@ -8,6 +8,10 @@ import javax.ws.rs.core.Response;
import
javax.ws.rs.ext.Provider
;
import
pe.so.api.formulario.utilities.Commons
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
@Provider
@Path
(
"excel"
)
@Consumes
(
"application/json"
)
...
...
@@ -175,4 +179,40 @@ public class ExcelApi {
return
Response
.
status
(
200
).
entity
(
MSJ_RESPUESTA
.
toString
()).
build
();
}
@POST
@Path
(
"/ejecutar_matricula_online2"
)
public
Response
ejecutar_matricula_online2
(
String
json
)
throws
Exception
{
String
[]
jsonString
=
{
"p_alumno_es_menor"
,
"p_alumno_tipo_documento_id"
,
"p_alumno_numero_documento"
,
"p_alumno_apellido_paterno"
,
"p_alumno_apellido_materno"
,
"p_alumno_nombre"
,
"p_alumno_departamento_residencia_id"
,
"p_alumno_provincia_residencia_id"
,
"p_alumno_distrito_residencia_id"
,
"p_apoderado_tipo_documento_id"
,
"p_apoderado_numero_documento"
,
"p_apoderado_apellido_paterno"
,
"p_apoderado_apellido_materno"
,
"p_apoderado_nombre"
,
"p_apoderado_parentesco_id"
,
"p_contacto_telefono"
,
"p_contacto_correo"
,
"p_alumno_ciclo_grado"
,
"p_alumno_procedencia_id"
,
"p_voucher_numero_operacion"
,
"p_voucher_fecha_deposito"
,
"p_voucher_titular_cuenta"
,
"p_voucher_link"
,
"p_alumno_usuario_informa"
,
"p_alumno_medio_difusion_id"
,
"p_acceso_id"
,
"p_sede_id"
};
JSONObject
entrada
=
new
JSONObject
(
json
);
if
(
Commons
.
validarFormato
(
jsonString
,
json
)){
ExcelServices
excelServices
=
new
ExcelServices
();
MSJ_RESPUESTA
=
excelServices
.
execute_matricula_online2
(
entrada
);
return
Response
.
status
(
200
).
entity
(
MSJ_RESPUESTA
.
toString
()).
build
();
}
else
{
//keys that are not in the jsoNString
List
<
String
>
SALIDA
=
new
ArrayList
<
String
>();
String
[]
keys
=
JSONObject
.
getNames
(
entrada
);
for
(
String
jsonkey
:
jsonString
)
{
if
(!
Arrays
.
asList
(
keys
).
contains
(
jsonkey
)){
SALIDA
.
add
(
jsonkey
);
}
}
return
Response
.
status
(
500
).
entity
(
MSJ_RESPUESTA
.
put
(
"status"
,
false
)
.
put
(
"mensaje"
,
"Error en el formato de entrada"
)
.
put
(
"keys"
,
SALIDA
).
toString
()
).
build
();
}
}
}
src/main/java/pe/so/api/formulario/dao/ExcelDAO.java
View file @
36b5b902
...
...
@@ -24,4 +24,6 @@ public interface ExcelDAO{
JSONObject
execute_reporte_franquicia
(
JSONObject
json
)
throws
Exception
;
JSONObject
execute_matricula_online2
(
JSONObject
json
)
throws
Exception
;
}
src/main/java/pe/so/api/formulario/postgresdao/PostgreSqlExcel.java
View file @
36b5b902
This diff is collapsed.
Click to expand it.
src/main/java/pe/so/api/formulario/services/ExcelServices.java
View file @
36b5b902
...
...
@@ -4,9 +4,11 @@ import org.json.JSONObject;
import
pe.so.api.formulario.dao.ExcelDAO
;
import
pe.so.api.formulario.dao.FactoryDAO
;
import
java.util.Objects
;
public
class
ExcelServices
{
ExcelDAO
dao
=
FactoryDAO
.
getFactoryDAO
(
FactoryDAO
.
POSTGRESQL
).
getExcelDAO
();
ExcelDAO
dao
=
Objects
.
requireNonNull
(
FactoryDAO
.
getFactoryDAO
(
FactoryDAO
.
POSTGRESQL
)
).
getExcelDAO
();
public
JSONObject
execute_encuesta
(
JSONObject
json
)
throws
Exception
{
return
dao
.
execute_encuesta
(
json
);
}
...
...
@@ -46,4 +48,8 @@ public class ExcelServices{
public
JSONObject
execute_reporte_franquicias
(
JSONObject
json
)
throws
Exception
{
return
dao
.
execute_reporte_franquicia
(
json
);
}
public
JSONObject
execute_matricula_online2
(
JSONObject
json
)
throws
Exception
{
return
dao
.
execute_matricula_online2
(
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