Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SalidasAutomaticas
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Billy Larru
SalidasAutomaticas
Commits
904229ff
Commit
904229ff
authored
May 16, 2018
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
se omiten las asistencias del sabado de personal de primaria
parent
379d31e1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
6 deletions
+30
-6
SalidasMysqlDAO.java
src/salidasautomaticas/mysqldao/SalidasMysqlDAO.java
+21
-5
ProgramarSalidasTask.java
src/salidasautomaticas/schedule/ProgramarSalidasTask.java
+9
-1
No files found.
src/salidasautomaticas/mysqldao/SalidasMysqlDAO.java
View file @
904229ff
...
...
@@ -8,6 +8,8 @@ package salidasautomaticas.mysqldao;
import
java.sql.Connection
;
import
java.time.LocalDate
;
import
java.util.Iterator
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
org.json.JSONArray
;
import
org.json.JSONObject
;
import
salidasautomaticas.dao.SalidasDAO
;
...
...
@@ -112,13 +114,16 @@ public class SalidasMysqlDAO implements SalidasDAO {
+
"WHERE "
+
" asistencia.horasal = '' "
+
"AND asistencia.minsal = '' "
+
"AND ( {campo_salida} <= ? AND asistencia.fecha_asis='{fecha_hoy}' "
+
"AND ( {campo_salida} <= ? AND asistencia.fecha_asis='{fecha_hoy}' "
//Se setea la horaProgramada como parametro en "?"
+
"OR asistencia.fecha_asis BETWEEN '{fecha_partida}' AND '{fecha_ayer}') "
+
"AND {campo_salida} is not NULL "
+
"AND NOT personal.codlocal IN ('L035', 'L053', 'L038') "
+
"AND NOT personal.codcargo IN (71, 13) "
+
"AND NOT personal.pronoe = 1 "
+
"AND (WEEKDAY(asistencia.fecha_asis) + 1) !=7 AND personal.retirado=0) as tabla "
+
"AND NOT personal.codlocal IN ('L035', 'L053', 'L038') "
//Que no sea profesores por horas, pronoe belisario, grupo MH
+
"AND NOT personal.codcargo IN (71, 13) "
//Que no sea policia ni de cafeteria
+
"AND NOT personal.pronoe = 1 "
//Que no sea pronoe
+
"AND (WEEKDAY(asistencia.fecha_asis) + 1) !=7 "
//Que no sea domingo
+
"AND NOT ( (WEEKDAY(asistencia.fecha_asis) + 1)=6 and personal.codcargo in ({cod_cargo_primaria}) ) "
//Que no sean de primaria los sabados
+
"AND asistencia.estado in (1, 2, 5)"
//Que sean asistio, tardanza y no marco
+
"AND personal.retirado=0) as tabla "
+
"where tabla.salida!=''"
;
String
campoSalida
=
"("
...
...
@@ -127,12 +132,15 @@ public class SalidasMysqlDAO implements SalidasDAO {
+
"when (WEEKDAY(asistencia.fecha_asis) + 1)=6 then salidaS end "
+
") "
;
String
codCargoPrimaria
=
"1, 2, 4, 9, 11, 12, 20, 25, 33, 39, 40, 45, 51"
;
String
fechaPartida
=
"2018-04-01"
;
query
=
query
.
replaceAll
(
"\\{campo_salida\\}"
,
campoSalida
);
query
=
query
.
replaceAll
(
"\\{fecha_hoy\\}"
,
getFechaHoy
());
query
=
query
.
replaceAll
(
"\\{fecha_partida\\}"
,
fechaPartida
);
query
=
query
.
replaceAll
(
"\\{fecha_ayer\\}"
,
getFechaAyer
());
query
=
query
.
replaceAll
(
"\\{cod_cargo_primaria\\}"
,
codCargoPrimaria
);
JSONArray
parametros
=
new
JSONArray
();
parametros
.
put
(
horaProgramada
);
...
...
@@ -233,5 +241,13 @@ public class SalidasMysqlDAO implements SalidasDAO {
return
resultado
;
}
public
static
void
main
(
String
[]
args
)
{
try
{
System
.
out
.
println
(
new
SalidasMysqlDAO
().
actualizarSalida
(
"11:00"
));;
}
catch
(
Exception
ex
)
{
Logger
.
getLogger
(
SalidasMysqlDAO
.
class
.
getName
()).
log
(
Level
.
SEVERE
,
null
,
ex
);
}
}
}
src/salidasautomaticas/schedule/ProgramarSalidasTask.java
View file @
904229ff
...
...
@@ -28,7 +28,15 @@ public class ProgramarSalidasTask extends TimerTask {
public
void
run
()
{
try
{
JSONArray
listaHorarios
=
service
.
obtenerHorariosSalida
();
// JSONArray listaHorarios = service.obtenerHorariosSalida();
JSONArray
listaHorarios
=
new
JSONArray
();
String
[]
arraySalidas
=
{
"12:31"
,
"14:46"
,
"14:50"
,
"17:00"
,
"17:30"
,
"18:00"
};
for
(
String
salida
:
arraySalidas
)
{
listaHorarios
.
put
(
new
JSONObject
().
put
(
"salida"
,
salida
));
}
Timer
timer
;
TimerTask
task
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment