- estatisticas : filtrar por estabelecimento;

- filtro por ano na listagem de analises de acidentes de trabalho;
- as passagens de fase estao a enviar mails (desde que o email seja valido).

git-svn-id: https://svn.coded.pt/svn/SIPRP@1635 bb69d46d-e84e-40c8-a05a-06db0d633741
lxbfYeaa
Diogo Neves 15 years ago
parent f4f9a5ef56
commit 9884fd6385

@ -2,8 +2,8 @@
<Scene Scope="Project" version="2">
<Scope Scope="Faces Configuration Only"/>
<Scope Scope="Project">
<Node id="RecuperarPassword.jsp" x="400" y="150" zoom="true"/>
<Node id="GestaoUtilizadores.jsp" x="400" y="450" zoom="true"/>
<Node id="RecuperarPassword.jsp" x="400" y="150" zoom="true"/>
<Node id="FormDirGerRh.jsp" x="150" y="750" zoom="true"/>
<Node id="FormGestor.jsp" x="400" y="300" zoom="true"/>
<Node id="Erro.jsp" x="650" y="450" zoom="true"/>
@ -15,8 +15,8 @@
<Node id="NovoUtilizador.jsp" x="900" y="150" zoom="true"/>
<Node id="FormDirSiprp.jsp" x="1400" y="150" zoom="true"/>
<Node id="FichaUtilizador.jsp" x="150" y="300" zoom="true"/>
<Node id="FormMedico.jsp" x="900" y="450" zoom="true"/>
<Node id="FormHS.jsp" x="900" y="300" zoom="true"/>
<Node id="FormMedico.jsp" x="900" y="450" zoom="true"/>
<Node id="EnviarCorrecao.jsp" x="150" y="150" zoom="true"/>
<Node id="UtilizadorFields.jsp" x="1150" y="300" zoom="true"/>
<Node id="ConfirmarDesactivar.jsp" x="1650" y="150" zoom="true"/>

