devel cursos

git-svn-id: https://svn.coded.pt/svn/SIPRP@1360 bb69d46d-e84e-40c8-a05a-06db0d633741
lxbfYeaa
Luis Flores 15 years ago
parent 0af1a53191
commit dc796fd689

Binary file not shown.

@ -4,14 +4,13 @@ app.main-class = siprp.Main
app.main = siprp.Main app.main = siprp.Main
db.url.prefix = jdbc:postgresql:// db.url.prefix = jdbc:postgresql://
db.user = postgres db.user = siprp
db.password = Typein db.password = rg2h-opksiprp
#rg2h-opksiprp db.name = siprp_local_3
db.name = siprp_local_3_20100713
db.connection.driver = org.postgresql.Driver db.connection.driver = org.postgresql.Driver
jnlp.resources.property.server.address = evoserver jnlp.resources.property.server.address = www.evolute.pt
jnlp.resources.property.server.port = 5432 jnlp.resources.property.server.port = 5436
app.resources.j2se.max-heap-size=512m app.resources.j2se.max-heap-size=512m
app.resources.j2se.initial-heap-size=256m app.resources.j2se.initial-heap-size=256m

@ -8,7 +8,6 @@ package siprp;
import java.text.DateFormat; import java.text.DateFormat;
import java.util.Date; import java.util.Date;
import java.util.Hashtable;
import siprp.data.AvisoConstants; import siprp.data.AvisoConstants;
import siprp.data.Marcacao; import siprp.data.Marcacao;
@ -18,7 +17,6 @@ import com.evolute.utils.Singleton;
import com.evolute.utils.arrays.Virtual2DArray; import com.evolute.utils.arrays.Virtual2DArray;
import com.evolute.utils.data.IDObject; import com.evolute.utils.data.IDObject;
import com.evolute.utils.data.MappableObject; import com.evolute.utils.data.MappableObject;
import com.evolute.utils.db.DBException;
import com.evolute.utils.db.DBManager; import com.evolute.utils.db.DBManager;
import com.evolute.utils.db.Executer; import com.evolute.utils.db.Executer;
import com.evolute.utils.sql.Assignment; import com.evolute.utils.sql.Assignment;
@ -30,6 +28,8 @@ import com.evolute.utils.sql.Update;
import com.evolute.utils.strings.StringPlainer; import com.evolute.utils.strings.StringPlainer;
import com.evolute.utils.ui.search.SearchDialog; import com.evolute.utils.ui.search.SearchDialog;
import com.evolute.utils.ui.search.SearchExecuter; import com.evolute.utils.ui.search.SearchExecuter;
import java.util.HashMap;
import java.util.Map;
/** /**
* *
@ -180,10 +180,10 @@ public class FichaDataProvider
private int SEARCH_TRABALHADORES_ID = -1; private int SEARCH_TRABALHADORES_ID = -1;
private int SEARCH_EXAMES_ID = -1; private int SEARCH_EXAMES_ID = -1;
protected final Hashtable medicosEstabelecimentosHash = new Hashtable(); protected final Map<Integer,Integer> medicosEstabelecimentosHash = new HashMap<Integer,Integer>();
/** Creates a new instance of FichaDataProvider */ /** Creates a new instance of FichaDataProvider */
public FichaDataProvider() private FichaDataProvider()
throws Exception throws Exception
{ {
DBManager dbm = ( DBManager ) Singleton.getInstance( Singleton.DEFAULT_DBMANAGER /*SingletonConstants.DBMANAGER*/ ); DBManager dbm = ( DBManager ) Singleton.getInstance( Singleton.DEFAULT_DBMANAGER /*SingletonConstants.DBMANAGER*/ );
@ -687,7 +687,7 @@ public class FichaDataProvider
public void setMedicoForEstabelecimento( Integer estabelecimentoID, Integer medicoID ) public void setMedicoForEstabelecimento( Integer estabelecimentoID, Integer medicoID )
throws Exception throws Exception
{ {
Integer medicoAntigo = ( Integer ) medicosEstabelecimentosHash.get( estabelecimentoID ); Integer medicoAntigo = medicosEstabelecimentosHash.get( estabelecimentoID );
if( !medicoID.equals( medicoAntigo ) ) if( !medicoID.equals( medicoAntigo ) )
{ {
Update update = Update update =
@ -721,11 +721,10 @@ public class FichaDataProvider
} }
public Long countTrabalhadoresActivosForEmpresa( Integer empresaID ) public Long countTrabalhadoresActivosForEmpresa( Integer empresaID )
throws Exception
{ {
Long result = 0L; Long result = 0L;
try Select2 query = new Select2( new String[]{ "trabalhadores", "estabelecimentos", "empresas" },
{
Select2 query = new Select2( new String[]{ "trabalhadores", "estabelecimentos", "empresas" },
new Integer[]{ Select2.JOIN_INNER, Select2.JOIN_INNER }, new Integer[]{ Select2.JOIN_INNER, Select2.JOIN_INNER },
new Expression[]{ new Expression[]{
new Field("estabelecimentos.id").isEqual(new Field("trabalhadores.estabelecimento_id")), new Field("estabelecimentos.id").isEqual(new Field("trabalhadores.estabelecimento_id")),
@ -736,14 +735,10 @@ public class FichaDataProvider
and( new Field("trabalhadores.data_demissao").isEqual( null ) ). and( new Field("trabalhadores.data_demissao").isEqual( null ) ).
and( new Field("estabelecimentos.inactivo").isEqual( "n" ) ), and( new Field("estabelecimentos.inactivo").isEqual( "n" ) ),
null, null, null, null ); null, null, null, null );
Virtual2DArray returned = executer.executeQuery( query ); Virtual2DArray returned = executer.executeQuery( query );
if( returned.columnLength() > 0 ) if( returned.columnLength() > 0 )
{ {
result = (Long) returned.get( 0, 0 ); result = (Long) returned.get( 0, 0 );
}
}
catch (DBException e) {
e.printStackTrace();
} }
return result; return result;
} }

@ -6,8 +6,8 @@
package siprp; package siprp;
import java.util.Hashtable;
import com.evolute.module.cursos.CursosWindow;
import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultMutableTreeNode;
import shst.SHSTTrackerInterface; import shst.SHSTTrackerInterface;
@ -32,10 +32,15 @@ import siprp.medicina.prestadores.PrestadoresWindow;
import siprp.pesquisas.RelatorioAnualWindow; import siprp.pesquisas.RelatorioAnualWindow;
import com.evolute.utils.Singleton; import com.evolute.utils.Singleton;
import com.evolute.utils.error.ErrorLogger;
import com.evolute.utils.tracker.TrackableWindow; import com.evolute.utils.tracker.TrackableWindow;
import com.evolute.utils.tracker.WindowCreator; import com.evolute.utils.tracker.WindowCreator;
import com.evolute.utils.tracker.WindowTracker; import com.evolute.utils.tracker.WindowTracker;
import com.evolute.utils.ui.window.LoginWindow; import com.evolute.utils.ui.window.LoginWindow;
import java.util.HashMap;
import java.util.Map;
import siprp.cursos.CursosInit;
import siprp.cursos.CursosWindowAdapter;
/** /**
* *
* @author fpalma * @author fpalma
@ -69,7 +74,7 @@ public class SIPRPTracker extends WindowTracker implements SHSTTrackerInterface
Singleton.setInstance( Singleton.TRACKER, this ); Singleton.setInstance( Singleton.TRACKER, this );
this.avisos = avisosP; this.avisos = avisosP;
avisos.setTracker( this ); avisos.setTracker( this );
Hashtable<String, WindowCreator> creators = new Hashtable<String, WindowCreator>(); Map<String, WindowCreator> creators = new HashMap<String, WindowCreator>();
DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode( DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode(
Singleton.getInstance( SingletonConstants.COMPANY_ACRONYM ) ); Singleton.getInstance( SingletonConstants.COMPANY_ACRONYM ) );
@ -77,6 +82,8 @@ public class SIPRPTracker extends WindowTracker implements SHSTTrackerInterface
boolean hasGestao = ( (Boolean)Singleton.getInstance( SingletonConstants.MODULE_CLIENTES ) ).booleanValue(); boolean hasGestao = ( (Boolean)Singleton.getInstance( SingletonConstants.MODULE_CLIENTES ) ).booleanValue();
boolean hasRelatorio = ( (Boolean)Singleton.getInstance( SingletonConstants.MODULE_RELATORIO ) ).booleanValue(); boolean hasRelatorio = ( (Boolean)Singleton.getInstance( SingletonConstants.MODULE_RELATORIO ) ).booleanValue();
boolean hasListagens = ( (Boolean)Singleton.getInstance( SingletonConstants.MODULE_LISTAGENS ) ).booleanValue(); boolean hasListagens = ( (Boolean)Singleton.getInstance( SingletonConstants.MODULE_LISTAGENS ) ).booleanValue();
// TODO use property !!!!
boolean hasCursos = false;//true; //( (Boolean)Singleton.getInstance( SingletonConstants.MODULE_CURSOS ) ).booleanValue();
if( hasGestao ) if( hasGestao )
{ {
@ -94,7 +101,7 @@ public class SIPRPTracker extends WindowTracker implements SHSTTrackerInterface
clientesWindow = null; clientesWindow = null;
medicinaWindow = null; medicinaWindow = null;
higieneWindow = null; higieneWindow = null;
ex.printStackTrace(); ErrorLogger.logException(ex);
} }
} }
else else
@ -289,6 +296,18 @@ public class SIPRPTracker extends WindowTracker implements SHSTTrackerInterface
} }
} ); } );
} }
if( hasCursos )
{
rootNode.add( new DefaultMutableTreeNode( CursosWindow.TITLE ) );
creators.put( CursosWindow.TITLE, new WindowCreator() {
public TrackableWindow create()
throws Exception
{
CursosInit.initFactory();
return new CursosWindowAdapter();
}
} );
}
setRoot( rootNode ); setRoot( rootNode );
setCreators( creators ); setCreators( creators );
} }

@ -36,6 +36,7 @@ public class SingletonConstants
public static final String WEB_AWARE = "web_aware"; public static final String WEB_AWARE = "web_aware";
public static final String MODULE_RELATORIO = "module_relatorio"; public static final String MODULE_RELATORIO = "module_relatorio";
public static final String MODULE_LISTAGENS = "module_listagens"; public static final String MODULE_LISTAGENS = "module_listagens";
public static final String MODULE_CURSOS = "module_cursos";
public static final String WEB_USER = "web_user"; public static final String WEB_USER = "web_user";
public static final String WEB_PASSWORD = "web_password"; public static final String WEB_PASSWORD = "web_password";

@ -9,8 +9,6 @@
package siprp.clientes; package siprp.clientes;
import java.util.Hashtable;
import java.util.Vector;
import com.evolute.utils.Singleton; import com.evolute.utils.Singleton;
import com.evolute.utils.arrays.Virtual2DArray; import com.evolute.utils.arrays.Virtual2DArray;
@ -24,6 +22,10 @@ import com.evolute.utils.sql.Delete;
import com.evolute.utils.sql.Field; import com.evolute.utils.sql.Field;
import com.evolute.utils.sql.Insert; import com.evolute.utils.sql.Insert;
import com.evolute.utils.sql.Select; import com.evolute.utils.sql.Select;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* *
@ -38,14 +40,14 @@ public class ClientesDataProvider extends MetaProvider
private Integer etiquetaID; private Integer etiquetaID;
/** Creates a new instance of ClientesDataProvider */ /** Creates a new instance of ClientesDataProvider */
public ClientesDataProvider() private ClientesDataProvider()
throws Exception throws Exception
{ {
DBManager dbm = ( DBManager ) Singleton.getInstance( Singleton.DEFAULT_DBMANAGER /*SingletonConstants.DBMANAGER*/ ); DBManager dbm = ( DBManager ) Singleton.getInstance( Singleton.DEFAULT_DBMANAGER /*SingletonConstants.DBMANAGER*/ );
executer = dbm.getSharedExecuter( this ); executer = dbm.getSharedExecuter( this );
} }
public static MetaProvider getProvider() public static ClientesDataProvider getProvider()
throws Exception throws Exception
{ {
synchronized( LOCK ) synchronized( LOCK )
@ -88,7 +90,7 @@ public class ClientesDataProvider extends MetaProvider
return grupos; return grupos;
} }
public Hashtable getAllTiposElementosProtocoloByGrupo() public Map<Integer,List<IDObject>> getAllTiposElementosProtocoloByGrupo()
throws Exception throws Exception
{ {
Select select = Select select =
@ -98,16 +100,16 @@ public class ClientesDataProvider extends MetaProvider
new String[]{ "grupo_protocolo_id", "ordem" }, new String[]{ "grupo_protocolo_id", "ordem" },
null ); null );
Virtual2DArray array = executer.executeQuery( select ); Virtual2DArray array = executer.executeQuery( select );
Hashtable tipos = new Hashtable(); Map<Integer,List<IDObject>> tipos = new HashMap<Integer,List<IDObject>>();
for( int n = 0; n < array.columnLength(); n++ ) for( int n = 0; n < array.columnLength(); n++ )
{ {
IDObject tipo = new MappableObject( ( Integer ) array.get( n, 0 ), ( String ) array.get( n, 1 ) ); IDObject tipo = new MappableObject( ( Integer ) array.get( n, 0 ), ( String ) array.get( n, 1 ) );
Integer grupoID = ( Integer ) array.get( n, 3 ); Integer grupoID = ( Integer ) array.get( n, 3 );
if( !tipos.containsKey( grupoID ) ) if( !tipos.containsKey( grupoID ) )
{ {
tipos.put( grupoID, new Vector() ); tipos.put( grupoID, new ArrayList<IDObject>() );
} }
Vector tiposGrupo = ( Vector ) tipos.get( grupoID ); List tiposGrupo = tipos.get( grupoID );
tiposGrupo.add( tipo ); tiposGrupo.add( tipo );
} }
return tipos; return tipos;
@ -156,14 +158,14 @@ public class ClientesDataProvider extends MetaProvider
new String[]{ "numero_perfil" }, new String[]{ "numero_perfil" },
null ); null );
Virtual2DArray array = executer.executeQuery( select ); Virtual2DArray array = executer.executeQuery( select );
Vector data[] = new Vector[ numeroPerfis ]; List<Integer> data[] = new List[ numeroPerfis ];
for( int n = 0; n < array.columnLength(); n++ ) for( int n = 0; n < array.columnLength(); n++ )
{ {
int perfil = ( ( Integer ) array.get( n, 1 ) ).intValue() - 1; int perfil = ( ( Integer ) array.get( n, 1 ) ).intValue() - 1;
Integer tipo = ( Integer ) array.get( n, 0 ); Integer tipo = ( Integer ) array.get( n, 0 );
if( data[ perfil ] == null ) if( data[ perfil ] == null )
{ {
data[ perfil ] = new Vector(); data[ perfil ] = new ArrayList<Integer>();
} }
data[ perfil ].add( tipo ); data[ perfil ].add( tipo );
} }
@ -176,7 +178,7 @@ public class ClientesDataProvider extends MetaProvider
} }
else else
{ {
elementos[ n ] = ( Integer [] ) data[ n ].toArray( new Integer[ data[ n ].size() ] ); elementos[ n ] = data[ n ].toArray( new Integer[ data[ n ].size() ] );
} }
} }
return elementos; return elementos;

