Commit 1126b7c5 by sistem26user

[ADD] Método cargarDocentePrimaria3, parche temporal para que no liste más de un…

[ADD] Método cargarDocentePrimaria3, parche temporal para que no liste más de un docente en el sistema horario
parent 3b4c1317
...@@ -20,12 +20,17 @@ public interface DocenteDAO { ...@@ -20,12 +20,17 @@ public interface DocenteDAO {
public ArrayList<Docente> listaDocentes() throws Exception; public ArrayList<Docente> listaDocentes() throws Exception;
public ArrayList<HorarioCF> listarCambiosFijo(String fechaDesde,String fechaHasta) throws Exception; public ArrayList<HorarioCF> listarCambiosFijo(String fechaDesde, String fechaHasta) throws Exception;
public ArrayList<HorarioCF> listarRegistrosNuevosYEliminados(String fechaDesde,String fechaHasta) throws Exception;
public ArrayList<HorarioCF> listarEliminados(String fechaDesde,String fechaHasta) throws Exception; public ArrayList<HorarioCF> listarRegistrosNuevosYEliminados(String fechaDesde, String fechaHasta) throws Exception;
public ArrayList<Horario> listarCambiosDia(String fechaDesde,String fechaHasta) throws Exception;
public ArrayList<Horario> listarCambiosDiaDocente(String cadenaAulas,String dia,String codigoDocente) throws Exception; public ArrayList<HorarioCF> listarEliminados(String fechaDesde, String fechaHasta) throws Exception;
public ArrayList<Horario> listarBajasDocente(String fechaDesde,String fechaHasta) throws Exception;
public ArrayList<Horario> listarCambiosDia(String fechaDesde, String fechaHasta) throws Exception;
public ArrayList<Horario> listarCambiosDiaDocente(String cadenaAulas, String dia, String codigoDocente) throws Exception;
public ArrayList<Horario> listarBajasDocente(String fechaDesde, String fechaHasta) throws Exception;
public ArrayList<Docente> listaDocentes(String apellido) throws Exception; public ArrayList<Docente> listaDocentes(String apellido) throws Exception;
...@@ -47,7 +52,7 @@ public interface DocenteDAO { ...@@ -47,7 +52,7 @@ public interface DocenteDAO {
public int registrarDatosEdit(String codDocente, String telefono, String mail, int cod_dep, int cod_pro, int cod_dis) throws Exception; public int registrarDatosEdit(String codDocente, String telefono, String mail, int cod_dep, int cod_pro, int cod_dis) throws Exception;
public ArrayList<Docente> consultarDatos(String codDocente,String codPeriodo) throws Exception; public ArrayList<Docente> consultarDatos(String codDocente, String codPeriodo) throws Exception;
public void actualizarDatos(String codDocente, String telefono, String zona, String email) throws Exception; public void actualizarDatos(String codDocente, String telefono, String zona, String email) throws Exception;
...@@ -66,13 +71,16 @@ public interface DocenteDAO { ...@@ -66,13 +71,16 @@ public interface DocenteDAO {
public ArrayList<Docente> listaDocentes(String apellido, int inicio, int cantidad) throws Exception; public ArrayList<Docente> listaDocentes(String apellido, int inicio, int cantidad) throws Exception;
//------------------------ //------------------------
public int registroDatos(String codDocente, String telefono, String mail, int cod_dep, int cod_pro, int cod_dis, String cel, String dir,int numHijos,int codArea,int codPlana,int codPeriodo) throws Exception; public int registroDatos(String codDocente, String telefono, String mail, int cod_dep, int cod_pro, int cod_dis, String cel, String dir, int numHijos, int codArea, int codPlana, int codPeriodo) throws Exception;
public int registrarDatosEdit(String codDocente, String telefono, String mail, int cod_dep, int cod_pro, int cod_dis, String cel, String dir,int cantHijos,int codArea,int codPlana,int periodo) throws Exception; public int registrarDatosEdit(String codDocente, String telefono, String mail, int cod_dep, int cod_pro, int cod_dis, String cel, String dir, int cantHijos, int codArea, int codPlana, int periodo) throws Exception;
public ArrayList<Docente> cargarDocentePrimaria(String codcurso) throws Exception; public ArrayList<Docente> cargarDocentePrimaria(String codcurso) throws Exception;
public ArrayList<Docente> cargarDocentePrimaria2(String codcurso, String apellido, int inicio, int cantidad) throws Exception; public ArrayList<Docente> cargarDocentePrimaria2(String codcurso, String apellido, int inicio, int cantidad) throws Exception;
public ArrayList<Docente> cargarDocentePrimaria3(String codcurso, String apellido, int inicio, int cantidad, String documentos_ignorados) throws Exception;
public Docente listarDocenteSede(String local) throws Exception; public Docente listarDocenteSede(String local) throws Exception;
public ArrayList<Docente> listarDocSecPri(String codPri, String codSec) throws Exception; public ArrayList<Docente> listarDocSecPri(String codPri, String codSec) throws Exception;
...@@ -110,7 +118,7 @@ public interface DocenteDAO { ...@@ -110,7 +118,7 @@ public interface DocenteDAO {
public ArrayList<Docente> filtroDocentesPrimSec(String periodo, String filtro) throws Exception; public ArrayList<Docente> filtroDocentesPrimSec(String periodo, String filtro) throws Exception;
public Docente consultarInforme(String codigoDocente,String codSede) throws Exception; public Docente consultarInforme(String codigoDocente, String codSede) throws Exception;
public ArrayList<Docente> listaDocentesPorArea(String codigoArea, String apellidoDocente, int inicio, int cant) throws Exception; public ArrayList<Docente> listaDocentesPorArea(String codigoArea, String apellidoDocente, int inicio, int cant) throws Exception;
...@@ -128,13 +136,13 @@ public interface DocenteDAO { ...@@ -128,13 +136,13 @@ public interface DocenteDAO {
public int consultarCoordinadorArea(String codigoDocente, String codigoPeriodoAcademico, String codigoArea) throws Exception; public int consultarCoordinadorArea(String codigoDocente, String codigoPeriodoAcademico, String codigoArea) throws Exception;
public int cantidadCoordinadorAsignado(String codigoArea,String codigoPeriodoAcademico) throws Exception; public int cantidadCoordinadorAsignado(String codigoArea, String codigoPeriodoAcademico) throws Exception;
public int quitarAsignacionCoordinador(String codigoDocente, String codigoPeriodoAcademico, String codigoArea) throws Exception; public int quitarAsignacionCoordinador(String codigoDocente, String codigoPeriodoAcademico, String codigoArea) throws Exception;
public int asignarCoordinador(String codigoDocente, String codigoPeriodoAcademico, String codigoArea) throws Exception; public int asignarCoordinador(String codigoDocente, String codigoPeriodoAcademico, String codigoArea) throws Exception;
public ArrayList<Docente> listaDocentesPorPlana(String codigoPlana,String codigoPeriodoAcademico,String apellidoDocente) throws Exception; public ArrayList<Docente> listaDocentesPorPlana(String codigoPlana, String codigoPeriodoAcademico, String apellidoDocente) throws Exception;
public int cantidadCoordinadorAsignadoPlana(String codigoPlana, String codigoPeriodoAcademico) throws Exception; public int cantidadCoordinadorAsignadoPlana(String codigoPlana, String codigoPeriodoAcademico) throws Exception;
...@@ -145,8 +153,9 @@ public interface DocenteDAO { ...@@ -145,8 +153,9 @@ public interface DocenteDAO {
public int asignarCoordinadorPlana(String codigoDocente, String codigoPeriodoAcademico, String codigoPlana) throws Exception; public int asignarCoordinadorPlana(String codigoDocente, String codigoPeriodoAcademico, String codigoPlana) throws Exception;
// public int validarSiExisteCoordinador(String codigoDocente,String codigoPeriodoAcademico,String codigoPlana) throws Exception; // public int validarSiExisteCoordinador(String codigoDocente,String codigoPeriodoAcademico,String codigoPlana) throws Exception;
public ArrayList<Docente> filtroDocentesPrimSec(String periodo, String filtro,String codigoAula) throws Exception; public ArrayList<Docente> filtroDocentesPrimSec(String periodo, String filtro, String codigoAula) throws Exception;
// //
// public Docente obtenerNombreDocente(String codigoDocente)throws Exception; // public Docente obtenerNombreDocente(String codigoDocente)throws Exception;
public int validarDni(String dni)throws Exception;
public int validarDni(String dni) throws Exception;
} }
...@@ -52,23 +52,22 @@ public class MySqlDAOFactory extends DAOFactory { ...@@ -52,23 +52,22 @@ public class MySqlDAOFactory extends DAOFactory {
} }
public static Connection obtenerConexion(String base) { public static Connection obtenerConexion(String base) {
Connection conexion = null; Connection conexion = null;
if (base.equals("encuentas")) { if (base.equals("encuentas")) {
try { try {
conexion = DriverManager.getConnection( conexion = DriverManager.getConnection(
"jdbc:mysql://serverprueba:3306/encuesta_docente", // "jdbc:mysql://serverprueba:3306/encuesta_docente",
"desarrollo", // "desarrollo",
"5VC02019"); // "5VC02019");
// "jdbc:mysql://localhost:3306/encuesta_docente", // "jdbc:mysql://localhost:3306/encuesta_docente",
// "root", // "root",
// "mysql"); // "mysql");
// //server_winpla //server_winpla
// "jdbc:mysql://172.16.2.68:3306/encuesta_docente", "jdbc:mysql://172.16.2.68:3306/encuesta_docente",
// "sis_horarios", "sis_horarios",
// "Sy356ho899"); "Sy356ho899");
} catch (Exception e) { } catch (Exception e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
...@@ -80,16 +79,16 @@ public class MySqlDAOFactory extends DAOFactory { ...@@ -80,16 +79,16 @@ public class MySqlDAOFactory extends DAOFactory {
try { try {
conexion = DriverManager.getConnection( conexion = DriverManager.getConnection(
"jdbc:mysql://serverprueba:3306/nuevo", // "jdbc:mysql://serverprueba:3306/nuevo",
"desarrollo", // "desarrollo",
"5VC02019"); // "5VC02019");
// "jdbc:mysql://localhost:3306/nuevo", // "jdbc:mysql://localhost:3306/nuevo",
// "root", // "root",
// "mysql"); // "mysql");
//server_winpla //server_winpla
// "jdbc:mysql://172.16.2.68:3306/nuevo", "jdbc:mysql://172.16.2.68:3306/nuevo",
// "sis_horarios", "sis_horarios",
// "Sy356ho899"); "Sy356ho899");
} catch (Exception e) { } catch (Exception e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
...@@ -101,16 +100,16 @@ public class MySqlDAOFactory extends DAOFactory { ...@@ -101,16 +100,16 @@ public class MySqlDAOFactory extends DAOFactory {
try { try {
conexion = DriverManager.getConnection( conexion = DriverManager.getConnection(
"jdbc:mysql://serverprueba:3306/horarios_docente", // "jdbc:mysql://serverprueba:3306/horarios_docente",
"desarrollo", // "desarrollo",
"5VC02019"); // "5VC02019");
// "jdbc:mysql://localhost:3306/horarios_docente", // "jdbc:mysql://localhost:3306/horarios_docente",
// "root", // "root",
// "mysql"); // "mysql");
//server_winpla //server_winpla
// "jdbc:mysql://172.16.2.68:3306/horarios_docente", "jdbc:mysql://172.16.2.68:3306/horarios_docente",
// "sis_horarios", "sis_horarios",
// "Sy356ho899"); "Sy356ho899");
} catch (Exception e) { } catch (Exception e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
...@@ -121,16 +120,16 @@ public class MySqlDAOFactory extends DAOFactory { ...@@ -121,16 +120,16 @@ public class MySqlDAOFactory extends DAOFactory {
try { try {
conexion = DriverManager.getConnection( conexion = DriverManager.getConnection(
"jdbc:mysql://serverprueba:3306/sacoolive3", // "jdbc:mysql://serverprueba:3306/sacoolive3",
"desarrollo", // "desarrollo",
"5VC02019"); // "5VC02019");
// "jdbc:mysql://localhost:3306/sacoolive3", // "jdbc:mysql://localhost:3306/sacoolive3",
// "root", // "root",
// "mysql"); // "mysql");
//server_winpla //server_winpla
// "jdbc:mysql://172.16.2.68:3306/sacoolive3", "jdbc:mysql://172.16.2.68:3306/sacoolive3",
// "sis_horarios", "sis_horarios",
// "Sy356ho899"); "Sy356ho899");
} catch (Exception e) { } catch (Exception e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
......
...@@ -368,7 +368,6 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -368,7 +368,6 @@ public class MySqlDocenteDAO implements DocenteDAO {
docente.setCantHijos(rs.getInt("cant_hijos")); docente.setCantHijos(rs.getInt("cant_hijos"));
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
...@@ -403,34 +402,34 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -403,34 +402,34 @@ public class MySqlDocenteDAO implements DocenteDAO {
} }
@Override @Override
public ArrayList<Docente> consultarDatos(String codDocente,String codPeriodo) throws Exception { public ArrayList<Docente> consultarDatos(String codDocente, String codPeriodo) throws Exception {
ArrayList<Docente> lista = new ArrayList<Docente>(); ArrayList<Docente> lista = new ArrayList<Docente>();
String base = "horario"; String base = "horario";
Connection cnx = null; Connection cnx = null;
try { try {
cnx = MySqlDAOFactory.obtenerConexion(base); cnx = MySqlDAOFactory.obtenerConexion(base);
Statement st = cnx.createStatement(); Statement st = cnx.createStatement();
String query = "SELECT DISTINCT IFNULL(p.nom_pla,'-')nom_pla,datos_docente.cant_hijos,datos_docente.cod_dat_per, \n" + String query = "SELECT DISTINCT IFNULL(p.nom_pla,'-')nom_pla,datos_docente.cant_hijos,datos_docente.cod_dat_per, \n"
" datos_docente.cod_doc, datos_docente.tel_dat_per, \n" + + " datos_docente.cod_doc, datos_docente.tel_dat_per, \n"
" datos_docente.cor_dat_per, datos_docente.cod_prov, \n" + + " datos_docente.cor_dat_per, datos_docente.cod_prov, \n"
" datos_docente.cod_dep, datos_docente.cod_dis, \n" + + " datos_docente.cod_dep, datos_docente.cod_dis, \n"
" datos_docente.cel_dat_per, datos_docente.nom_dir, \n" + + " datos_docente.cel_dat_per, datos_docente.nom_dir, \n"
" ubigeo.nom_dis_ubi, ubigeo.nom_dep_ubi, \n" + + " ubigeo.nom_dis_ubi, ubigeo.nom_dep_ubi, \n"
" ubigeo.nom_pro_ubi FROM datos_docente \n" + + " ubigeo.nom_pro_ubi FROM datos_docente \n"
" INNER JOIN ubigeo \n" + + " INNER JOIN ubigeo \n"
" ON datos_docente.cod_dis = ubigeo.cod_dis_ubi \n" + + " ON datos_docente.cod_dis = ubigeo.cod_dis_ubi \n"
" AND datos_docente.cod_dep = ubigeo.cod_dep_ubi \n" + + " AND datos_docente.cod_dep = ubigeo.cod_dep_ubi \n"
" AND datos_docente.cod_prov = ubigeo.cod_pro_ubi\n" + + " AND datos_docente.cod_prov = ubigeo.cod_pro_ubi\n"
" LEFT JOIN(\n" + + " LEFT JOIN(\n"
" SELECT ad.cod_doc, p.nom_pla FROM area_docente ad\n" + + " SELECT ad.cod_doc, p.nom_pla FROM area_docente ad\n"
" INNER JOIN plana_docente pd ON ad.cod_doc=pd.cod_doc\n" + + " INNER JOIN plana_docente pd ON ad.cod_doc=pd.cod_doc\n"
" INNER JOIN plana p ON p.cod_pla=pd.cod_pla\n" + + " INNER JOIN plana p ON p.cod_pla=pd.cod_pla\n"
" WHERE ad.cod_doc='"+codDocente+"' and pd.cod_per='"+codPeriodo+"' AND pd.est_plana='1'\n" + + " WHERE ad.cod_doc='" + codDocente + "' and pd.cod_per='" + codPeriodo + "' AND pd.est_plana='1'\n"
" ) p\n" + + " ) p\n"
" \n" + + " \n"
" ON p.cod_doc=datos_docente.cod_doc\n" + + " ON p.cod_doc=datos_docente.cod_doc\n"
" \n" + + " \n"
" WHERE datos_docente.cod_doc='"+codDocente+"'"; + " WHERE datos_docente.cod_doc='" + codDocente + "'";
ResultSet rs = st.executeQuery(query); ResultSet rs = st.executeQuery(query);
...@@ -667,7 +666,7 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -667,7 +666,7 @@ public class MySqlDocenteDAO implements DocenteDAO {
} }
@Override @Override
public int registroDatos(String codDocente, String telefono, String mail, int cod_dep, int cod_pro, int cod_dis, String cel, String dir,int numhijos,int codarea,int codplana,int codperiodo) throws Exception { public int registroDatos(String codDocente, String telefono, String mail, int cod_dep, int cod_pro, int cod_dis, String cel, String dir, int numhijos, int codarea, int codplana, int codperiodo) throws Exception {
int dato = 0; int dato = 0;
String base = "horario"; String base = "horario";
Connection cnx = null; Connection cnx = null;
...@@ -680,10 +679,9 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -680,10 +679,9 @@ public class MySqlDocenteDAO implements DocenteDAO {
dato = rs.getInt("cant"); dato = rs.getInt("cant");
} }
if (dato == 0) { if (dato == 0) {
String queryInsert = "insert into datos_docente (cod_doc, tel_dat_per, cor_dat_per,cod_prov,cod_dep, cod_dis, cel_dat_per, nom_dir,cant_hijos) VALUES ('" + codDocente + "','" + telefono + "','" + mail + "','" + cod_pro + "','" + cod_dep + "','" + cod_dis + "','" + cel + "','" + dir + "','"+numhijos+"')"; String queryInsert = "insert into datos_docente (cod_doc, tel_dat_per, cor_dat_per,cod_prov,cod_dep, cod_dis, cel_dat_per, nom_dir,cant_hijos) VALUES ('" + codDocente + "','" + telefono + "','" + mail + "','" + cod_pro + "','" + cod_dep + "','" + cod_dis + "','" + cel + "','" + dir + "','" + numhijos + "')";
String insertarArea="insert into area_docente(cod_doc,cod_are,est_are_doc) VALUES ('"+codDocente+"','"+codarea+"',1)"; String insertarArea = "insert into area_docente(cod_doc,cod_are,est_are_doc) VALUES ('" + codDocente + "','" + codarea + "',1)";
String insertarPlana="insert into plana_docente(cod_pla,cod_doc,cod_per,est_plana) VALUES('"+codplana+"','"+codDocente+"','"+codperiodo+"',1)"; String insertarPlana = "insert into plana_docente(cod_pla,cod_doc,cod_per,est_plana) VALUES('" + codplana + "','" + codDocente + "','" + codperiodo + "',1)";
st.executeUpdate(queryInsert); st.executeUpdate(queryInsert);
st.executeUpdate(insertarArea); st.executeUpdate(insertarArea);
...@@ -699,12 +697,12 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -699,12 +697,12 @@ public class MySqlDocenteDAO implements DocenteDAO {
} }
@Override @Override
public int registrarDatosEdit(String codDocente, String telefono, String mail, int cod_dep, int cod_pro, int cod_dis, String cel, String dir,int cantHijos,int codArea,int codPlana,int periodo) throws Exception { public int registrarDatosEdit(String codDocente, String telefono, String mail, int cod_dep, int cod_pro, int cod_dis, String cel, String dir, int cantHijos, int codArea, int codPlana, int periodo) throws Exception {
int dato = 0; int dato = 0;
int datoPlana = 0; int datoPlana = 0;
String base = "horario"; String base = "horario";
Connection cnx = null; Connection cnx = null;
String consultaPlanaDocente=""; String consultaPlanaDocente = "";
try { try {
cnx = MySqlDAOFactory.obtenerConexion(base); cnx = MySqlDAOFactory.obtenerConexion(base);
...@@ -712,11 +710,10 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -712,11 +710,10 @@ public class MySqlDocenteDAO implements DocenteDAO {
String queryConsulta = "SELECT COUNT(cod_doc) as cant from datos_docente where cod_doc='" + codDocente + "'"; String queryConsulta = "SELECT COUNT(cod_doc) as cant from datos_docente where cod_doc='" + codDocente + "'";
consultaPlanaDocente = "SELECT COUNT(cod_doc) as cantidad from plana_docente where cod_doc='" + codDocente + "' and cod_per='"+periodo+"'"; consultaPlanaDocente = "SELECT COUNT(cod_doc) as cantidad from plana_docente where cod_doc='" + codDocente + "' and cod_per='" + periodo + "'";
ResultSet rs = st.executeQuery(queryConsulta); ResultSet rs = st.executeQuery(queryConsulta);
while (rs.next()) { while (rs.next()) {
dato = rs.getInt("cant"); dato = rs.getInt("cant");
...@@ -733,28 +730,26 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -733,28 +730,26 @@ public class MySqlDocenteDAO implements DocenteDAO {
datoPlana = rsDos.getInt("cantidad"); datoPlana = rsDos.getInt("cantidad");
} }
if(datoPlana > 0){ if (datoPlana > 0) {
String updateArea = "UPDATE area_docente SET cod_are="+codArea+" where cod_doc="+codDocente+""; String updateArea = "UPDATE area_docente SET cod_are=" + codArea + " where cod_doc=" + codDocente + "";
String updatePlan = "UPDATE plana_docente SET cod_pla="+codPlana+" where cod_doc="+codDocente+" and cod_per='"+periodo+"' and est_plana=1"; String updatePlan = "UPDATE plana_docente SET cod_pla=" + codPlana + " where cod_doc=" + codDocente + " and cod_per='" + periodo + "' and est_plana=1";
st.executeUpdate(updateArea); st.executeUpdate(updateArea);
st.executeUpdate(updatePlan); st.executeUpdate(updatePlan);
} else { } else {
String insertArea = "INSERT INTO area_docente (cod_doc,cod_are,est_are_doc) VALUES('"+codDocente+"','"+codArea+"',1)"; String insertArea = "INSERT INTO area_docente (cod_doc,cod_are,est_are_doc) VALUES('" + codDocente + "','" + codArea + "',1)";
String insertPlan = "INSERT INTO plana_docente (cod_pla,cod_doc,cod_per,est_plana) VALUES('"+codPlana+"','"+codDocente+"','"+periodo+"',1)"; String insertPlan = "INSERT INTO plana_docente (cod_pla,cod_doc,cod_per,est_plana) VALUES('" + codPlana + "','" + codDocente + "','" + periodo + "',1)";
st.executeUpdate(insertArea); st.executeUpdate(insertArea);
st.executeUpdate(insertPlan); st.executeUpdate(insertPlan);
} }
System.out.println("consulta-->" + queryInsert); System.out.println("consulta-->" + queryInsert);
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
...@@ -885,6 +880,53 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -885,6 +880,53 @@ public class MySqlDocenteDAO implements DocenteDAO {
} }
@Override @Override
public ArrayList<Docente> cargarDocentePrimaria3(String codcurso, String apellido, int inicio, int cantidad, String documentos_ignorados) throws Exception { //checkpoint
ArrayList<Docente> lista = new ArrayList<Docente>();
String base = "nuevo";
Connection cnx = null;
try {
cnx = MySqlDAOFactory.obtenerConexion(base);
Statement st = cnx.createStatement();
String query = "";
String condicion_documentos_ignorados = "";
if (!documentos_ignorados.equalsIgnoreCase("")) {
condicion_documentos_ignorados = " AND dni NOT IN (" + documentos_ignorados.substring(0, documentos_ignorados.length()-1) + ") ";
}
if (codcurso.equals("30")) {
query = "SELECT codper,apellido,nombre,codcargo,dni FROM personal\n"
+ "WHERE codcargo in (" + codcurso + ")\n"
+ "AND retirado= '0' AND codlocal='L067'\n"
+ condicion_documentos_ignorados + "\n"
+ "ORDER BY apellido,nombre LIMIT " + inicio + ", " + cantidad + " ";
} else {
query = "SELECT codper,apellido,nombre,codcargo,dni\n"
+ "FROM personal\n"
+ "WHERE codcargo in (" + codcurso + ")\n"
+ "AND retirado= '0' and apellido LIKE '" + apellido + "%'\n"
+ condicion_documentos_ignorados + "\n"
+ "ORDER BY apellido,nombre LIMIT " + inicio + ", " + cantidad + " ";
}
ResultSet rs = st.executeQuery(query);
System.out.println("cargarDocentePrimaria " + query);
while (rs.next()) {
Docente docente = new Docente();
docente.setCodDocenteId("P" + rs.getString("codper"));
docente.setApe_pro(rs.getString("apellido"));
docente.setNom_pro(rs.getString("nombre"));
docente.setCodigoCargo(rs.getString("codcargo"));
docente.setDni(rs.getString("codcargo"));
lista.add(docente);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
cnx.close();
}
return lista;
}
@Override
public Docente listarDocenteSede(String local) throws Exception { public Docente listarDocenteSede(String local) throws Exception {
ArrayList<Docente> lista = new ArrayList<Docente>(); ArrayList<Docente> lista = new ArrayList<Docente>();
Docente doc = new Docente(); Docente doc = new Docente();
...@@ -1515,7 +1557,7 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -1515,7 +1557,7 @@ public class MySqlDocenteDAO implements DocenteDAO {
} }
@Override @Override
public Docente consultarInforme(String codigoDocente,String codSede) throws Exception { public Docente consultarInforme(String codigoDocente, String codSede) throws Exception {
String base = "horario"; String base = "horario";
Docente docente = new Docente(); Docente docente = new Docente();
...@@ -1523,18 +1565,18 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -1523,18 +1565,18 @@ public class MySqlDocenteDAO implements DocenteDAO {
try { try {
cnx = MySqlDAOFactory.obtenerConexion(base); cnx = MySqlDAOFactory.obtenerConexion(base);
Statement st = cnx.createStatement(); Statement st = cnx.createStatement();
String query = "SELECT \n" + String query = "SELECT \n"
" i.nom_doc, \n" + + " i.nom_doc, \n"
" i.mot_int, \n" + + " i.mot_int, \n"
" i.arg_inf, \n" + + " i.arg_inf, \n"
" i.nom_sed, \n" + + " i.nom_sed, \n"
" DATE(i.fec_inf) AS fec_inf, \n" + + " DATE(i.fec_inf) AS fec_inf, \n"
" i.res_inf \n" + + " i.res_inf \n"
" FROM \n" + + " FROM \n"
" informe i \n" + + " informe i \n"
"INNER JOIN sede s ON s.cod_loc=i.cod_sed\n" + + "INNER JOIN sede s ON s.cod_loc=i.cod_sed\n"
" WHERE \n" + + " WHERE \n"
" i.cod_doc = '"+codigoDocente+"' and i.cod_sed='"+codSede+"'"; + " i.cod_doc = '" + codigoDocente + "' and i.cod_sed='" + codSede + "'";
ResultSet rs = st.executeQuery(query); ResultSet rs = st.executeQuery(query);
if (rs.next()) { if (rs.next()) {
docente.setRespuestaInforme(rs.getString("res_inf")); docente.setRespuestaInforme(rs.getString("res_inf"));
...@@ -2276,14 +2318,12 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -2276,14 +2318,12 @@ public class MySqlDocenteDAO implements DocenteDAO {
st = cnx.createStatement(); st = cnx.createStatement();
String query = "SELECT cod_hcd,codAula,dia,pos_blo,hor_ini,hor_fin,cod_cur,cod_doc,cod_tur,cod_per,codGru FROM horario_curso_docente WHERE cod_doc = ? and cod_per= ? "; String query = "SELECT cod_hcd,codAula,dia,pos_blo,hor_ini,hor_fin,cod_cur,cod_doc,cod_tur,cod_per,codGru FROM horario_curso_docente WHERE cod_doc = ? and cod_per= ? ";
String deshabilitarDisponibilidad = "UPDATE disponibilidad_docente SET estDis='0' WHERE codDoc = '"+codigo+"' and cod_per= '"+periodo+"' "; String deshabilitarDisponibilidad = "UPDATE disponibilidad_docente SET estDis='0' WHERE codDoc = '" + codigo + "' and cod_per= '" + periodo + "' ";
pst = cnx.prepareStatement(query); pst = cnx.prepareStatement(query);
st.executeUpdate(deshabilitarDisponibilidad); st.executeUpdate(deshabilitarDisponibilidad);
pst.setString(1, codigo); pst.setString(1, codigo);
pst.setString(2, periodo); pst.setString(2, periodo);
rs = pst.executeQuery(); rs = pst.executeQuery();
...@@ -2332,44 +2372,44 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -2332,44 +2372,44 @@ public class MySqlDocenteDAO implements DocenteDAO {
try { try {
cnx = MySqlDAOFactory.obtenerConexion(base); cnx = MySqlDAOFactory.obtenerConexion(base);
String query = "SELECT tbl1.fecha,tbl1.des_loc,tbl1.dia,tbl1.turno,CONCAT(tbl1.ingreso,\" - \",tbl1.salida)as horario,tbl1.grupoAcademico,tbl1.aulas,\n" + String query = "SELECT tbl1.fecha,tbl1.des_loc,tbl1.dia,tbl1.turno,CONCAT(tbl1.ingreso,\" - \",tbl1.salida)as horario,tbl1.grupoAcademico,tbl1.aulas,\n"
"\n" + + "\n"
"IF(tbl1.cantLib=0,tbl1.cantAulas*tbl1.computable,(tbl1.computable*3)-(tbl1.cantLib*tbl1.computable)) cantMin,\n" + + "IF(tbl1.cantLib=0,tbl1.cantAulas*tbl1.computable,(tbl1.computable*3)-(tbl1.cantLib*tbl1.computable)) cantMin,\n"
"\n" + + "\n"
"tbl1.doc_saliente,tbl1.nom_cur,tbl1.fechafin,tbl1.motivoCambio,tbl1.doc_entrante,tbl1.curso_entrante,\n" + + "tbl1.doc_saliente,tbl1.nom_cur,tbl1.fechafin,tbl1.motivoCambio,tbl1.doc_entrante,tbl1.curso_entrante,\n"
"\n" + + "\n"
"tbl1.fechainicio,tbl1.condicionTrabajador,tbl1.observacion\n" + + "tbl1.fechainicio,tbl1.condicionTrabajador,tbl1.observacion\n"
"FROM (\n" + + "FROM (\n"
"SELECT tbl.fecha,tbl.dia,tbl.des_loc,MIN(tbl.ingreso) ingreso,MAX(tbl.salida) salida,SUM(tbl.cantLib) cantLib,\n" + + "SELECT tbl.fecha,tbl.dia,tbl.des_loc,MIN(tbl.ingreso) ingreso,MAX(tbl.salida) salida,SUM(tbl.cantLib) cantLib,\n"
"tbl.turno,REPLACE(GROUP_CONCAT(tbl.aula ORDER BY ingreso ),',','-') aulas,SUM(tbl.cantAulas) cantAulas,tbl.grupoAcademico,\n" + + "tbl.turno,REPLACE(GROUP_CONCAT(tbl.aula ORDER BY ingreso ),',','-') aulas,SUM(tbl.cantAulas) cantAulas,tbl.grupoAcademico,\n"
"tbl.computable,tbl.doc_saliente,tbl.nom_cur,tbl.fechafin,tbl.motivoCambio,tbl.doc_entrante,tbl.curso_entrante,tbl.cod_cur,\n" + + "tbl.computable,tbl.doc_saliente,tbl.nom_cur,tbl.fechafin,tbl.motivoCambio,tbl.doc_entrante,tbl.curso_entrante,tbl.cod_cur,\n"
"tbl.fechainicio,tbl.condicionTrabajador,tbl.observacion\n" + + "tbl.fechainicio,tbl.condicionTrabajador,tbl.observacion\n"
"FROM (\n" + + "FROM (\n"
"SELECT hcd.cod_hcd,hcd.fecha,hcd.dia numdia,ELT(hcd.dia, 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo') AS dia,\n" + + "SELECT hcd.cod_hcd,hcd.fecha,hcd.dia numdia,ELT(hcd.dia, 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo') AS dia,\n"
"s.des_loc,TIME_FORMAT(hcd.hor_ini,'%H:%i') ingreso,TIME_FORMAT(hcd.hor_fin,'%H:%i') salida,IF(tg.destipogrado ='LIBRE',1,0) cantLib,\n" + + "s.des_loc,TIME_FORMAT(hcd.hor_ini,'%H:%i') ingreso,TIME_FORMAT(hcd.hor_fin,'%H:%i') salida,IF(tg.destipogrado ='LIBRE',1,0) cantLib,\n"
"IF (hcd.hor_ini>='07:00' AND hcd.hor_fin<'14:20','M','T') turno,\n" + + "IF (hcd.hor_ini>='07:00' AND hcd.hor_fin<'14:20','M','T') turno,\n"
"TRIM(IF(tg.destipogrado ='LIBRE',tg.abrTipGrado,REPLACE(REPLACE(REPLACE(REPLACE(a.nombre,'TO ',''),'DO ',''),'RO ',''),'Y ','y'))) aula,\n" + + "TRIM(IF(tg.destipogrado ='LIBRE',tg.abrTipGrado,REPLACE(REPLACE(REPLACE(REPLACE(a.nombre,'TO ',''),'DO ',''),'RO ',''),'Y ','y'))) aula,\n"
"1 cantAulas,IF(g.abrGrado LIKE '%1' OR g.abrGrado LIKE '%2','A',IF(a.codtipocentro = 2,'C','B')) grupoAcademico,\n" + + "1 cantAulas,IF(g.abrGrado LIKE '%1' OR g.abrGrado LIKE '%2','A',IF(a.codtipocentro = 2,'C','B')) grupoAcademico,\n"
"IF(a.codtipocentro = 2,120,80) computable,CONCAT(pf1.apellido,\" \",pf1.nombre) as doc_saliente ,c2.nom_cur,IF(hcd.fechafin = '','-',hcd.fechafin) fechafin,\n" + + "IF(a.codtipocentro = 2,120,80) computable,CONCAT(pf1.apellido,\" \",pf1.nombre) as doc_saliente ,c2.nom_cur,IF(hcd.fechafin = '','-',hcd.fechafin) fechafin,\n"
"hcd.motivoCambio,CONCAT(pf2.apellido,\" \",pf2.nombre)as doc_entrante ,c.nom_cur as curso_entrante,hcd.cod_cur,\n" + + "hcd.motivoCambio,CONCAT(pf2.apellido,\" \",pf2.nombre)as doc_entrante ,c.nom_cur as curso_entrante,hcd.cod_cur,\n"
"IF(hcd.fechainicio = '','-',hcd.fechainicio) fechainicio,hcd.condicionTrabajador,hcd.observacion\n" + + "IF(hcd.fechainicio = '','-',hcd.fechainicio) fechainicio,hcd.condicionTrabajador,hcd.observacion\n"
"FROM historial_horario hcd\n" + + "FROM historial_horario hcd\n"
"INNER JOIN curso c ON c.cod_cur=hcd.cod_cur\n" + + "INNER JOIN curso c ON c.cod_cur=hcd.cod_cur\n"
"INNER JOIN curso c2 ON c2.cod_cur=hcd.cod_cur_reemp\n" + + "INNER JOIN curso c2 ON c2.cod_cur=hcd.cod_cur_reemp\n"
"INNER JOIN sacoolive3.profesor pf1 ON pf1.codprofesor=hcd.cod_doc_reemp\n" + + "INNER JOIN sacoolive3.profesor pf1 ON pf1.codprofesor=hcd.cod_doc_reemp\n"
"INNER JOIN sacoolive3.profesor pf2 ON pf2.codprofesor=hcd.cod_doc\n" + + "INNER JOIN sacoolive3.profesor pf2 ON pf2.codprofesor=hcd.cod_doc\n"
"INNER JOIN aula a ON a.codaula=hcd.codAula\n" + + "INNER JOIN aula a ON a.codaula=hcd.codAula\n"
"INNER JOIN grado g on g.codgrado = a.codgrado \n" + + "INNER JOIN grado g on g.codgrado = a.codgrado \n"
"INNER JOIN tipo_grado tg ON g.codtipogrado=tg.codtipogrado\n" + + "INNER JOIN tipo_grado tg ON g.codtipogrado=tg.codtipogrado\n"
"INNER JOIN sede s ON s.cod_loc=a.codlocal\n" + + "INNER JOIN sede s ON s.cod_loc=a.codlocal\n"
"WHERE \n" + + "WHERE \n"
"hcd.fecha BETWEEN ? AND ? AND accion='CAMBIO FIJO'\n" + + "hcd.fecha BETWEEN ? AND ? AND accion='CAMBIO FIJO'\n"
"\n" + + "\n"
") tbl\n" + + ") tbl\n"
"GROUP BY tbl.fecha,tbl.dia,tbl.des_loc,tbl.turno,tbl.grupoAcademico,tbl.cantAulas,tbl.doc_saliente,\n" + + "GROUP BY tbl.fecha,tbl.dia,tbl.des_loc,tbl.turno,tbl.grupoAcademico,tbl.cantAulas,tbl.doc_saliente,\n"
"tbl.nom_cur,tbl.fechafin,tbl.motivoCambio,tbl.doc_entrante,tbl.curso_entrante,tbl.cod_cur,\n" + + "tbl.nom_cur,tbl.fechafin,tbl.motivoCambio,tbl.doc_entrante,tbl.curso_entrante,tbl.cod_cur,\n"
"tbl.fechainicio,tbl.condicionTrabajador \n" + + "tbl.fechainicio,tbl.condicionTrabajador \n"
") tbl1"; + ") tbl1";
// String query = "" // String query = ""
// + "SELECT " // + "SELECT "
...@@ -2461,52 +2501,51 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -2461,52 +2501,51 @@ public class MySqlDocenteDAO implements DocenteDAO {
try { try {
cnx = MySqlDAOFactory.obtenerConexion(base); cnx = MySqlDAOFactory.obtenerConexion(base);
String query = "SELECT \n" + String query = "SELECT \n"
" \n" + + " \n"
" tbl1.fecha,tbl1.des_loc,tbl1.dia,tbl1.turno,CONCAT(tbl1.ingreso,\" -\",tbl1.salida)as horario,tbl1.grupoAcademico,tbl1.aulas,\n" + + " tbl1.fecha,tbl1.des_loc,tbl1.dia,tbl1.turno,CONCAT(tbl1.ingreso,\" -\",tbl1.salida)as horario,tbl1.grupoAcademico,tbl1.aulas,\n"
"\n" + + "\n"
" tbl1.hora,tbl1.docente,tbl1.nom_cur,\n" + + " tbl1.hora,tbl1.docente,tbl1.nom_cur,\n"
"if(tbl1.accion = 'REGISTRADO',tbl1.accion,'') as sincurso,if(tbl1.accion = 'ELIMINADO',tbl1.accion,'') as eliminado\n" + + "if(tbl1.accion = 'REGISTRADO',tbl1.accion,'') as sincurso,if(tbl1.accion = 'ELIMINADO',tbl1.accion,'') as eliminado\n"
" FROM ( \n" + + " FROM ( \n"
" SELECT tbl.cod_doc,tbl.fecha,tbl.dia,tbl.des_loc,MIN(tbl.ingreso) ingreso,MAX(tbl.salida) salida,SUM(tbl.cantLib) cantLib, \n" + + " SELECT tbl.cod_doc,tbl.fecha,tbl.dia,tbl.des_loc,MIN(tbl.ingreso) ingreso,MAX(tbl.salida) salida,SUM(tbl.cantLib) cantLib, \n"
" \n" + + " \n"
" tbl.turno, \n" + + " tbl.turno, \n"
" REPLACE(GROUP_CONCAT(DISTINCT tbl.aula ORDER BY ingreso ),',','-') aulas, \n" + + " REPLACE(GROUP_CONCAT(DISTINCT tbl.aula ORDER BY ingreso ),',','-') aulas, \n"
" SUM(tbl.cantAulas) cantAulas,tbl.grupoAcademico, \n" + + " SUM(tbl.cantAulas) cantAulas,tbl.grupoAcademico, \n"
" tbl.computable,tbl.hora,tbl.docente,tbl.accion,tbl.nom_cur \n" + + " tbl.computable,tbl.hora,tbl.docente,tbl.accion,tbl.nom_cur \n"
" FROM ( \n" + + " FROM ( \n"
" SELECT hcd.cod_doc,hcd.hora,hcd.cod_hcd,hcd.fecha,hcd.dia numdia,ELT(hcd.dia, 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo') AS dia, \n" + + " SELECT hcd.cod_doc,hcd.hora,hcd.cod_hcd,hcd.fecha,hcd.dia numdia,ELT(hcd.dia, 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo') AS dia, \n"
" s.des_loc, \n" + + " s.des_loc, \n"
" TIME_FORMAT(hcd.hor_ini,'%H:%i') ingreso, \n" + + " TIME_FORMAT(hcd.hor_ini,'%H:%i') ingreso, \n"
" TIME_FORMAT(hcd.hor_fin,'%H:%i') salida, \n" + + " TIME_FORMAT(hcd.hor_fin,'%H:%i') salida, \n"
" IF(tg.destipogrado ='LIBRE',1,0) cantLib, \n" + + " IF(tg.destipogrado ='LIBRE',1,0) cantLib, \n"
" IF (hcd.hor_ini>='07:00' AND hcd.hor_fin<='14:30','M','T') turno, \n" + + " IF (hcd.hor_ini>='07:00' AND hcd.hor_fin<='14:30','M','T') turno, \n"
" \n" + + " \n"
" TRIM(IF(tg.destipogrado ='LIBRE',tg.abrTipGrado,REPLACE(REPLACE(REPLACE(REPLACE(a.nombre,'TO ',''),'DO ',''),'RO ',''),'Y ','y'))) aula, \n" + + " TRIM(IF(tg.destipogrado ='LIBRE',tg.abrTipGrado,REPLACE(REPLACE(REPLACE(REPLACE(a.nombre,'TO ',''),'DO ',''),'RO ',''),'Y ','y'))) aula, \n"
" \n" + + " \n"
" 1 cantAulas,IF(g.abrGrado LIKE '%1%' OR g.abrGrado LIKE '%2%','A',IF(a.codtipocentro = 2,'C','B')) grupoAcademico, \n" + + " 1 cantAulas,IF(g.abrGrado LIKE '%1%' OR g.abrGrado LIKE '%2%','A',IF(a.codtipocentro = 2,'C','B')) grupoAcademico, \n"
" IF(a.codtipocentro = 2,240,360) computable, \n" + + " IF(a.codtipocentro = 2,240,360) computable, \n"
" CONCAT(pf1.apellido,',',pf1.nombre)as docente, \n" + + " CONCAT(pf1.apellido,',',pf1.nombre)as docente, \n"
" IF(hcd.accion = 'REGISTRADO','REGISTRADO','ELIMINADO') as accion,c.nom_cur \n" + + " IF(hcd.accion = 'REGISTRADO','REGISTRADO','ELIMINADO') as accion,c.nom_cur \n"
" \n" + + " \n"
" FROM historial_horario hcd \n" + + " FROM historial_horario hcd \n"
" INNER JOIN curso c ON c.cod_cur=hcd.cod_cur \n" + + " INNER JOIN curso c ON c.cod_cur=hcd.cod_cur \n"
" INNER JOIN sacoolive3.profesor pf1 ON pf1.codprofesor=hcd.cod_doc \n" + + " INNER JOIN sacoolive3.profesor pf1 ON pf1.codprofesor=hcd.cod_doc \n"
" INNER JOIN aula a ON a.codaula=hcd.codAula \n" + + " INNER JOIN aula a ON a.codaula=hcd.codAula \n"
" INNER JOIN grado g on g.codgrado = a.codgrado \n" + + " INNER JOIN grado g on g.codgrado = a.codgrado \n"
" INNER JOIN tipo_grado tg ON g.codtipogrado=tg.codtipogrado \n" + + " INNER JOIN tipo_grado tg ON g.codtipogrado=tg.codtipogrado \n"
" INNER JOIN sede s ON s.cod_loc=a.codlocal \n" + + " INNER JOIN sede s ON s.cod_loc=a.codlocal \n"
" WHERE \n" + + " WHERE \n"
" hcd.fecha BETWEEN ? AND ? and hcd.est_hcd=1 \n" + + " hcd.fecha BETWEEN ? AND ? and hcd.est_hcd=1 \n"
" AND (accion ='ELIMINADO' or accion='REGISTRADO') \n" + + " AND (accion ='ELIMINADO' or accion='REGISTRADO') \n"
" \n" + + " \n"
" \n" + + " \n"
" ) tbl \n" + + " ) tbl \n"
" GROUP BY tbl.fecha,tbl.dia,tbl.des_loc,tbl.turno,tbl.grupoAcademico,tbl.nom_cur,tbl.cantAulas \n" + + " GROUP BY tbl.fecha,tbl.dia,tbl.des_loc,tbl.turno,tbl.grupoAcademico,tbl.nom_cur,tbl.cantAulas \n"
" ORDER BY tbl.hora DESC \n" + + " ORDER BY tbl.hora DESC \n"
" \n" + + " \n"
" ) tbl1 "; + " ) tbl1 ";
PreparedStatement st = cnx.prepareStatement(query); PreparedStatement st = cnx.prepareStatement(query);
...@@ -2546,7 +2585,6 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -2546,7 +2585,6 @@ public class MySqlDocenteDAO implements DocenteDAO {
} }
@Override @Override
public ArrayList<HorarioCF> listarEliminados(String fechaDesde, String fechaHasta) throws Exception { public ArrayList<HorarioCF> listarEliminados(String fechaDesde, String fechaHasta) throws Exception {
ArrayList<HorarioCF> lista = new ArrayList<HorarioCF>(); ArrayList<HorarioCF> lista = new ArrayList<HorarioCF>();
...@@ -2555,52 +2593,51 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -2555,52 +2593,51 @@ public class MySqlDocenteDAO implements DocenteDAO {
try { try {
cnx = MySqlDAOFactory.obtenerConexion(base); cnx = MySqlDAOFactory.obtenerConexion(base);
String query = "SELECT \n" + String query = "SELECT \n"
" tbl1.fecha,tbl1.des_loc,tbl1.dia,tbl1.turno,CONCAT(tbl1.ingreso,\" - \",tbl1.salida)as horario,tbl1.grupoAcademico,tbl1.aulas,\n" + + " tbl1.fecha,tbl1.des_loc,tbl1.dia,tbl1.turno,CONCAT(tbl1.ingreso,\" - \",tbl1.salida)as horario,tbl1.grupoAcademico,tbl1.aulas,\n"
"\n" + + "\n"
" tbl1.hora,tbl1.docente,tbl1.nom_cur,tbl1.accion\n" + + " tbl1.hora,tbl1.docente,tbl1.nom_cur,tbl1.accion\n"
" FROM ( \n" + + " FROM ( \n"
" SELECT tbl.fecha,tbl.dia,tbl.des_loc,MIN(tbl.ingreso) ingreso,MAX(tbl.salida) salida,SUM(tbl.cantLib) cantLib, \n" + + " SELECT tbl.fecha,tbl.dia,tbl.des_loc,MIN(tbl.ingreso) ingreso,MAX(tbl.salida) salida,SUM(tbl.cantLib) cantLib, \n"
"\n" + + "\n"
" tbl.turno,\n" + + " tbl.turno,\n"
" REPLACE(GROUP_CONCAT(DISTINCT tbl.aula ORDER BY ingreso ),',','-') aulas,\n" + + " REPLACE(GROUP_CONCAT(DISTINCT tbl.aula ORDER BY ingreso ),',','-') aulas,\n"
" SUM(tbl.cantAulas) cantAulas,tbl.grupoAcademico, \n" + + " SUM(tbl.cantAulas) cantAulas,tbl.grupoAcademico, \n"
" tbl.computable,tbl.hora,tbl.docente,tbl.accion,tbl.nom_cur\n" + + " tbl.computable,tbl.hora,tbl.docente,tbl.accion,tbl.nom_cur\n"
" FROM ( \n" + + " FROM ( \n"
" SELECT hcd.hora,hcd.cod_hcd,hcd.fecha,hcd.dia numdia,ELT(hcd.dia, 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo') AS dia, \n" + + " SELECT hcd.hora,hcd.cod_hcd,hcd.fecha,hcd.dia numdia,ELT(hcd.dia, 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo') AS dia, \n"
" s.des_loc,\n" + + " s.des_loc,\n"
" TIME_FORMAT(hcd.hor_ini,'%H:%i') ingreso,\n" + + " TIME_FORMAT(hcd.hor_ini,'%H:%i') ingreso,\n"
" TIME_FORMAT(hcd.hor_fin,'%H:%i') salida,\n" + + " TIME_FORMAT(hcd.hor_fin,'%H:%i') salida,\n"
" IF(tg.destipogrado ='LIBRE',1,0) cantLib, \n" + + " IF(tg.destipogrado ='LIBRE',1,0) cantLib, \n"
" IF (hcd.hor_ini>='07:00' AND hcd.hor_fin<='14:30','M','T') turno, \n" + + " IF (hcd.hor_ini>='07:00' AND hcd.hor_fin<='14:30','M','T') turno, \n"
"\n" + + "\n"
" \n" + + " \n"
"\n" + + "\n"
" TRIM(IF(tg.destipogrado ='LIBRE',tg.abrTipGrado,REPLACE(REPLACE(REPLACE(REPLACE(a.nombre,'TO ',''),'DO ',''),'RO ',''),'Y ','y'))) aula, \n" + + " TRIM(IF(tg.destipogrado ='LIBRE',tg.abrTipGrado,REPLACE(REPLACE(REPLACE(REPLACE(a.nombre,'TO ',''),'DO ',''),'RO ',''),'Y ','y'))) aula, \n"
"\n" + + "\n"
" 1 cantAulas,IF(g.abrGrado LIKE '%1%' OR g.abrGrado LIKE '%2%','A',IF(a.codtipocentro = 2,'C','B')) grupoAcademico, \n" + + " 1 cantAulas,IF(g.abrGrado LIKE '%1%' OR g.abrGrado LIKE '%2%','A',IF(a.codtipocentro = 2,'C','B')) grupoAcademico, \n"
" IF(a.codtipocentro = 2,240,360) computable,\n" + + " IF(a.codtipocentro = 2,240,360) computable,\n"
" CONCAT(pf1.apellido,',',pf1.nombre)as docente,\n" + + " CONCAT(pf1.apellido,',',pf1.nombre)as docente,\n"
" IF(hcd.accion = 'REGISTRADO','SIN CURSO','ELIMINADO') as accion,c.nom_cur\n" + + " IF(hcd.accion = 'REGISTRADO','SIN CURSO','ELIMINADO') as accion,c.nom_cur\n"
"\n" + + "\n"
" FROM historial_horario hcd \n" + + " FROM historial_horario hcd \n"
" INNER JOIN curso c ON c.cod_cur=hcd.cod_cur \n" + + " INNER JOIN curso c ON c.cod_cur=hcd.cod_cur \n"
" INNER JOIN sacoolive3.profesor pf1 ON pf1.codprofesor=hcd.cod_doc \n" + + " INNER JOIN sacoolive3.profesor pf1 ON pf1.codprofesor=hcd.cod_doc \n"
" INNER JOIN aula a ON a.codaula=hcd.codAula \n" + + " INNER JOIN aula a ON a.codaula=hcd.codAula \n"
" INNER JOIN grado g on g.codgrado = a.codgrado \n" + + " INNER JOIN grado g on g.codgrado = a.codgrado \n"
" INNER JOIN tipo_grado tg ON g.codtipogrado=tg.codtipogrado \n" + + " INNER JOIN tipo_grado tg ON g.codtipogrado=tg.codtipogrado \n"
" INNER JOIN sede s ON s.cod_loc=a.codlocal \n" + + " INNER JOIN sede s ON s.cod_loc=a.codlocal \n"
" WHERE \n" + + " WHERE \n"
" hcd.fecha BETWEEN ? AND ? and hcd.est_hcd=1\n" + + " hcd.fecha BETWEEN ? AND ? and hcd.est_hcd=1\n"
" AND accion ='ELIMINADO'\n" + + " AND accion ='ELIMINADO'\n"
" \n" + + " \n"
" \n" + + " \n"
" ) tbl \n" + + " ) tbl \n"
" GROUP BY tbl.fecha,tbl.dia,tbl.des_loc,tbl.turno,tbl.grupoAcademico,tbl.nom_cur,tbl.cantAulas\n" + + " GROUP BY tbl.fecha,tbl.dia,tbl.des_loc,tbl.turno,tbl.grupoAcademico,tbl.nom_cur,tbl.cantAulas\n"
" ORDER BY tbl.hora DESC\n" + + " ORDER BY tbl.hora DESC\n"
" \n" + + " \n"
" ) tbl1"; + " ) tbl1";
PreparedStatement st = cnx.prepareStatement(query); PreparedStatement st = cnx.prepareStatement(query);
...@@ -2623,7 +2660,6 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -2623,7 +2660,6 @@ public class MySqlDocenteDAO implements DocenteDAO {
// h.setGrupoAcademico(rs.getString("grupoAcademico")); // h.setGrupoAcademico(rs.getString("grupoAcademico"));
// h.setCodigoAula(rs.getString("aulas")); // h.setCodigoAula(rs.getString("aulas"));
// h.setHora(rs.getTime("hora")); // h.setHora(rs.getTime("hora"));
h.setDocenteEntrante(rs.getString("docente")); h.setDocenteEntrante(rs.getString("docente"));
h.setCursoEntrante(rs.getString("nom_cur")); h.setCursoEntrante(rs.getString("nom_cur"));
h.setMotivoCambio(rs.getString("accion")); h.setMotivoCambio(rs.getString("accion"));
...@@ -2638,7 +2674,6 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -2638,7 +2674,6 @@ public class MySqlDocenteDAO implements DocenteDAO {
return lista; return lista;
} }
@Override @Override
public ArrayList<Horario> listarCambiosDia(String fechaDesde, String fechaHasta) throws Exception { public ArrayList<Horario> listarCambiosDia(String fechaDesde, String fechaHasta) throws Exception {
ArrayList<Horario> lista = new ArrayList<Horario>(); ArrayList<Horario> lista = new ArrayList<Horario>();
...@@ -2647,54 +2682,53 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -2647,54 +2682,53 @@ public class MySqlDocenteDAO implements DocenteDAO {
try { try {
cnx = MySqlDAOFactory.obtenerConexion(base); cnx = MySqlDAOFactory.obtenerConexion(base);
String query = "SELECT tbl1.fecha,tbl1.des_loc,tbl1.fechafin,CONCAT(tbl1.ingreso,\"- \",tbl1.salida)as horario,tbl1.grupoAcademico,tbl1.aulas,tbl1.nom_cur, \n" + String query = "SELECT tbl1.fecha,tbl1.des_loc,tbl1.fechafin,CONCAT(tbl1.ingreso,\"- \",tbl1.salida)as horario,tbl1.grupoAcademico,tbl1.aulas,tbl1.nom_cur, \n"
" \n" + + " \n"
" IF(tbl1.cantLib=0,tbl1.cantAulas*tbl1.computable,(tbl1.computable*3)-(tbl1.cantLib*tbl1.computable)) cantMin, \n" + + " IF(tbl1.cantLib=0,tbl1.cantAulas*tbl1.computable,(tbl1.computable*3)-(tbl1.cantLib*tbl1.computable)) cantMin, \n"
"\n" + + "\n"
"\n" + + "\n"
" tbl1.doc_saliente,tbl1.motivoCambio,tbl1.observacion,tbl1.horaAviso,tbl1.doc_entrante,tbl1.curso_entrante, \n" + + " tbl1.doc_saliente,tbl1.motivoCambio,tbl1.observacion,tbl1.horaAviso,tbl1.doc_entrante,tbl1.curso_entrante, \n"
" \n" + + " \n"
" tbl1.fechainicio,tbl1.avance,tbl1.recuperacion,tbl1.fecha_aviso,tbl1.docente_recuperacion,tbl1.curso_recuperacion,tbl1.fecha_recuperacion,tbl1.horini_recuperacion,tbl1.horfini_recuperacion \n" + + " tbl1.fechainicio,tbl1.avance,tbl1.recuperacion,tbl1.fecha_aviso,tbl1.docente_recuperacion,tbl1.curso_recuperacion,tbl1.fecha_recuperacion,tbl1.horini_recuperacion,tbl1.horfini_recuperacion \n"
" \n" + + " \n"
" FROM ( \n" + + " FROM ( \n"
" SELECT tbl.fecha,tbl.dia,tbl.des_loc,MIN(tbl.ingreso) ingreso,MAX(tbl.salida) salida,SUM(tbl.cantLib) cantLib, \n" + + " SELECT tbl.fecha,tbl.dia,tbl.des_loc,MIN(tbl.ingreso) ingreso,MAX(tbl.salida) salida,SUM(tbl.cantLib) cantLib, \n"
" \n" + + " \n"
" tbl.turno,REPLACE(GROUP_CONCAT(tbl.aula ORDER BY ingreso ),',','-') aulas,SUM(tbl.cantAulas) cantAulas,tbl.grupoAcademico, \n" + + " tbl.turno,REPLACE(GROUP_CONCAT(tbl.aula ORDER BY ingreso ),',','-') aulas,SUM(tbl.cantAulas) cantAulas,tbl.grupoAcademico, \n"
" \n" + + " \n"
" tbl.computable,tbl.doc_saliente,tbl.nom_cur,tbl.fechafin,tbl.motivoCambio,tbl.doc_entrante,tbl.curso_entrante,tbl.cod_cur, \n" + + " tbl.computable,tbl.doc_saliente,tbl.nom_cur,tbl.fechafin,tbl.motivoCambio,tbl.doc_entrante,tbl.curso_entrante,tbl.cod_cur, \n"
" tbl.fechainicio,tbl.observacion,tbl.avance,tbl.recuperacion,tbl.horaAviso,tbl.fecha_aviso,tbl.docente_recuperacion,tbl.curso_recuperacion,tbl.fecha_recuperacion,tbl.horini_recuperacion,tbl.horfini_recuperacion\n" + + " tbl.fechainicio,tbl.observacion,tbl.avance,tbl.recuperacion,tbl.horaAviso,tbl.fecha_aviso,tbl.docente_recuperacion,tbl.curso_recuperacion,tbl.fecha_recuperacion,tbl.horini_recuperacion,tbl.horfini_recuperacion\n"
" FROM ( \n" + + " FROM ( \n"
" SELECT hcd.cod_hcd,hcd.fecha,hcd.dia numdia,ELT(hcd.dia, 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo') AS dia,\n" + + " SELECT hcd.cod_hcd,hcd.fecha,hcd.dia numdia,ELT(hcd.dia, 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo') AS dia,\n"
" \n" + + " \n"
" s.des_loc,TIME_FORMAT(hcd.hor_ini,'%H:%i') ingreso,TIME_FORMAT(hcd.hor_fin,'%H:%i') salida,IF(tg.destipogrado ='LIBRE',1,0) cantLib, \n" + + " s.des_loc,TIME_FORMAT(hcd.hor_ini,'%H:%i') ingreso,TIME_FORMAT(hcd.hor_fin,'%H:%i') salida,IF(tg.destipogrado ='LIBRE',1,0) cantLib, \n"
" IF (hcd.hor_ini>='07:00' AND hcd.hor_fin<'14:20','M','T') turno, \n" + + " IF (hcd.hor_ini>='07:00' AND hcd.hor_fin<'14:20','M','T') turno, \n"
" \n" + + " \n"
" TRIM(IF(tg.destipogrado ='LIBRE',tg.abrTipGrado,REPLACE(REPLACE(REPLACE(REPLACE(a.nombre,'TO ',''),'DO ',''),'RO ',''),'Y ','y'))) aula, \n" + + " TRIM(IF(tg.destipogrado ='LIBRE',tg.abrTipGrado,REPLACE(REPLACE(REPLACE(REPLACE(a.nombre,'TO ',''),'DO ',''),'RO ',''),'Y ','y'))) aula, \n"
" 1 cantAulas,IF(g.abrGrado LIKE '%1' OR g.abrGrado LIKE '%2','A',IF(a.codtipocentro = 2,'C','B')) grupoAcademico, \n" + + " 1 cantAulas,IF(g.abrGrado LIKE '%1' OR g.abrGrado LIKE '%2','A',IF(a.codtipocentro = 2,'C','B')) grupoAcademico, \n"
"\n" + + "\n"
" IF(a.codtipocentro = 2,120,80) computable,CONCAT(pf1.apellido,\" \",pf1.nombre) as doc_saliente ,c2.nom_cur,hcd.fechafin, \n" + + " IF(a.codtipocentro = 2,120,80) computable,CONCAT(pf1.apellido,\" \",pf1.nombre) as doc_saliente ,c2.nom_cur,hcd.fechafin, \n"
"\n" + + "\n"
" hcd.motivoCambio,CONCAT(pf2.apellido,\" \",pf2.nombre)as doc_entrante ,c.nom_cur as curso_entrante,hcd.cod_cur, \n" + + " hcd.motivoCambio,CONCAT(pf2.apellido,\" \",pf2.nombre)as doc_entrante ,c.nom_cur as curso_entrante,hcd.cod_cur, \n"
" \n" + + " \n"
" hcd.fechainicio,hcd.observacion,hcd.avance,hcd.recuperacion,hcd.horaAviso,hcd.fecha_aviso,hcd.docente_recuperacion ,hcd.curso_recuperacion,hcd.fecha_recuperacion,hcd.horini_recuperacion,hcd.horfini_recuperacion\n" + + " hcd.fechainicio,hcd.observacion,hcd.avance,hcd.recuperacion,hcd.horaAviso,hcd.fecha_aviso,hcd.docente_recuperacion ,hcd.curso_recuperacion,hcd.fecha_recuperacion,hcd.horini_recuperacion,hcd.horfini_recuperacion\n"
" FROM historial_horario hcd \n" + + " FROM historial_horario hcd \n"
" INNER JOIN curso c ON c.cod_cur=hcd.cod_cur \n" + + " INNER JOIN curso c ON c.cod_cur=hcd.cod_cur \n"
" INNER JOIN curso c2 ON c2.cod_cur=hcd.cod_cur_reemp \n" + + " INNER JOIN curso c2 ON c2.cod_cur=hcd.cod_cur_reemp \n"
" INNER JOIN sacoolive3.profesor pf1 ON pf1.codprofesor=hcd.cod_doc_reemp \n" + + " INNER JOIN sacoolive3.profesor pf1 ON pf1.codprofesor=hcd.cod_doc_reemp \n"
" INNER JOIN sacoolive3.profesor pf2 ON pf2.codprofesor=hcd.cod_doc \n" + + " INNER JOIN sacoolive3.profesor pf2 ON pf2.codprofesor=hcd.cod_doc \n"
" INNER JOIN aula a ON a.codaula=hcd.codAula \n" + + " INNER JOIN aula a ON a.codaula=hcd.codAula \n"
" INNER JOIN grado g on g.codgrado = a.codgrado \n" + + " INNER JOIN grado g on g.codgrado = a.codgrado \n"
" INNER JOIN tipo_grado tg ON g.codtipogrado=tg.codtipogrado \n" + + " INNER JOIN tipo_grado tg ON g.codtipogrado=tg.codtipogrado \n"
" INNER JOIN sede s ON s.cod_loc=a.codlocal \n" + + " INNER JOIN sede s ON s.cod_loc=a.codlocal \n"
" WHERE \n" + + " WHERE \n"
" accion = 'CAMBIO DIA' AND est_hcd = 1 and \n" + + " accion = 'CAMBIO DIA' AND est_hcd = 1 and \n"
" hcd.fecha BETWEEN ? AND ?\n" + + " hcd.fecha BETWEEN ? AND ?\n"
" ) tbl \n" + + " ) tbl \n"
" GROUP BY tbl.fecha,tbl.dia,tbl.des_loc,tbl.turno,tbl.grupoAcademico,tbl.cantAulas,tbl.doc_saliente, \n" + + " GROUP BY tbl.fecha,tbl.dia,tbl.des_loc,tbl.turno,tbl.grupoAcademico,tbl.cantAulas,tbl.doc_saliente, \n"
" tbl.nom_cur,tbl.fechafin,tbl.motivoCambio,tbl.doc_entrante,tbl.curso_entrante,tbl.cod_cur, \n" + + " tbl.nom_cur,tbl.fechafin,tbl.motivoCambio,tbl.doc_entrante,tbl.curso_entrante,tbl.cod_cur, \n"
" tbl.fechainicio \n" + + " tbl.fechainicio \n"
" ) tbl1"; + " ) tbl1";
// + "SELECT " // + "SELECT "
// + " s.des_loc, " // + " s.des_loc, "
...@@ -2734,7 +2768,6 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -2734,7 +2768,6 @@ public class MySqlDocenteDAO implements DocenteDAO {
// + " s.des_loc, " // + " s.des_loc, "
// + " dia, " // + " dia, "
// + " hh.cod_doc "; // + " hh.cod_doc ";
PreparedStatement st = cnx.prepareStatement(query); PreparedStatement st = cnx.prepareStatement(query);
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
Date fechaInicio = dateFormat.parse(fechaDesde); Date fechaInicio = dateFormat.parse(fechaDesde);
...@@ -2756,15 +2789,12 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -2756,15 +2789,12 @@ public class MySqlDocenteDAO implements DocenteDAO {
h.setH_codigoDocente(rs.getString("doc_saliente")); h.setH_codigoDocente(rs.getString("doc_saliente"));
h.setGrupoAcademico(rs.getString("grupoAcademico")); h.setGrupoAcademico(rs.getString("grupoAcademico"));
h.setH_nombreCurso(rs.getString("nom_cur")); h.setH_nombreCurso(rs.getString("nom_cur"));
h.setH_motivoCambio(rs.getString("motivoCambio")); h.setH_motivoCambio(rs.getString("motivoCambio"));
h.setH_observacion(rs.getString("observacion")); h.setH_observacion(rs.getString("observacion"));
h.setH_horaAviso(rs.getString("horaAviso")); h.setH_horaAviso(rs.getString("horaAviso"));
h.setFechaAvisoFalta(rs.getString("fecha_aviso")); h.setFechaAvisoFalta(rs.getString("fecha_aviso"));
h.setH_codigo_doc_reemp(rs.getString("doc_entrante")); h.setH_codigo_doc_reemp(rs.getString("doc_entrante"));
h.setH_nombre_cur_reemp(rs.getString("curso_entrante")); h.setH_nombre_cur_reemp(rs.getString("curso_entrante"));
h.setAvance(rs.getString("avance")); h.setAvance(rs.getString("avance"));
...@@ -2776,12 +2806,6 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -2776,12 +2806,6 @@ public class MySqlDocenteDAO implements DocenteDAO {
h.setHoraInicioRecuperacion(rs.getString("horini_recuperacion")); h.setHoraInicioRecuperacion(rs.getString("horini_recuperacion"));
h.setHoraFinRecuperacion(rs.getString("horfini_recuperacion")); h.setHoraFinRecuperacion(rs.getString("horfini_recuperacion"));
lista.add(h); lista.add(h);
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -2822,26 +2846,25 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -2822,26 +2846,25 @@ public class MySqlDocenteDAO implements DocenteDAO {
// + "GROUP BY " // + "GROUP BY "
// + "cod_doc, " // + "cod_doc, "
// + "s.cod_loc "; // + "s.cod_loc ";
String query
String query= = "select ELT(hh.dia, 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo') AS dia,cod_doc, \n"
"select ELT(hh.dia, 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo') AS dia,cod_doc, \n" + + " a.codaula,a.nombre nombreAula,\n"
" a.codaula,a.nombre nombreAula,\n" + + " s.des_loc, IF (hh.hor_ini>='07:00' AND hh.hor_fin<'14:20','MAÑANA','TARDE') turno,\n"
" s.des_loc, IF (hh.hor_ini>='07:00' AND hh.hor_fin<'14:20','MAÑANA','TARDE') turno,\n" + + " TIME_FORMAT(hh.hor_ini,'%H:%i') ingreso,TIME_FORMAT(hh.hor_fin,'%H:%i') salida,\n"
" TIME_FORMAT(hh.hor_ini,'%H:%i') ingreso,TIME_FORMAT(hh.hor_fin,'%H:%i') salida,\n" + + "\n"
"\n" + + " p.nom_pla curso, \n"
" p.nom_pla curso, \n" + + " \n"
" \n" + + " date_format(fecha, '%d/%m/%Y') fecha, \n"
" date_format(fecha, '%d/%m/%Y') fecha, \n" + + " ultimoDia \n"
" ultimoDia \n" + + " from historial_horario hh \n"
" from historial_horario hh \n" + + " inner join aula a on hh.codAula = a.codaula \n"
" inner join aula a on hh.codAula = a.codaula \n" + + " inner join sede s on s.cod_loc = a.codlocal \n"
" inner join sede s on s.cod_loc = a.codlocal \n" + + " inner join curso c on c.cod_cur = hh.cod_cur \n"
" inner join curso c on c.cod_cur = hh.cod_cur \n" + + " inner join plana p on p.cod_pla = c.cod_pla \n"
" inner join plana p on p.cod_pla = c.cod_pla \n" + + " where accion = 'DADO DE BAJA' \n"
" where accion = 'DADO DE BAJA' \n" + + " and est_hcd = 1 \n"
" and est_hcd = 1 \n" + + " and fecha between ? and ?\n"
" and fecha between ? and ?\n" + + " ORDER BY s.cod_loc";
" ORDER BY s.cod_loc";
PreparedStatement st = cnx.prepareStatement(query); PreparedStatement st = cnx.prepareStatement(query);
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
...@@ -2926,21 +2949,20 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -2926,21 +2949,20 @@ public class MySqlDocenteDAO implements DocenteDAO {
// System.out.println(query); // System.out.println(query);
// //
// } // }
@Override @Override
public ArrayList<Horario> listarCambiosDiaDocente(String cadenaAulas, String dia, String codigoDocente) throws Exception { public ArrayList<Horario> listarCambiosDiaDocente(String cadenaAulas, String dia, String codigoDocente) throws Exception {
ArrayList<Horario> lista = new ArrayList<Horario>(); ArrayList<Horario> lista = new ArrayList<Horario>();
Object[] arrayCadenas=cadenaAulas.split(","); Object[] arrayCadenas = cadenaAulas.split(",");
String aula1=""; String aula1 = "";
for(int i=0;i < arrayCadenas.length;i++){ for (int i = 0; i < arrayCadenas.length; i++) {
aula1 +="'"+arrayCadenas[i].toString()+"'"; aula1 += "'" + arrayCadenas[i].toString() + "'";
if(i<arrayCadenas.length-1){ if (i < arrayCadenas.length - 1) {
aula1 +=","; aula1 += ",";
} }
} }
...@@ -2964,7 +2986,7 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -2964,7 +2986,7 @@ public class MySqlDocenteDAO implements DocenteDAO {
+ "SELECT " + "SELECT "
+ " s.des_loc, " + " s.des_loc, "
+ " GROUP_CONCAT(CONCAT(a.nombre)) aulas, " + " GROUP_CONCAT(CONCAT(a.nombre)) aulas, "
// + " GROUP_CONCAT(CONCAT(grado.abrGrado,seccion.desseccion)) aulas, " // + " GROUP_CONCAT(CONCAT(grado.abrGrado,seccion.desseccion)) aulas, "
+ " dia, " + " dia, "
+ " TIME_FORMAT(MIN(hor_ini),'%H:%i') hora_ini, " + " TIME_FORMAT(MIN(hor_ini),'%H:%i') hora_ini, "
+ " TIME_FORMAT(MAX(hor_fin),'%H:%i') hora_fin, " + " TIME_FORMAT(MAX(hor_fin),'%H:%i') hora_fin, "
...@@ -2989,15 +3011,15 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -2989,15 +3011,15 @@ public class MySqlDocenteDAO implements DocenteDAO {
+ " INNER JOIN curso c1 ON c1.cod_cur = hh.cod_cur " + " INNER JOIN curso c1 ON c1.cod_cur = hh.cod_cur "
+ " INNER JOIN curso c2 ON c2.cod_cur = hh.cod_cur_reemp " + " INNER JOIN curso c2 ON c2.cod_cur = hh.cod_cur_reemp "
+ " INNER JOIN usuario usu ON usu.cod_usu = hh.cod_usu" + " INNER JOIN usuario usu ON usu.cod_usu = hh.cod_usu"
+ " WHERE \n" + + " WHERE \n"
" accion = 'CAMBIO DIA' \n" + + " accion = 'CAMBIO DIA' \n"
" AND est_hcd = 1 and hh.codAula IN ("+aula1+") AND dia='"+dia+"' and hh.cod_doc_reemp = '"+codigoDocente+"' \n" + + " AND est_hcd = 1 and hh.codAula IN (" + aula1 + ") AND dia='" + dia + "' and hh.cod_doc_reemp = '" + codigoDocente + "' \n"
" GROUP BY \n" + + " GROUP BY \n"
" s.des_loc, \n" + + " s.des_loc, \n"
" dia, \n" + + " dia, \n"
" hh.cod_doc ORDER BY hh.hora,hh.fecha DESC "; + " hh.cod_doc ORDER BY hh.hora,hh.fecha DESC ";
System.out.println("CONSULTA HISTORIAL CAMBIO DIA:"+query); System.out.println("CONSULTA HISTORIAL CAMBIO DIA:" + query);
PreparedStatement st = cnx.prepareStatement(query); PreparedStatement st = cnx.prepareStatement(query);
ResultSet rs = st.executeQuery(); ResultSet rs = st.executeQuery();
...@@ -3027,7 +3049,7 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -3027,7 +3049,7 @@ public class MySqlDocenteDAO implements DocenteDAO {
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
System.out.println("ERROR "+e.getMessage()); System.out.println("ERROR " + e.getMessage());
} finally { } finally {
cnx.close(); cnx.close();
} }
...@@ -3036,32 +3058,30 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -3036,32 +3058,30 @@ public class MySqlDocenteDAO implements DocenteDAO {
@Override @Override
public int validarDni(String dni) throws Exception { public int validarDni(String dni) throws Exception {
int codDocente=0; int codDocente = 0;
String base="horario"; String base = "horario";
ResultSet rs=null; ResultSet rs = null;
Connection cnx=null; Connection cnx = null;
try { try {
cnx = MySqlDAOFactory.obtenerConexion(base); cnx = MySqlDAOFactory.obtenerConexion(base);
Statement st = cnx.createStatement(); Statement st = cnx.createStatement();
String query="select codprofesor from sacoolive3.profesor where dni="+dni+""; String query = "select codprofesor from sacoolive3.profesor where dni=" + dni + "";
rs=st.executeQuery(query); rs = st.executeQuery(query);
System.out.println("queryy->>"+query); System.out.println("queryy->>" + query);
if(rs.next()){ if (rs.next()) {
codDocente = rs.getInt("codprofesor"); codDocente = rs.getInt("codprofesor");
} }
System.out.println("codDocnete->" + codDocente);
System.out.println("codDocnete->"+codDocente);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
}finally{ } finally {
if(cnx != null){ if (cnx != null) {
cnx.close(); cnx.close();
} }
...@@ -3070,6 +3090,4 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -3070,6 +3090,4 @@ public class MySqlDocenteDAO implements DocenteDAO {
} }
} }
...@@ -209,10 +209,10 @@ public class DocenteServices { ...@@ -209,10 +209,10 @@ public class DocenteServices {
return dato; return dato;
} }
public ArrayList<Docente> consultarDatos(String codDocente,String codPeriodo) { public ArrayList<Docente> consultarDatos(String codDocente, String codPeriodo) {
ArrayList<Docente> lista = null; ArrayList<Docente> lista = null;
try { try {
lista = objDocenteDAO.consultarDatos(codDocente,codPeriodo); lista = objDocenteDAO.consultarDatos(codDocente, codPeriodo);
} catch (Exception e) { } catch (Exception e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
...@@ -297,10 +297,10 @@ public class DocenteServices { ...@@ -297,10 +297,10 @@ public class DocenteServices {
return dato; return dato;
} }
public int registroDatos(String codDocente, String telefono, String mail, int cod_dep, int cod_pro, int cod_dis, String cel, String dir,int numhijos,int codarea,int codplana,int codperiodo) { public int registroDatos(String codDocente, String telefono, String mail, int cod_dep, int cod_pro, int cod_dis, String cel, String dir, int numhijos, int codarea, int codplana, int codperiodo) {
int dato = 0; int dato = 0;
try { try {
dato = objDocenteDAO.registroDatos(codDocente, telefono, mail, cod_dep, cod_pro, cod_dis, cel, dir,numhijos,codarea,codplana,codperiodo); dato = objDocenteDAO.registroDatos(codDocente, telefono, mail, cod_dep, cod_pro, cod_dis, cel, dir, numhijos, codarea, codplana, codperiodo);
} catch (Exception e) { } catch (Exception e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
...@@ -308,10 +308,10 @@ public class DocenteServices { ...@@ -308,10 +308,10 @@ public class DocenteServices {
return dato; return dato;
} }
public int registrarDatosEdit(String codDocente, String telefono, String mail, int cod_dep, int cod_pro, int cod_dis, String cel, String dir,int cantHijos,int codArea,int codPlana,int periodo) { public int registrarDatosEdit(String codDocente, String telefono, String mail, int cod_dep, int cod_pro, int cod_dis, String cel, String dir, int cantHijos, int codArea, int codPlana, int periodo) {
int dato = 0; int dato = 0;
try { try {
dato = objDocenteDAO.registrarDatosEdit(codDocente, telefono, mail, cod_dep, cod_pro, cod_dis, cel, dir,cantHijos,codArea,codPlana,periodo); dato = objDocenteDAO.registrarDatosEdit(codDocente, telefono, mail, cod_dep, cod_pro, cod_dis, cel, dir, cantHijos, codArea, codPlana, periodo);
} catch (Exception e) { } catch (Exception e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
...@@ -363,6 +363,18 @@ public class DocenteServices { ...@@ -363,6 +363,18 @@ public class DocenteServices {
return lista; return lista;
} }
// TEMPORAL
public ArrayList<Docente> cargarDocentePrimaria3(String codcurso, String apellido, int inicio, int cantidad, String documentos_ignorados) {
ArrayList<Docente> lista = null;
try {
lista = objDocenteDAO.cargarDocentePrimaria3(codcurso, apellido, inicio, cantidad, documentos_ignorados);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return lista;
}
public Docente listarDocenteSede(String local) { public Docente listarDocenteSede(String local) {
Docente docente = new Docente(); Docente docente = new Docente();
try { try {
......
...@@ -154,14 +154,14 @@ public class ServletDocente extends HttpServlet { ...@@ -154,14 +154,14 @@ public class ServletDocente extends HttpServlet {
verificarCrucesPorPeriodo(request, response); verificarCrucesPorPeriodo(request, response);
} else if ("tablaDocentesDisponiblesGeneral5".equals(param)) { } else if ("tablaDocentesDisponiblesGeneral5".equals(param)) {
tablaDocentesDisponiblesGeneral5(request, response); tablaDocentesDisponiblesGeneral5(request, response);
}else if("cargarDocentesDisponiblesGeneralRecuperacion".equals(param)){ } else if ("cargarDocentesDisponiblesGeneralRecuperacion".equals(param)) {
cargarDocentesDisponiblesGeneralRecuperacion(request,response); cargarDocentesDisponiblesGeneralRecuperacion(request, response);
}else if("validarDni".equals(param)){ } else if ("validarDni".equals(param)) {
validarDni(request,response); validarDni(request, response);
}else if("armarEdicionConformidad".equals(param)){ } else if ("armarEdicionConformidad".equals(param)) {
armarEdicionConformidad(request,response); armarEdicionConformidad(request, response);
}else if("registrarDisponibilidadConformidad".equals(param)){ } else if ("registrarDisponibilidadConformidad".equals(param)) {
registrarDisponibilidadConformidad(request,response); registrarDisponibilidadConformidad(request, response);
} }
} }
...@@ -618,7 +618,7 @@ public class ServletDocente extends HttpServlet { ...@@ -618,7 +618,7 @@ public class ServletDocente extends HttpServlet {
for (int i = 0; i < lista.size(); i++) { for (int i = 0; i < lista.size(); i++) {
if (cadenaCodigoDocente.equals("")) { if (cadenaCodigoDocente.equals("")) {
cadenaCodigoDocente += lista.get(i).getCod_pro(); cadenaCodigoDocente += lista.get(i).getCod_pro();
}else{ } else {
cadenaCodigoDocente += "," + lista.get(i).getCod_pro(); cadenaCodigoDocente += "," + lista.get(i).getCod_pro();
} }
} }
...@@ -749,7 +749,6 @@ public class ServletDocente extends HttpServlet { ...@@ -749,7 +749,6 @@ public class ServletDocente extends HttpServlet {
String[] arrayDisponibilidad = {TM, TT, TN}; String[] arrayDisponibilidad = {TM, TT, TN};
String[] arrayHora = {"07:50 a 14:30", "15:00 a 19:00 ", "19:00 a 22:00"}; String[] arrayHora = {"07:50 a 14:30", "15:00 a 19:00 ", "19:00 a 22:00"};
String[] arrayTurno = {"MAÑANA", "TARDE", "NOCHE"}; String[] arrayTurno = {"MAÑANA", "TARDE", "NOCHE"};
...@@ -922,6 +921,7 @@ public class ServletDocente extends HttpServlet { ...@@ -922,6 +921,7 @@ public class ServletDocente extends HttpServlet {
pw.println("0");// Error pw.println("0");// Error
} }
} }
private void registrarDisponibilidadConformidad(HttpServletRequest request, HttpServletResponse response) throws IOException { private void registrarDisponibilidadConformidad(HttpServletRequest request, HttpServletResponse response) throws IOException {
DisponibilidadServices servicios = new DisponibilidadServices(); DisponibilidadServices servicios = new DisponibilidadServices();
String codDoc = request.getParameter("codDoc"); String codDoc = request.getParameter("codDoc");
...@@ -1965,7 +1965,7 @@ public class ServletDocente extends HttpServlet { ...@@ -1965,7 +1965,7 @@ public class ServletDocente extends HttpServlet {
int codDepartamento = 0; int codDepartamento = 0;
int codProvincia = 0; int codProvincia = 0;
int codDistrito = 0; int codDistrito = 0;
int numHijos=0; int numHijos = 0;
if (docente.getTelefono() == null) { if (docente.getTelefono() == null) {
telefono = ""; telefono = "";
} else { } else {
...@@ -2084,11 +2084,8 @@ public class ServletDocente extends HttpServlet { ...@@ -2084,11 +2084,8 @@ public class ServletDocente extends HttpServlet {
// + " </tr>" // + " </tr>"
// + "</table>" // + "</table>"
// + "</center>"); // + "</center>");
// NUEVO FORMULARIO PARA EL REGISTRO DE DATOS // NUEVO FORMULARIO PARA EL REGISTRO DE DATOS
pw.println("<center>" pw.println("<center>"
+ "<table width='400' border='0'>" + "<table width='400' border='0'>"
+ " <tr>" + " <tr>"
+ " <td height='15' colspan='3' ></td>" + " <td height='15' colspan='3' ></td>"
...@@ -2118,7 +2115,7 @@ pw.println("<center>" ...@@ -2118,7 +2115,7 @@ pw.println("<center>"
+ " <tr>" + " <tr>"
+ " <td>Num.Hijos <font color='red'>*</font></td>" + " <td>Num.Hijos <font color='red'>*</font></td>"
+ " <td width='5'></td>" + " <td width='5'></td>"
+ " <td><input type='number' min='0' max='15' class='form-control validate[required]' id='txt_new_numHijos' value='"+numHijos+"'/></td>" + " <td><input type='number' min='0' max='15' class='form-control validate[required]' id='txt_new_numHijos' value='" + numHijos + "'/></td>"
+ " </tr>" + " </tr>"
+ " <tr>" + " <tr>"
+ " <td colspan='3' height='15'>" + " <td colspan='3' height='15'>"
...@@ -2131,7 +2128,6 @@ pw.println("<center>" ...@@ -2131,7 +2128,6 @@ pw.println("<center>"
+ " <tr>" + " <tr>"
+ " <td colspan='3' height='15'>" + " <td colspan='3' height='15'>"
+ " </tr>" + " </tr>"
// AREA // AREA
+ " <tr>" + " <tr>"
+ " <td>Area <font color='red'>*</font></td>" + " <td>Area <font color='red'>*</font></td>"
...@@ -2144,12 +2140,9 @@ pw.println("<center>" ...@@ -2144,12 +2140,9 @@ pw.println("<center>"
+ " </span>" + " </span>"
+ " </td>" + " </td>"
+ " </tr>" + " </tr>"
+ " <tr>" + " <tr>"
+ " <td colspan='3' height='15'>" + " <td colspan='3' height='15'>"
+ " </tr>" + " </tr>"
// FIN AREA // FIN AREA
// PLANA // PLANA
+ " <tr>" + " <tr>"
...@@ -2161,13 +2154,12 @@ pw.println("<center>" ...@@ -2161,13 +2154,12 @@ pw.println("<center>"
+ " <option>PRUEBA</option>" + " <option>PRUEBA</option>"
+ " </select>" + " </select>"
+ " </span>" + " </span>"
+" </td>" + " </td>"
+ " </tr>" + " </tr>"
// FIN PLANA // FIN PLANA
+ " <tr>" + " <tr>"
+ " <td colspan='3' height='15'>" + " <td colspan='3' height='15'>"
+ " </tr>" + " </tr>"
+ " <tr>" + " <tr>"
+ " <td>Departamento <font color='red'>*</font></td>" + " <td>Departamento <font color='red'>*</font></td>"
+ " <td width='5'></td>"); + " <td width='5'></td>");
...@@ -2250,7 +2242,7 @@ pw.println("<center>" ...@@ -2250,7 +2242,7 @@ pw.println("<center>"
response.setContentType("text/html"); response.setContentType("text/html");
PrintWriter pw = response.getWriter(); PrintWriter pw = response.getWriter();
dato = servicios.registroDatos(codDocente, telefono, mail, codDepartamento, codProvincia, codDistrito, cel, direccion,numHijos,codArea,codPlana,codPeriodo); dato = servicios.registroDatos(codDocente, telefono, mail, codDepartamento, codProvincia, codDistrito, cel, direccion, numHijos, codArea, codPlana, codPeriodo);
dato2 = servicios2.registrarZonaDocente(codDocente, codDepartamento, codProvincia, codDistrito); dato2 = servicios2.registrarZonaDocente(codDocente, codDepartamento, codProvincia, codDistrito);
if (dato == 0) { if (dato == 0) {
...@@ -2271,7 +2263,7 @@ pw.println("<center>" ...@@ -2271,7 +2263,7 @@ pw.println("<center>"
String codPeriodo = request.getParameter("codPeriodo"); String codPeriodo = request.getParameter("codPeriodo");
String dni = request.getParameter("dni"); String dni = request.getParameter("dni");
String nombres = request.getParameter("nombres"); String nombres = request.getParameter("nombres");
lista = servicios.consultarDatos(codDocente,codPeriodo); lista = servicios.consultarDatos(codDocente, codPeriodo);
response.setContentType("text/html"); response.setContentType("text/html");
PrintWriter pw = response.getWriter(); PrintWriter pw = response.getWriter();
...@@ -2325,10 +2317,10 @@ pw.println("<center>" ...@@ -2325,10 +2317,10 @@ pw.println("<center>"
+ " <td align='center'>" + nombres + "</td>" + " <td align='center'>" + nombres + "</td>"
+ " <td align='center'>" + lista.get(i).getTelefono() + "</td>" + " <td align='center'>" + lista.get(i).getTelefono() + "</td>"
+ " <td align='center'>" + lista.get(i).getCell() + "</td>" + " <td align='center'>" + lista.get(i).getCell() + "</td>"
+ " <td align='center'>" + lista.get(i).getCantHijos()+ "</td>" + " <td align='center'>" + lista.get(i).getCantHijos() + "</td>"
+ " <td align='center'>" + lista.get(i).getCorreo() + "<input type='hidden' value='" + lista.get(i).getCorreo() + "' id='correo' ></td>" + " <td align='center'>" + lista.get(i).getCorreo() + "<input type='hidden' value='" + lista.get(i).getCorreo() + "' id='correo' ></td>"
+ " <td align='center'>" + lista.get(i).getNombreDep() + "</td>" + " <td align='center'>" + lista.get(i).getNombreDep() + "</td>"
+ " <td align='center'>" + lista.get(i).getNombrePlanaAsiste()+ "</td>" + " <td align='center'>" + lista.get(i).getNombrePlanaAsiste() + "</td>"
+ " <td align='center'>" + lista.get(i).getNombrePro() + "</td>" + " <td align='center'>" + lista.get(i).getNombrePro() + "</td>"
+ " <td align='center'>" + lista.get(i).getNombreDDis() + "</td>" + " <td align='center'>" + lista.get(i).getNombreDDis() + "</td>"
); );
...@@ -2413,7 +2405,7 @@ pw.println("<center>" ...@@ -2413,7 +2405,7 @@ pw.println("<center>"
} else { } else {
telefono = docente.getTelefono(); telefono = docente.getTelefono();
} }
if (docente.getCantHijos() == 0 ) { if (docente.getCantHijos() == 0) {
cantHijos = 0; cantHijos = 0;
} else { } else {
cantHijos = docente.getCantHijos(); cantHijos = docente.getCantHijos();
...@@ -2512,8 +2504,6 @@ pw.println("<center>" ...@@ -2512,8 +2504,6 @@ pw.println("<center>"
+ " </select>" + " </select>"
+ " </div> </td>"); + " </div> </td>");
pw.println(" </tr>" pw.println(" </tr>"
+ " <tr>" + " <tr>"
+ " <td colspan='3' height='15'></td>" + " <td colspan='3' height='15'></td>"
...@@ -2524,16 +2514,12 @@ pw.println("<center>" ...@@ -2524,16 +2514,12 @@ pw.println("<center>"
+ " <td><b>Plana Asiste</b><font color='red'>*</font></td>" + " <td><b>Plana Asiste</b><font color='red'>*</font></td>"
+ " <td width='5'></td>"); + " <td width='5'></td>");
pw.println(" <td><div id='divPlanaAsisteEdit'>" pw.println(" <td><div id='divPlanaAsisteEdit'>"
+ " <select class='form-control' id='cmbDis'>" + " <select class='form-control' id='cmbDis'>"
+ " <option value=''>[Seleccione]</option>" + " <option value=''>[Seleccione]</option>"
+ " </select>" + " </select>"
+ " </div> </td>"); + " </div> </td>");
pw.println(" </tr>" pw.println(" </tr>"
+ " <tr>" + " <tr>"
+ " <td colspan='3' height='15'></td>" + " <td colspan='3' height='15'></td>"
...@@ -2549,7 +2535,6 @@ pw.println("<center>" ...@@ -2549,7 +2535,6 @@ pw.println("<center>"
+ " </select>" + " </select>"
+ " </div> </td>"); + " </div> </td>");
pw.println(" </tr>" pw.println(" </tr>"
+ " <tr>" + " <tr>"
+ " <td colspan='3' height='15'></td>" + " <td colspan='3' height='15'></td>"
...@@ -2559,11 +2544,8 @@ pw.println("<center>" ...@@ -2559,11 +2544,8 @@ pw.println("<center>"
+ " <td><b>Num. Hijos </b><font color='red'>*</font></td>" + " <td><b>Num. Hijos </b><font color='red'>*</font></td>"
+ " <td width='5'></td>"); + " <td width='5'></td>");
pw.println(" <td><div id='divCantHijos'>" pw.println(" <td><div id='divCantHijos'>"
+ " <input type='number' class='form-control validate[required]' min='0' max='15' id='txt_cant_hijos' value='"+cantHijos+"' />" + " <input type='number' class='form-control validate[required]' min='0' max='15' id='txt_cant_hijos' value='" + cantHijos + "' />"
+ " </div> </td>"); + " </div> </td>");
pw.println(" </tr>" pw.println(" </tr>"
...@@ -2663,7 +2645,7 @@ pw.println("<center>" ...@@ -2663,7 +2645,7 @@ pw.println("<center>"
int periodo = Integer.parseInt(request.getParameter("periodo")); int periodo = Integer.parseInt(request.getParameter("periodo"));
response.setContentType("text/html"); response.setContentType("text/html");
PrintWriter pw = response.getWriter(); PrintWriter pw = response.getWriter();
dato = servicios.registrarDatosEdit(codDocente, telefono, mail, codDepartamento, codProvincia, codDistrito, cel, dir,cantHijos,codArea,codPlana,periodo); dato = servicios.registrarDatosEdit(codDocente, telefono, mail, codDepartamento, codProvincia, codDistrito, cel, dir, cantHijos, codArea, codPlana, periodo);
pw.println(dato); pw.println(dato);
} }
...@@ -2683,7 +2665,14 @@ pw.println("<center>" ...@@ -2683,7 +2665,14 @@ pw.println("<center>"
int cantRegistro = 0; int cantRegistro = 0;
lista = servicios.buscarUsuarioDocente(apellido, inicio, cantidad); lista = servicios.buscarUsuarioDocente(apellido, inicio, cantidad);
String cargos = "41,57,102,95,11,51,30,33,19"; String cargos = "41,57,102,95,11,51,30,33,19";
ArrayList<Docente> lista2 = servicios.cargarDocentePrimaria2(cargos, apellido, inicio, cantidad - lista.size()); String documentos_ignorados = "";
for (Docente docente : lista) {
documentos_ignorados += "'" + docente.getDni() + "',";
}
System.out.println("DOCUMENTOS IGNORADOSSS: " + documentos_ignorados);
// Metodo creado para parchar momentaneamente a cargarDocentePrimaria2 (Revisar en dónde se usan cargarDocentePrimaria2 y reemplazar)
ArrayList<Docente> lista2 = servicios.cargarDocentePrimaria3(cargos, apellido, inicio, cantidad - lista.size(), documentos_ignorados);
// ArrayList<Docente> lista2 = servicios.cargarDocentePrimaria2(cargos, apellido, inicio, cantidad - lista.size());
for (Docente docente : lista2) { for (Docente docente : lista2) {
Docente docente1 = lista.stream() Docente docente1 = lista.stream()
...@@ -3227,7 +3216,7 @@ pw.println("<center>" ...@@ -3227,7 +3216,7 @@ pw.println("<center>"
+ " <tr>" + " <tr>"
+ " <td>Num.Hijos <font color='red'>*</font></td>" + " <td>Num.Hijos <font color='red'>*</font></td>"
+ " <td width='5'></td>" + " <td width='5'></td>"
+ " <td><input type='number' min='0' max='15' class='form-control validate[required]' id='txt_numHijos' value='"+numHijos+"'/></td>" + " <td><input type='number' min='0' max='15' class='form-control validate[required]' id='txt_numHijos' value='" + numHijos + "'/></td>"
+ " </tr>" + " </tr>"
+ " <tr>" + " <tr>"
+ " <td colspan='3' height='15'>" + " <td colspan='3' height='15'>"
...@@ -3240,7 +3229,6 @@ pw.println("<center>" ...@@ -3240,7 +3229,6 @@ pw.println("<center>"
+ " <tr>" + " <tr>"
+ " <td colspan='3' height='15'>" + " <td colspan='3' height='15'>"
+ " </tr>" + " </tr>"
// AREA // AREA
+ " <tr>" + " <tr>"
+ " <td>Area <font color='red'>*</font></td>" + " <td>Area <font color='red'>*</font></td>"
...@@ -3253,12 +3241,9 @@ pw.println("<center>" ...@@ -3253,12 +3241,9 @@ pw.println("<center>"
+ " </span>" + " </span>"
+ " </td>" + " </td>"
+ " </tr>" + " </tr>"
+ " <tr>" + " <tr>"
+ " <td colspan='3' height='15'>" + " <td colspan='3' height='15'>"
+ " </tr>" + " </tr>"
// FIN AREA // FIN AREA
// PLANA // PLANA
+ " <tr>" + " <tr>"
...@@ -3270,13 +3255,12 @@ pw.println("<center>" ...@@ -3270,13 +3255,12 @@ pw.println("<center>"
+ " <option>PRUEBA</option>" + " <option>PRUEBA</option>"
+ " </select>" + " </select>"
+ " </span>" + " </span>"
+" </td>" + " </td>"
+ " </tr>" + " </tr>"
// FIN PLANA // FIN PLANA
+ " <tr>" + " <tr>"
+ " <td colspan='3' height='15'>" + " <td colspan='3' height='15'>"
+ " </tr>" + " </tr>"
+ " <tr>" + " <tr>"
+ " <td>Departamento <font color='red'>*</font></td>" + " <td>Departamento <font color='red'>*</font></td>"
+ " <td width='5'></td>"); + " <td width='5'></td>");
...@@ -3638,8 +3622,9 @@ pw.println("<center>" ...@@ -3638,8 +3622,9 @@ pw.println("<center>"
dato = serviciosDocente.insertarTemporal(cadena); dato = serviciosDocente.insertarTemporal(cadena);
} }
private void cargarDocentesDisponiblesGeneralRecuperacion(HttpServletRequest request, HttpServletResponse response) throws IOException { private void cargarDocentesDisponiblesGeneralRecuperacion(HttpServletRequest request, HttpServletResponse response) throws IOException {
PrintWriter pw=response.getWriter(); PrintWriter pw = response.getWriter();
response.setContentType("text/html"); response.setContentType("text/html");
DocenteServices serviciosDocente = new DocenteServices(); DocenteServices serviciosDocente = new DocenteServices();
AreaDocenteServices servicios = new AreaDocenteServices(); AreaDocenteServices servicios = new AreaDocenteServices();
...@@ -3650,21 +3635,19 @@ pw.println("<center>" ...@@ -3650,21 +3635,19 @@ pw.println("<center>"
String periodo = request.getParameter("periodo"); String periodo = request.getParameter("periodo");
// String historial=request.getParameter("historial"); // String historial=request.getParameter("historial");
int dato = 0; int dato = 0;
String print=""; String print = "";
lista = servicios.cargarDocentesDisponibles2(codTurno, dia, codcurso, periodo); lista = servicios.cargarDocentesDisponibles2(codTurno, dia, codcurso, periodo);
pw.println("<select class='form-control' id='cbDocentesRecuperacion'>"); pw.println("<select class='form-control' id='cbDocentesRecuperacion'>");
pw.println("<option value=\"\">[SELECCIONE]</option>"); pw.println("<option value=\"\">[SELECCIONE]</option>");
for (int i = 0; i < lista.size(); i++) { for (int i = 0; i < lista.size(); i++) {
pw.println("<option value='"+lista.get(i).getCodigoDocente()+"'>"+lista.get(i).getApellidoDocente()+", "+lista.get(i).getNombreDocente()+"</option>"); pw.println("<option value='" + lista.get(i).getCodigoDocente() + "'>" + lista.get(i).getApellidoDocente() + ", " + lista.get(i).getNombreDocente() + "</option>");
} }
pw.println("</select>"); pw.println("</select>");
} }
private void tablaDocentesDisponiblesGeneral3(HttpServletRequest request, HttpServletResponse response) throws IOException { private void tablaDocentesDisponiblesGeneral3(HttpServletRequest request, HttpServletResponse response) throws IOException {
String periodo = request.getParameter("periodo"); String periodo = request.getParameter("periodo");
...@@ -3885,7 +3868,7 @@ pw.println("<center>" ...@@ -3885,7 +3868,7 @@ pw.println("<center>"
+ " <td style='vertical-align: middle;' width='100' >" + fecInfo + "</td>" + " <td style='vertical-align: middle;' width='100' >" + fecInfo + "</td>"
+ " <td style='vertical-align: middle;' width='250'>" + lista.get(i).getNombreDocente().toUpperCase() + "</td>" + " <td style='vertical-align: middle;' width='250'>" + lista.get(i).getNombreDocente().toUpperCase() + "</td>"
+ " <td style='vertical-align: middle;' width='200'>" + lista.get(i).getMotivo().toUpperCase() + "</td>" + " <td style='vertical-align: middle;' width='200'>" + lista.get(i).getMotivo().toUpperCase() + "</td>"
+ " <td style='vertical-align: middle;' width='250'><span class='' data-rel='tooltip' data-placement='left' title='' style='cursor: pointer;' data-original-title='" + lista.get(i).getArgumento().toUpperCase() + "'>" + cortado.toUpperCase() + "...<a href=\"javascript:armarPopUpInforme('" + codDocente + "','"+codSede+"');\"><span style='color:orange;'><b>ver más</b></span></a></span></td>" + " <td style='vertical-align: middle;' width='250'><span class='' data-rel='tooltip' data-placement='left' title='' style='cursor: pointer;' data-original-title='" + lista.get(i).getArgumento().toUpperCase() + "'>" + cortado.toUpperCase() + "...<a href=\"javascript:armarPopUpInforme('" + codDocente + "','" + codSede + "');\"><span style='color:orange;'><b>ver más</b></span></a></span></td>"
+ " <td style='vertical-align: middle;'>" + estado + "</td>" + " <td style='vertical-align: middle;'>" + estado + "</td>"
+ " <td style='vertical-align: middle;' width='50'>" + " <td style='vertical-align: middle;' width='50'>"
+ " <div class=\"inline pull-center position-relative dropdown-hover\">" + " <div class=\"inline pull-center position-relative dropdown-hover\">"
...@@ -3937,7 +3920,7 @@ pw.println("<center>" ...@@ -3937,7 +3920,7 @@ pw.println("<center>"
String codigoSede = request.getParameter("codigoSede"); String codigoSede = request.getParameter("codigoSede");
DocenteServices servicios = new DocenteServices(); DocenteServices servicios = new DocenteServices();
Docente docente = new Docente(); Docente docente = new Docente();
docente = servicios.consultarInforme(codigoDocente,codigoSede); docente = servicios.consultarInforme(codigoDocente, codigoSede);
String respuestaInforme = docente.getRespuestaInforme(); String respuestaInforme = docente.getRespuestaInforme();
String fechaInforme = docente.getFechaInforme(); String fechaInforme = docente.getFechaInforme();
...@@ -6127,6 +6110,7 @@ pw.println("<center>" ...@@ -6127,6 +6110,7 @@ pw.println("<center>"
ArrayList<Docente> lista = null; ArrayList<Docente> lista = null;
DocenteServices servicio = new DocenteServices(); DocenteServices servicio = new DocenteServices();
System.out.println("cadenaAulas=>" + cadenaAulas); System.out.println("cadenaAulas=>" + cadenaAulas);
lista = servicio.filtroDocentesPrimSec(periodo, filtro, cadenaAulas); lista = servicio.filtroDocentesPrimSec(periodo, filtro, cadenaAulas);
response.setContentType("text/html"); response.setContentType("text/html");
...@@ -6281,21 +6265,17 @@ pw.println("<center>" ...@@ -6281,21 +6265,17 @@ pw.println("<center>"
private void validarDni(HttpServletRequest request, HttpServletResponse response) throws IOException { private void validarDni(HttpServletRequest request, HttpServletResponse response) throws IOException {
PrintWriter pw = response.getWriter(); PrintWriter pw = response.getWriter();
response.setContentType("text/html"); response.setContentType("text/html");
String dni=request.getParameter("dni"); String dni = request.getParameter("dni");
System.out.println("DNIIII ->>>>"+dni);
System.out.println("DNIIII ->>>>" + dni);
DocenteServices service = new DocenteServices(); DocenteServices service = new DocenteServices();
int codDocente=service.validarDni(dni); int codDocente = service.validarDni(dni);
System.out.println("COD DEVUELTO ->>>>"+codDocente);
System.out.println("COD DEVUELTO ->>>>" + codDocente);
pw.print(codDocente); pw.print(codDocente);
...@@ -6347,7 +6327,6 @@ pw.println("<center>" ...@@ -6347,7 +6327,6 @@ pw.println("<center>"
String[] arrayDisponibilidad = {TM, TT, TN}; String[] arrayDisponibilidad = {TM, TT, TN};
String[] arrayHora = {"07:50 a 14:30", "15:00 a 19:00 ", "19:00 a 22:00"}; String[] arrayHora = {"07:50 a 14:30", "15:00 a 19:00 ", "19:00 a 22:00"};
String[] arrayTurno = {"MAÑANA", "TARDE", "NOCHE"}; String[] arrayTurno = {"MAÑANA", "TARDE", "NOCHE"};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment