no message

git-svn-id: https://svn.coded.pt/svn/SIPRP@264 bb69d46d-e84e-40c8-a05a-06db0d633741
0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Frederico Palma 20 years ago
parent f49fd9fbb0
commit d7941ac84f

@ -0,0 +1,26 @@
/*
* MedicinaConstants.java
*
* Created on 6 de Julho de 2006, 15:22
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package siprp.medicina;
/**
*
* @author fpalma
*/
public interface MedicinaConstants
{
public static final int MOTIVO_ADMISSAO = 1;
public static final Integer MOTIVO_ADMISSAO_INTEGER = new Integer( MOTIVO_ADMISSAO );
public static final int MOTIVO_PERIODICO = 2;
public static final Integer MOTIVO_PERIODICO_INTEGER = new Integer( MOTIVO_PERIODICO );
public static final int MOTIVO_OCASIONAL = 3;
public static final Integer MOTIVO_OCASIONAL_INTEGER = new Integer( MOTIVO_OCASIONAL );
public static final int MOTIVO_PERIODICO_INICIAL = 5;
public static final Integer MOTIVO_PERIODICO_INICIAL_INTEGER = new Integer( MOTIVO_PERIODICO_INICIAL );
}

@ -27,6 +27,7 @@ import siprp.data.*;
* @author fpalma
*/
public class MedicinaDataProvider extends MetaProvider
implements MedicinaConstants
{
public static final int ESTADO_POR_REALIZAR = 0;
public static final int ESTADO_PARCIALMENTE_REALIZADO = 1;
@ -292,13 +293,22 @@ public class MedicinaDataProvider extends MetaProvider
public Integer getConsultaIDByTrabalhadorMotivoAndDate( Integer trabalhadorID, Integer motivo, Date data )
throws Exception
{
Integer motivos[];
if( motivo != null && ( motivo.intValue() == MOTIVO_PERIODICO || motivo.intValue() == MOTIVO_PERIODICO_INICIAL ) )
{
motivos = new Integer[]{ MOTIVO_PERIODICO_INTEGER, MOTIVO_PERIODICO_INICIAL_INTEGER };
}
else
{
motivos = new Integer[]{ motivo };
}
Select select =
new Select( new String[]{ "marcacoes_trabalhador" },
new String[]{ "id" },
new Field( "trabalhador_id" ).isEqual( trabalhadorID ).and(
new Field( "tipo" ).isEqual( new Integer( Marcacao.TIPO_MARCACAO_TRABALHADOR_CONSULTA ) ) ).and(
new Field( "data" ).isEqual( data ) ).and(
new Field( "motivo" ).isEqual( motivo ) ) );
new Field( "motivo" ).in( motivos ) ) );
Virtual2DArray array = executer.executeQuery( select );
Integer id;
if( array.columnLength() == 0 || array.get( 0, 0 ) == null )

Loading…
Cancel
Save