reporte vu

parent 012dccca
......@@ -118,5 +118,17 @@ public class ExcelApi {
}
@POST
@Path("/ejecutar_reportevu")
public Response ejecutar_reportevu(String json) throws Exception {
JSONObject entrada = new JSONObject(json);
ExcelServices excelServices = new ExcelServices();
MSJ_RESPUESTA = excelServices.execute_VU(entrada);
return Response.status(200).entity(MSJ_RESPUESTA.toString()).build();
}
}
......@@ -14,4 +14,6 @@ public interface ExcelDAO{
JSONObject execute_redes (JSONObject json) throws Exception;
JSONObject execute_VU (JSONObject json) throws Exception;
}
......@@ -271,4 +271,32 @@ public class PostgreSqlExcel implements ExcelDAO{
return respuesta;
}
@Override
public JSONObject execute_VU(JSONObject json) throws Exception{
JSONObject respuesta=new JSONObject();
Connection conexion=null;
conexion=PostgreSqlFactoryDAO.obtenerConexion("siiaa");
try{
String sql="SELECT * FROM matricula.func_vacacional_reporte()";
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;
}
}
......@@ -26,4 +26,8 @@ public class ExcelServices{
public JSONObject execute_redes(JSONObject json) throws Exception{
return dao.execute_redes(json);
}
public JSONObject execute_VU(JSONObject json) throws Exception{
return dao.execute_VU(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