|
|
|
|
@ -19,6 +19,8 @@ import com.evolute.utils.ui.search.*;
|
|
|
|
|
import com.evolute.utils.sql.*;
|
|
|
|
|
import com.evolute.utils.strings.*;
|
|
|
|
|
|
|
|
|
|
import siprp.data.*;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* @author pars
|
|
|
|
|
@ -523,4 +525,37 @@ public class FichaDataProvider extends MetaProvider implements SearchExecuter {
|
|
|
|
|
return objects;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Object[] getDadosUltimaMarcacao( Integer trabalhadorID )
|
|
|
|
|
throws Exception
|
|
|
|
|
{
|
|
|
|
|
Select select =
|
|
|
|
|
new Select( new String[]{ "marcacoes_trabalhador" },
|
|
|
|
|
new String[]{ "MAX( data )" },
|
|
|
|
|
new Field( "trabalhador_id" ).isEqual( trabalhadorID ).and(
|
|
|
|
|
new Field( "tipo" ).isEqual( Marcacao.TIPO_MARCACAO_TRABALHADOR_CONSULTA ) ).and(
|
|
|
|
|
new Field( "realizada" ).isEqual( "y" ).or(
|
|
|
|
|
new Field( "estado" ).isEqual( new Integer( 2 ) ) ) ) );
|
|
|
|
|
Virtual2DArray array = executer.executeQuery( select );
|
|
|
|
|
if( array.columnLength() == 0 || array.get( 0, 0 ) == null )
|
|
|
|
|
{
|
|
|
|
|
return new Object[]{ null, null };
|
|
|
|
|
}
|
|
|
|
|
Date data = ( Date ) array.get( 0, 0 );
|
|
|
|
|
select =
|
|
|
|
|
new Select( new String[]{ "marcacoes_trabalhador" },
|
|
|
|
|
new String[]{ "motivo", "id" },
|
|
|
|
|
new Field( "data" ).isEqual( data ).and(
|
|
|
|
|
new Field( "trabalhador_id" ).isEqual( trabalhadorID ) ).and(
|
|
|
|
|
new Field( "tipo" ).isEqual( Marcacao.TIPO_MARCACAO_TRABALHADOR_CONSULTA ) ).and(
|
|
|
|
|
new Field( "realizada" ).isEqual( "y" ).or(
|
|
|
|
|
new Field( "estado" ).isEqual( new Integer( 2 ) ) ) ),
|
|
|
|
|
new String[]{ "id" }, null );
|
|
|
|
|
array = executer.executeQuery( select );
|
|
|
|
|
Integer tipo = ( Integer ) array.get( 0, 0 );
|
|
|
|
|
if( tipo.intValue() == 5 )
|
|
|
|
|
{
|
|
|
|
|
tipo = new Integer( 2 );
|
|
|
|
|
}
|
|
|
|
|
return new Object[]{ data, tipo };
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|