Commit 8fe58636 by Denys Tito Urbano

[ADD] Reporte de aniversario

parent e2c29a2f
......@@ -502,4 +502,29 @@ public class ExcelApi {
}
}
@POST
@Path("/listar_aniversario_reporte")
public Response listar_aniversario_reporte(String json) {
JSONObject salida = new JSONObject();
try {
JSONObject entrada = new JSONObject(json);
salida = new ExcelServices().listar_aniversario_reporte(entrada);
return Response.status(200).entity(salida.toString()).build();
} catch (JSONException ex) {
salida.put("status", false);
salida.put("message", ex.getMessage());
throw new WebApplicationException(Response.status(400).entity(salida.toString()).build());
} catch (BadRequestException ex) {
salida = new JSONObject(ex.getMessage());
throw new WebApplicationException(Response.status(500).entity(salida.toString()).build());
} catch (Exception ex) {
salida.put("status", false);
salida.put("message", ex.getMessage());
throw new WebApplicationException(Response.status(500).entity(salida.toString()).build());
}
}
}
......@@ -48,4 +48,6 @@ public interface ExcelDAO{
JSONObject actualizar_aniversario (JSONObject entrada) throws Exception;
JSONObject listar_aniversario_reporte (JSONObject entrada) throws Exception;
}
......@@ -725,4 +725,11 @@ public class PostgreSqlExcel implements ExcelDAO {
return new JSONObject(data.getString("json"));
}
@Override
public JSONObject listar_aniversario_reporte(JSONObject entrada) throws Exception {
String sql = "SELECT * FROM caja.func_aniversario_reporte_listar ( ?, ? );";
JSONObject salida = PostgreSqlFactoryDAO.queryPSSingle("siiaa", sql, entrada.getJSONArray("params"));
return new JSONObject(salida.getString("json"));
}
}
......@@ -523,4 +523,18 @@ public class ExcelServices {
.put("data", lista_aniversario_bd);
}
public JSONObject listar_aniversario_reporte(JSONObject entrada) throws Exception {
JSONArray params = new JSONArray();
if (!entrada.isNull("usuario_perfil_id")) {
params.put(0, entrada.getInt("usuario_perfil_id"));
}
params.put(1, entrada.getString("tipo_operacion"));
entrada.put("params", params);
return dao.listar_aniversario_reporte(entrada);
}
}
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