|
|
|
|
@ -18,6 +18,7 @@ import org.apache.velocity.app.*;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.evolute.utils.arrays.*;
|
|
|
|
|
import com.evolute.utils.db.*;
|
|
|
|
|
import com.evolute.utils.sql.*;
|
|
|
|
|
import com.evolute.utils.strings.*;
|
|
|
|
|
/**
|
|
|
|
|
@ -69,7 +70,7 @@ public class doGetListaTrabalhadoresTudo
|
|
|
|
|
// + " AND ( proximo_exame IS NULL OR proximo_exame - current_date > 14 )"
|
|
|
|
|
// + " ORDER BY nome" );
|
|
|
|
|
dbQuery.append( "SELECT trabalhadores.id, trabalhadores.nome, "
|
|
|
|
|
+ "marcacoes_trabalhador.tipo, marcacoes_trabalhador.data, marcacoes_trabalhador.realizada, "
|
|
|
|
|
+ "marcacoes_trabalhador.tipo, marcacoes_trabalhador.data, marcacoes_trabalhador.estado, "
|
|
|
|
|
+ " trabalhadores.nome_plain "
|
|
|
|
|
+ "FROM trabalhadores, marcacoes_trabalhador "
|
|
|
|
|
+ "WHERE estabelecimento_id = " + estabelecimentoId
|
|
|
|
|
@ -98,9 +99,6 @@ public class doGetListaTrabalhadoresTudo
|
|
|
|
|
verificarTrabalhador( listaConsultas, listaExames ) )
|
|
|
|
|
{
|
|
|
|
|
temp=""+rs.get(index - 1,0); // converter de int para String
|
|
|
|
|
dbQuery = new StringBuffer();
|
|
|
|
|
dbQuery.append("/"+super.servletName+"/?"+empresaId+"/"+estabelecimentoId+"/"+temp); // construir url
|
|
|
|
|
links.add(dbQuery.toString());
|
|
|
|
|
java.util.Date dataUltimaConsulta = null;
|
|
|
|
|
for( int c = 0; c < listaConsultas.length; c++ )
|
|
|
|
|
{
|
|
|
|
|
@ -110,7 +108,14 @@ public class doGetListaTrabalhadoresTudo
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
desc.add( criarDadosTrabalhador( con, trabalhadorID, nomeTrabalhador, dataUltimaConsulta ) );
|
|
|
|
|
HashMap dadosTrabalhador = criarDadosTrabalhador( trabalhadorID, nomeTrabalhador, dataUltimaConsulta );
|
|
|
|
|
if( dadosTrabalhador != null )
|
|
|
|
|
{
|
|
|
|
|
dbQuery = new StringBuffer();
|
|
|
|
|
dbQuery.append("/"+super.servletName+"/?"+empresaId+"/"+estabelecimentoId+"/"+temp); // construir url
|
|
|
|
|
links.add(dbQuery.toString());
|
|
|
|
|
desc.add( dadosTrabalhador );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
exames.clear();
|
|
|
|
|
consultas.clear();
|
|
|
|
|
@ -221,9 +226,10 @@ public class doGetListaTrabalhadoresTudo
|
|
|
|
|
return estadoConsultas && estadoExames;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected HashMap criarDadosTrabalhador( Connection con, Integer id, String nome, java.util.Date ultimaConsulta )
|
|
|
|
|
protected HashMap criarDadosTrabalhador( Integer id, String nome, java.util.Date ultimaConsulta )
|
|
|
|
|
throws Exception
|
|
|
|
|
{
|
|
|
|
|
Executer executer = getExecuter();
|
|
|
|
|
HashMap trabalhador = new HashMap();
|
|
|
|
|
trabalhador.put( "Nome", nome );
|
|
|
|
|
Select select =
|
|
|
|
|
@ -232,13 +238,15 @@ public class doGetListaTrabalhadoresTudo
|
|
|
|
|
new Field( "data" ).isGreaterOrEqual( ultimaConsulta ) ),
|
|
|
|
|
new String[]{ "data" }, null );
|
|
|
|
|
|
|
|
|
|
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
|
|
|
|
ResultSet2DArray rs = new ResultSet2DArray( stmt.executeQuery( select.toString() ) );
|
|
|
|
|
// Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
|
|
|
|
// ResultSet2DArray rs = new ResultSet2DArray( stmt.executeQuery( select.toString() ) );
|
|
|
|
|
Virtual2DArray rs = executer.executeQuery( select );
|
|
|
|
|
Object data_ficha = rs.columnLength() > 0 ? rs.get( 0, 0 ) : null;
|
|
|
|
|
stmt.close();
|
|
|
|
|
// stmt.close();
|
|
|
|
|
if( data_ficha == null )
|
|
|
|
|
{
|
|
|
|
|
data_ficha = "";
|
|
|
|
|
return null;
|
|
|
|
|
// data_ficha = "";
|
|
|
|
|
}
|
|
|
|
|
trabalhador.put( "Data", data_ficha );
|
|
|
|
|
return trabalhador;
|
|
|
|
|
|