|
|
|
|
@ -47,10 +47,10 @@ public class doGetTrabalhador extends siprpServlet
|
|
|
|
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
|
|
|
|
rs = new ResultSet2DArray( stmt.executeQuery( dbQuery.toString()) );
|
|
|
|
|
|
|
|
|
|
// int index=0;
|
|
|
|
|
// int max = super.trabalhadorDescFields.length;
|
|
|
|
|
// int index=0;
|
|
|
|
|
// int max = super.trabalhadorDescFields.length;
|
|
|
|
|
|
|
|
|
|
HashMap hmFuncionario = new HashMap();
|
|
|
|
|
HashMap hmFuncionario = new HashMap();
|
|
|
|
|
if( rs.columnLength() > 0 )
|
|
|
|
|
{
|
|
|
|
|
String tmp;
|
|
|
|
|
@ -89,65 +89,65 @@ HashMap hmFuncionario = new HashMap();
|
|
|
|
|
hmFuncionario.put( "proxima_consulta", rs.get( 0, "proxima_consulta" ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// while ( index < max )
|
|
|
|
|
// {
|
|
|
|
|
// dbQuery = new StringBuffer();
|
|
|
|
|
// dbQuery.append( " SELECT "+super.trabalhadorDescFields[index][1]+" FROM trabalhadores where id='"+trabalhadorId+"'");
|
|
|
|
|
// stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
|
|
|
|
// rs = new ResultSet2DArray( stmt.executeQuery( dbQuery.toString()) );
|
|
|
|
|
// names.add(trabalhadorDescFields[index][0]);
|
|
|
|
|
//
|
|
|
|
|
// if (rs.get(0,0) == null )
|
|
|
|
|
// {
|
|
|
|
|
// values.add(super.bdNullString);
|
|
|
|
|
// }
|
|
|
|
|
// else
|
|
|
|
|
// {
|
|
|
|
|
//// values.add(rs.get(0,0).toString());
|
|
|
|
|
// temp=rs.get(0,0).toString();
|
|
|
|
|
//
|
|
|
|
|
// if ( temp.equals("n") )
|
|
|
|
|
// {
|
|
|
|
|
// temp="n\u00E3o";
|
|
|
|
|
// }
|
|
|
|
|
// else if ( temp.equals("y") )
|
|
|
|
|
// {
|
|
|
|
|
// temp="sim";
|
|
|
|
|
// }
|
|
|
|
|
// values.add(temp); }
|
|
|
|
|
//
|
|
|
|
|
// ++index;
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// while ( index < max )
|
|
|
|
|
// {
|
|
|
|
|
// dbQuery = new StringBuffer();
|
|
|
|
|
// dbQuery.append( " SELECT "+super.trabalhadorDescFields[index][1]+" FROM trabalhadores where id='"+trabalhadorId+"'");
|
|
|
|
|
// stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
|
|
|
|
// rs = new ResultSet2DArray( stmt.executeQuery( dbQuery.toString()) );
|
|
|
|
|
// names.add(trabalhadorDescFields[index][0]);
|
|
|
|
|
//
|
|
|
|
|
// if (rs.get(0,0) == null )
|
|
|
|
|
// {
|
|
|
|
|
// values.add(super.bdNullString);
|
|
|
|
|
// }
|
|
|
|
|
// else
|
|
|
|
|
// {
|
|
|
|
|
//// values.add(rs.get(0,0).toString());
|
|
|
|
|
// temp=rs.get(0,0).toString();
|
|
|
|
|
//
|
|
|
|
|
// if ( temp.equals("n") )
|
|
|
|
|
// {
|
|
|
|
|
// temp="n\u00E3o";
|
|
|
|
|
// }
|
|
|
|
|
// else if ( temp.equals("y") )
|
|
|
|
|
// {
|
|
|
|
|
// temp="sim";
|
|
|
|
|
// }
|
|
|
|
|
// values.add(temp); }
|
|
|
|
|
//
|
|
|
|
|
// ++index;
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
stmt.close();
|
|
|
|
|
|
|
|
|
|
sBuffer = new StringBuffer();
|
|
|
|
|
sBuffer.append("<b>"+super.nomeEmpresa(con,empresaId)+"</b><br><br><i>"
|
|
|
|
|
+super.nomeEstabelecimento(con, estabelecimentoId)+"</i>" );
|
|
|
|
|
|
|
|
|
|
HashMap hmValues = new HashMap();
|
|
|
|
|
hmValues.put( "empresa_nome", session.getAttribute( sessionCompanyName ) );
|
|
|
|
|
hmValues.put( "empresa_id", session.getAttribute( sessionEmpresaId ) );
|
|
|
|
|
hmValues.put( "estabelecimento_nome", super.nomeEstabelecimento( con, estabelecimentoId ) );
|
|
|
|
|
|
|
|
|
|
/*Dados para marcacao de consulta/exame*/
|
|
|
|
|
session.setAttribute( "session_estabelecimento_nome", hmValues.get( "estabelecimento_nome" ) );
|
|
|
|
|
session.setAttribute( "session_funcionario_nome", hmFuncionario.get( "nome" ) );
|
|
|
|
|
session.setAttribute( "session_funcionario_numero", hmFuncionario.get( "numero" ) );
|
|
|
|
|
|
|
|
|
|
hmValues.put( "estabelecimento_id", estabelecimentoId );
|
|
|
|
|
hmValues.put( "userRole", userRole );
|
|
|
|
|
hmValues.put( "userName", session.getAttribute( sessionUser ) );
|
|
|
|
|
hmValues.put( msgTemplate , sBuffer.toString() ) ;
|
|
|
|
|
hmValues.put( templateUserRole, userRole);
|
|
|
|
|
hmValues.put( templateQuery, super.queryStringTrabalhador );
|
|
|
|
|
hmValues.put( "funcionario", hmFuncionario );
|
|
|
|
|
//hmValues.put( templateVector1,names);
|
|
|
|
|
//hmValues.put( templateVector2,values);
|
|
|
|
|
//hmValues.put( templateVector3,null);
|
|
|
|
|
out.println( mergeTemplate( hmValues, super.authenticatedUserTemplate));
|
|
|
|
|
|
|
|
|
|
// out.println( mergeTemplate( sBuffer.toString(), userRole, super.queryStringTrabalhador, names, values, null, super.authenticatedUserTemplate) );
|
|
|
|
|
HashMap hmValues = new HashMap();
|
|
|
|
|
hmValues.put( "empresa_nome", session.getAttribute( sessionCompanyName ) );
|
|
|
|
|
hmValues.put( "empresa_id", session.getAttribute( sessionEmpresaId ) );
|
|
|
|
|
hmValues.put( "estabelecimento_nome", super.nomeEstabelecimento( con, estabelecimentoId ) );
|
|
|
|
|
|
|
|
|
|
/*Dados para marcacao de consulta/exame*/
|
|
|
|
|
session.setAttribute( "session_estabelecimento_nome", hmValues.get( "estabelecimento_nome" ) );
|
|
|
|
|
session.setAttribute( "session_funcionario_nome", hmFuncionario.get( "nome" ) );
|
|
|
|
|
session.setAttribute( "session_funcionario_numero", hmFuncionario.get( "numero" ) );
|
|
|
|
|
|
|
|
|
|
hmValues.put( "estabelecimento_id", estabelecimentoId );
|
|
|
|
|
hmValues.put( "userRole", userRole );
|
|
|
|
|
hmValues.put( "userName", session.getAttribute( sessionUser ) );
|
|
|
|
|
hmValues.put( msgTemplate , sBuffer.toString() ) ;
|
|
|
|
|
hmValues.put( templateUserRole, userRole);
|
|
|
|
|
hmValues.put( templateQuery, super.queryStringTrabalhador );
|
|
|
|
|
hmValues.put( "funcionario", hmFuncionario );
|
|
|
|
|
//hmValues.put( templateVector1,names);
|
|
|
|
|
//hmValues.put( templateVector2,values);
|
|
|
|
|
//hmValues.put( templateVector3,null);
|
|
|
|
|
out.println( mergeTemplate( hmValues, super.authenticatedUserTemplate));
|
|
|
|
|
|
|
|
|
|
// out.println( mergeTemplate( sBuffer.toString(), userRole, super.queryStringTrabalhador, names, values, null, super.authenticatedUserTemplate) );
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
|