git-svn-id: https://svn.coded.pt/svn/SIPRP@1501 bb69d46d-e84e-40c8-a05a-06db0d633741

lxbfYeaa
Tiago Simão 15 years ago
parent bf7418fe3c
commit 48a0422ba5

@ -72,7 +72,7 @@ public class SIPRPTracker extends WindowTracker implements SHSTTrackerInterface
/** Creates a new instance of SIPRPTracker */ /** Creates a new instance of SIPRPTracker */
public SIPRPTracker( AvisosPanel avisosP ) public SIPRPTracker( AvisosPanel avisosP )
{ {
Singleton.setInstance( SHSTPropertiesConstants.SHST_TRACKER /*SingletonConstants.SIPRP_TRACKER*/, this ); Singleton.setInstance( SHSTPropertiesConstants.SHST_TRACKER, this );
Singleton.setInstance( Singleton.TRACKER, this ); Singleton.setInstance( Singleton.TRACKER, this );
this.avisos = avisosP; this.avisos = avisosP;
avisos.setTracker( this ); avisos.setTracker( this );
@ -80,10 +80,10 @@ public class SIPRPTracker extends WindowTracker implements SHSTTrackerInterface
DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode( DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode(
Singleton.getInstance( SHSTPropertiesConstants.COMPANY_ACRONYM ) ); Singleton.getInstance( SHSTPropertiesConstants.COMPANY_ACRONYM ) );
boolean hasFicha = ( (Boolean)Singleton.getInstance( SHSTPropertiesConstants.MODULE_FICHA ) ).booleanValue(); boolean hasFicha = ( (Boolean) Singleton.getInstance( SHSTPropertiesConstants.MODULE_FICHA ) ).booleanValue();
boolean hasGestao = ( (Boolean)Singleton.getInstance( SHSTPropertiesConstants.MODULE_CLIENTES ) ).booleanValue(); boolean hasGestao = ( (Boolean) Singleton.getInstance( SHSTPropertiesConstants.MODULE_CLIENTES ) ).booleanValue();
boolean hasRelatorio = ( (Boolean)Singleton.getInstance( SHSTPropertiesConstants.MODULE_RELATORIO ) ).booleanValue(); boolean hasRelatorio = ( (Boolean) Singleton.getInstance( SHSTPropertiesConstants.MODULE_RELATORIO ) ).booleanValue();
boolean hasListagens = ( (Boolean)Singleton.getInstance( SHSTPropertiesConstants.MODULE_LISTAGENS ) ).booleanValue(); boolean hasListagens = ( (Boolean) Singleton.getInstance( SHSTPropertiesConstants.MODULE_LISTAGENS ) ).booleanValue();
boolean hasCursos = SIPRPPropertiesLoader.getInstance().findProperty( SHSTPropertiesConstants.MODULE_CURSOS, true ); boolean hasCursos = SIPRPPropertiesLoader.getInstance().findProperty( SHSTPropertiesConstants.MODULE_CURSOS, true );
if( hasGestao ) if( hasGestao )
@ -116,7 +116,7 @@ public class SIPRPTracker extends WindowTracker implements SHSTTrackerInterface
DefaultMutableTreeNode fichaNode = new DefaultMutableTreeNode( FICHA_APTIDAO ); DefaultMutableTreeNode fichaNode = new DefaultMutableTreeNode( FICHA_APTIDAO );
fichaNode.add( new DefaultMutableTreeNode( CRIACAO_FICHA_APTIDAO ) ); fichaNode.add( new DefaultMutableTreeNode( CRIACAO_FICHA_APTIDAO ) );
creators.put( CRIACAO_FICHA_APTIDAO, new WindowCreator() { creators.put( CRIACAO_FICHA_APTIDAO, new WindowCreator(){
public TrackableWindow create() public TrackableWindow create()
throws Exception throws Exception
{ {

@ -36,10 +36,10 @@ import shst.data.outer.ExamesData;
import shst.data.outer.MedicosData; import shst.data.outer.MedicosData;
import shst.data.outer.TrabalhadoresData; import shst.data.outer.TrabalhadoresData;
import shst.importer.Importer; import shst.importer.Importer;
import shst.lembretes.LembretesDataProvider;
import shst.medicina.MarcacoesMedicinaHandler; import shst.medicina.MarcacoesMedicinaHandler;
import shst.printer.Printer; import shst.printer.Printer;
import siprp.FichaDataProvider; import siprp.FichaDataProvider;
import siprp.lembretes.LembretesDataProvider;
import siprp.ui.SIPRPTabbedWindow; import siprp.ui.SIPRPTabbedWindow;
import com.evolute.entity.ProviderInterface; import com.evolute.entity.ProviderInterface;
@ -263,13 +263,6 @@ public class FichaWindow extends SIPRPTabbedWindow implements ListAction, FichaA
public boolean save( int index ) public boolean save( int index )
{ {
new ProgressDialog( this, "A gravar...",
new Runnable(){
public void run()
{
}
});
StringBuilder msg = new StringBuilder(); StringBuilder msg = new StringBuilder();
MedicosData medico; MedicosData medico;
try try
@ -323,17 +316,11 @@ public class FichaWindow extends SIPRPTabbedWindow implements ListAction, FichaA
com.evolute.utils.strings.StringPlainer.convertString( ( String ) com.evolute.utils.strings.StringPlainer.convertString( ( String )
estabelecimento.get( EstabelecimentosData.NOME ) ) ); estabelecimento.get( EstabelecimentosData.NOME ) ) );
// trabalhador.setProperty( FichaDataProvider.R_TRABALHADOR_ESTABELECIMENTO, estabelecimento );
// trabalhador.setProperty( FichaDataProvider.OBSERVACOES, observacoesPanel.save() );
trabalhador.set( TrabalhadoresData.TO_ESTABELECIMENTO_ID, estabelecimento ); trabalhador.set( TrabalhadoresData.TO_ESTABELECIMENTO_ID, estabelecimento );
trabalhador.set( TrabalhadoresData.OBSERVACOES, observacoes ); trabalhador.set( TrabalhadoresData.OBSERVACOES, observacoes );
trabalhador.set( TrabalhadoresData.NOME_PLAIN, trabalhador.set( TrabalhadoresData.NOME_PLAIN,
com.evolute.utils.strings.StringPlainer.convertString( ( String ) com.evolute.utils.strings.StringPlainer.convertString( ( String )
trabalhador.get( TrabalhadoresData.NOME ) ) ); trabalhador.get( TrabalhadoresData.NOME ) ) );
// exame.setProperty( FichaDataProvider.R_EXAME_MEDICO, medico );
// exame.setProperty( FichaDataProvider.R_EXAME_TRABALHADOR, trabalhador );
exame.set( ExamesData.TO_MEDICO_ID, medico ); exame.set( ExamesData.TO_MEDICO_ID, medico );
exame.set( ExamesData.TO_TRABALHADOR_ID, trabalhador ); exame.set( ExamesData.TO_TRABALHADOR_ID, trabalhador );
@ -349,16 +336,8 @@ public class FichaWindow extends SIPRPTabbedWindow implements ListAction, FichaA
try try
{ {
// lflores - disable FO for now
// System.out.println( "FO sz: " + fo.length );
exame.set( ExamesData.FO, fo ); exame.set( ExamesData.FO, fo );
exame.set( ExamesData.PDF, createPDF( exame ) ); exame.set( ExamesData.PDF, createPDF( exame ) );
// empresa.save();
// estabelecimento.save();
exame.save(); exame.save();
trabalhador.save(); trabalhador.save();
try try
@ -372,11 +351,6 @@ public class FichaWindow extends SIPRPTabbedWindow implements ListAction, FichaA
catch( Exception mex ) catch( Exception mex )
{ {
} }
// fdpProvider.savePDF( exame );
// DBKey key = trabalhador.getPrimaryKeyValue();
// DBField fields[] = FichaDataProvider.TRABALHADORES.getPrimaryKey();
// trabalhadorID = new Integer( ((Number)key.getFieldValue( fields[ 0 ] )).intValue() );
trabalhadorID = ( Integer ) trabalhador.get( TrabalhadoresData.ID ); trabalhadorID = ( Integer ) trabalhador.get( TrabalhadoresData.ID );
try try
{ {
@ -390,21 +364,21 @@ public class FichaWindow extends SIPRPTabbedWindow implements ListAction, FichaA
{ {
iex.printStackTrace(); iex.printStackTrace();
} }
Integer motivoProximoExame = (Integer) exame.get( ExamesData.TIPO ); // Integer motivoProximoExame = (Integer) exame.get( ExamesData.TIPO );
if ( motivoProximoExame != null && motivoProximoExame.equals( new Integer( FichaAptidaoConstants.CODIGO_TIPO_OCASIONAL ) ) ) // if ( motivoProximoExame != null && motivoProximoExame.equals( new Integer( FichaAptidaoConstants.CODIGO_TIPO_OCASIONAL ) ) )
{ // {
Date proximoExameDate = (Date) exame.get( ExamesData.PROXIMO_EXAME ); // Date proximoExameDate = (Date) exame.get( ExamesData.PROXIMO_EXAME );
if( proximoExameDate != null && proximoExameDate.getTime() > 0 ) // if( proximoExameDate != null && proximoExameDate.getTime() > 0 )
{ // {
Calendar whenCal = Calendar.getInstance(); // Calendar whenCal = Calendar.getInstance();
whenCal.setTime( proximoExameDate ); // whenCal.setTime( proximoExameDate );
whenCal.add( Calendar.MONTH, -2 ); // whenCal.add( Calendar.MONTH, -2 );
Date now = new Date(); // Date now = new Date();
Date when = whenCal.getTime(); // Date when = whenCal.getTime();
lembretesProvider.criarLembreteFicha( exame, now.after( when ) ? now : when ); // lembretesProvider.criarLembreteFicha( exame, now.after( when ) ? now : when );
System.out.println(new Date() + ": A criar lembrete"); // System.out.println(new Date() + ": A criar lembrete");
} // }
} // }
// createPDF( exame ); // createPDF( exame );
// print(); // print();
} }

Loading…
Cancel
Save