diff --git a/.gitignore b/.gitignore index b9f36ea..6f109b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ out +lib .idea dist/*.dat -workspace.xml -tasks.xml \ No newline at end of file diff --git a/dist/Programa Caja.jar b/dist/Programa Caja.jar index ff01140..6433fa3 100644 Binary files a/dist/Programa Caja.jar and b/dist/Programa Caja.jar differ diff --git a/dist/config/app.properties b/dist/config/app.properties index 1124530..f4d7869 100644 --- a/dist/config/app.properties +++ b/dist/config/app.properties @@ -9,7 +9,7 @@ # database_uri es la uri de la base de datos con la que se conectara el sistema. # por ahora soporte solo a sqlite asi que debe ser la uri correspondiente -sqlite_database_uri = jdbc:sqlite:rodriguez.dat +sqlite_database_uri = jdbc:sqlite:data/rodriguez.dat # look_and_feel elige el look and feel que intentara utilizar la aplicacion, si el seleccionado no funciona en el sistema operativo se hara fallback a metal. diff --git a/dist/config/logging.properties b/dist/config/logging.properties index cc52969..a4df2a5 100644 --- a/dist/config/logging.properties +++ b/dist/config/logging.properties @@ -1,32 +1,8 @@ -# -# MIT License -# -# Copyright (c) 2018-2019 Daniel Cortes -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# - #handlers= java.util.logging.ConsoleHandler handlers= java.util.logging.FileHandler java.util.logging.FileHandler.level = ALL -java.util.logging.FileHandler.pattern = logs.xml +java.util.logging.FileHandler.pattern = logs/logs-%u.xml java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter #java.util.logging.ConsoleHandler.level = ALL diff --git a/lib/LGoodDatePicker-10.3.1-javadoc.jar b/lib/LGoodDatePicker-10.3.1-javadoc.jar deleted file mode 100644 index caa74c1..0000000 Binary files a/lib/LGoodDatePicker-10.3.1-javadoc.jar and /dev/null differ diff --git a/lib/LGoodDatePicker-10.3.1-sources.jar b/lib/LGoodDatePicker-10.3.1-sources.jar deleted file mode 100644 index 94e41c6..0000000 Binary files a/lib/LGoodDatePicker-10.3.1-sources.jar and /dev/null differ diff --git a/lib/LGoodDatePicker-10.3.1.jar b/lib/LGoodDatePicker-10.3.1.jar deleted file mode 100644 index 79bb360..0000000 Binary files a/lib/LGoodDatePicker-10.3.1.jar and /dev/null differ diff --git a/lib/gson-2.8.5-javadoc.jar b/lib/gson-2.8.5-javadoc.jar deleted file mode 100644 index e74a1d2..0000000 Binary files a/lib/gson-2.8.5-javadoc.jar and /dev/null differ diff --git a/lib/gson-2.8.5-sources.jar b/lib/gson-2.8.5-sources.jar deleted file mode 100644 index a64f4e7..0000000 Binary files a/lib/gson-2.8.5-sources.jar and /dev/null differ diff --git a/lib/gson-2.8.5.jar b/lib/gson-2.8.5.jar deleted file mode 100644 index 0d5baf3..0000000 Binary files a/lib/gson-2.8.5.jar and /dev/null differ diff --git a/lib/mysql-connector-java-8.0.13-sources.jar b/lib/mysql-connector-java-8.0.13-sources.jar deleted file mode 100644 index aed2eda..0000000 Binary files a/lib/mysql-connector-java-8.0.13-sources.jar and /dev/null differ diff --git a/lib/mysql-connector-java-8.0.13.jar b/lib/mysql-connector-java-8.0.13.jar deleted file mode 100644 index a4efaf5..0000000 Binary files a/lib/mysql-connector-java-8.0.13.jar and /dev/null differ diff --git a/lib/protobuf-java-3.6.1-javadoc.jar b/lib/protobuf-java-3.6.1-javadoc.jar deleted file mode 100644 index a2893ca..0000000 Binary files a/lib/protobuf-java-3.6.1-javadoc.jar and /dev/null differ diff --git a/lib/protobuf-java-3.6.1-sources.jar b/lib/protobuf-java-3.6.1-sources.jar deleted file mode 100644 index c106429..0000000 Binary files a/lib/protobuf-java-3.6.1-sources.jar and /dev/null differ diff --git a/lib/protobuf-java-3.6.1.jar b/lib/protobuf-java-3.6.1.jar deleted file mode 100644 index 8a18789..0000000 Binary files a/lib/protobuf-java-3.6.1.jar and /dev/null differ diff --git a/lib/sqlite-jdbc-3.25.2-javadoc.jar b/lib/sqlite-jdbc-3.25.2-javadoc.jar deleted file mode 100644 index d8926cb..0000000 Binary files a/lib/sqlite-jdbc-3.25.2-javadoc.jar and /dev/null differ diff --git a/lib/sqlite-jdbc-3.25.2-sources.jar b/lib/sqlite-jdbc-3.25.2-sources.jar deleted file mode 100644 index 405340a..0000000 Binary files a/lib/sqlite-jdbc-3.25.2-sources.jar and /dev/null differ diff --git a/lib/sqlite-jdbc-3.25.2.jar b/lib/sqlite-jdbc-3.25.2.jar deleted file mode 100644 index abec989..0000000 Binary files a/lib/sqlite-jdbc-3.25.2.jar and /dev/null differ diff --git a/src/danielcortes/xyz/data/Configuration.java b/src/danielcortes/xyz/data/Configuration.java index ac21142..3191883 100644 --- a/src/danielcortes/xyz/data/Configuration.java +++ b/src/danielcortes/xyz/data/Configuration.java @@ -41,7 +41,7 @@ public class Configuration { try { LOGGER.log(Level.INFO, "Leyendo y llenando el objeto de properties"); - FileInputStream in = new FileInputStream("conf.properties"); + FileInputStream in = new FileInputStream("config/app.properties"); config.load(in); in.close(); diff --git a/src/danielcortes/xyz/models/caja/SQLiteCajaDAO.java b/src/danielcortes/xyz/models/caja/SQLiteCajaDAO.java index e1004bc..82935fc 100644 --- a/src/danielcortes/xyz/models/caja/SQLiteCajaDAO.java +++ b/src/danielcortes/xyz/models/caja/SQLiteCajaDAO.java @@ -55,10 +55,10 @@ public class SQLiteCajaDAO extends CajaDAO { List cajaList = new ArrayList<>(); try (Connection conn = connectionHolder.getConnection()) { String query = "select * from caja"; - PreparedStatement ps = conn.prepareStatement("select * from caja"); + PreparedStatement ps = conn.prepareStatement(query); ResultSet rs = ps.executeQuery(); - LOGGER.log(Level.FINE, "Se ejecuta query: {0}", query); + LOGGER.log(Level.FINE, "QUERY: {0}", new Object[]{query}); cajaList = this.cajasFromResultSet(rs); @@ -80,7 +80,7 @@ public class SQLiteCajaDAO extends CajaDAO { ps.setInt(1, id); ResultSet rs = ps.executeQuery(); - LOGGER.log(Level.FINE, "Se ejecuta query: {0}, con id = {1}", new Object[]{query, id}); + LOGGER.log(Level.FINE, "QUERY: {0} | values [{1}]", new Object[]{query, id}); caja = this.cajasFromResultSet(rs).get(0); @@ -102,7 +102,7 @@ public class SQLiteCajaDAO extends CajaDAO { ps.setString(1, fecha.toString()); ResultSet rs = ps.executeQuery(); - LOGGER.log(Level.FINE, "Se ejecuta query: {0}, con fecha = {1}", new Object[]{query, fecha}); + LOGGER.log(Level.FINE, "QUERY: {0} | values [{1}]", new Object[]{query, fecha}); List cajaList = this.cajasFromResultSet(rs); @@ -128,7 +128,7 @@ public class SQLiteCajaDAO extends CajaDAO { updates = ps.executeUpdate(); - LOGGER.log(Level.FINE, "Se ejecuta query: {0}, con fecha = {1}", new Object[]{query, caja.getFecha().toString()}); + LOGGER.log(Level.FINE, "QUERY: {0} values [{1}]", new Object[]{query, caja.getFecha().toString()}); ps.close(); @@ -137,7 +137,7 @@ public class SQLiteCajaDAO extends CajaDAO { ps = conn.prepareStatement("select last_insert_rowid()"); ResultSet rs = ps.executeQuery(); - LOGGER.log(Level.FINE, "Se ejecuta query: {0}", new Object[]{query}); + LOGGER.log(Level.FINE, "QUERY: {0}", new Object[]{query}); rs.next(); caja.setId(rs.getInt(1)); @@ -161,7 +161,8 @@ public class SQLiteCajaDAO extends CajaDAO { ps.setInt(2, caja.getId()); updates = ps.executeUpdate(); - LOGGER.log(Level.FINE, "Se ejecuta query: {0}, con fecha = {1} y id = {2}", new Object[]{query, caja.getFecha(), caja.getId()}); + LOGGER.log(Level.FINE, "QUERY: {0} | values [{1},{2}]", new Object[]{query, caja.getFecha().toString(), caja.getId()}); + ps.close(); } catch (SQLException e) { @@ -175,6 +176,7 @@ public class SQLiteCajaDAO extends CajaDAO { public void createCajasForMonth(LocalDate month) { LocalDate date = month.withDayOfMonth(1); LocalDate endDate = date.withDayOfMonth(date.lengthOfMonth()).plusDays(1); + int count = 0; LOGGER.log(Level.FINE, "Se intentara crear las cajas para un mes para las fechas entre {0} y {1}", new Object[]{date, endDate}); @@ -199,6 +201,9 @@ public class SQLiteCajaDAO extends CajaDAO { documentosDAO.insertDefaultDocumentos(documentos); date = date.plusDays(1); + count++; } + + LOGGER.log(Level.FINE, "Terminado de intentar crear las cajas y se crearon {2}", new Object[]{date, endDate, count}); } }