|
|
|
@ -70,13 +70,17 @@ public class doGetListaTrabalhadoresTudo
|
|
|
|
// + " AND ( proximo_exame IS NULL OR proximo_exame - current_date > 14 )"
|
|
|
|
// + " AND ( proximo_exame IS NULL OR proximo_exame - current_date > 14 )"
|
|
|
|
// + " ORDER BY nome" );
|
|
|
|
// + " ORDER BY nome" );
|
|
|
|
dbQuery.append( "SELECT trabalhadores.id, trabalhadores.nome, "
|
|
|
|
dbQuery.append( "SELECT trabalhadores.id, trabalhadores.nome, "
|
|
|
|
+ "marcacoes_trabalhador.tipo, marcacoes_trabalhador.data, marcacoes_trabalhador.estado, "
|
|
|
|
+ "marcacoes_trabalhador.tipo, marcacoes_trabalhador.data, "
|
|
|
|
|
|
|
|
// + "marcacoes_trabalhador.estado, "
|
|
|
|
+ " trabalhadores.nome_plain "
|
|
|
|
+ " trabalhadores.nome_plain "
|
|
|
|
+ "FROM trabalhadores, marcacoes_trabalhador "
|
|
|
|
+ "FROM trabalhadores, marcacoes_trabalhador "
|
|
|
|
+ "WHERE estabelecimento_id = " + estabelecimentoId
|
|
|
|
+ "WHERE estabelecimento_id = " + estabelecimentoId
|
|
|
|
+ " AND marcacoes_trabalhador.trabalhador_id = trabalhadores.id "
|
|
|
|
+ " AND marcacoes_trabalhador.trabalhador_id = trabalhadores.id "
|
|
|
|
+ " AND trabalhadores.inactivo <> 'y' AND data_demissao IS NULL "
|
|
|
|
+ " AND trabalhadores.inactivo <> 'y' AND data_demissao IS NULL "
|
|
|
|
+ "ORDER BY 6, 3, 4 DESC " );
|
|
|
|
+ "ORDER BY 6, 3, 4 DESC " );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println( "\nSQL : " + dbQuery.toString() );
|
|
|
|
|
|
|
|
|
|
|
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
|
|
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
|
|
|
rs = new ResultSet2DArray( stmt.executeQuery( dbQuery.toString()) );
|
|
|
|
rs = new ResultSet2DArray( stmt.executeQuery( dbQuery.toString()) );
|
|
|
|
|
|
|
|
|
|
|
|
@ -91,6 +95,7 @@ public class doGetListaTrabalhadoresTudo
|
|
|
|
for ( index = 0; index <= max; index++ )
|
|
|
|
for ( index = 0; index <= max; index++ )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Integer id = index < max ? ( Integer ) rs.get( index, 0 ) : new Integer( -1 );
|
|
|
|
Integer id = index < max ? ( Integer ) rs.get( index, 0 ) : new Integer( -1 );
|
|
|
|
|
|
|
|
// System.out.println( "\tIndex : " + index + " ; " + id );
|
|
|
|
if( !id.equals( trabalhadorID ) )
|
|
|
|
if( !id.equals( trabalhadorID ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Object listaConsultas[][] = ( Object[][] ) consultas.toArray( new Object[consultas.size()][2] );
|
|
|
|
Object listaConsultas[][] = ( Object[][] ) consultas.toArray( new Object[consultas.size()][2] );
|
|
|
|
@ -127,20 +132,20 @@ public class doGetListaTrabalhadoresTudo
|
|
|
|
Integer tipo = ( Integer ) rs.get( index, 2 );
|
|
|
|
Integer tipo = ( Integer ) rs.get( index, 2 );
|
|
|
|
String nome = ( String ) rs.get( index, 1 );
|
|
|
|
String nome = ( String ) rs.get( index, 1 );
|
|
|
|
java.util.Date data = ( java.util.Date ) rs.get( index, 3 );
|
|
|
|
java.util.Date data = ( java.util.Date ) rs.get( index, 3 );
|
|
|
|
Integer estado = ( Integer ) rs.get( index, 4 );
|
|
|
|
// Integer estado = ( Integer ) rs.get( index, 4 );
|
|
|
|
trabalhadorID = id;
|
|
|
|
trabalhadorID = id;
|
|
|
|
nomeTrabalhador = nome;
|
|
|
|
nomeTrabalhador = nome;
|
|
|
|
Object marcacao[] = new Object[]{ data, estado };
|
|
|
|
// Object marcacao[] = new Object[]{ data, estado };
|
|
|
|
switch( tipo.intValue() )
|
|
|
|
// switch( tipo.intValue() )
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
case TIPO_MARCACAO_EXAMES:
|
|
|
|
// case TIPO_MARCACAO_EXAMES:
|
|
|
|
exames.add( marcacao );
|
|
|
|
// exames.add( marcacao );
|
|
|
|
break;
|
|
|
|
// break;
|
|
|
|
|
|
|
|
//
|
|
|
|
case TIPO_MARCACAO_CONSULTA:
|
|
|
|
// case TIPO_MARCACAO_CONSULTA:
|
|
|
|
consultas.add( marcacao );
|
|
|
|
// consultas.add( marcacao );
|
|
|
|
break;
|
|
|
|
// break;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stmt.close();
|
|
|
|
stmt.close();
|
|
|
|
|
|
|
|
|
|
|
|
|