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
23767bc9
Commit
23767bc9
authored
Apr 06, 2018
by
sistem02 user
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
actualizando las horas de salidas de las asistencias
parent
0d1ad79a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
9 deletions
+29
-9
Main.java
src/salidasautomaticas/main/Main.java
+23
-6
SalidasMysqlDAO.java
src/salidasautomaticas/mysqldao/SalidasMysqlDAO.java
+2
-2
Temporizador.java
src/salidasautomaticas/schedule/Temporizador.java
+4
-1
No files found.
src/salidasautomaticas/main/Main.java
View file @
23767bc9
package
salidasautomaticas
.
main
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.Timer
;
import
java.util.TimerTask
;
import
salidasautomaticas.schedule.Temporizador
;
import
salidasautomaticas.services.SalidasServices
;
public
class
Main
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
Date
horaInicio
=
new
Date
(
System
.
currentTimeMillis
());
Calendar
c
=
Calendar
.
getInstance
();
c
.
setTime
(
horaInicio
);
// System.out.println(c.get(Calendar.DAY_OF_WEEK));
// Si la hora es posterior a las 8am se programa la alarma para el dia siguiente
if
(
c
.
get
(
Calendar
.
HOUR_OF_DAY
)
>=
22
)
{
c
.
set
(
Calendar
.
DAY_OF_YEAR
,
c
.
get
(
Calendar
.
DAY_OF_YEAR
)
+
1
);
}
c
.
set
(
Calendar
.
HOUR_OF_DAY
,
20
);
c
.
set
(
Calendar
.
MINUTE
,
18
);
c
.
set
(
Calendar
.
SECOND
,
0
);
horaInicio
=
c
.
getTime
();
Timer
timer
=
new
Timer
();
SalidasServices
services
=
new
SalidasServices
();
timer
.
schedule
(
new
Temporizador
(),
0
);
// timer.schedule(new Temporizador(), horaInicio, 1);
timer
.
schedule
(
new
Temporizador
(),
0
);
}
}
src/salidasautomaticas/mysqldao/SalidasMysqlDAO.java
View file @
23767bc9
...
...
@@ -78,8 +78,8 @@ public class SalidasMysqlDAO implements SalidasDAO {
+
"WHERE\n"
+
" asistencia.horasal = ''\n"
+
"AND asistencia.minsal = ''\n"
+
"AND ( ? <='*' AND asistencia.fecha_asis='2018-04-05'
)
\n"
+
"OR
(
asistencia.fecha_asis BETWEEN '2018-04-03' AND '2018-04-04')\n"
+
"AND ( ? <='*' AND asistencia.fecha_asis='2018-04-05'\n"
+
"OR asistencia.fecha_asis BETWEEN '2018-04-03' AND '2018-04-04')\n"
+
"AND ? is not NULL \n"
+
"AND (WEEKDAY(asistencia.fecha_asis) + 1) !=7 AND personal.retirado=0 "
;
...
...
src/salidasautomaticas/schedule/Temporizador.java
View file @
23767bc9
...
...
@@ -16,10 +16,13 @@ import salidasautomaticas.services.SalidasServices;
public
class
Temporizador
extends
TimerTask
{
SalidasServices
service
=
new
SalidasServices
();
@Override
public
void
run
()
{
service
.
actualizarSalidas
();
//
service.actualizarSalidas();
System
.
out
.
println
(
"Actualizar salida"
);
cancel
();
}
}
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