|
|
|
|
@ -7,16 +7,24 @@ import static com.evolute.utils.strings.UnicodeLatin1Map.oacute;
|
|
|
|
|
import info.clearthought.layout.TableLayout;
|
|
|
|
|
import info.clearthought.layout.TableLayoutConstraints;
|
|
|
|
|
|
|
|
|
|
import java.awt.event.ActionEvent;
|
|
|
|
|
import java.awt.event.ActionListener;
|
|
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Vector;
|
|
|
|
|
|
|
|
|
|
import javax.swing.JButton;
|
|
|
|
|
import javax.swing.JPanel;
|
|
|
|
|
|
|
|
|
|
import leaf.ui.SimpleTable;
|
|
|
|
|
import siprp.data.Estabelecimento;
|
|
|
|
|
import siprp.database.cayenne.objects.Estabelecimentos;
|
|
|
|
|
import siprp.database.cayenne.objects.HsRelatorio;
|
|
|
|
|
import siprp.database.cayenne.objects.HsRelatorioNormalizacao;
|
|
|
|
|
import siprp.database.cayenne.objects.MarcacoesEstabelecimento;
|
|
|
|
|
import siprp.logic.HigieneSegurancaLogic;
|
|
|
|
|
|
|
|
|
|
import com.evolute.utils.error.ErrorLogger;
|
|
|
|
|
import com.evolute.utils.tables.ColumnizedObjectArray;
|
|
|
|
|
|
|
|
|
|
public class RelatorioNormalizacaoPanel extends JPanel
|
|
|
|
|
@ -26,6 +34,8 @@ public class RelatorioNormalizacaoPanel extends JPanel
|
|
|
|
|
|
|
|
|
|
private HsRelatorio relatorio = null;
|
|
|
|
|
|
|
|
|
|
private final JButton revert = new JButton("Reverter");
|
|
|
|
|
|
|
|
|
|
private final SimpleTable<ColumnizedObjectArray> table = new SimpleTable<ColumnizedObjectArray>( "C" + oacute + "digo", "Normaliza" + ccedil + atilde + "o", "" );
|
|
|
|
|
|
|
|
|
|
public RelatorioNormalizacaoPanel()
|
|
|
|
|
@ -39,17 +49,45 @@ public class RelatorioNormalizacaoPanel extends JPanel
|
|
|
|
|
{
|
|
|
|
|
table.getTable().fixColumnWidth(0,50);
|
|
|
|
|
table.getTable().fixColumnWidth(2,100);
|
|
|
|
|
revert.addActionListener( new ActionListener()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void actionPerformed( ActionEvent e )
|
|
|
|
|
{
|
|
|
|
|
if( relatorio != null )
|
|
|
|
|
{
|
|
|
|
|
MarcacoesEstabelecimento marcacao = relatorio.getToHsMarcacoesEstabelecimento();
|
|
|
|
|
if( marcacao != null )
|
|
|
|
|
{
|
|
|
|
|
Estabelecimentos estabelecimento = marcacao.getToEstabelecimentos();
|
|
|
|
|
if( estabelecimento != null )
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
HigieneSegurancaLogic.reverterNormalizacao( relatorio, estabelecimento );
|
|
|
|
|
} catch( Exception e1 )
|
|
|
|
|
{
|
|
|
|
|
ErrorLogger.logException( e1 );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
refresh();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void setupLayout()
|
|
|
|
|
{
|
|
|
|
|
TableLayout layout = new TableLayout( new double[]{ TableLayout.FILL }, new double[]{ TableLayout.FILL } );
|
|
|
|
|
TableLayout layout = new TableLayout( new double[]{ TableLayout.MINIMUM, TableLayout.FILL }, new double[]{ TableLayout.MINIMUM, TableLayout.FILL } );
|
|
|
|
|
this.setLayout( layout );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void placeComponents()
|
|
|
|
|
{
|
|
|
|
|
this.add( table, new TableLayoutConstraints( 0, 0 ) );
|
|
|
|
|
this.add( table, new TableLayoutConstraints( 0, 1,1,1 ) );
|
|
|
|
|
this.add( revert, new TableLayoutConstraints( 0, 0 ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setRelatorio( HsRelatorio relatorio )
|
|
|
|
|
|