[ADD] SE AGREGO NUEVO ENDPOINT PARA GESTION DE REDES

parent b364f879
nb-configuration.xml
target/
.idea
idea
\ No newline at end of file
......@@ -130,5 +130,18 @@ public class ExcelApi {
}
@POST
@Path("/ejecutar_reporte_sedes")
public Response ejecutar_reporte_sedes(String json) throws Exception {
JSONObject entrada = new JSONObject(json);
ExcelServices excelServices = new ExcelServices();
MSJ_RESPUESTA = excelServices.execute_reporte_sedes(entrada);
return Response.status(200).entity(MSJ_RESPUESTA.toString()).build();
}
}
......@@ -16,4 +16,6 @@ public interface ExcelDAO{
JSONObject execute_VU (JSONObject json) throws Exception;
JSONObject execute_reporte_sedes (JSONObject json) throws Exception;
}
......@@ -279,7 +279,36 @@ public class PostgreSqlExcel implements ExcelDAO{
conexion=PostgreSqlFactoryDAO.obtenerConexion("siiaa");
try{
String sql="SELECT * FROM matricula.func_vacacional_reporte()";
String sql="SELECT * FROM matricula.func_reporte_general_vacacional()";
ResultSet rs=conexion.prepareStatement(sql).executeQuery();
if(rs.next()){
int columnCount=rs.getMetaData().getColumnCount();
for (int i=1; i <= columnCount; i++) {
respuesta.put(rs.getMetaData().getColumnName(i),rs.getObject(i));
}
}
} catch (Exception e) {
respuesta.put("error",e.getMessage());
}finally {
if(conexion != null){
conexion.close();
}
}
return respuesta;
}
@Override
public JSONObject execute_reporte_sedes(JSONObject json) throws Exception{
JSONObject respuesta=new JSONObject();
Connection conexion=null;
conexion=PostgreSqlFactoryDAO.obtenerConexion("siiaa");
try{
String sql="select * from matricula.func_reporte_general_matricula()";
ResultSet rs=conexion.prepareStatement(sql).executeQuery();
if(rs.next()){
......
......@@ -30,4 +30,8 @@ public class ExcelServices{
public JSONObject execute_VU(JSONObject json) throws Exception{
return dao.execute_VU(json);
}
public JSONObject execute_reporte_sedes(JSONObject json) throws Exception{
return dao.execute_reporte_sedes(json);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment