[ADD] SE AGREGO EL ENDPOINT REPORTE GENERAL CORREOS

parent 1b820c4c
......@@ -9,6 +9,11 @@
<inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true">
<option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,pe.so.api.formulario.postgresdao.PostgreSqlFactoryDAO,obtenerConexion" />
</inspection_tool>
<inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<Languages>
<language minSize="48" name="Java" />
</Languages>
</inspection_tool>
<inspection_tool class="SpellCheckingInspection" enabled="false" level="WARNING" enabled_by_default="false" editorAttributes="WARNING_ATTRIBUTES">
<option name="processCode" value="true" />
<option name="processLiterals" value="true" />
......
......@@ -142,6 +142,16 @@ public class ExcelApi {
}
@POST
@Path("/ejecutar_reporte_correos")
public Response ejecutar_reporte_correos(String json) throws Exception {
JSONObject entrada = new JSONObject(json);
ExcelServices excelServices = new ExcelServices();
MSJ_RESPUESTA = excelServices.execute_reporte_correos(entrada);
return Response.status(200).entity(MSJ_RESPUESTA.toString()).build();
}
}
......@@ -18,4 +18,6 @@ public interface ExcelDAO{
JSONObject execute_reporte_sedes (JSONObject json) throws Exception;
JSONObject execute_reporte_correos (JSONObject json) throws Exception;
}
......@@ -328,4 +328,32 @@ public class PostgreSqlExcel implements ExcelDAO{
return respuesta;
}
@Override
public JSONObject execute_reporte_correos(JSONObject json) throws Exception{
JSONObject respuesta=new JSONObject();
Connection conexion=null;
conexion=PostgreSqlFactoryDAO.obtenerConexion("siiaa");
try{
String sql="select * from matricula.func_reporte_general_correos()";
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;
}
}
......@@ -34,4 +34,8 @@ public class ExcelServices{
public JSONObject execute_reporte_sedes(JSONObject json) throws Exception{
return dao.execute_reporte_sedes(json);
}
public JSONObject execute_reporte_correos(JSONObject json) throws Exception{
return dao.execute_reporte_correos(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