diff --git a/trunk/SIPRPSoft/src/siprp/SIPRPTracker.java b/trunk/SIPRPSoft/src/siprp/SIPRPTracker.java index 15087810..b7385814 100644 --- a/trunk/SIPRPSoft/src/siprp/SIPRPTracker.java +++ b/trunk/SIPRPSoft/src/siprp/SIPRPTracker.java @@ -72,7 +72,7 @@ public class SIPRPTracker extends WindowTracker implements SHSTTrackerInterface /** Creates a new instance of SIPRPTracker */ public SIPRPTracker( AvisosPanel avisosP ) { - Singleton.setInstance( SHSTPropertiesConstants.SHST_TRACKER /*SingletonConstants.SIPRP_TRACKER*/, this ); + Singleton.setInstance( SHSTPropertiesConstants.SHST_TRACKER, this ); Singleton.setInstance( Singleton.TRACKER, this ); this.avisos = avisosP; avisos.setTracker( this ); @@ -80,10 +80,10 @@ public class SIPRPTracker extends WindowTracker implements SHSTTrackerInterface DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode( Singleton.getInstance( SHSTPropertiesConstants.COMPANY_ACRONYM ) ); - boolean hasFicha = ( (Boolean)Singleton.getInstance( SHSTPropertiesConstants.MODULE_FICHA ) ).booleanValue(); - boolean hasGestao = ( (Boolean)Singleton.getInstance( SHSTPropertiesConstants.MODULE_CLIENTES ) ).booleanValue(); - boolean hasRelatorio = ( (Boolean)Singleton.getInstance( SHSTPropertiesConstants.MODULE_RELATORIO ) ).booleanValue(); - boolean hasListagens = ( (Boolean)Singleton.getInstance( SHSTPropertiesConstants.MODULE_LISTAGENS ) ).booleanValue(); + boolean hasFicha = ( (Boolean) Singleton.getInstance( SHSTPropertiesConstants.MODULE_FICHA ) ).booleanValue(); + boolean hasGestao = ( (Boolean) Singleton.getInstance( SHSTPropertiesConstants.MODULE_CLIENTES ) ).booleanValue(); + boolean hasRelatorio = ( (Boolean) Singleton.getInstance( SHSTPropertiesConstants.MODULE_RELATORIO ) ).booleanValue(); + boolean hasListagens = ( (Boolean) Singleton.getInstance( SHSTPropertiesConstants.MODULE_LISTAGENS ) ).booleanValue(); boolean hasCursos = SIPRPPropertiesLoader.getInstance().findProperty( SHSTPropertiesConstants.MODULE_CURSOS, true ); if( hasGestao ) @@ -116,7 +116,7 @@ public class SIPRPTracker extends WindowTracker implements SHSTTrackerInterface DefaultMutableTreeNode fichaNode = new DefaultMutableTreeNode( 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() throws Exception { diff --git a/trunk/SIPRPSoft/src/siprp/ficha/FichaWindow.java b/trunk/SIPRPSoft/src/siprp/ficha/FichaWindow.java index 7ef858e6..444829b2 100644 --- a/trunk/SIPRPSoft/src/siprp/ficha/FichaWindow.java +++ b/trunk/SIPRPSoft/src/siprp/ficha/FichaWindow.java @@ -36,10 +36,10 @@ import shst.data.outer.ExamesData; import shst.data.outer.MedicosData; import shst.data.outer.TrabalhadoresData; import shst.importer.Importer; +import shst.lembretes.LembretesDataProvider; import shst.medicina.MarcacoesMedicinaHandler; import shst.printer.Printer; import siprp.FichaDataProvider; -import siprp.lembretes.LembretesDataProvider; import siprp.ui.SIPRPTabbedWindow; import com.evolute.entity.ProviderInterface; @@ -263,13 +263,6 @@ public class FichaWindow extends SIPRPTabbedWindow implements ListAction, FichaA public boolean save( int index ) { - new ProgressDialog( this, "A gravar...", - new Runnable(){ - public void run() - { - - } - }); StringBuilder msg = new StringBuilder(); MedicosData medico; try @@ -323,17 +316,11 @@ public class FichaWindow extends SIPRPTabbedWindow implements ListAction, FichaA com.evolute.utils.strings.StringPlainer.convertString( ( String ) 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.OBSERVACOES, observacoes ); trabalhador.set( TrabalhadoresData.NOME_PLAIN, com.evolute.utils.strings.StringPlainer.convertString( ( String ) 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_TRABALHADOR_ID, trabalhador ); @@ -349,16 +336,8 @@ public class FichaWindow extends SIPRPTabbedWindow implements ListAction, FichaA try { - // lflores - disable FO for now - - -// System.out.println( "FO sz: " + fo.length ); exame.set( ExamesData.FO, fo ); exame.set( ExamesData.PDF, createPDF( exame ) ); - -// empresa.save(); -// estabelecimento.save(); - exame.save(); trabalhador.save(); try @@ -372,11 +351,6 @@ public class FichaWindow extends SIPRPTabbedWindow implements ListAction, FichaA 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 ); try { @@ -390,21 +364,21 @@ public class FichaWindow extends SIPRPTabbedWindow implements ListAction, FichaA { iex.printStackTrace(); } - Integer motivoProximoExame = (Integer) exame.get( ExamesData.TIPO ); - if ( motivoProximoExame != null && motivoProximoExame.equals( new Integer( FichaAptidaoConstants.CODIGO_TIPO_OCASIONAL ) ) ) - { - Date proximoExameDate = (Date) exame.get( ExamesData.PROXIMO_EXAME ); - if( proximoExameDate != null && proximoExameDate.getTime() > 0 ) - { - Calendar whenCal = Calendar.getInstance(); - whenCal.setTime( proximoExameDate ); - whenCal.add( Calendar.MONTH, -2 ); - Date now = new Date(); - Date when = whenCal.getTime(); - lembretesProvider.criarLembreteFicha( exame, now.after( when ) ? now : when ); - System.out.println(new Date() + ": A criar lembrete"); - } - } +// Integer motivoProximoExame = (Integer) exame.get( ExamesData.TIPO ); +// if ( motivoProximoExame != null && motivoProximoExame.equals( new Integer( FichaAptidaoConstants.CODIGO_TIPO_OCASIONAL ) ) ) +// { +// Date proximoExameDate = (Date) exame.get( ExamesData.PROXIMO_EXAME ); +// if( proximoExameDate != null && proximoExameDate.getTime() > 0 ) +// { +// Calendar whenCal = Calendar.getInstance(); +// whenCal.setTime( proximoExameDate ); +// whenCal.add( Calendar.MONTH, -2 ); +// Date now = new Date(); +// Date when = whenCal.getTime(); +// lembretesProvider.criarLembreteFicha( exame, now.after( when ) ? now : when ); +// System.out.println(new Date() + ": A criar lembrete"); +// } +// } // createPDF( exame ); // print(); }