@ -173,7 +173,6 @@ public class Dummy extends AbstractPageBean {
super.init();
// Perform application initialization that must complete
// *before* managed components are initialized
// TODO - add your own initialiation code here
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// Initialize automatically managed components
@ -188,7 +187,6 @@ public class Dummy extends AbstractPageBean {
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
}
/**
@ -241,61 +239,50 @@ public class Dummy extends AbstractPageBean {
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected ApplicationBean1 getApplicationBean1() {
protected ApplicationBean1 getApplicationBean1()
{
return (ApplicationBean1)getBean("ApplicationBean1");
}
public String butCancelar_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
public String butCancelar_action()
{
return null;
}
public String butGravar_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
public String butGravar_action()
{
return null;
}
public String butEnviar_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
public String butEnviar_action()
{
return null;
}
public String butImagem_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
public String butImagem_action()
{
return null;
}
public String lnkMoreMed1_action() {
// TODO: Replace with your code
public String lnkMoreMed1_action()
{
return null;
}
public String lnkNome_action() {
// TODO: Replace with your code
public String lnkNome_action()
{
return null;
}
public String lnkDataNascimento_action() {
// TODO: Replace with your code
public String lnkDataNascimento_action()
{
return null;
}
public String lnkEditUser_action() {
// TODO: Replace with your code
public String lnkEditUser_action()
{
return null;
}
@ -305,44 +292,38 @@ public class Dummy extends AbstractPageBean {
return null;
}
public String butProcurarTrab_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
public String butProcurarTrab_action()
{
return null;
}
public String lnkPOR_action() {
// TODO: Replace with your code
public String lnkPOR_action()
{
return null;
}
public String lnkNomeTrabalhador_action() {
// TODO: Replace with your code
public String lnkNomeTrabalhador_action()
{
return null;
}
public String lnkEstabelecimentoTrabalhador_action() {
// TODO: Replace with your code
public String lnkEstabelecimentoTrabalhador_action()
{
return null;
}
public void drpTipo_processValueChange(ValueChangeEvent event) {
// TODO: Replace with your code
public void drpTipo_processValueChange(ValueChangeEvent event)
{
}
public void drpNome_processValueChange(ValueChangeEvent event) {
// TODO: Replace with your code
public void drpNome_processValueChange(ValueChangeEvent event)
{
}
public String hyperlink1_action() {
// TODO: Replace with your code
public String hyperlink1_action()
{
return null;
}
@ -353,8 +334,8 @@ public class Dummy extends AbstractPageBean {
// public String lnkAjuda_action() {
// // TODO: Replace with your code
// public String lnkAjuda_action()
// {
// ServletContext theApplicationsServletContext =
// (ServletContext) this.getExternalContext().getContext();
// String pdfFolderPath = theApplicationsServletContext.getRealPath(Global.PDF_FOLDER_URL);
@ -372,52 +353,48 @@ public class Dummy extends AbstractPageBean {
// return null;
// }
public String butVoltar_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
public String butVoltar_action()
{
return null;
}
public String butEliminar_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
public String butEliminar_action()
{
return null;
}
public String lnkPlanosActuacao_action() {
// TODO: Replace with your code
public String lnkPlanosActuacao_action()
{
return null;
}
public String lnkAnalisesAcidente_action() {
// TODO: Replace with your code
public String lnkAnalisesAcidente_action()
{
return null;
}
public String lnkNewUser_action() {
// TODO: Replace with your code
public String lnkNewUser_action()
{
return null;
}
public String lnkAjuda_action() {
// TODO: Replace with your code
public String lnkAjuda_action()
{
return null;
}
public String lnkGerirUtilizadores_action() {
// TODO: Replace with your code
public String lnkGerirUtilizadores_action()
{
return null;
}
public String lnkAnalises_action() {
// TODO: Replace with your code
public String lnkAnalises_action()
{
return null;
}
public String lnkPlanos_action() {
// TODO: Replace with your code
public String lnkPlanos_action()
{
return null;
}
}

@ -20,6 +20,7 @@ import com.sun.rave.web.ui.component.TextField;
import com.sun.rave.web.ui.model.Option;
import db.EstatisticasConstants;
import db.data.siprp.outer.SeccoesData;
import db.data.siprp_local.outer.EstabelecimentosData;
import db.providers.EstatisticasDataProvider;
import global.Global;
import java.text.SimpleDateFormat;
@ -175,6 +176,18 @@ public class EstatisticasProcesso extends AbstractPageBean
// this.textDepartamento = textDepartamento;
// }
private DropDown dropEstabelecimentos = new DropDown();
public DropDown getDropEstabelecimentos()
{
return dropEstabelecimentos;
}
public void setDropEstabelecimentos( DropDown dropEstabelecimentos )
{
this.dropEstabelecimentos = dropEstabelecimentos;
}
private DropDown dropSeccoes = new DropDown();
public DropDown getDropSeccoes() {
@ -378,6 +391,12 @@ public class EstatisticasProcesso extends AbstractPageBean
{
dropSeccoes.setItems( seccoes );
}
Option[] estabelecimentos = statsProvider.getEstabelecimentos();
if ( estabelecimentos != null )
{
dropEstabelecimentos.setItems( estabelecimentos );
}
}
catch ( Exception e )
{
@ -503,6 +522,18 @@ public class EstatisticasProcesso extends AbstractPageBean
// departamento = ( ( String ) textDepartamento.getText() ).trim();
// departamento = "".equals( departamento ) ? null : departamento;
// }
Integer estabelecimentoID = null;
if ( dropEstabelecimentos.getSelected() != null )
{
String estabelecimento = ( String ) dropEstabelecimentos.getSelected();
if ( estabelecimento != null )
{
try { estabelecimentoID = Integer.parseInt( estabelecimento ); }
catch ( Exception e ) { }
}
}
Integer seccaoID = null;
if ( dropSeccoes.getSelected() != null )
{
@ -569,6 +600,7 @@ public class EstatisticasProcesso extends AbstractPageBean
searchProperties.put( EstatisticasConstants.KEY_HORA_OCORRENCIA, horaOcorrencia );
searchProperties.put( EstatisticasConstants.KEY_HORAS_TRABALHADAS, horasTrabalhadas );
// searchProperties.put( EstatisticasConstants.KEY_DEPARTAMENTO, departamento );
searchProperties.put( EstatisticasConstants.KEY_ESTABELECIMENTO, estabelecimentoID );
searchProperties.put( EstatisticasConstants.KEY_SECCAO, seccaoID );
searchProperties.put( EstatisticasConstants.KEY_CAUSAS_ACIDENTE, causas );
searchProperties.put( EstatisticasConstants.KEY_TURNO_TRABALHO, turno );
@ -725,7 +757,17 @@ public class EstatisticasProcesso extends AbstractPageBean
String horaOcorrencia = ( String ) searchProperties.get( EstatisticasConstants.KEY_HORA_OCORRENCIA );
String horasTrabalhadas = ( String ) searchProperties.get( EstatisticasConstants.KEY_HORAS_TRABALHADAS );
// String departamento = ( String ) searchProperties.get( EstatisticasConstants.KEY_DEPARTAMENTO );
Integer estabelecimentoID = ( Integer ) searchProperties.get( EstatisticasConstants.KEY_ESTABELECIMENTO );
Integer seccaoID = ( Integer ) searchProperties.get( EstatisticasConstants.KEY_SECCAO );
String estabelecimento = null;
try
{
estabelecimento = EstatisticasDataProvider.getInstance().getEstabelecimentoByID( estabelecimentoID );
}
catch ( Exception e )
{
ErrorLogger.logException( e );
}
String seccao = null;
try
{
@ -805,6 +847,14 @@ public class EstatisticasProcesso extends AbstractPageBean
// columnValue.setCellValue( departamento );
// row++;
keyName = EstatisticasConstants.KEY_NAMES[ row ];
currentRow = getRow( sheet, row );
columnLabel = getCell( currentRow, 0 );
columnLabel.setCellValue( keyName );
columnValue = getCell( currentRow, 1 );
columnValue.setCellValue( estabelecimento );
row++;
keyName = EstatisticasConstants.KEY_NAMES[ row ];
currentRow = getRow( sheet, row );
columnLabel = getCell( currentRow, 0 );

@ -45,7 +45,8 @@ import utils.JSFUtils;
* lifecycle methods and event handlers where you may add behavior
* to respond to incoming events.</p>
*/
public class FichaUtilizador extends AbstractPageBean {
public class FichaUtilizador extends AbstractPageBean
{
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
private int __placeholder;
@ -515,7 +516,8 @@ public class FichaUtilizador extends AbstractPageBean {
private StaticText staticText12 = new StaticText();
public StaticText getStaticText12() {
public StaticText getStaticText12()
{
return staticText12;
}
@ -654,7 +656,9 @@ public class FichaUtilizador extends AbstractPageBean {
/**
* <p>Construct a new Page bean instance.</p>
*/
public FichaUtilizador() {
public FichaUtilizador()
{
}
/**
@ -669,13 +673,13 @@ public class FichaUtilizador extends AbstractPageBean {
* values submitted with this request. Instead, they represent the
* property values that were saved for this view when it was rendered.</p>
*/
@Override
public void init()
{
// Perform initializations inherited from our superclass
super.init();
// Perform application initialization that must complete
// *before* managed components are initialized
// TODO - add your own initialiation code here
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// Initialize automatically managed components
@ -690,7 +694,6 @@ public class FichaUtilizador extends AbstractPageBean {
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
if ( ! getSessionBean1().isLoggedIn() )
{
try
@ -848,7 +851,10 @@ public class FichaUtilizador extends AbstractPageBean {
* is processing a form submit. Customize this method to allocate
* resources that will be required in your event handlers.</p>
*/
public void preprocess() {
@Override
public void preprocess()
{
}
/**
@ -859,7 +865,9 @@ public class FichaUtilizador extends AbstractPageBean {
* this method to allocate resources that will be required for rendering
* this page.</p>
*/
public void prerender() {
@Override
public void prerender()
{
stCriarEditar.setText("EDITAR");
if(getSessionBean1().getModoEdicaoUtilizador().matches("new"))
@ -873,12 +881,10 @@ public class FichaUtilizador extends AbstractPageBean {
lblCedula.setRendered(false);
stCedula.setRendered(false);
}
}
if(getSessionBean1().getModoEdicaoUtilizador().matches("edit"))
{
//drpNome.setRendered(true);
//drpNome.setRendered(true);
if(!isPostData)
{
showUser();
@ -907,31 +913,38 @@ public class FichaUtilizador extends AbstractPageBean {
* <code>preprocess()</code>, or <code>prerender()</code> methods (or
* acquired during execution of an event handler).</p>
*/
public void destroy() {
@Override
public void destroy()
{
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected SessionBean1 getSessionBean1() {
protected SessionBean1 getSessionBean1()
{
return (SessionBean1)getBean("SessionBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected ApplicationBean1 getApplicationBean1() {
protected ApplicationBean1 getApplicationBean1()
{
return (ApplicationBean1)getBean("ApplicationBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected RequestBean1 getRequestBean1() {
protected RequestBean1 getRequestBean1()
{
return (RequestBean1)getBean("RequestBean1");
}
public String lnkAnalisesAcidente_action() {
public String lnkAnalisesAcidente_action()
{
//return navigate();
int tipo = getSessionBean1().getCurrentUser().getTipo().intValue();
if(tipo == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP)
@ -982,16 +995,13 @@ public class FichaUtilizador extends AbstractPageBean {
}
public String butCancelar_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
public String butCancelar_action()
{
return navigate();
}
public String butGravar_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
public String butGravar_action()
{
if(validationOk())
{
if(getSessionBean1().getModoEdicaoUtilizador().matches("new"))
@ -1027,14 +1037,12 @@ public class FichaUtilizador extends AbstractPageBean {
{
getSessionBean1().setMudarPassword(false);
}
}
return null;
}
public void drpTipo_processValueChange(ValueChangeEvent event) {
// TODO: Replace with your code
public void drpTipo_processValueChange(ValueChangeEvent event)
{
drpNome.setVisible(true);
Integer tipo = (Integer) drpTipo.getSelected();
boolean booGestor = false;
@ -1448,16 +1456,15 @@ public class FichaUtilizador extends AbstractPageBean {
return u;
}
public String lnkEditUser_action() {
// TODO: Replace with your code
public String lnkEditUser_action()
{
getSessionBean1().setModoEdicaoUtilizador("edit");
return "user";
}
public String butApagar_action() {
// TODO: Replace with your code
hidConfDelUser.setValue("apagar");
public String butApagar_action()
{
hidConfDelUser.setValue("apagar");
return null;
}
@ -1544,9 +1551,8 @@ public class FichaUtilizador extends AbstractPageBean {
return null;
}
public String lnkNewUser_action() {
// TODO: Replace with your code
public String lnkNewUser_action()
{
if(getSessionBean1().getCurrentUser().getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_GERAL_RH)
{
getSessionBean1().setNavFrom("FormDirGerRh");
@ -1555,12 +1561,11 @@ public class FichaUtilizador extends AbstractPageBean {
{
getSessionBean1().setNavFrom("FormDirSiprp");
}
return "gestao_utilizadores";
}
public String lnkAjuda_action() {
// TODO: Replace with your code
public String lnkAjuda_action()
{
// ServletContext theApplicationsServletContext =
// (ServletContext) this.getExternalContext().getContext();
// String pdfFolderPath = theApplicationsServletContext.getRealPath(Global.PDF_FOLDER_URL);
@ -1578,8 +1583,8 @@ public class FichaUtilizador extends AbstractPageBean {
return null;
}
public String lnkPlanosActuacao_action() {
// TODO: Replace with your code
public String lnkPlanosActuacao_action()
{
Utilizador u = getSessionBean1().getCurrentUser();
// String curUser = "?user=" + u.getId().toString();
FacesContext fc = getFacesContext().getCurrentInstance();

@ -49,7 +49,8 @@ import utils.Utils;
* lifecycle methods and event handlers where you may add behavior
* to respond to incoming events.</p>
*/
public class GestaoUtilizadores extends AbstractPageBean {
public class GestaoUtilizadores extends AbstractPageBean
{
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
private int __placeholder;
@ -793,12 +794,13 @@ public class GestaoUtilizadores extends AbstractPageBean {
* values submitted with this request. Instead, they represent the
* property values that were saved for this view when it was rendered.</p>
*/
public void init() {
@Override
public void init()
{
// Perform initializations inherited from our superclass
super.init();
// Perform application initialization that must complete
// *before* managed components are initialized
// TODO - add your own initialiation code here
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// Initialize automatically managed components
@ -813,14 +815,18 @@ public class GestaoUtilizadores extends AbstractPageBean {
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
if (!getSessionBean1().isLoggedIn()) {
try {
getExternalContext().redirect("Login.jsp");
} catch(Exception e) {
// . . . handle exception . . .
}
}
if ( ! getSessionBean1().isLoggedIn() )
{
try
{
getExternalContext().redirect("Login.jsp");
}
catch ( Exception e )
{
// . . . handle exception . . .
}
}
else
{
lblUser.setText( getSessionBean1().getCurrentUser().getLogin() );
@ -963,13 +969,13 @@ public class GestaoUtilizadores extends AbstractPageBean {
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected ApplicationBean1 getApplicationBean1() {
protected ApplicationBean1 getApplicationBean1()
{
return (ApplicationBean1)getBean("ApplicationBean1");
}
public String lnkEditUser_action() {
// TODO: Replace with your code
public String lnkEditUser_action()
{
getSessionBean1().setNavFrom("GestaoUtilizadores");
getSessionBean1().setModoEdicaoUtilizador("edit");
return "user";
@ -979,88 +985,75 @@ public class GestaoUtilizadores extends AbstractPageBean {
{
Utils.doLogout( getExternalContext(), true );
return null;
}
public String butNovaAnalise_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
public String butNovaAnalise_action()
{
return null;
}
public String lnkDataAcidente_action() {
// TODO: Replace with your code
public String lnkDataAcidente_action()
{
return null;
}
public String lnkNr_action() {
// TODO: Replace with your code
public String lnkNr_action()
{
return null;
}
public String lnkPor_action() {
// TODO: Replace with your code
public String lnkPor_action()
{
return null;
}
public String lnkNomeAcidentado_action() {
// TODO: Replace with your code
public String lnkNomeAcidentado_action()
{
return null;
}
public String lnkFase_action() {
// TODO: Replace with your code
public String lnkFase_action()
{
return null;
}
public String lnkDataAcidenteSeg_action() {
// TODO: Replace with your code
public String lnkDataAcidenteSeg_action()
{
return null;
}
public String lnkNrSeg_action() {
// TODO: Replace with your code
public String lnkNrSeg_action()
{
return null;
}
public String lnkPorSeg_action() {
// TODO: Replace with your code
public String lnkPorSeg_action()
{
return null;
}
public String lnkNomeAcidentadoSeg_action() {
// TODO: Replace with your code
public String lnkNomeAcidentadoSeg_action()
{
return null;
}
public String lnkFaseSeg_action() {
// TODO: Replace with your code
public String lnkFaseSeg_action()
{
return null;
}
public void drpAno_processValueChange(ValueChangeEvent event) {
// TODO: Replace with your code
public void drpAno_processValueChange(ValueChangeEvent event)
{
}
public void drpMes_processValueChange(ValueChangeEvent event) {
// TODO: Replace with your code
public void drpMes_processValueChange(ValueChangeEvent event)
{
}
public void drpDia_processValueChange(ValueChangeEvent event) {
// TODO: Replace with your code
public void drpDia_processValueChange(ValueChangeEvent event)
{
}
@ -1220,8 +1213,8 @@ public class GestaoUtilizadores extends AbstractPageBean {
return "user_fields";
}
public String lnkNomeInactivos_action() {
// TODO: Replace with your code
public String lnkNomeInactivos_action()
{
Utilizador u = getUtilizadorInactivoRowData();
getSessionBean1().setEditUser(u);
getSessionBean1().setModoEdicaoUtilizador("edit");
@ -1238,8 +1231,8 @@ public class GestaoUtilizadores extends AbstractPageBean {
return "user_fields";
}
public String lnkCategoriaInactivos_action() {
// TODO: Replace with your code
public String lnkCategoriaInactivos_action()
{
Utilizador u = getUtilizadorInactivoRowData();
getSessionBean1().setEditUser(u);
getSessionBean1().setModoEdicaoUtilizador("edit");
@ -1247,8 +1240,8 @@ public class GestaoUtilizadores extends AbstractPageBean {
return "user_fields";
}
public String lnkEstabelecimentoInactivos_action() {
// TODO: Replace with your code
public String lnkEstabelecimentoInactivos_action()
{
Utilizador u = getUtilizadorInactivoRowData();
getSessionBean1().setEditUser(u);
getSessionBean1().setModoEdicaoUtilizador("edit");
@ -1267,21 +1260,18 @@ public class GestaoUtilizadores extends AbstractPageBean {
}
public String lnkNewUser_action() {
// TODO: Replace with your code
public String lnkNewUser_action()
{
return null;
}
public String butNovoUtilizador_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
public String butNovoUtilizador_action()
{
return "novo_utilizador";
}
public String lnkAnalisesAcidente_action() {
// TODO: Replace with your code
public String lnkAnalisesAcidente_action()
{
String nav_from = getSessionBean1().getNavFrom();
Integer tipo_utilizador = getSessionBean1().getCurrentUser().getTipo();
if(tipo_utilizador.intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP)
@ -1295,8 +1285,8 @@ public class GestaoUtilizadores extends AbstractPageBean {
return null;
}
public String lnkAjuda_action() {
// TODO: Replace with your code
public String lnkAjuda_action()
{
// ServletContext theApplicationsServletContext =
// (ServletContext) this.getExternalContext().getContext();
// String pdfFolderPath = theApplicationsServletContext.getRealPath(Global.PDF_FOLDER_URL);
@ -1314,8 +1304,8 @@ public class GestaoUtilizadores extends AbstractPageBean {
return null;
}
public String lnkPlanosActuacao_action() {
// TODO: Replace with your code
public String lnkPlanosActuacao_action()
{
Utilizador u = getSessionBean1().getCurrentUser();
// String curUser = "?user=" + u.getId().toString();
FacesContext fc = getFacesContext().getCurrentInstance();

@ -17,7 +17,8 @@ import utils.Utils;
* lifecycle methods and event handlers where you may add behavior
* to respond to incoming events.</p>
*/
public class Header extends AbstractFragmentBean {
public class Header extends AbstractFragmentBean
{
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
private int __placeholder;
@ -30,7 +31,9 @@ public class Header extends AbstractFragmentBean {
}
// </editor-fold>
public Header() {
public Header()
{
}
/**
@ -41,12 +44,13 @@ public class Header extends AbstractFragmentBean {
*
* <p>The default implementation does nothing.</p>
*/
public void init() {
@Override
public void init()
{
// Perform initializations inherited from our superclass
super.init();
// Perform application initialization that must complete
// *before* managed components are initialized
// TODO - add your own initialiation code here
// <editor-fold defaultstate="collapsed" desc="Visual-Web-managed Component Initialization">
@ -62,7 +66,6 @@ public class Header extends AbstractFragmentBean {
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
}
/**
@ -73,7 +76,10 @@ public class Header extends AbstractFragmentBean {
*
* <p>The default implementation does nothing.</p>
*/
public void destroy() {
@Override
public void destroy()
{
}
/**
@ -97,28 +103,28 @@ public class Header extends AbstractFragmentBean {
return (ApplicationBean1)getBean("ApplicationBean1");
}
public String lnkAnalisesAcidente_action() {
// TODO: Replace with your code
public String lnkAnalisesAcidente_action()
{
return null;
}
public String lnkPlanosActuacao_action() {
// TODO: Replace with your code
public String lnkPlanosActuacao_action()
{
return null;
}
public String lnkNewUser_action() {
// TODO: Replace with your code
public String lnkNewUser_action()
{
return null;
}
public String lnkEditUser_action() {
// TODO: Replace with your code
public String lnkEditUser_action()
{
return null;
}
public String lnkAjuda_action() {
// TODO: Replace with your code
public String lnkAjuda_action()
{
return null;
}

@ -218,12 +218,13 @@ public class LoadImage extends AbstractPageBean {
* values submitted with this request. Instead, they represent the
* property values that were saved for this view when it was rendered.</p>
*/
public void init() {
@Override
public void init()
{
// Perform initializations inherited from our superclass
super.init();
// Perform application initialization that must complete
// *before* managed components are initialized
// TODO - add your own initialiation code here
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// Initialize automatically managed components
@ -238,15 +239,18 @@ public class LoadImage extends AbstractPageBean {
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
if (!getSessionBean1().isLoggedIn()) {
try {
getExternalContext().redirect("Login.jsp");
} catch(Exception e) {
// . . . handle exception . . .
}
}
if (!getSessionBean1().isLoggedIn())
{
try
{
getExternalContext().redirect("Login.jsp");
}
catch(Exception e)
{
// . . . handle exception . . .
}
}
else
{
@ -266,9 +270,6 @@ public class LoadImage extends AbstractPageBean {
ErrorLogger.logException( ex );
}
}
}
/**
@ -278,7 +279,10 @@ public class LoadImage extends AbstractPageBean {
* is processing a form submit. Customize this method to allocate
* resources that will be required in your event handlers.</p>
*/
public void preprocess() {
@Override
public void preprocess()
{
}
/**
@ -289,7 +293,9 @@ public class LoadImage extends AbstractPageBean {
* this method to allocate resources that will be required for rendering
* this page.</p>
*/
public void prerender() {
@Override
public void prerender()
{
//String uploadedFileName = (String) this.txtFileName.getValue();
//if ( uploadedFileName != null ) {
// IMAGE_URL += getSessionBean1().getImageName();
@ -297,8 +303,7 @@ public class LoadImage extends AbstractPageBean {
//image1.setUrl(IMAGE_URL);
// }
txtMsg.setText(getSessionBean1().getMsg());
getSessionBean1().setMsg("");
getSessionBean1().setMsg("");
}
/**
@ -309,7 +314,10 @@ public class LoadImage extends AbstractPageBean {
* <code>preprocess()</code>, or <code>prerender()</code> methods (or
* acquired during execution of an event handler).</p>
*/
public void destroy() {
@Override
public void destroy()
{
}
/**
@ -339,37 +347,32 @@ public class LoadImage extends AbstractPageBean {
return null;
}
public String lnkNome_action() {
// TODO: Replace with your code
public String lnkNome_action()
{
return null;
}
public String lnkDataNascimento_action() {
// TODO: Replace with your code
public String lnkDataNascimento_action()
{
return null;
}
public String butCancelar_action() {
getSessionBean1().setImageName(null);
return "analise_acidente";
public String butCancelar_action()
{
getSessionBean1().setImageName( null );
return "analise_acidente";
}
public String butUpload_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
public String butUpload_action()
{
//realImageFilePath += "/tmp" + getSessionBean1().getCurrentUser().getLogin();
System.out.println("REAL IMAGE FILE PATH : " + realImageFilePath);
File fdir = new File(realImageFilePath);
System.out.println("FDIR : " + fdir);
UploadedFile uploadedFile = fileUpload1.getUploadedFile();
if(uploadedFile != null)
{
String uploadedFileName = uploadedFile.getOriginalName();
// Some browsers return complete path name, some don't

@ -381,10 +381,6 @@ public class Login extends AbstractPageBean
Utils.doLogin( getExternalContext(), u );
//Login Ok !
// if(u.getPrimeiro_login().matches("y") || mustChangePassword(u))
if(u.getPrimeiro_login().matches("y") )

@ -20,7 +20,8 @@ import javax.faces.FacesException;
* or method binding expression that references a managed bean using
* this class.</p>
*/
public class RequestBean1 extends AbstractRequestBean {
public class RequestBean1 extends AbstractRequestBean
{
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
private int __placeholder;
@ -36,7 +37,9 @@ public class RequestBean1 extends AbstractRequestBean {
/**
* <p>Construct a new request data bean instance.</p>
*/
public RequestBean1() {
public RequestBean1()
{
}
/**
@ -49,12 +52,13 @@ public class RequestBean1 extends AbstractRequestBean {
* <p>You may customize this method to allocate resources that are required
* for the lifetime of the current request.</p>
*/
public void init() {
@Override
public void init()
{
// Perform initializations inherited from our superclass
super.init();
// Perform application initialization that must complete
// *before* managed components are initialized
// TODO - add your own initialiation code here
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// Initialize automatically managed components
@ -69,7 +73,6 @@ public class RequestBean1 extends AbstractRequestBean {
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
}
/**
@ -81,20 +84,25 @@ public class RequestBean1 extends AbstractRequestBean {
* during the execution of the <code>init()</code> method, or
* at any later time during the lifetime of the request.</p>
*/
public void destroy() {
@Override
public void destroy()
{
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected SessionBean1 getSessionBean1() {
protected SessionBean1 getSessionBean1()
{
return (SessionBean1)getBean("SessionBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected ApplicationBean1 getApplicationBean1() {
protected ApplicationBean1 getApplicationBean1()
{
return (ApplicationBean1)getBean("ApplicationBean1");
}
}

@ -46,7 +46,8 @@ import utils.Utils;
* lifecycle methods and event handlers where you may add behavior
* to respond to incoming events.</p>
*/
public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean {
public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean
{
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
private int __placeholder;
@ -2170,7 +2171,6 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean {
super.init();
// Perform application initialization that must complete
// *before* managed components are initialized
// TODO - add your own initialiation code here
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// Initialize automatically managed components
@ -2185,15 +2185,19 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean {
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
if (!getSessionBean1().isLoggedIn()) {
try {
getExternalContext().redirect("Login.jsp");
} catch(Exception e) {
// . . . handle exception . . .
if (!getSessionBean1().isLoggedIn())
{
try
{
getExternalContext().redirect("Login.jsp");
}
catch(Exception e)
{
// . . . handle exception . . .
System.out.println("LOGGED IN = " + e.getMessage());
}
}
}
}
else
{
lblUser.setText( getSessionBean1().getCurrentUser().getLogin() );
@ -2302,21 +2306,24 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean {
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected SessionBean1 getSessionBean1() {
protected SessionBean1 getSessionBean1()
{
return (SessionBean1)getBean("SessionBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected RequestBean1 getRequestBean1() {
protected RequestBean1 getRequestBean1()
{
return (RequestBean1)getBean("RequestBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected ApplicationBean1 getApplicationBean1() {
protected ApplicationBean1 getApplicationBean1()
{
return (ApplicationBean1)getBean("ApplicationBean1");
}
@ -2326,15 +2333,13 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean {
return null;
}
public String lnkNome_action() {
// TODO: Replace with your code
public String lnkNome_action()
{
return null;
}
public String lnkDataNascimento_action() {
// TODO: Replace with your code
public String lnkDataNascimento_action()
{
return null;
}
@ -4438,10 +4443,8 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean {
}
}
public String butVoltar_action() {
// TODO: Replace with your code
public String butVoltar_action()
{
String navFrom = getSessionBean1().getNavFrom();
if(navFrom.matches("FormSeguranca"))
{
@ -4471,10 +4474,8 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean {
else if(navFrom.matches("FormGestor"))
{
return "form_gestor";
}
}
return null;
}
public String lnkAnalisesAcidente_action()
@ -4537,22 +4538,20 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean {
return null;
}
public String lnkNewUser_action() {
// TODO: Replace with your code
public String lnkNewUser_action()
{
return null;
}
public String lnkEditUser_action() {
// TODO: Replace with your code
public String lnkEditUser_action()
{
getSessionBean1().setNavFrom("ViewAnaliseAcidenteTrabalho");
getSessionBean1().setModoEdicaoUtilizador("edit");
return "user";
}
public String lnkAjuda_action() {
// TODO: Replace with your code
public String lnkAjuda_action()
{
// ServletContext theApplicationsServletContext =
// (ServletContext) this.getExternalContext().getContext();
// String pdfFolderPath = theApplicationsServletContext.getRealPath(Global.PDF_FOLDER_URL);
@ -4570,9 +4569,8 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean {
return null;
}
public String butEliminar_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
public String butEliminar_action()
{
hidConfDelete.setValue("apagar");
return null;
}
@ -4645,8 +4643,8 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean {
// }
}
public String lnkPlanosActuacao_action() {
// TODO: Replace with your code
public String lnkPlanosActuacao_action()
{
return null;
}

@ -12,6 +12,22 @@ database.siprp_local = siprp_local_3
username.siprp_local = postgres
#password.siprp_local =
# tests localhost
#server.siprp = localhost
#port.siprp = 5432
#database.siprp = siprp
#username.siprp = postgres
#password.siprp = Typein
#
#server.siprp_local = localhost
#port.siprp_local = 5432
#database.siprp_local = siprp_local_3
#username.siprp_local = postgres
#password.siprp_local = Typein
# tests evoserver
#server.siprp = evoserver
#port.siprp = 5432

@ -13,7 +13,7 @@ public interface EstatisticasConstants
{
public static final String[] KEY_NAMES = new String[] {
"POR", "Nome", "Ano Ocorrência", "Data Ocorrência", "Hora Ocorrência", "Horas Trabalhadas no Turno",
/*"Departamento", */"Secção", "Causas do Acidente", "Turno de Trabalho", "Formação SHST"
/*"Departamento", */"Estabelecimento", "Secção", "Causas do Acidente", "Turno de Trabalho", "Formação SHST"
//TODO: falta os 2 ultimos
};
@ -26,6 +26,7 @@ public interface EstatisticasConstants
public static final String KEY_HORAS_TRABALHADAS = "analises_acidentes.horas_turno";
// public static final String KEY_DEPARTAMENTO = "departamentos.descricao";
public static final String KEY_ESTABELECIMENTO = "analises_acidentes.estabelecimento_id";
public static final String KEY_SECCAO = "analises_acidentes.seccao_id";
public static final String KEY_CAUSAS_ACIDENTE = "analises_acidentes.causas";

@ -23,6 +23,10 @@ import beans.Seccao;
import beans.TecnicoSaude;
import beans.TipoUtilizador;
import beans.Trabalhador;
import com.evolute.utils.arrays.Virtual2DArray;
import com.evolute.utils.sql.Expression;
import com.evolute.utils.sql.Field;
import com.evolute.utils.sql.Select2;
import com.evolute.utils.strings.StringPlainer;
import com.sun.rave.web.ui.model.Option;
import global.Global;
@ -36,6 +40,8 @@ import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.StringTokenizer;
import utils.Strings;
@ -49,27 +55,6 @@ public class AnalisesDataProvider extends GenericDataProvider
{
private static AnalisesDataProvider INSTANCE = null;
// private final static int ESTADO_SEG = 1;
// private final static int ESTADO_RH1 = 2;
// private final static int ESTADO_HS = 3;
// private final static int ESTADO_RH2 = 4;
// private final static int ESTADO_MEDICO = 5;
// private final static int ESTADO_ASSINATURAS = 6;
// private final static int ESTADO_IMPRESSAO = 7;
// private final static int ESTADO_FECHAR = 8;
// private final static int ESTADO_CONCLUIDO = 9;
private final static int ESTADO_ASSINATURA_1 = 1;
private final static int ESTADO_ASSINATURA_2 = 2;
private final static int ESTADO_ASSINATURA_3 = 3;
private final static int ESTADO_ASSINATURA_RESP_SEG = 1;
private final static int ESTADO_ASSINATURA_SEG = 2;
private final static int ESTADO_ASSINATURA_HS = 3;
private final static int ESTADO_ASSINATURA_MED = 4;
private final static int ESTADO_ASSINATURA_RH = 5;
private final static int ESTADO_ASSINATURA_RESP_RH = 6;
private AnalisesDataProvider() throws Exception
{
@ -155,7 +140,6 @@ public class AnalisesDataProvider extends GenericDataProvider
joinConditions += "acidentados.id = analises_acidentes.acidentado_id AND ";
}
if ( nome != null )
{
nome = StringPlainer.convertString( nome.trim() );
@ -190,12 +174,12 @@ public class AnalisesDataProvider extends GenericDataProvider
/*************************************************************************/
public ArrayList searchAnalisesActualSeg( Integer estabelecimento_id,
String nome, String visitaDate, String POR, String responsavel_loja )
String nome, String visitaDate, String POR, String responsavel_loja, Integer fromYear )
throws Exception
{
if ( nome == null && visitaDate == null && POR == null )
{
return getAnalisesActuaisSegList( estabelecimento_id, responsavel_loja );
return getAnalisesActuaisSegList( estabelecimento_id, responsavel_loja, fromYear );
}
Statement st = createStatement();
@ -220,48 +204,90 @@ public class AnalisesDataProvider extends GenericDataProvider
return list;
}
public ArrayList getAnalisesActuaisSegList(Integer estabelecimento_id, String responsavel_loja) throws Exception
public ArrayList getAnalisesActuaisSegList( Integer estabelecimentoID, String responsavel_loja, Integer fromYear )
throws Exception
{
Statement st = createStatement();
String sql = "";
if(responsavel_loja.matches("y"))
{
sql ="SELECT * FROM analises_acidentes WHERE (estado = " + Global.ESTADO_SEG + " OR (averiguacao_posterior = 'y' AND averiguacao_obs = '')" + " OR estado = " + Global.ESTADO_ASSINATURA_SEG + ")" + " AND estabelecimento_id = " + estabelecimento_id + " AND apagada = 'n' ORDER BY analise_nr";
}
else
{
sql ="SELECT * FROM analises_acidentes WHERE (estado = " + Global.ESTADO_SEG + " OR (averiguacao_posterior = 'y' AND averiguacao_obs = ''))" + " AND estabelecimento_id = " + estabelecimento_id + " AND apagada = 'n' ORDER BY analise_nr";
}
Expression where = new Field( "analises_acidentes.apagada" ).isEqual( "n" );
where = where.and( new Field( "analises_acidentes.estabelecimento_id" ).isEqual( estabelecimentoID ) );
if ( fromYear != null )
{
where = where.and( new Field( "EXTRACT( year FROM analises_acidentes.data_acidente )" ).isEqual( fromYear ) );
}
ResultSet rs = st.executeQuery(sql);
ArrayList list = fillAnaliseFields(rs);
Expression states = new Field( "analises_acidentes.estado" ).isEqual( Global.ESTADO_SEG )
.or(
new Field( "analises_acidentes.averiguacao_posterior" ).isEqual( "y" )
.and( new Field( "analises_acidentes.averiguacao_obs" ).isEqual( "" ) )
);
if ( "y".equals( responsavel_loja ) )
{
states = states.or( new Field( "analises_acidentes.estado" ).isEqual( Global.ESTADO_ASSINATURA_SEG ) );
}
where = where.and( states );
Select2 query = new Select2(
new String[] { "analises_acidentes" },
new Integer[] {},
new Expression[] {},
new String[] { "*" },
where,
new String[] { "analises_acidentes.analise_nr" },
null, null, null
);
// String sql = "";
// if ( responsavel_loja.matches( "y" ) )
// {
// sql = "SELECT * " +
// "FROM analises_acidentes " +
// "WHERE " +
// "(estado = " + Global.ESTADO_SEG + " OR (averiguacao_posterior = 'y' AND averiguacao_obs = '')" +
// " OR estado = " + Global.ESTADO_ASSINATURA_SEG + ")" +
// " AND estabelecimento_id = " + estabelecimentoID +
// " AND apagada = 'n' " +
// "ORDER BY analise_nr";
// }
// else
// {
// sql = "SELECT * " +
// "FROM analises_acidentes " +
// "WHERE " +
// "( estado = " + Global.ESTADO_SEG + " OR (averiguacao_posterior = 'y' AND averiguacao_obs = '') )" +
// " AND estabelecimento_id = " + estabelecimentoID +
// " AND apagada = 'n' " +
// "ORDER BY analise_nr";
// }
Statement st = createStatement();
ResultSet rs = st.executeQuery( query.toString() );
ArrayList list = fillAnaliseFields( rs );
return list;
}
public ArrayList searchAnalisesActualRH( Integer estabelecimento_id,
String nome, String visitaDate, String POR, String responsavel_loja )
String nome, String visitaDate, String POR, String responsavel_loja, Integer fromYear )
throws Exception
{
if ( nome == null && visitaDate == null && POR == null )
{
return getAnalisesActuaisRhList( estabelecimento_id, responsavel_loja );
return getAnalisesActuaisRhList( estabelecimento_id, responsavel_loja, fromYear );
}
Statement st = createStatement();
String sql = getExpression( nome, null, visitaDate, POR );
if(responsavel_loja.matches("y"))
if ( responsavel_loja.matches( "y" ) )
{
sql += "AND (estado = " + Global.ESTADO_RH1 + " OR estado = " + Global.ESTADO_RH2 +
" OR estado = " + Global.ESTADO_ASSINATURA_RH + ") AND estabelecimento_id = " + estabelecimento_id +
" ORDER BY analise_nr";
" OR estado = " + Global.ESTADO_ASSINATURA_RH + ") AND estabelecimento_id = " + estabelecimento_id +
" ORDER BY analise_nr";
}
else
{
sql += "AND (estado = " + Global.ESTADO_RH1 + " OR estado = " + Global.ESTADO_RH2 +
") AND estabelecimento_id = " + estabelecimento_id +
" ORDER BY analise_nr";
") AND estabelecimento_id = " + estabelecimento_id +
" ORDER BY analise_nr";
}
ResultSet rs = st.executeQuery( sql );
@ -269,32 +295,72 @@ public class AnalisesDataProvider extends GenericDataProvider
return list;
}
public ArrayList getAnalisesActuaisRhList(Integer estabelecimento_id, String responsavel_loja) throws Exception
public ArrayList getAnalisesActuaisRhList( Integer estabelecimentoID, String responsavel_loja, Integer fromYear )
throws Exception
{
Statement st = createStatement();
String sql = "";
if(responsavel_loja.matches("y"))
{
sql ="SELECT * FROM analises_acidentes WHERE (estado = " + Global.ESTADO_RH1 + " OR estado = " + Global.ESTADO_RH2 + " OR estado = " + Global.ESTADO_ASSINATURA_RH + ") AND estabelecimento_id = " + estabelecimento_id + " AND apagada = 'n' ORDER BY analise_nr";
}
else
{
sql ="SELECT * FROM analises_acidentes WHERE (estado = " + Global.ESTADO_RH1 + " OR estado = " + Global.ESTADO_RH2 + ") AND estabelecimento_id = " + estabelecimento_id + " AND apagada = 'n' ORDER BY analise_nr";
}
Expression where = new Field( "apagada" ).isEqual( "n" );
where = where.and( new Field( "estabelecimento_id" ).isEqual( estabelecimentoID ) );
if ( fromYear != null )
{
where = where.and( new Field( "EXTRACT( year FROM analises_acidentes.data_acidente )" ).isEqual( fromYear ) );
}
ResultSet rs = st.executeQuery(sql);
ArrayList list = fillAnaliseFields(rs);
Expression or = new Field( "estado" ).isEqual( Global.ESTADO_RH1 )
.or( new Field( "estado" ).isEqual( Global.ESTADO_RH2 ) );
if ( "y".equals( responsavel_loja ) )
{
or = or.or( new Field( "estado" ).isEqual( Global.ESTADO_ASSINATURA_RH ) );
}
where = where.and( or );
Select2 query = new Select2(
new String[] { "analises_acidentes" },
new Integer[] {},
new Expression[] {},
new String[] { "*" },
where,
new String[] { "analise_nr" },
null, null, null
);
// String sql = "";
// if ( responsavel_loja.matches( "y" ) )
// {
// sql = "SELECT * " +
// "FROM analises_acidentes " +
// "WHERE " +
// "(estado = " + Global.ESTADO_RH1 + " OR estado = " + Global.ESTADO_RH2 + " OR estado = " + Global.ESTADO_ASSINATURA_RH + ") " +
// "AND estabelecimento_id = " + estabelecimentoID +
// " AND apagada = 'n' " +
// "ORDER BY analise_nr";
// }
// else
// {
// sql = "SELECT * " +
// "FROM analises_acidentes " +
// "WHERE " +
// "(estado = " + Global.ESTADO_RH1 + " OR estado = " + Global.ESTADO_RH2 + ") " +
// "AND estabelecimento_id = " + estabelecimentoID +
// " AND apagada = 'n' " +
// "ORDER BY analise_nr";
// }
System.out.println( "\ngetAnalisesActuaisRhList() : " + query.toString() + "\n" );
Statement st = createStatement();
ResultSet rs = st.executeQuery( query.toString() );
ArrayList list = fillAnaliseFields( rs );
return list;
}
public ArrayList searchAnalisesActuaisHS( Integer estabelecimento_id,
String nome, String estabelecimento, String visitaDate, String POR )
public ArrayList searchAnalisesActuaisHS( Integer estabelecimento_id,
String nome, String estabelecimento, String visitaDate, String POR, Integer fromYear )
throws Exception
{
if ( nome == null && estabelecimento == null && visitaDate == null && POR == null )
{
return getAnalisesActuaisHsList( estabelecimento_id );
return getAnalisesActuaisHsList( estabelecimento_id, fromYear );
}
Statement st = createStatement();
@ -309,42 +375,44 @@ public class AnalisesDataProvider extends GenericDataProvider
return list;
}
public ArrayList getAnalisesActuaisHsList(Integer estabelecimento_id) throws Exception
public ArrayList getAnalisesActuaisHsList( Integer estabelecimentoID, Integer fromYear ) throws Exception
{
Statement st = createStatement();
String sql ="SELECT * FROM analises_acidentes WHERE (estado = " + Global.ESTADO_HS + " OR estado = " + Global.ESTADO_FECHAR + " OR estado = " + Global.ESTADO_CONSOLIDACAO + ")" + " AND apagada = 'n' ORDER BY analise_nr"; //AND estabelecimento_id = " + estabelecimento_id;
ResultSet rs = st.executeQuery(sql);
ArrayList list = fillAnaliseFields(rs);
return list;
}
Expression where = new Field( "apagada" ).isEqual( "n" ).and(
new Field( "estado" ).isEqual( Global.ESTADO_HS )
.or( new Field( "estado" ).isEqual( Global.ESTADO_FECHAR ) )
.or( new Field( "estado" ).isEqual( Global.ESTADO_CONSOLIDACAO ) )
);
// public ArrayList searchAnalisesActuaisMedico( Integer estabelecimento_id, String nome )
// throws Exception
// {
// if ( nome == null )
// {
// return getAnalisesActuaisMedicoList( estabelecimento_id );
// }
//
// Statement st = createStatement();
// String sql = getExpression( nome, null );
//
// sql += "AND (estado = " + Global.ESTADO_MEDICINA + " OR (estado = " + Global.ESTADO_ASSINATURAS +
// " AND estado_assinatura = 2 and ass_med = 'n')) AND estabelecimento_id = " + estabelecimento_id;
//
// ResultSet rs = st.executeQuery( sql );
// ArrayList list = fillAnaliseFields( rs );
// return list;
// }
if ( fromYear != null )
{
where = where.and( new Field( "EXTRACT( year FROM data_acidente )" ).isEqual( fromYear ) );
}
Select2 query = new Select2(
new String[] { "analises_acidentes" },
new Integer[] {},
new Expression[] {},
new String[] { "*" },
where,
new String[] { "analise_nr" },
null, null, null
);
// String sql = "SELECT * " +
// "FROM analises_acidentes " +
// "WHERE " +
// "(estado = " + Global.ESTADO_HS + " OR estado = " + Global.ESTADO_FECHAR +
// " OR estado = " + Global.ESTADO_CONSOLIDACAO + ")" +
// " AND apagada = 'n' " +
// "ORDER BY analise_nr";
System.out.println( "\nAnalisesDataProvider . getAnalisesActuaisHsList() : " + query.toString() );
Statement st = createStatement();
ResultSet rs = st.executeQuery( query.toString() );
ArrayList list = fillAnaliseFields( rs );
return list;
}
// public ArrayList getAnalisesActuaisMedicoList(Integer estabelecimento_id) throws Exception
// {
// Statement st = createStatement();
// String sql ="SELECT * FROM analises_acidentes WHERE (estado = " + Global.ESTADO_MEDICINA + " OR (estado = " + Global.ESTADO_ASSINATURAS + " AND estado_assinatura = 2 and ass_med = 'n')) AND estabelecimento_id = " + estabelecimento_id;
// ResultSet rs = st.executeQuery(sql);
// ArrayList list = fillAnaliseFields(rs);
// return list;
// }
@ -354,12 +422,12 @@ public class AnalisesDataProvider extends GenericDataProvider
/*************************************************************************/
public ArrayList searchAnalisesSeguimentoSeg( Integer estabelecimento_id,
String nome, String visitaDate, String POR, String responsavel_loja )
String nome, String visitaDate, String POR, String responsavel_loja, Integer fromYear )
throws Exception
{
if ( nome == null && visitaDate == null && POR == null )
{
return getAnalisesSeguimentoSegList( estabelecimento_id, responsavel_loja );
return getAnalisesSeguimentoSegList( estabelecimento_id, responsavel_loja, fromYear );
}
Statement st = createStatement();
@ -382,54 +450,59 @@ public class AnalisesDataProvider extends GenericDataProvider
")) OR estado = " + Global.ESTADO_FECHAR +
")" + " ORDER BY analise_nr";
}
System.out.println( "SQL: " + sql );
ResultSet rs = st.executeQuery( sql );
ArrayList list = fillAnaliseFields( rs );
return list;
}
public ArrayList getAnalisesSeguimentoSegList( Integer estabelecimento_id, String responsavel_loja )
public ArrayList getAnalisesSeguimentoSegList( Integer estabelecimento_id, String responsavel_loja, Integer fromYear )
throws Exception
{
Statement st = createStatement();
String sql = null;
// TODO : change to Select2
if ( responsavel_loja.matches( "y" ) )
{
sql ="SELECT * FROM analises_acidentes WHERE " +
sql = "SELECT * FROM analises_acidentes WHERE " +
"estabelecimento_id = " + estabelecimento_id + " AND (" +
"estado > " + Global.ESTADO_SEG + " AND estado < " + Global.ESTADO_ASSINATURA_SEG + " AND (" +
"averiguacao_posterior = 'n' OR (averiguacao_posterior = 'y' AND averiguacao_obs <> '')" +
") " +
"OR (estado > " + Global.ESTADO_ASSINATURA_SEG + " AND estado < " + Global.ESTADO_CONCLUIDO + ")" +
")" + " AND apagada = 'n' " +
"ORDER BY analise_nr";
// sql ="SELECT * FROM analises_acidentes WHERE estabelecimento_id = " + estabelecimento_id + " AND ((estado = 7 and ass_resp_seg = 'y') OR (estado > 1 AND estado < 7 AND (averiguacao_posterior = 'n' OR (averiguacao_posterior = 'y' AND averiguacao_obs <> ''))) OR (estado > 7 AND estado < 10))";
")" + " AND apagada = 'n' ";
}
else
{
// sql ="SELECT * FROM analises_acidentes WHERE estabelecimento_id = " + estabelecimento_id + " AND ((estado > " + Global.ESTADO_SEG + " AND estado < 8 AND (averiguacao_posterior = 'n' OR (averiguacao_posterior = 'y' AND averiguacao_obs <> ''))) OR (estado > 7 AND estado < 10))";
sql ="SELECT * FROM analises_acidentes WHERE " +
sql = "SELECT * FROM analises_acidentes WHERE " +
"estabelecimento_id = " + estabelecimento_id + " AND (" +
"(estado > " + Global.ESTADO_SEG + " AND estado < " + Global.ESTADO_FECHAR + " AND (" +
"averiguacao_posterior = 'n' OR (averiguacao_posterior = 'y' AND averiguacao_obs <> '')" +
")) OR estado = " + Global.ESTADO_FECHAR +
")" + " AND apagada = 'n' " +
"ORDER BY analise_nr";
")" + " AND apagada = 'n' ";
}
if ( fromYear != null )
{
sql += " AND EXTRACT( year FROM analises_acidentes.data_acidente ) = " + fromYear + " ";
}
sql += " ORDER BY analise_nr ";
System.out.println( "\ngetAnalisesSeguimentoSegList() : " + sql + "\n" );
Statement st = createStatement();
ResultSet rs = st.executeQuery( sql );
ArrayList list = fillAnaliseFields( rs );
return list;
}
public ArrayList searchAnalisesSeguimentoHS( Integer estabelecimento_id,
String nome, String estabelecimento, String visitaDate, String POR )
String nome, String estabelecimento, String visitaDate, String POR, Integer fromYear )
throws Exception
{
if ( nome == null && estabelecimento == null && visitaDate == null && POR == null )
{
return getAnalisesSeguimentoHsList( estabelecimento_id );
return getAnalisesSeguimentoHsList( estabelecimento_id, fromYear );
}
Statement st = createStatement();
@ -445,32 +518,53 @@ public class AnalisesDataProvider extends GenericDataProvider
return list;
}
public ArrayList getAnalisesSeguimentoHsList( Integer estabelecimento_id )
public ArrayList getAnalisesSeguimentoHsList( Integer estabelecimentoID, Integer fromYear )
throws Exception
{
Statement st = createStatement();
String sql = null;
sql = "SELECT * FROM analises_acidentes WHERE (" +
"estado < " + Global.ESTADO_HS + " OR (estado > " + Global.ESTADO_HS + " AND estado < " + Global.ESTADO_CONSOLIDACAO + ") " +
"OR (estado > " + Global.ESTADO_CONSOLIDACAO + " AND estado < " + Global.ESTADO_FECHAR + ")" +
")" + " AND apagada = 'n' " +
"ORDER BY analise_nr"; // AND estabelecimento_id = " + estabelecimento_id;
ResultSet rs = st.executeQuery(sql);
System.out.println("SEGUIMENTO HS SQL : " + sql);
ArrayList list = fillAnaliseFields(rs);
Expression where = new Field( "analises_acidentes.apagada" ).isEqual( "n" );
if ( fromYear != null )
{
where = where.and( new Field( "EXTRACT( year FROM analises_acidentes.data_acidente )" ).isEqual( fromYear ) );
}
where = where.and(
new Field( "estado" ).isLess( Global.ESTADO_HS )
.or( new Field( "estado" ).isGreater( Global.ESTADO_HS ).and( new Field( "estado" ).isLess( Global.ESTADO_CONSOLIDACAO ) ) )
.or( new Field( "estado" ).isGreater( Global.ESTADO_CONSOLIDACAO ).and( new Field( "estado" ).isLess( Global.ESTADO_FECHAR ) ) )
);
Select2 query = new Select2(
new String[] { "analises_acidentes" },
new Integer[] {},
new Expression[] {},
new String[] { "*" },
where,
new String[] { "analises_acidentes.analise_nr" },
null, null, null
);
// String sql = null;
// sql = "SELECT * FROM analises_acidentes WHERE (" +
// "estado < " + Global.ESTADO_HS + " OR (estado > " + Global.ESTADO_HS + " AND estado < " + Global.ESTADO_CONSOLIDACAO + ") " +
// "OR (estado > " + Global.ESTADO_CONSOLIDACAO + " AND estado < " + Global.ESTADO_FECHAR + ")" +
// ")" + " AND apagada = 'n' " +
// "ORDER BY analise_nr";
// AND estabelecimento_id = " + estabelecimento_id;
Statement st = createStatement();
ResultSet rs = st.executeQuery( query.toString() );
System.out.println( "SEGUIMENTO HS SQL : " + query.toString() );
ArrayList list = fillAnaliseFields( rs );
return list;
}
public ArrayList searchAnalisesSeguimentoRH( Integer estabelecimento_id,
String nome, String visitaDate, String POR, String responsavel_loja )
String nome, String visitaDate, String POR, String responsavel_loja, Integer fromYear )
throws Exception
{
if ( nome == null && visitaDate == null && POR == null )
{
return getAnalisesSeguimentoRhList( estabelecimento_id, responsavel_loja );
return getAnalisesSeguimentoRhList( estabelecimento_id, responsavel_loja, fromYear );
}
Statement st = createStatement();
@ -491,49 +585,56 @@ public class AnalisesDataProvider extends GenericDataProvider
") AND estabelecimento_id = " + estabelecimento_id +
" ORDER BY analise_nr";
}
ResultSet rs = st.executeQuery( sql );
ArrayList list = fillAnaliseFields( rs );
return list;
}
public ArrayList getAnalisesSeguimentoRhList( Integer estabelecimento_id, String responsavel_loja )
public ArrayList getAnalisesSeguimentoRhList( Integer estabelecimentoID, String responsavel_loja, Integer fromYear )
throws Exception
{
Statement st = createStatement();
String sql = null;
Expression where = new Field( "apagada" ).isEqual( "n" );
where = where.and( new Field( "estabelecimento_id" ).isEqual( estabelecimentoID ) );
if ( fromYear != null )
{
where = where.and( new Field( "EXTRACT( year FROM analises_acidentes.data_acidente )" ).isEqual( fromYear ) );
}
if ( responsavel_loja.matches( "y" ) )
{
// sql ="SELECT * FROM analises_acidentes WHERE (estado = 1 OR estado = 3 OR estado = 6 OR (estado = 7 AND estado_assinatura < 2) OR estado = 9) AND estabelecimento_id = " + estabelecimento_id;
// sql ="SELECT * FROM analises_acidentes WHERE (estado = 1 OR estado = 3 OR estado = 6 OR (estado = 7 AND estado_assinatura < 2) OR (estado = 7 and ass_resp_rh = 'y') OR estado = 9) AND estabelecimento_id = " + estabelecimento_id;
sql ="SELECT * FROM analises_acidentes WHERE (" +
"estado = " + Global.ESTADO_SEG + " OR estado = " + Global.ESTADO_HS + " OR estado = " + Global.ESTADO_CONSOLIDACAO +
" OR estado = " + Global.ESTADO_ASSINATURA_SEG + " OR estado = " + Global.ESTADO_FECHAR +
") AND estabelecimento_id = " + estabelecimento_id + " AND apagada = 'n' " +
"ORDER BY analise_nr";
}
else
{
sql ="SELECT * FROM analises_acidentes WHERE (" +
"estado = " + Global.ESTADO_SEG + " OR estado = " + Global.ESTADO_HS + " OR estado = " + Global.ESTADO_CONSOLIDACAO +
" OR estado = " + Global.ESTADO_ASSINATURA_SEG + " OR estado = " + Global.ESTADO_ASSINATURA_RH + " OR estado = " + Global.ESTADO_FECHAR +
") AND estabelecimento_id = " + estabelecimento_id + " AND apagada = 'n' " +
"ORDER BY analise_nr";
}
Expression or = new Field( "estado" ).isEqual( Global.ESTADO_SEG );
or = or.or( new Field( "estado" ).isEqual( Global.ESTADO_HS ) );
or = or.or( new Field( "estado" ).isEqual( Global.ESTADO_CONSOLIDACAO ) );
or = or.or( new Field( "estado" ).isEqual( Global.ESTADO_ASSINATURA_SEG ) );
or = or.or( new Field( "estado" ).isEqual( Global.ESTADO_FECHAR ) );
if ( ! "y".equals( responsavel_loja ) )
{
or = or.or( new Field( "estado" ).isEqual( Global.ESTADO_ASSINATURA_RH ) );
}
where = where.and( or );
Select2 query = new Select2(
new String[] { "analises_acidentes" },
new Integer[] {},
new Expression[] {},
new String[] { "*" },
where,
new String[] { "analise_nr" },
null, null, null
);
ResultSet rs = st.executeQuery(sql);
ArrayList list = fillAnaliseFields(rs);
Statement st = createStatement();
ResultSet rs = st.executeQuery( query.toString() );
ArrayList list = fillAnaliseFields( rs );
return list;
}
public ArrayList searchAnalisesSeguimentoMedico( Integer estabelecimento_id,
String nome, String visitaDate, String POR )
public ArrayList searchAnalisesSeguimentoMedico( Integer estabelecimento_id, String nome, String visitaDate, String POR, Integer fromYear )
throws Exception
{
if ( nome == null && visitaDate == null && POR == null )
{
return getAnalisesSeguimentoMedList( estabelecimento_id );
return getAnalisesSeguimentoMedList( estabelecimento_id, fromYear );
}
Statement st = createStatement();
@ -549,126 +650,164 @@ public class AnalisesDataProvider extends GenericDataProvider
return list;
}
public ArrayList getAnalisesSeguimentoMedList( Integer estabelecimento_id )
public ArrayList getAnalisesSeguimentoMedList( Integer estabelecimentoID, Integer fromYear )
throws Exception
{
Statement st = createStatement();
String sql = null;
sql = "SELECT * FROM analises_acidentes WHERE " +
"estado < 5 OR (estado = 6 AND estado_assinatura <> 2) OR (estado = 6 AND estado_assinatura = 2 AND ass_med = 'y') " +
"OR (estado > 6 AND estado < 9) " +
"AND estabelecimento_id = " + estabelecimento_id + " AND apagada = 'n' " +
"ORDER BY analise_nr";
ResultSet rs = st.executeQuery(sql);
ArrayList list = fillAnaliseFields(rs);
// String sql = null;
// sql = "SELECT * FROM analises_acidentes WHERE " +
// "estado < 5 OR (estado = 6 AND estado_assinatura <> 2) OR (estado = 6 AND estado_assinatura = 2 AND ass_med = 'y') " +
// "OR (estado > 6 AND estado < 9) " +
// "AND estabelecimento_id = " + estabelecimentoID + " AND apagada = 'n' ";
// if ( fromYear != null )
// {
// sql += " AND EXTRACT( year FROM analises_acidentes.data_acidente ) = " + fromYear + " ";
// }
// sql += " ORDER BY analise_nr ";
Expression where = new Field( "analises_acidentes.apagada" ).isEqual( "n" );
where = where.and( new Field( "analises_acidentes.estabelecimento_id" ).isEqual( estabelecimentoID ) );
if ( fromYear != null )
{
where = where.and( new Field( "EXTRACT( year FROM analises_acidentes.data_acidente )" ).isEqual( fromYear ) );
}
where = where.and(
new Field( "analises_acidentes.estado" ).isLess( 5 )
.or(
new Field( "analises_acidentes.estado" ).isEqual( 6 )
.and( new Field( "analises_acidentes.estado_assinatura" ).isDifferent( 2 ) )
)
.or(
new Field( "analises_acidentes.estado" ).isEqual( 6 )
.and( new Field( "analises_acidentes.estado_assinatura" ).isEqual( 2 ) )
.and( new Field( "analises_acidentes.ass_med" ).isEqual( "y" ) )
)
.or(
new Field( "analises_acidentes.estado" ).isGreater( 6 )
.and( new Field( "analises_acidentes.estado" ).isLess( 9 ) )
)
);
Select2 query = new Select2(
new String[] { "analises_acidentes" },
new Integer[] {},
new Expression[] {},
new String[] { "*" },
where,
new String[] { "analises_acidentes.analise_nr" },
null, null, null
);
Statement st = createStatement();
ResultSet rs = st.executeQuery( query.toString() );
ArrayList list = fillAnaliseFields( rs );
return list;
}
public ArrayList searchAnalisesSeguimentoDirSiprp(
String nome, String estabelecimento, String visitaDate, String POR )
public ArrayList searchAnalisesSeguimentoDirSiprp( String nome, String estabelecimento, String visitaDate, String POR, Integer fromYear )
throws Exception
{
if ( nome == null && estabelecimento == null && visitaDate == null && POR == null )
{
return getAnalisesSeguimentoDirSiprpList();
return getAnalisesSeguimentoDirSiprpList( fromYear );
}
Statement st = createStatement();
String sql = getExpression( nome, estabelecimento, visitaDate, POR );
sql += " AND estado < " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr";
ResultSet rs = st.executeQuery(sql);
ArrayList list = fillAnaliseFields(rs);
Statement st = createStatement();
ResultSet rs = st.executeQuery( sql );
ArrayList list = fillAnaliseFields( rs );
return list;
}
public ArrayList getAnalisesSeguimentoDirSiprpList() throws Exception
public ArrayList getAnalisesSeguimentoDirSiprpList( Integer fromYear ) throws Exception
{
Statement st = createStatement();
String sql = null;
sql = "SELECT * FROM analises_acidentes WHERE estado < " + Global.ESTADO_CONCLUIDO + " AND apagada = 'n' ORDER BY analise_nr";
Expression where = new Field( "apagada" ).isEqual( "n" );
where = where.and( new Field( "estado" ).isLess( Global.ESTADO_CONCLUIDO ) );
if ( fromYear != null )
{
where = where.and( new Field( "EXTRACT( year FROM analises_acidentes.data_acidente )" ).isEqual( fromYear ) );
}
ResultSet rs = st.executeQuery(sql);
ArrayList list = fillAnaliseFields(rs);
Select2 query = new Select2(
new String[] { "analises_acidentes" },
new Integer[] {},
new Expression[] {},
new String[] { "*" },
where,
new String[] { "analise_nr" },
null, null, null
);
Statement st = createStatement();
ResultSet rs = st.executeQuery( query.toString() );
ArrayList list = fillAnaliseFields( rs );
return list;
}
public ArrayList searchAnalisesSeguimentoDirGerRh(
String nome, String estabelecimento, String visitaDate, String POR )
String nome, String estabelecimento, String visitaDate, String POR, Integer fromYear )
throws Exception
{
return searchAnalisesSeguimentoDirSiprp( nome, estabelecimento, visitaDate, POR );
return searchAnalisesSeguimentoDirSiprp( nome, estabelecimento, visitaDate, POR, fromYear );
}
public ArrayList getAnalisesSeguimentoDirGerRhList() throws Exception
public ArrayList getAnalisesSeguimentoDirGerRhList( Integer fromYear ) throws Exception
{
return getAnalisesSeguimentoDirSiprpList();
// Statement st = createStatement();
// String sql = null;
//
// sql ="SELECT * FROM analises_acidentes WHERE estado < " + Global.ESTADO_CONCLUIDO + " AND apagada = 'n' ORDER BY analise_nr";
//
// ResultSet rs = st.executeQuery(sql);
// ArrayList list = fillAnaliseFields(rs);
// return list;
return getAnalisesSeguimentoDirSiprpList( fromYear );
}
public ArrayList searchAnalisesSeguimentoGestor( Integer estabelecimento_id,
String nome, String estabelecimento, String visitaDate, String POR )
String nome, String estabelecimento, String visitaDate, String POR, Integer fromYear )
throws Exception
{
if ( nome == null && estabelecimento == null && visitaDate == null && POR == null )
{
return getAnalisesSeguimentoGestorList( estabelecimento_id );
return getAnalisesSeguimentoGestorList( estabelecimento_id, fromYear );
}
Statement st = createStatement();
String sql = getExpression( nome, estabelecimento, visitaDate, POR );
sql += "AND estado < " + Global.ESTADO_CONCLUIDO + " ";
if ( estabelecimento_id == null )
if ( estabelecimento_id != null )
{
sql += "AND estado < " + Global.ESTADO_CONCLUIDO +
" ORDER BY analise_nr";
sql += " AND estabelecimento_id = " + estabelecimento_id + " ";
}
else
{
sql += "AND estado < " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id +
" ORDER BY analise_nr";
}
ResultSet rs = st.executeQuery(sql);
ArrayList list = fillAnaliseFields(rs);
sql += " ORDER BY analise_nr";
ResultSet rs = st.executeQuery( sql );
ArrayList list = fillAnaliseFields( rs );
return list;
}
public ArrayList getAnalisesSeguimentoGestorList( Integer estabelecimento_id )
public ArrayList getAnalisesSeguimentoGestorList( Integer estabelecimentoID, Integer fromYear )
throws Exception
{
Statement st = createStatement();
String sql = null;
Expression where = new Field( "apagada" ).isEqual( "n" );
where = where.and( new Field( "estado" ).isLess( Global.ESTADO_CONCLUIDO ) );
if ( estabelecimentoID != null )
{
where = where.and( new Field( "estabelecimento_id" ).isEqual( estabelecimentoID ) );
}
if ( fromYear != null )
{
where = where.and( new Field( "EXTRACT( year FROM analises_acidentes.data_acidente )" ).isEqual( fromYear ) );
}
if ( estabelecimento_id == null )
{
sql = "SELECT * FROM analises_acidentes WHERE " +
"estado < " + Global.ESTADO_CONCLUIDO +
" AND apagada = 'n' " +
"ORDER BY analise_nr";
}
else
{
sql = "SELECT * FROM analises_acidentes WHERE " +
"estado < " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id +
" AND apagada = 'n' " +
"ORDER BY analise_nr";
}
Select2 query = new Select2(
new String[] { "analises_acidentes" },
new Integer[] {},
new Expression[] {},
new String[] { "*" },
where,
new String[] { "analise_nr" },
null, null, null
);
ResultSet rs = st.executeQuery(sql);
ArrayList list = fillAnaliseFields(rs);
Statement st = createStatement();
ResultSet rs = st.executeQuery( query.toString() );
ArrayList list = fillAnaliseFields( rs );
return list;
}
@ -680,37 +819,45 @@ public class AnalisesDataProvider extends GenericDataProvider
/****************************** CONCLUIDOS *******************************/
/*************************************************************************/
public ArrayList getAnalisesConcluidasList(Integer estabelecimento_id) throws Exception
public ArrayList getAnalisesConcluidasList( Integer estabelecimentoID, Integer fromYear ) throws Exception
{
Statement st = createStatement();
String sql = "";
if(estabelecimento_id == null)
{
sql ="SELECT * FROM analises_acidentes WHERE estado = " + Global.ESTADO_CONCLUIDO + " AND apagada = 'n' ORDER BY analise_nr";
}
else
{
sql ="SELECT * FROM analises_acidentes WHERE estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + " AND apagada = 'n' ORDER BY analise_nr";
}
ResultSet rs = st.executeQuery(sql);
ArrayList list = fillAnaliseFields(rs);
Expression where = new Field( "estado" ).isEqual( Global.ESTADO_CONCLUIDO );
where = where.and( new Field( "apagada" ).isEqual( "n" ) );
if ( estabelecimentoID != null )
{
where = where.and( new Field( "estabelecimento_id" ).isEqual( estabelecimentoID ) );
}
if ( fromYear != null )
{
where = where.and( new Field( "EXTRACT( year FROM data_acidente )" ).isEqual( fromYear ) );
}
Select2 query = new Select2(
new String[] { "analises_acidentes" },
new Integer[] {},
new Expression[] {},
new String[] { "*" },
where,
new String[] { "analise_nr" },
null, null, null
);
System.out.println( "\ngetAnalisesConcluidasList() : " + query.toString() + "\n" );
ResultSet rs = st.executeQuery( query.toString() );
ArrayList list = fillAnaliseFields( rs );
return list;
}
public ArrayList getAnalisesConcluidasHsList() throws Exception
public ArrayList getAnalisesConcluidasHsList( Integer fromYear ) throws Exception
{
Statement st = createStatement();
String sql ="SELECT * FROM analises_acidentes WHERE estado = " + Global.ESTADO_CONCLUIDO + " AND apagada = 'n' ORDER BY analise_nr";
ResultSet rs = st.executeQuery(sql);
ArrayList list = fillAnaliseFields(rs);
return list;
return getAnalisesConcluidasList( null, fromYear );
}
public ArrayList searchAanalisesConcluidasList( Integer estabelecimento_id,
Integer ano, Integer mes, Integer dia, String POR, String nome, String estabelecimento )
public ArrayList searchAnalisesConcluidasList( Integer estabelecimento_id,
Integer ano, Integer mes, Integer dia, String POR, String nome, String estabelecimento, Integer fromYear )
throws Exception
{
String sql = null;
@ -771,7 +918,15 @@ public class AnalisesDataProvider extends GenericDataProvider
}
}
sql += "AND estado = " + Global.ESTADO_CONCLUIDO + " ORDER BY analises_acidentes.analise_nr ASC";
sql += " AND estado = " + Global.ESTADO_CONCLUIDO + " ";
// if search parameters are null, account with fromYear
if ( ano == null && mes == null && dia == null && POR == null && nome == null && estabelecimento == null && fromYear != null )
{
sql += " AND EXTRACT( year FROM analises_acidentes.data_acidente ) = " + fromYear + " ";
}
sql += " ORDER BY analises_acidentes.analise_nr ASC ";
System.out.println( "CONCLUIDAS SQL: " + sql );
@ -2840,27 +2995,58 @@ public class AnalisesDataProvider extends GenericDataProvider
s.setDescricao(rs.getString("descricao"));
return s;
}
public List< Integer > getDistinctYears( Integer excludeYear ) throws Exception
{
List< Integer > result = new LinkedList< Integer >();
Expression where = new Field( "apagada" ).isEqual( "n" );
if ( excludeYear != null )
{
where = where.and( new Field( "EXTRACT( year FROM data_acidente )" ).notIn( new Integer[] { excludeYear } ) );
}
Select2 query = new Select2(
new String[] { "analises_acidentes" },
new Integer[] {},
new Expression[] {},
new String[] { "DISTINCT( cast( EXTRACT( year FROM data_acidente ) as integer ) ) AS ano" },
where,
new String[] { "ano DESC" },
null, null, null
);
query.disableOrderFieldsVerification();
Virtual2DArray array = getExecuter().executeQuery( query );
for ( int i = 0; i < array.columnLength(); i++ )
{
Integer ano = array.get( i, 0 );
result.add( ano );
}
return result;
}
public ArrayList getAnosListFromAnalises() throws Exception
{
ArrayList list = new ArrayList();
Statement st = createStatement();
String sql = null;
sql ="select distinct extract(year from data_acidente) as ano from analises_acidentes where estado = " + Global.ESTADO_CONCLUIDO + " order by ano";
ResultSet rs = st.executeQuery(sql);
if(rs.isBeforeFirst())
String sql = "SELECT DISTINCT EXTRACT( year FROM data_acidente ) AS ano " +
"FROM analises_acidentes " +
"WHERE " +
"apagada = 'n' AND estado = " + Global.ESTADO_CONCLUIDO +
" ORDER BY ano";
Statement st = createStatement();
ResultSet rs = st.executeQuery( sql );
if ( rs.isBeforeFirst() )
{
rs.first();
do
{
Double dAno = new Double(rs.getDouble("ano"));
Integer iAno = new Integer(dAno.intValue());
list.add(iAno);
}while(rs.next());
Double dAno = new Double( rs.getDouble( "ano" ) );
Integer iAno = new Integer( dAno.intValue() );
list.add( iAno );
}
while ( rs.next() );
}
return list;
}

@ -16,6 +16,8 @@ import com.evolute.utils.sql.Select2;
import com.sun.rave.web.ui.model.Option;
import db.data.siprp.outer.CausasData;
import db.data.siprp.outer.SeccoesData;
import db.data.siprp_local.outer.EstabelecimentosData;
import global.Global;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
@ -67,6 +69,7 @@ public class EstatisticasDataProvider extends GenericDataProvider
String horaOcorrencia = ( String ) searchProperties.get( EstatisticasConstants.KEY_HORA_OCORRENCIA );
String horasTrabalhadas = ( String ) searchProperties.get( EstatisticasConstants.KEY_HORAS_TRABALHADAS );
// String departamento = ( String ) searchProperties.get( EstatisticasConstants.KEY_DEPARTAMENTO );
Integer estabelecimentoID = ( Integer ) searchProperties.get( EstatisticasConstants.KEY_ESTABELECIMENTO );
Integer seccaoID = ( Integer ) searchProperties.get( EstatisticasConstants.KEY_SECCAO );
Integer causas = ( Integer ) searchProperties.get( EstatisticasConstants.KEY_CAUSAS_ACIDENTE );
String turno = ( String ) searchProperties.get( EstatisticasConstants.KEY_TURNO_TRABALHO );
@ -153,6 +156,10 @@ public class EstatisticasDataProvider extends GenericDataProvider
// departamento = departamento.replaceAll( " ", "%" );
// whereConditions += " AND " + EstatisticasConstants.KEY_DEPARTAMENTO + " ILIKE '%" + departamento + "%' ";
// }
if ( estabelecimentoID != null )
{
whereConditions += " AND " + EstatisticasConstants.KEY_ESTABELECIMENTO + " = " + estabelecimentoID + " ";
}
if ( seccaoID != null )
{
whereConditions += " AND " + EstatisticasConstants.KEY_SECCAO + " = " + seccaoID + " ";
@ -290,5 +297,47 @@ public class EstatisticasDataProvider extends GenericDataProvider
}
return causa;
}
public com.sun.rave.web.ui.model.Option[] getEstabelecimentos() throws Exception
{
com.sun.rave.web.ui.model.Option[] options = null;
Select2 query = new Select2(
new String[] { EstabelecimentosData.TABLENAME },
new Integer[] { },
new Expression[] {},
new String[] {
EstabelecimentosData.ID_FULL, EstabelecimentosData.NOME_FULL
},
new Field( EstabelecimentosData.INACTIVO_FULL ).isDifferent( "y" )
.and( new Field( EstabelecimentosData.EMPRESA_ID_FULL ).isEqual( Global.AUCHAN ) ),
new String[] { EstabelecimentosData.NOME_FULL },
null, null, null );
Virtual2DArray array = getLocalExecuter().executeQuery( query );
if ( array != null )
{
options = new com.sun.rave.web.ui.model.Option[ array.columnLength() + 1 ];
options[ 0 ] = new Option( "", "" );
for ( int i = 0; i < array.columnLength(); i++ )
{
Integer estabelecimentoID = array.get( i, 0 );
String estabelecimentoNome = array.get( i, 1 );
options[ ( i + 1 ) ] = new Option( estabelecimentoID, estabelecimentoNome );
}
}
return options;
}
public String getEstabelecimentoByID( Integer estabelecimentoID ) throws Exception
{
String estabelecimento = "";
EstabelecimentosData estabelecimentoData = getLocalProvider().load( EstabelecimentosData.class, estabelecimentoID, EstabelecimentosData.ID );
if ( estabelecimentoData != null )
{
estabelecimento = estabelecimentoData.getNome();
}
return estabelecimento;
}
}

@ -12,12 +12,16 @@ package utils;
import beans.Utilizador;
import com.evolute.utils.Singleton;
import com.evolute.utils.error.ErrorLogger;
import com.sun.rave.web.ui.model.Option;
import db.providers.AnalisesDataProvider;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.faces.context.ExternalContext;
import javax.servlet.ServletContext;
@ -505,4 +509,38 @@ public class Utils {
}
}
public static Option[] getYearDropValues()
{
Calendar calendar = Calendar.getInstance();
calendar.setTime( new Date() );
Integer currentYear = calendar.get( Calendar.YEAR );
Option[] opts = null;
try
{
int start = 0;
List< Integer > anosList = AnalisesDataProvider.getInstance().getDistinctYears( null );
if ( anosList.contains( currentYear ) )
{
opts = new Option[ anosList.size() ];
}
else
{
opts = new Option[ anosList.size() + 1 ];
opts[ start++ ] = new Option( currentYear, currentYear.toString() );
}
Iterator< Integer > it = anosList.iterator();
for ( ; it.hasNext(); start++ )
{
Integer ano = it.next();
opts[ start ] = new Option( ano, ano.toString() );
}
}
catch ( Exception e )
{
ErrorLogger.logException( e );
}
return opts;
}
}

@ -100,7 +100,10 @@
<ui:staticText id="labelDepartamento" escape="false" text="Departamento:" styleClass="labelBold" />
<ui:textField id="textDepartamento" binding="#{EstatisticasProcesso.textDepartamento}" />
-->
<ui:staticText id="labelEstabelecimento" escape="false" text="Estabelecimento:" styleClass="labelBold" />
<ui:dropDown binding="#{EstatisticasProcesso.dropEstabelecimentos}" id="dropEstabelecimentos" style="height: 18px; width: 240px"/>
<ui:staticText id="labelSeccao" escape="false" text="Secção:" styleClass="labelBold" />
<ui:dropDown binding="#{EstatisticasProcesso.dropSeccoes}" id="dropSeccoes" style="height: 18px; width: 240px"/>

@ -54,6 +54,18 @@
</h:panelGrid>
</ui:form>
<h:panelGrid columnClasses="gridColCenter" columns="2" id="gridPanel2" style="height: 24px; width: 100%" width="504">
<ui:staticText escape="false" id="txtMsg1" text="" />
<h:panelGroup id="panelGroupCurrentYear" style="text-align: right;">
<ui:form id="formYear">
<ui:staticText escape="false" id="textCurrentYear" text="Visualizar análises do ano: " />
<ui:dropDown binding="#{FormDirGerRh.dropCurrentYear}" id="dropCurrentYear"
onChange="common_timeoutSubmitForm(this.form, 'dropCurrentYear');" valueChangeListener="#{FormDirGerRh.dropCurrentYear_valueChangeListener}"/>
</ui:form>
</h:panelGroup>
</h:panelGrid>
<ui:form id="form2">
<h:panelGrid binding="#{FormDirGerRh.gridLayoutTop1}" columnClasses="gridLayoutTopCols, gridLayoutTopCols" columns="2"
id="gridLayoutTop1" style="height: 15px; position: relative; vertical-align: top; width: 100%">

@ -59,9 +59,17 @@
</h:panelGrid>
</ui:form>
<h:panelGrid binding="#{FormDirSiprp.gridPanel2}" columnClasses="gridColCenter" columns="1" id="gridPanel2"
<h:panelGrid binding="#{FormDirSiprp.gridPanel2}" columnClasses="gridColCenter" columns="2" id="gridPanel2"
style="height: 24px; width: 100%" width="504">
<ui:staticText binding="#{FormDirSiprp.txtMsg1}" escape="false" id="txtMsg1" style="color: rgb(204, 0, 0); font-weight: bold; height: 24px"/>
<h:panelGroup id="panelGroupCurrentYear" style="text-align: right;">
<ui:form id="formYear">
<ui:staticText escape="false" id="textCurrentYear" text="Visualizar análises do ano: " />
<ui:dropDown binding="#{FormDirSiprp.dropCurrentYear}" id="dropCurrentYear"
onChange="common_timeoutSubmitForm(this.form, 'dropCurrentYear');" valueChangeListener="#{FormDirSiprp.dropCurrentYear_valueChangeListener}"/>
</ui:form>
</h:panelGroup>
</h:panelGrid>

@ -54,6 +54,18 @@
</h:panelGrid>
</ui:form>
<h:panelGrid columnClasses="gridColCenter" columns="2" id="gridPanel2" style="height: 24px; width: 100%" width="504">
<ui:staticText escape="false" id="txtMsg1" text="" />
<h:panelGroup id="panelGroupCurrentYear" style="text-align: right;">
<ui:form id="formYear">
<ui:staticText escape="false" id="textCurrentYear" text="Visualizar análises do ano: " />
<ui:dropDown binding="#{FormGestor.dropCurrentYear}" id="dropCurrentYear"
onChange="common_timeoutSubmitForm(this.form, 'dropCurrentYear');" valueChangeListener="#{FormGestor.dropCurrentYear_valueChangeListener}"/>
</ui:form>
</h:panelGroup>
</h:panelGrid>
<ui:form binding="#{FormGestor.form1}" id="form1">
<h:panelGrid binding="#{FormGestor.gridLayoutTop1}" columnClasses="gridLayoutTopCols, gridLayoutTopCols" columns="2"
id="gridLayoutTop1" style="height: 15px; position: relative; vertical-align: top; width: 100%">

@ -20,14 +20,11 @@
</script>
</ui:head>
<ui:body binding="#{FormHS.body1}" id="body1" style="-rave-layout: grid">
<!-- ui:form binding="#{FormHS.form1}" id="form1" -->
<h:panelGrid binding="#{FormHS.gridBase1}" columns="1" id="gridBase1"
style="height: 24px; left: 0px; top: 60px; position: absolute; width: 100%" styleClass="centerBlock" width="648">
<h:panelGrid binding="#{FormHS.gridLayout1}" columns="1" id="gridLayout1" style="height: 15px; width: 80%" styleClass="centerBlock">
<ui:form id="form0">
<h:panelGrid binding="#{FormHS.gridBase1}" columns="1" id="gridBase1"
style="height: 24px; left: 0px; top: 60px; position: absolute; width: 100%" styleClass="centerBlock" width="648">
<h:panelGrid binding="#{FormHS.gridLayout1}" columns="1" id="gridLayout1" style="height: 15px; width: 80%" styleClass="centerBlock">
<ui:form id="form0">
<h:panelGrid binding="#{FormHS.gridPanel1}" columnClasses="gridColLeft, gridColRightBottom" columns="2" id="gridPanel1"
style="border-bottom: solid #000000 1px; height: 24px; width: 100%" width="312">
<ui:panelGroup binding="#{FormHS.groupPanel1}" id="groupPanel1" style="height: 24px; width: 216px">
@ -36,10 +33,8 @@
</ui:panelGroup>
<h:panelGrid columnClasses="gridColRight" columns="1" id="gridPanel11" style="height: 24px; width: 100%">
<ui:panelGroup id="groupPanel2">
<ui:hyperlink action="estatisticasProcesso" id="linkEstatisticas" text="Estatisticas" rendered="#{SessionBean1.canAccessEstatisticas}" />
<ui:staticText escape="false" id="sepUpper" text=" | " rendered="#{SessionBean1.canAccessEstatisticas}" />
<ui:hyperlink action="estatisticasProcesso" id="linkEstatisticas" rendered="#{SessionBean1.canAccessEstatisticas}" text="Estatisticas"/>
<ui:staticText escape="false" id="sepUpper" rendered="#{SessionBean1.canAccessEstatisticas}" text=" | "/>
<ui:hyperlink action="#{FormHS.lnkPlanosActuacao_action}" binding="#{FormHS.lnkPlanosActuacao}"
id="lnkPlanosActuacao" text="planos actuação&gt;&gt;"/>
</ui:panelGroup>
@ -56,16 +51,22 @@
</ui:panelGroup>
</h:panelGrid>
</h:panelGrid>
</ui:form>
<h:panelGrid binding="#{FormHS.gridPanel10}" columnClasses="gridColCenter" columns="1" id="gridPanel10"
style="height: 24px; width: 100%" width="504">
<ui:staticText binding="#{FormHS.txtMsg}" escape="false" id="txtMsg" style="color: rgb(204, 0, 0); font-weight: bold; height: 24px"/>
</h:panelGrid>
<h:panelGrid binding="#{FormHS.gridLayoutTop1}" columnClasses="gridLayoutTopCols, gridLayoutTopCols" columns="1"
id="gridLayoutTop1" style="height: 15px; position: relative; vertical-align: top; width: 100%">
</ui:form>
<h:panelGrid columnClasses="gridColCenter" columns="2" id="gridPanel10" style="height: 24px; width: 100%;">
<ui:staticText binding="#{FormHS.txtMsg}" escape="false" id="txtMsg" style="color: rgb(204, 0, 0); font-weight: bold; height: 24px"/>
<ui:form binding="#{FormHS.form1}" id="form1">
<h:panelGroup id="panelGroupCurrentYear" style="text-align: right;">
<ui:form id="formYear">
<ui:staticText escape="false" id="textCurrentYear" text="Visualizar análises do ano: " />
<ui:dropDown binding="#{FormHS.dropCurrentYear}" id="dropCurrentYear"
onChange="common_timeoutSubmitForm(this.form, 'dropCurrentYear');" valueChangeListener="#{FormHS.dropCurrentYear_valueChangeListener}"/>
</ui:form>
</h:panelGroup>
</h:panelGrid>
<h:panelGrid binding="#{FormHS.gridLayoutTop1}" columnClasses="gridLayoutTopCols, gridLayoutTopCols" columns="1" id="gridLayoutTop1" style="height: 15px; position: relative; vertical-align: top; width: 100%">
<ui:form binding="#{FormHS.form1}" id="form1">
<h:panelGrid binding="#{FormHS.gridActual1}" columnClasses="gridColCenter" columns="1" id="gridActual1"
style="background-color: #f6f4e8; height: 24px; position: relative; width: 100%" width="360">
<h:panelGrid binding="#{FormHS.gridPanel2}" columnClasses="gridColCenter" columns="1" id="gridPanel2"
@ -75,27 +76,27 @@
</h:panelGrid>
<ui:staticText binding="#{FormHS.staticText5}" id="staticText5" styleClass="labelBold" text="Processos com dados pendentes"/>
<h:panelGrid binding="#{FormHS.gridPanel3}" id="gridPanel3" style="height: 24px; width: 100%" styleClass="centerBlock" width="456">
<h:panelGrid binding="#{FormHS.gridPanelFilterActual}" columns="5" id="gridPanelFilterActual" styleClass="centerBlock">
<ui:panelGroup>
<ui:staticText id="labelFilterDateActual" escape="false" text="Data do acidente:" styleClass="labelBold" />
<ui:calendar binding="#{FormHS.calFilterDateActual}" dateFormatPattern="yyyy/MM/dd" id="calFilterDateActual" />
</ui:panelGroup>
<ui:panelGroup>
<ui:staticText id="labelFilterPORActual" escape="false" text="POR:" styleClass="labelBold" />
<ui:textField binding="#{FormHS.textFilterPORActual}" id="textFilterPORActual" />
</ui:panelGroup>
<ui:panelGroup binding="#{FormHS.groupPanelFilterActual}" id="groupPanelFilterActual">
<ui:staticText binding="#{FormHS.labelFilterNameActual}" id="labelFilterNameActual" styleClass="labelBold" text="Nome:" />
<ui:textField binding="#{FormHS.textFilterNameActual}" id="textFilterNameActual" />
</ui:panelGroup>
<ui:panelGroup>
<ui:staticText binding="#{FormHS.labelFilterEstabelecimentoActual}" id="labelFilterEstabelecimentoActual" styleClass="labelBold" text="Estabelecimento:" />
<ui:textField binding="#{FormHS.textFilterEstabelecimentoActual}" id="textFilterEstabelecimentoActual" />
</ui:panelGroup>
<ui:button binding="#{FormHS.buttonFilterActual}" id="buttonFilterActual" action="#{FormHS.buttonFilterActual_action}" text="Pesquisar" />
</h:panelGrid>
<h:panelGrid binding="#{FormHS.gridPanelFilterActual}" columns="5" id="gridPanelFilterActual" styleClass="centerBlock">
<ui:panelGroup>
<ui:staticText escape="false" id="labelFilterDateActual" styleClass="labelBold" text="Data do acidente:"/>
<ui:calendar binding="#{FormHS.calFilterDateActual}" dateFormatPattern="yyyy/MM/dd" id="calFilterDateActual"/>
</ui:panelGroup>
<ui:panelGroup>
<ui:staticText escape="false" id="labelFilterPORActual" styleClass="labelBold" text="POR:"/>
<ui:textField binding="#{FormHS.textFilterPORActual}" id="textFilterPORActual"/>
</ui:panelGroup>
<ui:panelGroup binding="#{FormHS.groupPanelFilterActual}" id="groupPanelFilterActual">
<ui:staticText binding="#{FormHS.labelFilterNameActual}" id="labelFilterNameActual" styleClass="labelBold" text="Nome:"/>
<ui:textField binding="#{FormHS.textFilterNameActual}" id="textFilterNameActual"/>
</ui:panelGroup>
<ui:panelGroup>
<ui:staticText binding="#{FormHS.labelFilterEstabelecimentoActual}" id="labelFilterEstabelecimentoActual"
styleClass="labelBold" text="Estabelecimento:"/>
<ui:textField binding="#{FormHS.textFilterEstabelecimentoActual}" id="textFilterEstabelecimentoActual"/>
</ui:panelGroup>
<ui:button action="#{FormHS.buttonFilterActual_action}" binding="#{FormHS.buttonFilterActual}"
id="buttonFilterActual" text="Pesquisar"/>
</h:panelGrid>
<ui:table augmentTitle="false" binding="#{FormHS.table1}" id="table1" style="width: 80%; height: 48px"
styleClass="centerBlock" width="933">
<ui:tableRowGroup binding="#{FormHS.tableRowGroup1}" id="tableRowGroup1"
@ -114,8 +115,8 @@
sort="analise_nr" style="width: 10%" width="10%">
<ui:hyperlink action="#{FormHS.lnkNr_action}" binding="#{FormHS.lnkNr}" id="lnkNr" text="#{currentRow.value['analise_nr']}"/>
</ui:tableColumn>
<ui:tableColumn binding="#{FormHS.tableColumn12}" headerText="POR" id="tableColumn12" width="10%"
sort="numero_mecanografico">
<ui:tableColumn binding="#{FormHS.tableColumn12}" headerText="POR" id="tableColumn12"
sort="numero_mecanografico" width="10%">
<ui:hyperlink action="#{FormHS.lnkPor_action}" binding="#{FormHS.lnkPor}" id="lnkPor" style="" text="#{currentRow.value['numero_mecanografico']}"/>
</ui:tableColumn>
<ui:tableColumn binding="#{FormHS.tableColumn3}" headerText="Nome do acidentado" id="tableColumn3"
@ -123,13 +124,12 @@
<ui:hyperlink action="#{FormHS.lnkNomeAcidentado_action}" binding="#{FormHS.lnkNomeAcidentado}"
id="lnkNomeAcidentado" text="#{currentRow.value['nome_acidentado']}"/>
</ui:tableColumn>
<ui:tableColumn binding="#{FormHS.tableColumn10}" headerText="Fase" id="tableColumn10" width="20%"
sort="fase">
<ui:tableColumn binding="#{FormHS.tableColumn10}" headerText="Fase" id="tableColumn10" sort="fase" width="20%">
<ui:hyperlink action="#{FormHS.lnkFase_action}" binding="#{FormHS.lnkFase}" id="lnkFase"
style="height: 24px" text="#{currentRow.value['fase']}"/>
</ui:tableColumn>
<ui:tableColumn binding="#{FormHS.tableColumn19}" headerText="Estabelecimento" id="tableColumn19" width="15%"
sort="nome_estabelecimento">
<ui:tableColumn binding="#{FormHS.tableColumn19}" headerText="Estabelecimento" id="tableColumn19"
sort="nome_estabelecimento" width="15%">
<ui:hyperlink action="#{FormHS.lnkEstabelecimento_action}" binding="#{FormHS.lnkEstabelecimento}"
id="lnkEstabelecimento" style="" text="#{currentRow.value['nome_estabelecimento']}"/>
</ui:tableColumn>
@ -137,9 +137,8 @@
</ui:table>
</h:panelGrid>
</h:panelGrid>
</ui:form>
<ui:form id="form2">
</ui:form>
<ui:form id="form2">
<h:panelGrid binding="#{FormHS.gridSeguimento1}" columns="1" id="gridSeguimento1"
style="background-color: #f6f4e8; position: relative; width: 100%" width="360">
<h:panelGrid binding="#{FormHS.gridPanel4}" columnClasses="gridColCenter" columns="1" id="gridPanel4"
@ -149,28 +148,26 @@
</h:panelGrid>
<h:panelGrid binding="#{FormHS.gridPanel5}" id="gridPanel5" style="background-color: #f6f4e8; height: 24px; width: 100%"
styleClass="centerBlock" width="456">
<h:panelGrid binding="#{FormHS.gridPanelFilterSeg}" columns="5" id="gridPanelFilterSeg" styleClass="centerBlock">
<ui:panelGroup>
<ui:staticText id="labelFilterDateSeg" escape="false" styleClass="labelBold" text="Data do acidente:" />
<ui:calendar binding="#{FormHS.calFilterDateSeg}" dateFormatPattern="yyyy/MM/dd" id="calFilterDateSeg" />
</ui:panelGroup>
<ui:panelGroup>
<ui:staticText id="labelFilterPORSeg" escape="false" text="POR:" styleClass="labelBold" />
<ui:textField binding="#{FormHS.textFilterPORSeg}" id="textFilterPORSeg" />
</ui:panelGroup>
<ui:panelGroup binding="#{FormHS.groupPanelFilterSeg}" id="groupPanelFilterSeg">
<ui:staticText binding="#{FormHS.labelFilterNameSeg}" id="labelFilterNameSeg" styleClass="labelBold" text="Nome:" />
<ui:textField binding="#{FormHS.textFilterNameSeg}" id="textFilterNameSeg" />
</ui:panelGroup>
<ui:panelGroup>
<ui:staticText binding="#{FormHS.labelFilterEstabelecimentoSeg}" id="labelFilterEstabelecimentoSeg" styleClass="labelBold" text="Estabelecimento:" />
<ui:textField binding="#{FormHS.textFilterEstabelecimentoSeg}" id="textFilterEstabelecimentoSeg" />
</ui:panelGroup>
<ui:button binding="#{FormHS.buttonFilterSeg}" id="buttonFilterSeg" action="#{FormHS.buttonFilterSeg_action}" text="Pesquisar" />
</h:panelGrid>
<h:panelGrid binding="#{FormHS.gridPanelFilterSeg}" columns="5" id="gridPanelFilterSeg" styleClass="centerBlock">
<ui:panelGroup>
<ui:staticText escape="false" id="labelFilterDateSeg" styleClass="labelBold" text="Data do acidente:"/>
<ui:calendar binding="#{FormHS.calFilterDateSeg}" dateFormatPattern="yyyy/MM/dd" id="calFilterDateSeg"/>
</ui:panelGroup>
<ui:panelGroup>
<ui:staticText escape="false" id="labelFilterPORSeg" styleClass="labelBold" text="POR:"/>
<ui:textField binding="#{FormHS.textFilterPORSeg}" id="textFilterPORSeg"/>
</ui:panelGroup>
<ui:panelGroup binding="#{FormHS.groupPanelFilterSeg}" id="groupPanelFilterSeg">
<ui:staticText binding="#{FormHS.labelFilterNameSeg}" id="labelFilterNameSeg" styleClass="labelBold" text="Nome:"/>
<ui:textField binding="#{FormHS.textFilterNameSeg}" id="textFilterNameSeg"/>
</ui:panelGroup>
<ui:panelGroup>
<ui:staticText binding="#{FormHS.labelFilterEstabelecimentoSeg}" id="labelFilterEstabelecimentoSeg"
styleClass="labelBold" text="Estabelecimento:"/>
<ui:textField binding="#{FormHS.textFilterEstabelecimentoSeg}" id="textFilterEstabelecimentoSeg"/>
</ui:panelGroup>
<ui:button action="#{FormHS.buttonFilterSeg_action}" binding="#{FormHS.buttonFilterSeg}" id="buttonFilterSeg" text="Pesquisar"/>
</h:panelGrid>
<ui:table augmentTitle="false" binding="#{FormHS.table2}" id="table2" style="width: 80%; height: 48px"
styleClass="centerBlock" width="100%">
<ui:tableRowGroup binding="#{FormHS.tableRowGroup2}" id="tableRowGroup2"
@ -189,8 +186,8 @@
sort="analise_nr" style="width: 10%" width="10%">
<ui:hyperlink action="#{FormHS.lnkNrSeg_action}" binding="#{FormHS.lnkNrSeg}" id="lnkNrSeg" text="#{currentRow.value['analise_nr']}"/>
</ui:tableColumn>
<ui:tableColumn binding="#{FormHS.tableColumn13}" headerText="POR" id="tableColumn13" width="10%"
sort="numero_mecanografico">
<ui:tableColumn binding="#{FormHS.tableColumn13}" headerText="POR" id="tableColumn13"
sort="numero_mecanografico" width="10%">
<ui:hyperlink action="#{FormHS.lnkPorSeg_action}" binding="#{FormHS.lnkPorSeg}" id="lnkPorSeg" style="" text="#{currentRow.value['numero_mecanografico']}"/>
</ui:tableColumn>
<ui:tableColumn binding="#{FormHS.tableColumn6}" headerText="Nome do acidentado" id="tableColumn6"
@ -198,13 +195,12 @@
<ui:hyperlink action="#{FormHS.lnkNomeAcidentadoSeg_action}" binding="#{FormHS.lnkNomeAcidentadoSeg}"
id="lnkNomeAcidentadoSeg" text="#{currentRow.value['nome_acidentado']}"/>
</ui:tableColumn>
<ui:tableColumn binding="#{FormHS.tableColumn11}" headerText="Fase" id="tableColumn11" width="20%"
sort="fase">
<ui:tableColumn binding="#{FormHS.tableColumn11}" headerText="Fase" id="tableColumn11" sort="fase" width="20%">
<ui:hyperlink action="#{FormHS.lnkFaseSeg_action}" binding="#{FormHS.lnkFaseSeg}" id="lnkFaseSeg"
style="height: 24px" text="#{currentRow.value['fase']}"/>
</ui:tableColumn>
<ui:tableColumn binding="#{FormHS.tableColumn20}" headerText="Estabelecimento" id="tableColumn20" width="15%"
sort="nome_estabelecimento">
<ui:tableColumn binding="#{FormHS.tableColumn20}" headerText="Estabelecimento" id="tableColumn20"
sort="nome_estabelecimento" width="15%">
<ui:hyperlink action="#{FormHS.lnkEstabelecimentoSeg_action}" binding="#{FormHS.lnkEstabelecimentoSeg}"
id="lnkEstabelecimentoSeg" style="" text="#{currentRow.value['nome_estabelecimento']}"/>
</ui:tableColumn>
@ -212,11 +208,9 @@
</ui:table>
</h:panelGrid>
</h:panelGrid>
</ui:form>
</h:panelGrid>
<ui:form id="form3">
</ui:form>
</h:panelGrid>
<ui:form id="form3">
<h:panelGrid binding="#{FormHS.gridConcluidos1}" columns="1" id="gridConcluidos1"
style="border: 1px solid #000000; height: 24px; background-color: #f6f4e8; width: 100%" width="360">
<h:panelGrid binding="#{FormHS.gridPanel6}" columnClasses="gridColCenter" columns="1" id="gridPanel6"
@ -251,10 +245,10 @@
<ui:staticText binding="#{FormHS.staticText9}" id="staticText9" style="height: 24px; width: 46px" text="Nome:"/>
<ui:textField binding="#{FormHS.txtNome}" id="txtNome"/>
</ui:panelGroup>
<ui:panelGroup>
<ui:staticText id="labelFilterEstabelecimentoConc" text="Estabelecimento:" />
<ui:textField binding="#{FormHS.textFilterEstabelecimentoConc}" id="textFilterEstabelecimentoConc" />
</ui:panelGroup>
<ui:panelGroup>
<ui:staticText id="labelFilterEstabelecimentoConc" text="Estabelecimento:"/>
<ui:textField binding="#{FormHS.textFilterEstabelecimentoConc}" id="textFilterEstabelecimentoConc"/>
</ui:panelGroup>
<ui:button action="#{FormHS.butPesquisar_action}" binding="#{FormHS.butPesquisar}" id="butPesquisar" text="Pesquisar"/>
</h:panelGrid>
<h:panelGrid binding="#{FormHS.gridPanel8}" columnClasses="gridColCenter" columns="1" id="gridPanel8"
@ -277,8 +271,8 @@
<ui:hyperlink action="#{FormHS.lnkNrConcluida_action}" binding="#{FormHS.lnkNrConcluida}"
id="lnkNrConcluida" text="#{currentRow.value['analise_nr']}"/>
</ui:tableColumn>
<ui:tableColumn binding="#{FormHS.tableColumn14}" headerText="POR" id="tableColumn14" width="200"
sort="numero_mecanografico">
<ui:tableColumn binding="#{FormHS.tableColumn14}" headerText="POR" id="tableColumn14"
sort="numero_mecanografico" width="200">
<ui:hyperlink action="#{FormHS.lnkPorConcluida_action}" binding="#{FormHS.lnkPorConcluida}"
id="lnkPorConcluida" style="" text="#{currentRow.value['numero_mecanografico']}"/>
</ui:tableColumn>
@ -287,8 +281,8 @@
<ui:hyperlink action="#{FormHS.lnkNomeConcluida_action}" binding="#{FormHS.lnkNomeConcluida}"
id="lnkNomeConcluida" text="#{currentRow.value['nome_acidentado']}"/>
</ui:tableColumn>
<ui:tableColumn binding="#{FormHS.tableColumn15}" headerText="Estabelecimento" id="tableColumn15" width="200"
sort="nome_estabelecimento">
<ui:tableColumn binding="#{FormHS.tableColumn15}" headerText="Estabelecimento" id="tableColumn15"
sort="nome_estabelecimento" width="200">
<ui:hyperlink action="#{FormHS.lnkEstabConcluida_action}" binding="#{FormHS.lnkEstabConcluida}"
id="lnkEstabConcluida" style="" text="#{currentRow.value['nome_estabelecimento']}"/>
</ui:tableColumn>
@ -297,18 +291,16 @@
<ui:staticText binding="#{FormHS.txtSearchMsg}" escape="false" id="txtSearchMsg" rendered="false" style="color: rgb(204, 0, 0); height: 24px; width: 336px"/>
</h:panelGrid>
</h:panelGrid>
</ui:form>
<h:panelGrid binding="#{FormHS.gridPanel9}" columnClasses="gridColCenter" columns="1" id="gridPanel9" style="height: 24px; width: 100%">
<ui:panelGroup binding="#{FormHS.groupPanel8}" id="groupPanel8" style="border-bottom: solid rgb(255, 255, 255) 1px; height: 21px">
<ui:staticText binding="#{FormHS.staticText10}" id="staticText10" text="Software desenvolvido por "/>
<ui:image binding="#{FormHS.image3}" height="21" id="image3" url="/resources/images/logo_evolute_small.png" width="100"/>
<ui:staticText binding="#{FormHS.staticText11}" escape="false" id="staticText11" text="&amp;nbsp;&amp;copy; 2008 "/>
</ui:panelGroup>
</h:panelGrid>
</ui:form>
<h:panelGrid binding="#{FormHS.gridPanel9}" columnClasses="gridColCenter" columns="1" id="gridPanel9" style="height: 24px; width: 100%">
<ui:panelGroup binding="#{FormHS.groupPanel8}" id="groupPanel8" style="border-bottom: solid rgb(255, 255, 255) 1px; height: 21px">
<ui:staticText binding="#{FormHS.staticText10}" id="staticText10" text="Software desenvolvido por "/>
<ui:image binding="#{FormHS.image3}" height="21" id="image3" url="/resources/images/logo_evolute_small.png" width="100"/>
<ui:staticText binding="#{FormHS.staticText11}" escape="false" id="staticText11" text="&amp;nbsp;&amp;copy; 2008 "/>
</ui:panelGroup>
</h:panelGrid>
</h:panelGrid>
</h:panelGrid>
<!-- /ui:form -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
@ -318,7 +310,7 @@
try {
var pageTracker = _gat._getTracker("UA-6942416-1");
pageTracker._trackPageview();
} catch(err) {}</script>
} catch(err) {}</script>
</ui:body>
</ui:html>
</ui:page>

@ -31,6 +31,18 @@
</ui:panelGroup>
</h:panelGrid>
</ui:form>
<h:panelGrid columnClasses="gridColCenter" columns="2" id="gridPanel2" style="height: 24px; width: 100%" width="504">
<ui:staticText escape="false" id="txtMsg1" text="" />
<h:panelGroup id="panelGroupCurrentYear" style="text-align: right;">
<ui:form id="formYear">
<ui:staticText escape="false" id="textCurrentYear" text="Visualizar análises do ano: " />
<ui:dropDown binding="#{FormMedico.dropCurrentYear}" id="dropCurrentYear"
onChange="common_timeoutSubmitForm(this.form, 'dropCurrentYear');" valueChangeListener="#{FormMedico.dropCurrentYear_valueChangeListener}"/>
</ui:form>
</h:panelGroup>
</h:panelGrid>
<h:panelGrid binding="#{FormMedico.gridLayoutTop1}" columnClasses="gridLayoutTopCols, gridLayoutTopCols" columns="1"
id="gridLayoutTop1" style="height: 15px; position: relative; vertical-align: top; width: 100%">

@ -54,9 +54,17 @@
</h:panelGrid>
</ui:form>
<h:panelGrid binding="#{FormRH.gridPanel10}" columnClasses="gridColCenter" columns="1" id="gridPanel10"
<h:panelGrid binding="#{FormRH.gridPanel10}" columnClasses="gridColCenter" columns="2" id="gridPanel10"
style="height: 24px; width: 100%" width="504">
<ui:staticText binding="#{FormRH.txtMsg1}" escape="false" id="txtMsg1" style="color: rgb(204, 0, 0); font-weight: bold; height: 24px"/>
<h:panelGroup id="panelGroupCurrentYear" style="text-align: right;">
<ui:form id="formYear">
<ui:staticText escape="false" id="textCurrentYear" text="Visualizar análises do ano: " />
<ui:dropDown binding="#{FormRH.dropCurrentYear}" id="dropCurrentYear"
onChange="common_timeoutSubmitForm(this.form, 'dropCurrentYear');" valueChangeListener="#{FormRH.dropCurrentYear_valueChangeListener}"/>
</ui:form>
</h:panelGroup>
</h:panelGrid>
<h:panelGrid binding="#{FormRH.gridLayoutTop1}" columnClasses="gridLayoutTopCols, gridLayoutTopCols" columns="1"
id="gridLayoutTop1" style="height: 15px; position: relative; vertical-align: top; width: 100%">

@ -55,9 +55,19 @@
</h:panelGrid>
</ui:form>
<h:panelGrid binding="#{FormSeguranca.gridPanel10}" columnClasses="gridColCenter" columns="1" id="gridPanel10"
<h:panelGrid binding="#{FormSeguranca.gridPanel10}" columnClasses="gridColCenter" columns="2" id="gridPanel10"
style="height: 24px; width: 100%" width="504">
<ui:staticText binding="#{FormSeguranca.txtMsg}" escape="false" id="txtMsg" style="color: rgb(204, 0, 0); font-weight: bold; height: 24px"/>
<h:panelGroup id="panelGroupCurrentYear" style="text-align: right;">
<ui:form id="formYear">
<ui:staticText escape="false" id="textCurrentYear" text="Visualizar análises do ano: " />
<ui:dropDown binding="#{FormSeguranca.dropCurrentYear}" id="dropCurrentYear"
onChange="common_timeoutSubmitForm(this.form, 'dropCurrentYear');" valueChangeListener="#{FormSeguranca.dropCurrentYear_valueChangeListener}"/>
</ui:form>
</h:panelGroup>
</h:panelGrid>
<h:panelGrid binding="#{FormSeguranca.gridLayoutTop}" columnClasses="gridLayoutTopCols, gridLayoutTopCols" columns="1"
id="gridLayoutTop" style="height: 15px; position: relative; vertical-align: top; width: 100%">

Loading…
Cancel
Save