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
5b4789ed
Commit
5b4789ed
authored
Apr 30, 2018
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asignar horario de salida al personal
parent
c719526b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
9 deletions
+32
-9
SalidasDAO.java
src/salidasautomaticas/dao/SalidasDAO.java
+1
-1
SalidasMysqlDAO.java
src/salidasautomaticas/mysqldao/SalidasMysqlDAO.java
+31
-8
No files found.
src/salidasautomaticas/dao/SalidasDAO.java
View file @
5b4789ed
...
...
@@ -20,5 +20,5 @@ public interface SalidasDAO {
public
JSONObject
actualizarSalida
(
String
horaSalida
)
throws
Exception
;
public
JSONArray
obtenerSalidasNuevas
()
throws
Exception
;
public
JSONArray
obtenerPersonalNuevoSinSalida
()
throws
Exception
;
public
JSONObject
asignarHorarioSalida
(
JSONArray
listaPersonalNuevo
)
throws
Exception
;
public
JSONObject
asignarHorarioSalida
()
throws
Exception
;
}
src/salidasautomaticas/mysqldao/SalidasMysqlDAO.java
View file @
5b4789ed
...
...
@@ -246,7 +246,7 @@ public class SalidasMysqlDAO implements SalidasDAO {
}
public
static
void
main
(
String
[]
args
)
{
SalidasMysqlDAO
s
=
new
SalidasMysqlDAO
();
//
SalidasMysqlDAO s = new SalidasMysqlDAO();
// try {
// JSONObject obj = s.actualizarSalida("17:00");
// System.out.println(obj);
...
...
@@ -254,7 +254,21 @@ public class SalidasMysqlDAO implements SalidasDAO {
// Logger.getLogger(SalidasMysqlDAO.class.getName()).log(Level.SEVERE, null, ex);
// }
System
.
out
.
println
(
s
.
getFechaAyer
());
// System.out.println(s.getFechaAyer());
String
query
=
"SELECT "
+
" p.codper, "
+
" su.salidaLV, "
+
" su.salidaS, "
+
"FROM "
+
" personal p "
+
"INNER JOIN salidas_update su ON p.codcargo=su.codcargo "
+
"WHERE retirado=0 AND p.horaing=su.horaLV "
+
"and p.mining=su.minutoLV and p.horaingsabado=su.sabadoLV AND p.miningsabado=su.sabadoS "
+
"and NOT p.codlocal in('L035','L053','L038') AND NOT pronoe=1 "
+
"AND not p.codcargo in (71,13) and horaing < 19 and "
+
"(nullif(p.salidaLV,'') is null and nullif(p.salidaS, '') is null) ORDER BY p.codper "
;
System
.
out
.
println
(
query
);
}
@Override
...
...
@@ -301,13 +315,22 @@ public class SalidasMysqlDAO implements SalidasDAO {
}
@Override
public
JSONObject
asignarHorarioSalida
(
JSONArray
listaPersonalNuevo
)
throws
Exception
{
public
JSONObject
asignarHorarioSalida
()
throws
Exception
{
Connection
cn
=
MysqlDAOFactory
.
obtenerConexion
(
"nuevo"
);
String
query
=
"update personal p, "
+
" ("
+
" SELECT p.codper, su.salidaLV, su.salidaS FROM personal p INNER JOIN salidas_update su ON p.codcargo=su.codcargo "
+
" WHERE retirado=0 AND p.horaing=su.horaLV and p.mining=su.minutoLV "
+
" and p.horaingsabado=su.sabadoLV AND p.miningsabado=su.sabadoS and NOT p.codlocal in('L035','L053','L038') "
+
" AND NOT pronoe=1 AND not p.codcargo in (71,13) and horaing < 19 and (nullif(p.salidaLV,'') is null and nullif(p.salidaS, '') is null) "
+
" ) as tbl "
+
"SET p.salidaLV=tbl.salidaLV, "
+
" p.salidaS=tbl.salidaS "
+
"where tbl.codper=p.codper"
;
String
query
=
"UPDATE personal SET salidaLV=?,salidaS=? WHERE codper=?;"
;
JSONObject
jsonArray
=
EstandarDAO
.
getInstance
().
consultar
(
cn
,
query
);
return
jsonArray
;
JSONObject
resultado
=
EstandarDAO
.
getInstance
().
ejecutar
(
cn
,
query
);
return
resultado
;
}
}
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