Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
horario
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
Juan Guevara Mayta
horario
Commits
43d6871f
Commit
43d6871f
authored
Dec 29, 2018
by
Crhistian Yuri Anchivilca Amasifuen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cambios generar horarios
parent
f1ec7a26
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
140 additions
and
68 deletions
+140
-68
Horario.java
src/java/pe/siso/horario/Beans/Horario.java
+10
-0
NewMain.java
src/java/pe/siso/horario/Beans/NewMain.java
+44
-0
MySqlAulaDAO.java
src/java/pe/siso/horario/MySqlDAO/MySqlAulaDAO.java
+23
-3
MySqlDAOFactory.java
src/java/pe/siso/horario/MySqlDAO/MySqlDAOFactory.java
+3
-0
MySqlHorarioDAO.java
src/java/pe/siso/horario/MySqlDAO/MySqlHorarioDAO.java
+28
-29
ServletHorario.java
src/java/pe/siso/horario/Servlets/ServletHorario.java
+20
-34
arm_hor_gen.jsp
web/vista/arm_hor_gen.jsp
+5
-1
gen_hor_gen.jsp
web/vista/gen_hor_gen.jsp
+7
-1
No files found.
src/java/pe/siso/horario/Beans/Horario.java
View file @
43d6871f
...
...
@@ -17,6 +17,7 @@ public class Horario {
private
String
codigoPlana
;
private
String
examen
;
private
String
nota_encuesta
;
private
String
celularDocente
;
public
String
getExamen
()
{
return
examen
;
...
...
@@ -720,6 +721,15 @@ public class Horario {
public
void
setEstadoHorarioGrupo
(
String
estadoHorarioGrupo
)
{
this
.
estadoHorarioGrupo
=
estadoHorarioGrupo
;
}
public
String
getCelularDocente
(){
return
celularDocente
;
}
public
void
setCelularDocente
(
String
celularDocente
){
this
.
celularDocente
=
celularDocente
;
}
}
src/java/pe/siso/horario/Beans/NewMain.java
0 → 100644
View file @
43d6871f
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package
pe
.
siso
.
horario
.
Beans
;
import
java.util.Arrays
;
import
java.util.List
;
/**
*
* @author sistem20user
*/
public
class
NewMain
{
/**
* @param args the command line arguments
*/
public
static
void
main
(
String
[]
args
)
{
//// List<Object> list = Arrays.asList("Lars", "Simon","prueba","adsvasdf");
// list.forEach(System.out::println);
List
<
String
>
list1
=
createList
();
list1
.
sort
(
null
);
//ordenamos el arrayList
list1
.
forEach
(
System
.
out
::
println
);
System
.
out
.
println
(
"Sorting with a lamba expression for the comparison"
);
List
<
String
>
list2
=
createList
();
list2
.
sort
((
s1
,
s2
)
->
s1
.
compareToIgnoreCase
(
s2
));
list2
.
forEach
(
System
.
out
::
println
);
System
.
out
.
println
(
"Sorting with a method references"
);
List
<
String
>
list3
=
createList
();
list3
.
sort
(
String:
:
compareToIgnoreCase
);
//list3.forEach(System.out::println);
}
private
static
List
<
String
>
createList
()
{
return
Arrays
.
asList
(
"Alcatel"
,
"android"
,
"sony experia"
,
""
,
""
);
}
}
src/java/pe/siso/horario/MySqlDAO/MySqlAulaDAO.java
View file @
43d6871f
...
...
@@ -9,6 +9,8 @@ import java.sql.Connection;
import
java.sql.ResultSet
;
import
java.sql.Statement
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
pe.siso.horario.Beans.Aula
;
import
pe.siso.horario.DAO.AulaDAO
;
...
...
@@ -713,7 +715,8 @@ public class MySqlAulaDAO implements AulaDAO {
try
{
cnx
=
MySqlDAOFactory
.
obtenerConexion
(
base
);
Statement
st
=
cnx
.
createStatement
();
String
query
=
"SELECT aula.codaula,aula.codlocal,aula.codtipocentro,aula.cocentro,aula.codnivel,aula.codtipogrado,"
+
"aula.codgrado,aula.codseccion,aula.codturno,sede.des_loc,tipo_centro.destipocentro,centro.descentro,"
+
"nivel.desnivel,tipo_grado.destipogrado,grado.desgrado,seccion.desseccion,turno.desturno,aula.estado,aula.nombre FROM aula "
...
...
@@ -726,9 +729,26 @@ public class MySqlAulaDAO implements AulaDAO {
+
"INNER JOIN seccion on seccion.codseccion=aula.codseccion "
+
"INNER JOIN turno on turno.codturno=aula.codturno "
+
"WHERE sede.cod_loc='"
+
codigoLocal
+
"' and aula.anno=YEAR(CURDATE()) and nivel.codnivel not in (1,2) and aula.estado='1' "
+
"ORDER BY sede.des_loc,tipo_centro.destipocentro,centro.descentro, "
+
"nivel.desnivel,grado.desgrado,tipo_grado.destipogrado,seccion.desseccion,turno.desturno "
+
"ORDER BY aula.codaula DESC "
+
" LIMIT "
+
inicio
+
", "
+
cantitad
+
" "
;
// QUERY SIN DESC QUE ESTABA ANTES QUE EL DE ARRIBA
// String query = "SELECT aula.codaula,aula.codlocal,aula.codtipocentro,aula.cocentro,aula.codnivel,aula.codtipogrado,"
// + "aula.codgrado,aula.codseccion,aula.codturno,sede.des_loc,tipo_centro.destipocentro,centro.descentro,"
// + "nivel.desnivel,tipo_grado.destipogrado,grado.desgrado,seccion.desseccion,turno.desturno,aula.estado,aula.nombre FROM aula "
// + "INNER JOIN sede on sede.cod_loc=aula.codlocal "
// + "INNER JOIN tipo_centro on tipo_centro.codtipocentro=aula.codtipocentro "
// + "INNER JOIN centro on centro.codcentro=aula.cocentro "
// + "INNER JOIN nivel on nivel.codnivel=aula.codnivel "
// + "INNER JOIN tipo_grado on tipo_grado.codtipogrado=aula.codtipogrado "
// + "INNER JOIN grado on grado.codgrado=aula.codgrado "
// + "INNER JOIN seccion on seccion.codseccion=aula.codseccion "
// + "INNER JOIN turno on turno.codturno=aula.codturno "
// + "WHERE sede.cod_loc='" + codigoLocal + "' and aula.anno=YEAR(CURDATE()) and nivel.codnivel not in (1,2) and aula.estado='1' "
// + "ORDER BY sede.des_loc,tipo_centro.destipocentro,centro.descentro, "
// + "nivel.desnivel,grado.desgrado,tipo_grado.destipogrado,seccion.desseccion,turno.desturno "
// + " LIMIT " + inicio + ", " + cantitad + " ";
System
.
out
.
println
(
query
);
...
...
src/java/pe/siso/horario/MySqlDAO/MySqlDAOFactory.java
View file @
43d6871f
...
...
@@ -59,6 +59,7 @@ public class MySqlDAOFactory extends DAOFactory {
// "jdbc:mysql://172.16.2.69:3306/encuesta_docente",
// "root",
// "mysql");
//serverdes5
"jdbc:mysql://172.16.0.6:3306/encuesta_docente"
,
"christian"
,
"Saco1357$"
);
...
...
@@ -76,6 +77,7 @@ public class MySqlDAOFactory extends DAOFactory {
// "jdbc:mysql://172.16.2.69:3306/nuevo",
// "root",
// "mysql");
// serverweb
"jdbc:mysql://172.16.0.15:3306/nuevo"
,
"eduardo"
,
"mysql"
);
...
...
@@ -109,6 +111,7 @@ public class MySqlDAOFactory extends DAOFactory {
// "jdbc:mysql://localhost:3306/sacoolive3",
// "root",
// "mysql");
//serverdes5
"jdbc:mysql://172.16.0.6:3306/sacoolive3"
,
"backup"
,
"mysql2016"
);
...
...
src/java/pe/siso/horario/MySqlDAO/MySqlHorarioDAO.java
View file @
43d6871f
...
...
@@ -1750,11 +1750,11 @@ public class MySqlHorarioDAO implements HorarioDAO {
Connection
cnx2
=
MySqlDAOFactory
.
obtenerConexion
(
base2
);
Statement
st2
=
cnx2
.
createStatement
();
String
consultaTipoDocente
=
"SELECT hr.codSec,hr.cod_hcd,hr.codAula,hr.dia,hr.pos_blo,hr.hor_ini,hr.hor_fin,hr.cod_cur, "
// + " hr.cod_doc,hr.cod_tur,hr.cod_per,hr.codGru,hr.est_hcd,cur.nom_cur "
// + " hr.cod_doc,hr.cod_tur,hr.cod_per,hr.codGru,hr.est_hcd,cur.nom_cur "
+
" hr.cod_doc,hr.cod_tur,hr.cod_per,hr.codGru,hr.est_hcd,cur.nom_cur,pd.cod_pla "
+
"FROM "
+
" horario_curso_docente AS hr "
// + " INNER JOIN curso AS cur ON cur.cod_cur = hr.cod_cur "
// + " INNER JOIN curso AS cur ON cur.cod_cur = hr.cod_cur "
+
" INNER JOIN curso AS cur ON cur.cod_cur = hr.cod_cur LEFT JOIN tabla_evaluacion pd ON pd.cod_doc=hr.cod_doc "
+
"WHERE "
+
" hr.codAula = '"
+
codigoAula
+
"' "
...
...
@@ -2488,8 +2488,6 @@ public class MySqlHorarioDAO implements HorarioDAO {
// System.out.println("" + resp.toString());
//
// }
@Override
public
JSONObject
listarVistaHorarioDisponibilidad
(
JSONObject
json
)
throws
Exception
{
JSONObject
jReturn
=
new
JSONObject
();
...
...
@@ -2690,38 +2688,39 @@ public class MySqlHorarioDAO implements HorarioDAO {
public
Horario
verDocenteExamenEncuesta
(
String
codigoDocente
,
String
codigoPlana
)
throws
Exception
{
String
base
=
"horario"
;
Connection
cnx
=
null
;
ResultSet
rs
=
null
;
PreparedStatement
pst
=
null
;
ResultSet
rs
=
null
;
PreparedStatement
pst
=
null
;
Horario
horario
=
new
Horario
();
try
{
cnx
=
MySqlDAOFactory
.
obtenerConexion
(
base
);
String
query
=
"SELECT "
+
" round(avg(te.exa),2), "
+
" round(avg(te.not_enc),2)"
+
" FROM "
+
" tabla_evaluacion te "
+
" INNER JOIN sacoolive3.profesor pr ON te.cod_doc = pr.codprofesor "
+
" WHERE "
+
" pr.codprofesor =? and te.cod_pla=? "
+
" GROUP BY te.cod_doc "
+
" order by te.cod_enc DESC "
+
" limit 3"
;
pst
=
cnx
.
prepareStatement
(
query
);
pst
.
setString
(
1
,
codigoDocente
);
pst
.
setString
(
2
,
codigoPlana
);
String
query
=
"SELECT \n"
+
" te.not_enc,\n"
+
" dd.cel_dat_per\n"
+
"FROM\n"
+
" tabla_evaluacion te\n"
+
"INNER JOIN sacoolive3.profesor pr ON te.cod_doc = pr.codprofesor\n"
+
"LEFT JOIN datos_docente dd ON pr.codprofesor = dd.cod_doc\n"
+
"WHERE\n"
+
" pr.codprofesor = ?\n"
+
"AND te.cod_pla = ?\n"
+
"\n"
+
"ORDER BY\n"
+
" te.cod_enc DESC\n"
+
"LIMIT 1"
;
pst
=
cnx
.
prepareStatement
(
query
);
pst
.
setString
(
1
,
codigoDocente
);
pst
.
setString
(
2
,
codigoPlana
);
//
rs
=
pst
.
executeQuery
();
rs
=
pst
.
executeQuery
();
while
(
rs
.
next
())
{
horario
.
setExamen
(
rs
.
getString
(
1
));
horario
.
set
Nota_encuesta
(
rs
.
getString
(
2
));
horario
.
set
CelularDocente
(
rs
.
getString
(
2
));
//
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
...
...
@@ -2730,9 +2729,9 @@ public class MySqlHorarioDAO implements HorarioDAO {
return
horario
;
}
public
static
void
main
(
String
[]
args
)
{
}
}
src/java/pe/siso/horario/Servlets/ServletHorario.java
View file @
43d6871f
...
...
@@ -1765,7 +1765,7 @@ public class ServletHorario extends HttpServlet {
+
" <td width='20'></td>"
+
" <td>"
+
" <div id='divTipClase'>"
+
" <select id='idClase'
class='validate[required]
form-control'>"
+
" <select id='idClase' form-control'>"
+
" <option>seleccione</option>"
);
for
(
int
i
=
0
;
i
<
listaClase
.
size
();
i
++)
{
pw
.
println
(
"<option value='"
+
listaClase
.
get
(
i
).
getCodigoClase
()
+
"'>"
+
listaClase
.
get
(
i
).
getNombreClase
()
+
"</option>"
);
...
...
@@ -2149,18 +2149,7 @@ public class ServletHorario extends HttpServlet {
+
" <td><b>Tipo de clase: </b><span style='color:red;'>*</span></td>"
+
" <td width='20'></td>"
+
" <td>"
+
" <div id='divTipClase'>"
+
" <select id='idClase' class='validate[required] form-control'>"
+
" <option>seleccione</option>"
);
for
(
int
i
=
0
;
i
<
listaCla
.
size
();
i
++)
{
if
(
listaCla
.
get
(
i
).
getCodigoClase
()
==
clase
)
{
pw
.
println
(
"<option value='"
+
listaCla
.
get
(
i
).
getCodigoClase
()
+
"' selected>"
+
listaCla
.
get
(
i
).
getNombreClase
()
+
"</option>"
);
}
else
{
pw
.
println
(
"<option value='"
+
listaCla
.
get
(
i
).
getCodigoClase
()
+
"'>"
+
listaCla
.
get
(
i
).
getNombreClase
()
+
"</option>"
);
}
}
pw
.
println
(
"</select>"
+
" </div>"
+
" </td>"
+
" </tr>"
+
" </table>"
...
...
@@ -2827,16 +2816,19 @@ public class ServletHorario extends HttpServlet {
if
(
DatosHorario
.
getCodigoPlana
()
==
null
){
//System.out.println("No hay plana");
obj
.
setExamen
(
" No evaluado "
);
obj
.
set
Nota_encuesta
(
" No evalu
ado "
);
obj
.
set
CelularDocente
(
" No registr
ado "
);
}
else
{
int
codigoACambiar
=
Integer
.
parseInt
(
codPeriodo2
);
int
resta
=
codigoACambiar
-
1
;
String
codigoCambiado
=
String
.
valueOf
(
resta
);
obj
=
serviciosHor
.
verDocenteExamenEncuesta
(
DatosHorario
.
getH_codigoDocente
(),
DatosHorario
.
getCodigoPlana
());
if
(
obj
.
getExamen
()
==
null
&&
obj
.
getNota_encuesta
()
==
null
){
if
(
obj
.
getExamen
()
==
null
){
obj
.
setExamen
(
" No evaluado "
);
obj
.
setNota_encuesta
(
" No evaluado "
);
}
if
(
obj
.
getCelularDocente
()
==
null
){
obj
.
setCelularDocente
(
"No registrado"
);
}
...
...
@@ -2992,7 +2984,7 @@ public class ServletHorario extends HttpServlet {
+
" </div><br>"
+
" <b>"
+
DatosHorario
.
getH_nombreCurso
()
+
"</b> "
+
" <br>"
+
DatosHorario
.
getH_apellidosDocente
()
+
", "
+
DatosHorario
.
getH_nombreDocente
()+
" "
+
" <br> Prom.ENC :"
+
obj
.
getExamen
()
+
" <br>
Prom.EAC : "
+
obj
.
getNota_encuesta
()
+
" "
+
" <br> Prom.ENC :"
+
obj
.
getExamen
()
+
" <br>
Cel : "
+
obj
.
getCelularDocente
()
+
" "
+
" </div>"
+
" </label>"
+
" </td>"
);
...
...
@@ -3143,18 +3135,10 @@ public class ServletHorario extends HttpServlet {
+
" </tr>"
+
" <tr><td height='10' colspan='3'></td></tr>"
+
" <tr>"
+
" <td><b>Tipo de clase: </b><span style='color:red;'>*</span></td>"
+
" <td width='20'></td>"
+
" <td>"
+
" <div id='divTipClase'>"
+
" <select id='idClase' class='validate[required] form-control'>"
+
" <option value=''>[Seleccione]</option>"
);
for
(
int
i
=
0
;
i
<
listaClase
.
size
();
i
++)
{
pw
.
println
(
"<option value='"
+
listaClase
.
get
(
i
).
getCodigoClase
()
+
"'>"
+
listaClase
.
get
(
i
).
getNombreClase
()
+
"</option>"
);
}
pw
.
println
(
"</select>"
+
" </div>"
+
" </td>"
// + " <td><b>Tipo de clase: </b><span style='color:red;'>*</span></td>"
// + " <td width='20'></td>"
// + " <td>"
// + " </td>"
+
" </tr>"
+
" </table>"
+
" </td>"
...
...
@@ -3235,7 +3219,7 @@ public class ServletHorario extends HttpServlet {
pw
.
println
(
"<div class='col-sm-2'>"
);
pw
.
println
(
"<b>Tipo de clase: </b><span style='color:red;'>*</span><br>"
);
pw
.
println
(
"<div id='divTipClase'>"
);
pw
.
println
(
"<select id='idClase'
class='validate[required]
form-control'>"
);
pw
.
println
(
"<select id='idClase' form-control'>"
);
pw
.
println
(
"<option value=''>[Seleccione]</option>"
);
for
(
int
i
=
0
;
i
<
listaClase
.
size
();
i
++)
{
if
(
listaClase
.
get
(
i
).
getCodigoClase
()
==
1
)
{
...
...
@@ -3436,7 +3420,7 @@ public class ServletHorario extends HttpServlet {
+
" <td width='20'></td>"
+
" <td>"
+
" <div id='divTipClase'>"
+
" <select id='idClase'
class='validate[required]
form-control'>"
+
" <select id='idClase' form-control'>"
+
" <option>seleccione</option>"
);
for
(
int
i
=
0
;
i
<
listaCla
.
size
();
i
++)
{
if
(
listaCla
.
get
(
i
).
getCodigoClase
()
==
clase
)
{
...
...
@@ -3551,7 +3535,7 @@ public class ServletHorario extends HttpServlet {
pw
.
println
(
"<div class='col-sm-4'>"
);
pw
.
println
(
"<b>Tipo de clase: </b><span style='color:red;'>*</span><br>"
);
pw
.
println
(
"<div id='divTipClase'>"
);
pw
.
println
(
"<select id='idClase'
class='validate[required]
form-control'>"
);
pw
.
println
(
"<select id='idClase' form-control'>"
);
pw
.
println
(
"<option value=''>[Seleccione]</option>"
);
for
(
int
i
=
0
;
i
<
listaCla
.
size
();
i
++)
{
if
(
listaCla
.
get
(
i
).
getCodigoClase
()
==
clase
)
{
...
...
@@ -4369,8 +4353,10 @@ public class ServletHorario extends HttpServlet {
pw
.
println
(
"<div class='col-sm-4'>"
);
pw
.
println
(
"<b>Tipo de clase: </b><span style='color:red;'>*</span><br>"
);
pw
.
println
(
"<div id='divTipClase'>"
);
pw
.
println
(
"<select id='idClase' class='validate[required] form-control'>"
);
pw
.
println
(
"<option value=''>[Seleccione]</option>"
);
pw
.
println
(
"<select id='idClase' form-control'>"
);
for
(
int
i
=
0
;
i
<
listaCla
.
size
();
i
++)
{
if
(
listaCla
.
get
(
i
).
getCodigoClase
()
==
clase
)
{
pw
.
println
(
"<option value='"
+
listaCla
.
get
(
i
).
getCodigoClase
()
+
"' selected>"
+
listaCla
.
get
(
i
).
getNombreClase
()
+
"</option>"
);
...
...
web/vista/arm_hor_gen.jsp
View file @
43d6871f
...
...
@@ -732,6 +732,7 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
$
(
"#aula #accionHorario"
).
hide
();
$
(
"#aula #tachoEliminar"
).
hide
();
$
(
"#aula #sinCurso"
).
prop
(
"onclick"
,
null
).
off
(
"click"
);
}
...
...
@@ -883,11 +884,13 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
// Recorremos todas las filas con contenido de la tabla
for
(
var
i
=
1
;
i
<
tableReg
.
rows
.
length
;
i
++
)
{
cellsOfRow
=
tableReg
.
rows
[
i
].
getElementsByTagName
(
'td'
);
found
=
false
;
// Recorremos todas las celdas
for
(
var
j
=
0
;
j
<
cellsOfRow
.
length
&&
!
found
;
j
++
)
{
compareWith
=
cellsOfRow
[
j
].
innerHTML
.
toLowerCase
();
//console.log(cellsOfRow);
// Buscamos el texto en el contenido de la celda
if
(
searchText
.
length
==
0
||
(
compareWith
.
indexOf
(
searchText
)
>
-
1
))
{
...
...
@@ -914,7 +917,7 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
// Recorremos todas las filas con contenido de la tabla
for
(
var
i
=
1
;
i
<
tableReg
.
rows
.
length
;
i
++
)
{
cellsOfRow
=
tableReg
.
rows
[
i
].
getElementsBy
Tag
Name
(
'td'
);
cellsOfRow
=
tableReg
.
rows
[
i
].
getElementsBy
Class
Name
(
'td'
);
found
=
false
;
// Recorremos todas las celdas
...
...
@@ -928,6 +931,7 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
}
if
(
found
)
{
tableReg
.
rows
[
i
].
style
.
display
=
''
;
}
else
{
// si no ha encontrado ninguna coincidencia, esconde la
// fila de la tabla
...
...
web/vista/gen_hor_gen.jsp
View file @
43d6871f
...
...
@@ -853,7 +853,7 @@
var
codTipoGrado
=
$
(
"#cmbtipogrado"
).
val
();
var
codGrado
=
$
(
"#cmbgrado"
).
val
();
var
accion
=
"cargarTurno();limpiarListado();"
;
var
nombre
=
"cmbSeccion"
;
var
nombre
=
"cmbSeccion"
;
$
.
ajax
({
type
:
'POST'
,
url
:
'../ServletSeccion?Accion=cargarSeccionBlo'
,
...
...
@@ -968,6 +968,12 @@
$
(
"#aula #btnArmado"
).
hide
();
}
if
(
name
.
substr
(
0
,
2
)
===
"DI"
){
$
(
"#aula #btnAgregar"
).
hide
();
$
(
"#aula #btnArmado"
).
hide
();
}
},
complete
:
function
(){
$
(
'#aula'
).
fadeIn
();
}
...
...
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