@ -19,7 +19,6 @@ import java.awt.Insets;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.Map; import java.util.Map;
import java.util.Vector;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JComboBox; import javax.swing.JComboBox;
@ -58,6 +57,8 @@ import com.evolute.utils.ui.DialogException;
import com.evolute.utils.ui.calendar.JCalendarPanel; import com.evolute.utils.ui.calendar.JCalendarPanel;
import com.evolute.utils.ui.text.CopyPasteHandler; import com.evolute.utils.ui.text.CopyPasteHandler;
import com.evolute.utils.ui.text.StateTextField; import com.evolute.utils.ui.text.StateTextField;
import java.util.ArrayList;
import java.util.List;
/** /**
* *
@ -125,7 +126,7 @@ public class EmpresaPanel extends JPanel
private boolean webAware; private boolean webAware;
private Vector listSelectionListeners; private final List<ListSelectionListener> listSelectionListeners = new ArrayList<ListSelectionListener>();
/** Creates a new instance of EmpresaPanel */ /** Creates a new instance of EmpresaPanel */
public EmpresaPanel() public EmpresaPanel()
@ -133,7 +134,6 @@ public class EmpresaPanel extends JPanel
{ {
webAware = ( ( Boolean ) Singleton.getInstance( SingletonConstants.WEB_AWARE ) ).booleanValue(); webAware = ( ( Boolean ) Singleton.getInstance( SingletonConstants.WEB_AWARE ) ).booleanValue();
provider = (FichaDataProvider)FichaDataProvider.getProvider(); provider = (FichaDataProvider)FichaDataProvider.getProvider();
listSelectionListeners = new Vector();
objectProvider = ( ProviderInterface ) Singleton.getInstance( Singleton.DEFAULT_EVO_DATA_PROVIDER ); objectProvider = ( ProviderInterface ) Singleton.getInstance( Singleton.DEFAULT_EVO_DATA_PROVIDER );
setupComponents(); setupComponents();
setupComponentsHashtable(); setupComponentsHashtable();
@ -800,25 +800,32 @@ public class EmpresaPanel extends JPanel
estabelecimentos = new IDObject[0]; estabelecimentos = new IDObject[0];
} }
reloadMarcacoes(); reloadMarcacoes();
Vector v = new Vector( Arrays.asList( estabelecimentos ) ); estabelecimentosModel.setValues( Arrays.asList( estabelecimentos ) );
estabelecimentosModel.setValues( v );
Vector dadosProtocolo[] = new Vector[]{ new Vector(), new Vector() }; List dadosProtocolo[] = new List[]{ new ArrayList(), new ArrayList() };
boolean analisesExamesA[] = new boolean[2]; boolean analisesExamesA[] = new boolean[2];
analisesExamesA[ 0 ] = "y".equals( empresa.get( EmpresasData.A_CONSULTAS ) ); analisesExamesA[ 0 ] = "y".equals( empresa.getA_consultas() );
analisesExamesA[ 1 ] = "y".equals( empresa.get( EmpresasData.A_EXAMES ) ); analisesExamesA[ 1 ] = "y".equals( empresa.getA_exames() );
dadosProtocolo[ 0 ].add( analisesExamesA ); dadosProtocolo[ 0 ].add( analisesExamesA );
dadosProtocolo[ 0 ].add( elementosProtocolo[ 0 ] ); dadosProtocolo[ 0 ].add( elementosProtocolo[ 0 ] );
boolean analisesExamesB[] = new boolean[2]; boolean analisesExamesB[] = new boolean[2];
analisesExamesB[ 0 ] = "y".equals( empresa.get( EmpresasData.B_CONSULTAS ) ); analisesExamesB[ 0 ] = "y".equals( empresa.getB_consultas() );
analisesExamesB[ 1 ] = "y".equals( empresa.get( EmpresasData.B_EXAMES ) ); analisesExamesB[ 1 ] = "y".equals( empresa.getB_exames() );
dadosProtocolo[ 1 ].add( analisesExamesB ); dadosProtocolo[ 1 ].add( analisesExamesB );
dadosProtocolo[ 1 ].add( elementosProtocolo[ 1 ] ); dadosProtocolo[ 1 ].add( elementosProtocolo[ 1 ] );
protocoloPanel.fill( dadosProtocolo ); protocoloPanel.fill( dadosProtocolo );
Integer empresaID = empresa == null ? null : (Integer) empresa.get( EmpresasData.ID ); Integer empresaID = empresa == null ? null : empresa.getId();
if( empresaID != null ) if( empresaID != null )
{ {
Long numTrabalhadoresActivos = provider.countTrabalhadoresActivosForEmpresa( empresaID ); Long numTrabalhadoresActivos = null;
try
{
numTrabalhadoresActivos = provider.countTrabalhadoresActivosForEmpresa(empresaID);
}
catch( Exception ex )
{
ErrorLogger.logException(ex);
}
labelTrabalhadoresActivos.setText( getTextForTrabalhadoresActivos( numTrabalhadoresActivos ) ); labelTrabalhadoresActivos.setText( getTextForTrabalhadoresActivos( numTrabalhadoresActivos ) );
ImageData logo = empresa.toEmpresa_logo_id(); ImageData logo = empresa.toEmpresa_logo_id();
logotipo.fill( logo == null ? null : logo.getImage_data() ); logotipo.fill( logo == null ? null : logo.getImage_data() );
@ -838,20 +845,20 @@ public class EmpresaPanel extends JPanel
empresa = new EmpresasData(); empresa = new EmpresasData();
} }
String names[] = ( String[] ) components.keySet().toArray( new String[ components.size() ] ); String names[] = components.keySet().toArray( new String[ components.size() ] );
Map<String,Object> hash = empresa.getHashData(); Map<String,Object> hash = empresa.getHashData();
ComponentController.save( names, hash, components ); ComponentController.save( names, hash, components );
empresa.setHashData( hash ); empresa.setHashData( hash );
Vector dadosProtocolo[] = ( Vector[] ) protocoloPanel.save(); List dadosProtocolo[] = protocoloPanel.save();
boolean analisesExamesA[] = ( boolean [] ) dadosProtocolo[ 0 ].elementAt( 0 ); boolean analisesExamesA[] = ( boolean [] ) dadosProtocolo[ 0 ].get( 0 );
empresa.set( EmpresasData.A_CONSULTAS, analisesExamesA[ 0 ] ? "y" : "n" ); empresa.set( EmpresasData.A_CONSULTAS, analisesExamesA[ 0 ] ? "y" : "n" );
empresa.set( EmpresasData.A_EXAMES, analisesExamesA[ 1 ] ? "y" : "n" ); empresa.set( EmpresasData.A_EXAMES, analisesExamesA[ 1 ] ? "y" : "n" );
boolean analisesExamesB[] = ( boolean [] ) dadosProtocolo[ 1 ].elementAt( 0 ); boolean analisesExamesB[] = ( boolean [] ) dadosProtocolo[ 1 ].get( 0 );
empresa.set( EmpresasData.B_CONSULTAS, analisesExamesB[ 0 ] ? "y" : "n" ); empresa.set( EmpresasData.B_CONSULTAS, analisesExamesB[ 0 ] ? "y" : "n" );
empresa.set( EmpresasData.B_EXAMES, analisesExamesB[ 1 ] ? "y" : "n" ); empresa.set( EmpresasData.B_EXAMES, analisesExamesB[ 1 ] ? "y" : "n" );
Integer elementosProtocolo[][] = Integer elementosProtocolo[][] =
new Integer[][]{ ( Integer [] ) dadosProtocolo[ 0 ].elementAt( 1 ), new Integer[][]{ ( Integer [] ) dadosProtocolo[ 0 ].get( 1 ),
( Integer [] ) dadosProtocolo[ 1 ].elementAt( 1 ) }; ( Integer [] ) dadosProtocolo[ 1 ].get( 1 ) };
ImageData logo = empresa.toEmpresa_logo_id(); ImageData logo = empresa.toEmpresa_logo_id();
try try
{ {
@ -872,6 +879,7 @@ public class EmpresaPanel extends JPanel
return new Object[] { empresa, elementosProtocolo }; return new Object[] { empresa, elementosProtocolo };
} }
@Override
public void setEnabled( boolean enable ) public void setEnabled( boolean enable )
{ {
super.setEnabled( enable ); super.setEnabled( enable );
@ -898,7 +906,7 @@ public class EmpresaPanel extends JPanel
{ {
ListSelectionEvent newEvent = ListSelectionEvent newEvent =
new ListSelectionEvent( this, e.getFirstIndex(), e.getLastIndex(), e.getValueIsAdjusting() ); new ListSelectionEvent( this, e.getFirstIndex(), e.getLastIndex(), e.getValueIsAdjusting() );
( (ListSelectionListener) listSelectionListeners.elementAt( n ) ).valueChanged( newEvent ); listSelectionListeners.get( n ).valueChanged( newEvent );
} }
} }
@ -930,7 +938,7 @@ public class EmpresaPanel extends JPanel
public void setSelectedEstabelecimento( EstabelecimentosData estab ) public void setSelectedEstabelecimento( EstabelecimentosData estab )
{ {
IDObject lista[] = (IDObject [])estabelecimentosModel.getValues().toArray( new IDObject[ 0 ] ); IDObject lista[] = (IDObject [])estabelecimentosModel.getValues().toArray( new IDObject[ 0 ] );
Integer id = (Integer)estab.get( EstabelecimentosData.ID ); Integer id = estab.getId();
for( int n = 0; n < lista.length; n++ ) for( int n = 0; n < lista.length; n++ )
{ {
if( lista[ n ].getID().equals( id ) ) if( lista[ n ].getID().equals( id ) )
@ -949,7 +957,7 @@ public class EmpresaPanel extends JPanel
Collection marcacoesCollection = Collection marcacoesCollection =
objectProvider.listLoad( MarcacoesEmpresaData.class, new Object[]{ empresa.getId() }, objectProvider.listLoad( MarcacoesEmpresaData.class, new Object[]{ empresa.getId() },
new String []{ MarcacoesEmpresaData.EMPRESA_ID }, new String[]{ "data desc" } ); new String []{ MarcacoesEmpresaData.EMPRESA_ID }, new String[]{ "data desc" } );
Vector marcacoes = new Vector(); List marcacoes = new ArrayList();
marcacoes.add( new ColumnizedObject(){ marcacoes.add( new ColumnizedObject(){
public Object getValue( int col ) public Object getValue( int col )
{ {

@ -15,7 +15,6 @@ import java.awt.Insets;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.util.Arrays; import java.util.Arrays;
import java.util.Vector;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JCheckBox; import javax.swing.JCheckBox;
@ -24,13 +23,15 @@ import javax.swing.JPanel;
import com.evolute.utils.data.IDObject; import com.evolute.utils.data.IDObject;
import com.evolute.utils.dataui.ControllableComponent; import com.evolute.utils.dataui.ControllableComponent;
import com.evolute.utils.ui.panel.CheckBoxPanel; import com.evolute.utils.ui.panel.CheckBoxPanel;
import java.util.ArrayList;
import java.util.List;
/** /**
* *
* @author fpalma * @author fpalma
*/ */
public class PerfilProtocoloPanel extends JPanel public class PerfilProtocoloPanel extends JPanel
implements ControllableComponent, ItemListener implements ControllableComponent<List>, ItemListener
{ {
protected JCheckBox consultasCheck; protected JCheckBox consultasCheck;
protected JCheckBox examesCheck; protected JCheckBox examesCheck;
@ -90,14 +91,13 @@ public class PerfilProtocoloPanel extends JPanel
return panel; return panel;
} }
public void fill( Object data ) public void fill( List list )
{ {
clear(); clear();
if( data != null ) if( list != null )
{ {
Vector list = ( Vector ) data; boolean consultasExames[] = ( boolean[] )list.get( 0 );
boolean consultasExames[] = (boolean[]) list.elementAt( 0 ); Integer tiposEscolhidos[] = ( Integer [] ) list.get( 1 );
Integer tiposEscolhidos[] = ( Integer [] ) list.elementAt( 1 );
consultasCheck.setSelected( consultasExames[ 0 ] ); consultasCheck.setSelected( consultasExames[ 0 ] );
examesCheck.setSelected( consultasExames[ 1 ] ); examesCheck.setSelected( consultasExames[ 1 ] );
for( int n = 0; n < tiposCheck.length; n++ ) for( int n = 0; n < tiposCheck.length; n++ )
@ -107,12 +107,12 @@ public class PerfilProtocoloPanel extends JPanel
} }
} }
public Object save() public List save()
{ {
boolean consultasExames[] = new boolean[ 2 ]; boolean consultasExames[] = new boolean[ 2 ];
consultasExames[ 0 ] = consultasCheck.isSelected(); consultasExames[ 0 ] = consultasCheck.isSelected();
consultasExames[ 1 ] = examesCheck.isSelected(); consultasExames[ 1 ] = examesCheck.isSelected();
Vector tiposEscolhidos = new Vector(); List tiposEscolhidos = new ArrayList();
if( consultasExames[ 1 ] ) if( consultasExames[ 1 ] )
{ {
for( int n = 0; n < tiposCheck.length; n++ ) for( int n = 0; n < tiposCheck.length; n++ )
@ -120,12 +120,13 @@ public class PerfilProtocoloPanel extends JPanel
tiposEscolhidos.addAll( Arrays.asList( tiposCheck[ n ].getSelected() ) ); tiposEscolhidos.addAll( Arrays.asList( tiposCheck[ n ].getSelected() ) );
} }
} }
Vector list = new Vector(); List list = new ArrayList();
list.add( consultasExames ); list.add( consultasExames );
list.add( tiposEscolhidos.toArray( new Integer[ tiposEscolhidos.size() ] ) ); list.add( tiposEscolhidos.toArray( new Integer[ tiposEscolhidos.size() ] ) );
return list; return list;
} }
@Override
public void setEnabled( boolean enable ) public void setEnabled( boolean enable )
{ {
consultasCheck.setEnabled( enable ); consultasCheck.setEnabled( enable );

@ -11,7 +11,6 @@ package siprp.clientes;
import java.awt.GridLayout; import java.awt.GridLayout;
import java.util.Arrays; import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector; import java.util.Vector;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
@ -21,15 +20,18 @@ import javax.swing.JScrollPane;
import com.evolute.utils.data.IDObject; import com.evolute.utils.data.IDObject;
import com.evolute.utils.data.MappableObject; import com.evolute.utils.data.MappableObject;
import com.evolute.utils.dataui.ControllableComponent; import com.evolute.utils.dataui.ControllableComponent;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/** /**
* *
* @author fpalma * @author fpalma
*/ */
public class ProtocoloPanel extends JPanel public class ProtocoloPanel extends JPanel
implements ControllableComponent implements ControllableComponent<List[]>
{ {
protected ClientesDataProvider provider; protected final ClientesDataProvider provider;
protected IDObject grupos[]; protected IDObject grupos[];
protected IDObject tipos[][]; protected IDObject tipos[][];
@ -40,28 +42,28 @@ public class ProtocoloPanel extends JPanel
public ProtocoloPanel() public ProtocoloPanel()
throws Exception throws Exception
{ {
provider = ( ClientesDataProvider ) ClientesDataProvider.getProvider(); provider = ClientesDataProvider.getProvider();
IDObject gruposReais[] = provider.getAllGruposProtocoloReais(); IDObject gruposReais[] = provider.getAllGruposProtocoloReais();
Vector gruposAux = new Vector( Arrays.asList( gruposReais ) ); List<IDObject> gruposAux = new ArrayList<IDObject>( Arrays.asList( gruposReais ) );
gruposAux.add( new MappableObject( new Integer( 0 ), "Outros" ) ); gruposAux.add( new MappableObject( new Integer( 0 ), "Outros" ) );
grupos = ( IDObject[] ) gruposAux.toArray( new IDObject[ gruposReais.length + 1 ] ); grupos = gruposAux.toArray( new IDObject[ gruposReais.length + 1 ] );
IDObject gruposFalsos[] = provider.getAllGruposProtocoloFalsos(); IDObject gruposFalsos[] = provider.getAllGruposProtocoloFalsos();
Hashtable tiposHash = provider.getAllTiposElementosProtocoloByGrupo(); Map<Integer,List<IDObject>> tiposHash = provider.getAllTiposElementosProtocoloByGrupo();
tipos = new IDObject[ grupos.length ][]; tipos = new IDObject[ grupos.length ][];
for( int n = 0; n < gruposReais.length; n++ ) for( int n = 0; n < gruposReais.length; n++ )
{ {
Vector tiposGrupo = ( Vector ) tiposHash.get( gruposReais[ n ].getID() ); List<IDObject> tiposGrupo = tiposHash.get( gruposReais[ n ].getID() );
tipos[ n ] = ( IDObject[] ) tiposGrupo.toArray( new IDObject[ tiposGrupo.size() ] ); tipos[ n ] = tiposGrupo.toArray( new IDObject[ tiposGrupo.size() ] );
} }
Vector outros = new Vector(); List<IDObject> outros = new ArrayList<IDObject>();
for( int n = 0; n < gruposFalsos.length; n++ ) for( int n = 0; n < gruposFalsos.length; n++ )
{ {
Vector tiposGrupo = ( Vector ) tiposHash.get( gruposFalsos[ n ].getID() ); List<IDObject> tiposGrupo = tiposHash.get( gruposFalsos[ n ].getID() );
outros.addAll( tiposGrupo ); outros.addAll( tiposGrupo );
} }
tipos[ gruposReais.length ] = ( IDObject[] ) outros.toArray( new IDObject[ outros.size() ] ); tipos[ gruposReais.length ] = outros.toArray( new IDObject[ outros.size() ] );
setupComponents(); setupComponents();
} }
@ -88,18 +90,17 @@ public class ProtocoloPanel extends JPanel
add( perfilBScp ); add( perfilBScp );
} }
public void fill( Object data ) public void fill( List lists[] )
{ {
Vector lists[] = ( Vector [] ) data;
perfisPanels[ 0 ].fill( lists[ 0 ] ); perfisPanels[ 0 ].fill( lists[ 0 ] );
perfisPanels[ 1 ].fill( lists[ 1 ] ); perfisPanels[ 1 ].fill( lists[ 1 ] );
} }
public Object save() public List[] save()
{ {
Vector lists[] = new Vector[ 2 ]; List lists[] = new List[ 2 ];
lists[ 0 ] = ( Vector ) perfisPanels[ 0 ].save(); lists[ 0 ] = perfisPanels[ 0 ].save();
lists[ 1 ] = ( Vector ) perfisPanels[ 1 ].save(); lists[ 1 ] = perfisPanels[ 1 ].save();
return lists; return lists;
} }

@ -0,0 +1,31 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package siprp.cursos;
import com.evolute.genericpeople.AutorizacaoLogicFactory;
import com.evolute.genericpeople.AutorizacaoProviderFactory;
import com.evolute.genericpeople.EntidadesProviderFactory;
import com.evolute.genericpeople.PessoasProviderFactory;
import siprp.cursos.logic.AutorizacaoLogic;
import siprp.cursos.provider.AutorizacaoProvider;
import siprp.cursos.provider.EntidadesProvider;
import siprp.cursos.provider.PessoasProvider;
/**
*
* @author lflores
*/
public class CursosInit
{
public static void initFactory()
throws Exception
{
AutorizacaoProviderFactory.setProvider( AutorizacaoProvider.getProvider() );
AutorizacaoLogicFactory.setLogic( AutorizacaoLogic.getLogic() );
EntidadesProviderFactory.setProvider( EntidadesProvider.getProvider() );
PessoasProviderFactory.setProvider( PessoasProvider.getProvider() );
}
}

@ -0,0 +1,21 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package siprp.cursos;
import com.evolute.utils.tracker.TrackableWindow;
/**
*
* @author lflores
*/
public class CursosWindowAdapter extends com.evolute.module.cursos.CursosWindow
implements TrackableWindow
{
public CursosWindowAdapter()
throws Exception
{
}
}

@ -0,0 +1,28 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package siprp.cursos.logic;
import com.evolute.genericpeople.AutorizacaoLogicInterface;
import com.evolute.swing.frame.EvoFrame;
/**
*
* @author lflores
*/
public class AutorizacaoLogic implements AutorizacaoLogicInterface
{
public static AutorizacaoLogic getLogic()
{
return null;
}
public boolean insertPedido(EvoFrame ef, Integer intgr, String string, String string1, byte[] bytes, Integer intgr1) throws Exception
{
throw new UnsupportedOperationException("Not supported yet.");
}
}

@ -0,0 +1,30 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package siprp.cursos.provider;
import com.evolute.genericpeople.AutorizacaoProviderInterface;
/**
*
* @author lflores
*/
public class AutorizacaoProvider implements AutorizacaoProviderInterface
{
public static AutorizacaoProvider getProvider()
{
return null;
}
public Integer getAutorizadorCursos()
{
throw new UnsupportedOperationException("Not supported yet.");
}
public Integer getSubTipoIDForDescricao(String string) throws Exception
{
throw new UnsupportedOperationException("Not supported yet.");
}
}

@ -0,0 +1,33 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package siprp.cursos.provider;
import com.evolute.genericpeople.EntidadeInterface;
import com.evolute.genericpeople.EntidadesProviderInterface;
import com.evolute.utils.data.IDObject;
/**
*
* @author lflores
*/
public class EntidadesProvider implements EntidadesProviderInterface
{
public static EntidadesProvider getProvider()
{
return null;
}
public EntidadeInterface loadEntidade(Integer intgr) throws Exception
{
throw new UnsupportedOperationException("Not supported yet.");
}
public IDObject[] getEntidades() throws Exception
{
throw new UnsupportedOperationException("Not supported yet.");
}
}

@ -0,0 +1,114 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package siprp.cursos.provider;
import com.evolute.genericpeople.PessoaDocumentoInterface;
import com.evolute.genericpeople.PessoaInterface;
import com.evolute.genericpeople.PessoasProviderInterface;
import com.evolute.module.cursos.data.CurFormadoresData;
import com.evolute.module.cursos.data.CurFormandosData;
import com.evolute.utils.arrays.Virtual2DArray;
import com.evolute.utils.data.IDObject;
import com.evolute.utils.data.Mappable;
import com.evolute.utils.ui.search.SearchDialog;
import java.util.List;
/**
*
* @author lflores
*/
public class PessoasProvider implements PessoasProviderInterface
{
public static PessoasProvider getProvider()
{
return null;
}
public void setDocumentosForPessoa(Integer intgr, PessoaDocumentoInterface[] pdis) throws Exception
{
throw new UnsupportedOperationException("Not supported yet.");
}
public PessoaInterface getPessoaFromFormador(CurFormadoresData cfd) throws Exception
{
throw new UnsupportedOperationException("Not supported yet.");
}
public PessoaInterface getPessoaFromFormando(CurFormandosData cfd) throws Exception
{
throw new UnsupportedOperationException("Not supported yet.");
}
public boolean biAlreadyExists(Integer intgr, String string) throws Exception
{
throw new UnsupportedOperationException("Not supported yet.");
}
public PessoaInterface loadPessoa(Integer intgr) throws Exception
{
throw new UnsupportedOperationException("Not supported yet.");
}
public List<IDObject> getAllPessoasIDObjects() throws Exception
{
throw new UnsupportedOperationException("Not supported yet.");
}
public Mappable[] getPaises() throws Exception
{
throw new UnsupportedOperationException("Not supported yet.");
}
public String getNacionalidadeByPaisID(Integer intgr) throws Exception
{
throw new UnsupportedOperationException("Not supported yet.");
}
public List<IDObject> getTiposDocumento() throws Exception
{
throw new UnsupportedOperationException("Not supported yet.");
}
public PessoaDocumentoInterface[] getDocumentosForPessoa(Integer intgr) throws Exception
{
throw new UnsupportedOperationException("Not supported yet.");
}
public PessoaInterface newPessoa()
{
throw new UnsupportedOperationException("Not supported yet.");
}
public PessoaDocumentoInterface newPessoaDocumento()
{
throw new UnsupportedOperationException("Not supported yet.");
}
public Virtual2DArray search(String string) throws Exception
{
throw new UnsupportedOperationException("Not supported yet.");
}
public boolean hasDetails()
{
throw new UnsupportedOperationException("Not supported yet.");
}
public void showDetails(SearchDialog sd, Object o) throws Exception
{
throw new UnsupportedOperationException("Not supported yet.");
}
public String getSearchTitle()
{
throw new UnsupportedOperationException("Not supported yet.");
}
public String[] getColumnNames()
{
throw new UnsupportedOperationException("Not supported yet.");
}
}
Loading…
Cancel
Save