diff --git a/trunk/AnaliseAcidentesTrabalho/properties/codegen_siprp.xml b/trunk/AnaliseAcidentesTrabalho/properties/codegen_siprp.xml new file mode 100644 index 00000000..3963e51e --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/properties/codegen_siprp.xml @@ -0,0 +1,214 @@ + + + + CIM + jdbc:postgresql://www.evolute.pt:5436/siprp + userexp + Typein + + y + /NetBeansProjects/AnaliseAcidentesTrabalho/src/java + db.data.siprp.inner + db.data.siprp.outer + n + + + + package.xml + + acidentados + Acidentados + +
+ + actualizacao + Actualizacao + +
+ + analises_acidentes + AnalisesAcidentes + +
+ + avisos + Avisos + +
+ + causas + Causas + +
+ + contactos + Contactos + +
+ + controle + Controle + +
+ + departamentos + Departamentos + +
+ + empresas + Empresas + +
+ + errors + Errors + +
+ + estabelecimentos + Estabelecimentos + +
+ + estado_medidas + EstadoMedidas + +
+ + exames + Exames + +
+ + exames_perfis + ExamesPerfis + +
+ + historico_estabelecimento + HistoricoEstabelecimento + +
+ + marcacoes_empresa + MarcacoesEmpresa + +
+ + marcacoes_estabelecimento + MarcacoesEstabelecimento + +
+ + marcacoes_trabalhador + MarcacoesTrabalhador + +
+ + medicos + Medicos + +
+ + medidas + Medidas + +
+ + not_noticias + NotNoticias + +
+ + permissoes + Permissoes + +
+ + plano_areas + PlanoAreas + +
+ + plano_medidas + PlanoMedidas + +
+ + plano_postos_trabalho + PlanoPostosTrabalho + +
+ + plano_riscos + PlanoRiscos + +
+ + plano_valores_qualitativos + PlanoValoresQualitativos + +
+ + planos_actuacao + PlanosActuacao + +
+ + properties + Properties + +
+ + recomendacoes + Recomendacoes + +
+ + risco_valores_temp + RiscoValoresTemp + +
+ + roles + Roles + +
+ + seccoes + Seccoes + +
+ + tipos_exames_comp + TiposExamesComp + +
+ + tipos_utilizadores + TiposUtilizadores + +
+ + trabalhadores + Trabalhadores + +
+ + users + Users + +
+ + utilizadores + Utilizadores + +
+ + version + Version + +
+
+ diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidenteTrabalho.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidenteTrabalho.java index 085f83a3..9bcdd903 100644 --- a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidenteTrabalho.java +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidenteTrabalho.java @@ -5960,6 +5960,42 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { this.gridAssinaturasView = hpg; } + + private HtmlPanelGrid gridParticipacao = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridParticipacao() + { + return gridParticipacao; + } + + public void setGridParticipacao( HtmlPanelGrid hpg ) + { + this.gridParticipacao = hpg; + } + + private PanelGroup grpParticipacao = new PanelGroup(); + + public PanelGroup getGrpParticipacao() + { + return grpParticipacao; + } + + public void setGrpParticipacao( PanelGroup pg ) + { + this.grpParticipacao = pg; + } + private Checkbox chkParticipacao = new Checkbox(); + + public Checkbox getChkParticipacao() + { + return chkParticipacao; + } + + public void setChkParticipacao( Checkbox c ) + { + this.chkParticipacao = c; + } + private DropDown drpCausas = new DropDown(); public DropDown getDrpCausas() @@ -7735,6 +7771,7 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean gridMedicoView.setRendered( false ); gridVerificacao.setRendered( false ); gridVerificacaoView.setRendered( false ); + gridParticipacao.setRendered( false ); gridImpressao.setRendered( false ); gridImpressaoView.setRendered( false ); @@ -7939,6 +7976,7 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean gridMedicoView.setRendered( false ); gridVerificacao.setRendered( false ); gridVerificacaoView.setRendered( false ); + gridParticipacao.setRendered( false ); gridImpressao.setRendered( false ); gridImpressaoView.setRendered( false ); @@ -7984,6 +8022,7 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean gridMedicoView.setRendered( false ); gridVerificacao.setRendered( false ); gridVerificacaoView.setRendered( false ); + gridParticipacao.setRendered( false ); gridImpressao.setRendered( false ); gridImpressaoView.setRendered( false ); @@ -8195,6 +8234,7 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean gridMedico.setRendered( false ); //gridMedicoView.setRendered(false); //gridVerificacaoView.setRendered(false); + gridParticipacao.setRendered( false ); gridImpressao.setRendered( false ); gridImpressaoView.setRendered( false ); grpVerRespSeg.setRendered( true ); @@ -8287,6 +8327,7 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean case Global.ESTADO_CONCLUIDO: } + chkParticipacao.setSelected( a.getParticipado() != null ? a.getParticipado() : Boolean.FALSE ); return null; } @@ -11779,7 +11820,15 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean case Global.ESTADO_ASSINATURA_RH: a = fillAnaliseAssinaturas( a ); break; + } + if( chkParticipacao.isChecked() ) + { + a = fillAnaliseFieldsParticipacao( a ); + } + else + { + a = clearAnaliseFieldsParticipacao( a ); } return a; @@ -12560,272 +12609,6 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { a.setPeriodo_incapacidade_a( null ); } - -// a.setImg_flexao("n"); -// if(chkImgFlexao.getSelected() != null) -// { -// if(chkImgFlexao.getSelected().equals(new Boolean(true))) -// { -// a.setImg_flexao("y"); -// } -// } -// -// a.setImg_rot1("n"); -// if(chkImgRot1.getSelected() != null) -// { -// if(chkImgRot1.getSelected().equals(new Boolean(true))) -// { -// a.setImg_rot1("y"); -// } -// } -// -// a.setImg_rot2("n"); -// if(chkImgRot2.getSelected() != null) -// { -// if(chkImgRot2.getSelected().equals(new Boolean(true))) -// { -// a.setImg_rot2("y"); -// } -// } -// -// a.setImg_ext1("n"); -// if(chkImgExt1.getSelected() != null) -// { -// if(chkImgExt1.getSelected().equals(new Boolean(true))) -// { -// a.setImg_ext1("y"); -// } -// } -// -// a.setImg_ext2("n"); -// if(chkImgExt2.getSelected() != null) -// { -// if(chkImgExt2.getSelected().equals(new Boolean(true))) -// { -// a.setImg_ext2("y"); -// } -// } -// -// a.setImg_cab1("n"); -// if(chkImgCab1.getSelected() != null) -// { -// if(chkImgCab1.getSelected().equals(new Boolean(true))) -// { -// a.setImg_cab1("y"); -// } -// } -// -// a.setImg_cab2("n"); -// if(chkImgCab2.getSelected() != null) -// { -// if(chkImgCab2.getSelected().equals(new Boolean(true))) -// { -// a.setImg_cab2("y"); -// } -// } -// -// a.setImg_cab3("n"); -// if(chkImgCab3.getSelected() != null) -// { -// if(chkImgCab3.getSelected().equals(new Boolean(true))) -// { -// a.setImg_cab3("y"); -// } -// } -// -// a.setImg_cab4("n"); -// if(chkImgCab4.getSelected() != null) -// { -// if(chkImgCab4.getSelected().equals(new Boolean(true))) -// { -// a.setImg_cab4("y"); -// } -// } -// -// a.setImg_ma1("n"); -// if(chkImgMa1.getSelected() != null) -// { -// if(chkImgMa1.getSelected().equals(new Boolean(true))) -// { -// a.setImg_ma1("y"); -// } -// } -// -// a.setImg_ma2("n"); -// if(chkImgMa2.getSelected() != null) -// { -// if(chkImgMa2.getSelected().equals(new Boolean(true))) -// { -// a.setImg_ma2("y"); -// } -// } -// -// a.setImg_ma3("n"); -// if(chkImgMa3.getSelected() != null) -// { -// if(chkImgMa3.getSelected().equals(new Boolean(true))) -// { -// a.setImg_ma3("y"); -// } -// } -// -// a.setImg_ma4("n"); -// if(chkImgMa4.getSelected() != null) -// { -// if(chkImgMa4.getSelected().equals(new Boolean(true))) -// { -// a.setImg_ma4("y"); -// } -// } -// -// a.setImg_ma5("n"); -// if(chkImgMa5.getSelected() != null) -// { -// if(chkImgMa5.getSelected().equals(new Boolean(true))) -// { -// a.setImg_ma5("y"); -// } -// } -// -// a.setImg_ma6("n"); -// if(chkImgMa6.getSelected() != null) -// { -// if(chkImgMa6.getSelected().equals(new Boolean(true))) -// { -// a.setImg_ma6("y"); -// } -// } -// -// a.setImg_ma7("n"); -// if(chkImgMa7.getSelected() != null) -// { -// if(chkImgMa7.getSelected().equals(new Boolean(true))) -// { -// a.setImg_ma7("y"); -// } -// } -// -// a.setImg_ma8("n"); -// if(chkImgMa8.getSelected() != null) -// { -// if(chkImgMa8.getSelected().equals(new Boolean(true))) -// { -// a.setImg_ma8("y"); -// } -// } -// -// a.setImg_ma9("n"); -// if(chkImgMa9.getSelected() != null) -// { -// if(chkImgMa9.getSelected().equals(new Boolean(true))) -// { -// a.setImg_ma9("y"); -// } -// } -// -// a.setImg_ma10("n"); -// if(chkImgMa10.getSelected() != null) -// { -// if(chkImgMa10.getSelected().equals(new Boolean(true))) -// { -// a.setImg_ma10("y"); -// } -// } -// -// a.setRestricao_carga(new Integer(0)); -// if(chkRestricaoCargas.getSelected()!= null) -// { -// if(chkRestricaoCargas.getSelected().equals(new Boolean(true))) -// { -// if(rbKgs2.getSelected() != null) -// { -// if(rbKgs2.getSelected().equals(new Boolean(true))) -// { -// a.setRestricao_carga(new Integer(2)); -// } -// } -// if(rbKgs5.getSelected() != null) -// { -// if(rbKgs5.getSelected().equals(new Boolean(true))) -// { -// a.setRestricao_carga(new Integer(5)); -// } -// } -// if(rbKgs10.getSelected() != null) -// { -// if(rbKgs10.getSelected().equals(new Boolean(true))) -// { -// a.setRestricao_carga(new Integer(10)); -// } -// } -// if(rbKgs15.getSelected() != null) -// { -// if(rbKgs15.getSelected().equals(new Boolean(true))) -// { -// a.setRestricao_carga(new Integer(15)); -// } -// } -// -// if(rbKgsOutro.getSelected() != null) -// { -// if(rbKgsOutro.getSelected().equals(new Boolean(true))) -// { -// if(txtKgs.getText() != null) -// { -// String kgs_str = txtKgs.getText().toString(); -// int kgs = Integer.parseInt(kgs_str); -// a.setRestricao_carga(new Integer(kgs)); -// } -// } -// } -// } -// } -// -// a.setRestricao_motricidade("n"); -// if(chkRestricaoMotricidade.getSelected() != null) -// { -// if(chkRestricaoMotricidade.getSelected().equals(new Boolean(true))) -// { -// a.setRestricao_motricidade("y"); -// } -// } -// -// a.setRestricao_conducao("n"); -// if(chkRestricaoConducao.getSelected() != null) -// { -// if(chkRestricaoConducao.getSelected().equals(new Boolean(true))) -// { -// a.setRestricao_conducao("y"); -// } -// } -// -// a.setRestricao_vibracoes("n"); -// if(chkRestricaoVibracoes.getSelected() != null) -// { -// if(chkRestricaoVibracoes.getSelected().equals(new Boolean(true))) -// { -// a.setRestricao_vibracoes("y"); -// } -// } -// -// a.setRestricao_outras(""); -// if(chkRestricaoOutras.getSelected() != null) -// { -// if(chkRestricaoOutras.getSelected().equals(new Boolean(true))) -// { -// if(txtRestricaoOutras.getText() != null) -// { -// a.setRestricao_outras((String)txtRestricaoOutras.getText()); -// } -// } -// } -// -// a.setMed_observ(""); -// if(txtObservacoes.getText() != null) -// { -// a.setMed_observ( (String) txtObservacoes.getText() ); -// } - return a; } @@ -12840,6 +12623,28 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean return a; } + private AnaliseAcidente fillAnaliseFieldsParticipacao( AnaliseAcidente a ) + { + if( a.getParticipado() == null || !a.getParticipado() ) + { + a.setParticipado( Boolean.TRUE ); + String nome = getSessionBean1().getCurrentUser().getNome(); + a.setNomeResponsavelParticipacao( nome ); + java.util.Date today = new java.util.Date(); + java.sql.Date sqlToday = new java.sql.Date( today.getTime() ); + a.setDataParticipacao( sqlToday ); + } + return a; + } + + private AnaliseAcidente clearAnaliseFieldsParticipacao( AnaliseAcidente a ) + { + a.setParticipado( Boolean.FALSE ); + a.setNomeResponsavelParticipacao( null ); + a.setDataParticipacao( null ); + return a; + } + private AnaliseAcidente fillAnaliseAssinaturas( AnaliseAcidente a ) { // UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormDirGerRh.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormDirGerRh.java index 9053ae38..bcdf5c43 100644 --- a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormDirGerRh.java +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormDirGerRh.java @@ -316,6 +316,30 @@ public class FormDirGerRh extends AbstractPageBean return lnkNrSeg; } + private TableColumn tableColumnSeguimentoParticipado = new TableColumn(); + + public TableColumn getTableColumnSeguimentoParticipado() + { + return tableColumnSeguimentoParticipado; + } + + public void setTableColumnSeguimentoParticipado( TableColumn tc ) + { + this.tableColumnSeguimentoParticipado = tc; + } + + private TableColumn tableColumnConcluidoParticipado = new TableColumn(); + + public TableColumn getTableColumnConcluidoParticipado() + { + return tableColumnConcluidoParticipado; + } + + public void setTableColumnConcluidoParticipado( TableColumn tc ) + { + this.tableColumnConcluidoParticipado = tc; + } + public void setLnkNrSeg( Hyperlink h ) { this.lnkNrSeg = h; diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormDirSiprp.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormDirSiprp.java index d606c4c3..6d585644 100755 --- a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormDirSiprp.java +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormDirSiprp.java @@ -261,6 +261,30 @@ public class FormDirSiprp extends AbstractPageBean return table2; } + private TableColumn tableColumnSeguimentoParticipado = new TableColumn(); + + public TableColumn getTableColumnSeguimentoParticipado() + { + return tableColumnSeguimentoParticipado; + } + + public void setTableColumnSeguimentoParticipado( TableColumn tc ) + { + this.tableColumnSeguimentoParticipado = tc; + } + + private TableColumn tableColumnConcluidoParticipado = new TableColumn(); + + public TableColumn getTableColumnConcluidoParticipado() + { + return tableColumnConcluidoParticipado; + } + + public void setTableColumnConcluidoParticipado( TableColumn tc ) + { + this.tableColumnConcluidoParticipado = tc; + } + public void setTable2( Table t ) { this.table2 = t; diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormHS.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormHS.java index e07766c9..feaeee1d 100644 --- a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormHS.java +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormHS.java @@ -387,6 +387,43 @@ public class FormHS extends AbstractPageBean { this.tableRowGroup2 = trg; } + + private TableColumn tableColumnActualParticipado = new TableColumn(); + + public TableColumn getTableColumnActualParticipado() + { + return tableColumnActualParticipado; + } + + public void setTableColumnActualParticipado( TableColumn tc ) + { + this.tableColumnActualParticipado = tc; + } + + private TableColumn tableColumnSeguimentoParticipado = new TableColumn(); + + public TableColumn getTableColumnSeguimentoParticipado() + { + return tableColumnSeguimentoParticipado; + } + + public void setTableColumnSeguimentoParticipado( TableColumn tc ) + { + this.tableColumnSeguimentoParticipado = tc; + } + + private TableColumn tableColumnConcluidoParticipado = new TableColumn(); + + public TableColumn getTableColumnConcluidoParticipado() + { + return tableColumnConcluidoParticipado; + } + + public void setTableColumnConcluidoParticipado( TableColumn tc ) + { + this.tableColumnConcluidoParticipado = tc; + } + private TableColumn tableColumn4 = new TableColumn(); public TableColumn getTableColumn4() diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormRH.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormRH.java index ba832c36..05797272 100644 --- a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormRH.java +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormRH.java @@ -288,6 +288,43 @@ public class FormRH extends AbstractPageBean { this.tableRowGroup1 = trg; } + + private TableColumn tableColumnActualParticipado = new TableColumn(); + + public TableColumn getTableColumnActualParticipado() + { + return tableColumnActualParticipado; + } + + public void setTableColumnActualParticipado( TableColumn tc ) + { + this.tableColumnActualParticipado = tc; + } + + private TableColumn tableColumnSeguimentoParticipado = new TableColumn(); + + public TableColumn getTableColumnSeguimentoParticipado() + { + return tableColumnSeguimentoParticipado; + } + + public void setTableColumnSeguimentoParticipado( TableColumn tc ) + { + this.tableColumnSeguimentoParticipado = tc; + } + + private TableColumn tableColumnConcluidoParticipado = new TableColumn(); + + public TableColumn getTableColumnConcluidoParticipado() + { + return tableColumnConcluidoParticipado; + } + + public void setTableColumnConcluidoParticipado( TableColumn tc ) + { + this.tableColumnConcluidoParticipado = tc; + } + private TableColumn tableColumn1 = new TableColumn(); public TableColumn getTableColumn1() diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/SessionBean1.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/SessionBean1.java index 572818cd..3a6f49f8 100644 --- a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/SessionBean1.java +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/SessionBean1.java @@ -29,6 +29,14 @@ public class SessionBean1 extends AbstractSessionBean { // private int __placeholder; + + private db.providers.AnalisesActualDataProvider analisesActualDataProvider; + private db.providers.AnalisesSeguimentoDataProvider analisesSeguimentoDataProvider; + private db.providers.AnalisesConcluidasDataProvider analisesConcluidasDataProvider; + private db.providers.TrabalhadoresListDataProvider trabalhadoresListDataProvider; + private db.providers.EstadosCorrecaoDataProvider estadosCorrecaoDataProvider; + private db.providers.UtilizadoresActivosListDataProvider utilizadoresActivosListDataProvider; + private db.providers.UtilizadoresInactivosListDataProvider utilizadoresInactivosListDataProvider; /** *

Automatically managed component initialization. WARNING: @@ -215,14 +223,6 @@ public class SessionBean1 extends AbstractSessionBean setCanAccessEstatisticas( getCanAccessEstatisticas() ); } - private db.providers.AnalisesActualDataProvider analisesActualDataProvider; - private db.providers.AnalisesSeguimentoDataProvider analisesSeguimentoDataProvider; - private db.providers.AnalisesConcluidasDataProvider analisesConcluidasDataProvider; - private db.providers.TrabalhadoresListDataProvider trabalhadoresListDataProvider; - private db.providers.EstadosCorrecaoDataProvider estadosCorrecaoDataProvider; - private db.providers.UtilizadoresActivosListDataProvider utilizadoresActivosListDataProvider; - private db.providers.UtilizadoresInactivosListDataProvider utilizadoresInactivosListDataProvider; - public db.providers.AnalisesActualDataProvider getAnalisesActualDataProvider() { return analisesActualDataProvider; diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/ViewAnaliseAcidenteTrabalho.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/ViewAnaliseAcidenteTrabalho.java index 448a9b3e..f743615f 100644 --- a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/ViewAnaliseAcidenteTrabalho.java +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/ViewAnaliseAcidenteTrabalho.java @@ -1088,6 +1088,30 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean this.gridAssinaturasView = hpg; } + private HtmlPanelGrid gridParticipacaoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridParticipacaoView() + { + return gridParticipacaoView; + } + + public void setGridParticipacaoView(HtmlPanelGrid hpg) + { + this.gridParticipacaoView = hpg; + } + + private HtmlPanelGrid gridEstadoParticipacaoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridEstadoParticipacaoView() + { + return gridEstadoParticipacaoView; + } + + public void setGridEstadoParticipacaoView(HtmlPanelGrid hpg) + { + this.gridEstadoParticipacaoView = hpg; + } + private HtmlPanelGrid gridImpressaoView = new HtmlPanelGrid(); public HtmlPanelGrid getGridImpressaoView() { @@ -2548,6 +2572,8 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean break; } + + fillParticipacaoSeguro( a ); } private void fillHeader(AnaliseAcidente a) @@ -4226,35 +4252,6 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean private void fillVerificacao(AnaliseAcidente a) { -// StaticText st = new StaticText(); -// st.setId("stVerificacao1"); -// st.setEscape(false); -// String txtVer = "Verificado por " + a.getNome_resp_seg() + " a "; -// //txtVer += a.getData_assinatura_seg(); -// -// try -// { -// java.util.Date ddate = new java.util.Date(a.getData_assinatura_seg().getTime()); -// txtVer += utils.Utils.dateToYYYYMMDD(ddate); -// } -// catch(Exception ex){}; -// st.setText(txtVer); -// gridAssinaturasView.getChildren().add(st); -// -// st = new StaticText(); -// st.setId("stVerificacao2"); -// st.setEscape(false); -// txtVer = "Verificado por " + a.getNome_resp_rh() + " a "; -// //txtVer += a.getData_assinatura_rh(); -// try -// { -// java.util.Date ddate = new java.util.Date(a.getData_assinatura_rh().getTime()); -// txtVer += utils.Utils.dateToYYYYMMDD(ddate); -// } -// catch(Exception ex){}; -// st.setText(txtVer); -// gridAssinaturasView.getChildren().add(st); - StaticText st = null; String txtVer = null; if(a.getAveriguador() != null) @@ -4392,7 +4389,42 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean grid.getChildren().add(st); gridAssinaturasView.getChildren().add(grid); } - + + private void fillParticipacaoSeguro(AnaliseAcidente a) + { + if( a.getParticipado() != null && a.getParticipado() ) + { + StaticText st = new StaticText(); + st.setId("stParticipacao"); + st.setEscape(false); + st.setText( "Participado ao Seguro" ); + gridEstadoParticipacaoView.getChildren().add(st); + } + else + { + StaticText st = new StaticText(); + st.setId("stParticipacao"); + st.setEscape(false); + st.setText( "Não Participado ao Seguro" ); + gridEstadoParticipacaoView.getChildren().add(st); + } + + Integer tipo = getSessionBean1().getCurrentUser().getTipo(); + + switch(tipo.intValue()) + { + case Global.TIPO_UTILIZADOR_RH: + case Global.TIPO_UTILIZADOR_HS: + case Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP: + gridParticipacaoView.setRendered( true ); + break; + + default: + gridParticipacaoView.setRendered( false ); + break; + } + } + private void fillImpressao(AnaliseAcidente a) { StaticText st = new StaticText(); diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/beans/AnaliseAcidente.java b/trunk/AnaliseAcidentesTrabalho/src/java/beans/AnaliseAcidente.java index 4e0adf0b..858b065a 100644 --- a/trunk/AnaliseAcidentesTrabalho/src/java/beans/AnaliseAcidente.java +++ b/trunk/AnaliseAcidentesTrabalho/src/java/beans/AnaliseAcidente.java @@ -147,6 +147,11 @@ public class AnaliseAcidente implements Serializable private java.util.Date data_desactivacao; private String comentario_desactivacao; + private Boolean participado; + private String participado_str; + private String nomeResponsavelParticipacao; + private java.util.Date dataParticipacao; + /** Creates a new instance of AnaliseAcidente */ public AnaliseAcidente() { @@ -1088,4 +1093,39 @@ public class AnaliseAcidente implements Serializable { return "Desactivado em " + getData_desactivacao(); } + + public Boolean getParticipado() + { + return this.participado; + } + + public void setParticipado( Boolean participado ) + { + this.participado = participado; + } + + public String getNomeResponsavelParticipacao() + { + return this.nomeResponsavelParticipacao; + } + + public void setNomeResponsavelParticipacao( String nomeResponsavelParticipacao ) + { + this.nomeResponsavelParticipacao = nomeResponsavelParticipacao; + } + + public java.util.Date getDataParticipacao() + { + return this.dataParticipacao; + } + + public void setDataParticipacao( java.util.Date dataParticipacao ) + { + this.dataParticipacao = dataParticipacao; + } + + public String getParticipado_str() + { + return ( participado != null && participado ) ? "Participado" : ""; + } } diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/db/data/siprp/inner/Acidentados.java b/trunk/AnaliseAcidentesTrabalho/src/java/db/data/siprp/inner/Acidentados.java index 48158509..48b8db9e 100644 --- a/trunk/AnaliseAcidentesTrabalho/src/java/db/data/siprp/inner/Acidentados.java +++ b/trunk/AnaliseAcidentesTrabalho/src/java/db/data/siprp/inner/Acidentados.java @@ -191,7 +191,6 @@ public class Acidentados extends com.evolute.entity.evo.EvoDataObjectfromAnalisesAcidentes_acidentado_id() { - java.util.List result = null; - try - { - result = fromReference( db.data.siprp.outer.AnalisesAcidentesData.class , getPrimaryKey().getMap().get("id"), "acidentado_id" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) - { - throw new RuntimeException( edex ); + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.AnalisesAcidentesData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.AnalisesAcidentesData.class , getPrimaryKey().getMap().get("id"), "acidentado_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } @@ -234,7 +236,6 @@ public class Acidentados extends com.evolute.entity.evo.EvoDataObject LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); @@ -580,6 +586,15 @@ public class AnalisesAcidentes extends com.evolute.entity.evo.EvoDataObjectfromMedidas_analise_id() { - java.util.List result = null; - try - { - result = fromReference( db.data.siprp.outer.MedidasData.class , getPrimaryKey().getMap().get("id"), "analise_id" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.MedidasData >(); + if ( getPrimaryKey() != null ) { - throw new RuntimeException( edex ); + try + { + result = fromReference( db.data.siprp.outer.MedidasData.class , getPrimaryKey().getMap().get("id"), "analise_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } public java.util.ListfromRecomendacoes_analise_id() { - java.util.List result = null; - try + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.RecomendacoesData >(); + if ( getPrimaryKey() != null ) { - result = fromReference( db.data.siprp.outer.RecomendacoesData.class , getPrimaryKey().getMap().get("id"), "analise_id" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) - { - throw new RuntimeException( edex ); + try + { + result = fromReference( db.data.siprp.outer.RecomendacoesData.class , getPrimaryKey().getMap().get("id"), "analise_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } @@ -913,7 +940,6 @@ public class AnalisesAcidentes extends com.evolute.entity.evo.EvoDataObjectfromAnalisesAcidentes_departamento_id() { - java.util.List result = null; - try + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.AnalisesAcidentesData >(); + if ( getPrimaryKey() != null ) { - result = fromReference( db.data.siprp.outer.AnalisesAcidentesData.class , getPrimaryKey().getMap().get("id"), "departamento_id" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) - { - throw new RuntimeException( edex ); + try + { + result = fromReference( db.data.siprp.outer.AnalisesAcidentesData.class , getPrimaryKey().getMap().get("id"), "departamento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } public java.util.ListfromSeccoes_departamento_id() { - java.util.List result = null; - try + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.SeccoesData >(); + if ( getPrimaryKey() != null ) { - result = fromReference( db.data.siprp.outer.SeccoesData.class , getPrimaryKey().getMap().get("id"), "departamento_id" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) - { - throw new RuntimeException( edex ); + try + { + result = fromReference( db.data.siprp.outer.SeccoesData.class , getPrimaryKey().getMap().get("id"), "departamento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } @@ -146,7 +151,6 @@ public class Departamentos extends com.evolute.entity.evo.EvoDataObjectfromAvisos_empresa_id() { - java.util.List result = null; - try - { - result = fromReference( db.data.siprp.outer.AvisosData.class , getPrimaryKey().getMap().get("id"), "empresa_id" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.AvisosData >(); + if ( getPrimaryKey() != null ) { - throw new RuntimeException( edex ); + try + { + result = fromReference( db.data.siprp.outer.AvisosData.class , getPrimaryKey().getMap().get("id"), "empresa_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } public java.util.ListfromEstabelecimentos_empresa_id() { - java.util.List result = null; - try + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.EstabelecimentosData >(); + if ( getPrimaryKey() != null ) { - result = fromReference( db.data.siprp.outer.EstabelecimentosData.class , getPrimaryKey().getMap().get("id"), "empresa_id" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) - { - throw new RuntimeException( edex ); + try + { + result = fromReference( db.data.siprp.outer.EstabelecimentosData.class , getPrimaryKey().getMap().get("id"), "empresa_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } public java.util.ListfromMarcacoesEmpresa_empresa_id() { - java.util.List result = null; - try + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.MarcacoesEmpresaData >(); + if ( getPrimaryKey() != null ) { - result = fromReference( db.data.siprp.outer.MarcacoesEmpresaData.class , getPrimaryKey().getMap().get("id"), "empresa_id" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) - { - throw new RuntimeException( edex ); + try + { + result = fromReference( db.data.siprp.outer.MarcacoesEmpresaData.class , getPrimaryKey().getMap().get("id"), "empresa_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } @@ -246,7 +254,6 @@ public class Empresas extends com.evolute.entity.evo.EvoDataObjectfromAvisos_estabelecimento_id() { - java.util.List result = null; - try - { - result = fromReference( db.data.siprp.outer.AvisosData.class , getPrimaryKey().getMap().get("id"), "estabelecimento_id" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.AvisosData >(); + if ( getPrimaryKey() != null ) { - throw new RuntimeException( edex ); + try + { + result = fromReference( db.data.siprp.outer.AvisosData.class , getPrimaryKey().getMap().get("id"), "estabelecimento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } public java.util.ListfromHistoricoEstabelecimento_estabelecimento_id() { - java.util.List result = null; - try + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.HistoricoEstabelecimentoData >(); + if ( getPrimaryKey() != null ) { - result = fromReference( db.data.siprp.outer.HistoricoEstabelecimentoData.class , getPrimaryKey().getMap().get("id"), "estabelecimento_id" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) - { - throw new RuntimeException( edex ); + try + { + result = fromReference( db.data.siprp.outer.HistoricoEstabelecimentoData.class , getPrimaryKey().getMap().get("id"), "estabelecimento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } public java.util.ListfromTrabalhadores_estabelecimento_id() { - java.util.List result = null; - try + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.TrabalhadoresData >(); + if ( getPrimaryKey() != null ) { - result = fromReference( db.data.siprp.outer.TrabalhadoresData.class , getPrimaryKey().getMap().get("id"), "estabelecimento_id" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) - { - throw new RuntimeException( edex ); + try + { + result = fromReference( db.data.siprp.outer.TrabalhadoresData.class , getPrimaryKey().getMap().get("id"), "estabelecimento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } @@ -216,7 +224,6 @@ public class Estabelecimentos extends com.evolute.entity.evo.EvoDataObjectfromPlanoMedidas_estado_medidas_id() { - java.util.List result = null; - try + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.PlanoMedidasData >(); + if ( getPrimaryKey() != null ) { - result = fromReference( db.data.siprp.outer.PlanoMedidasData.class , getPrimaryKey().getMap().get("id"), "estado_medidas_id" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) - { - throw new RuntimeException( edex ); + try + { + result = fromReference( db.data.siprp.outer.PlanoMedidasData.class , getPrimaryKey().getMap().get("id"), "estado_medidas_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } @@ -139,7 +141,6 @@ public class EstadoMedidas extends com.evolute.entity.evo.EvoDataObjectfromExames_medico_id() { - java.util.List result = null; - try + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.ExamesData >(); + if ( getPrimaryKey() != null ) { - result = fromReference( db.data.siprp.outer.ExamesData.class , getPrimaryKey().getMap().get("id"), "medico_id" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) - { - throw new RuntimeException( edex ); + try + { + result = fromReference( db.data.siprp.outer.ExamesData.class , getPrimaryKey().getMap().get("id"), "medico_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } @@ -139,7 +141,6 @@ public class Medicos extends com.evolute.entity.evo.EvoDataObject LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); @@ -54,15 +58,21 @@ public class PlanoAreas extends com.evolute.entity.evo.EvoDataObjectfromPlanoRiscos_area_id() { - java.util.List result = null; - try - { - result = fromReference( db.data.siprp.outer.PlanoRiscosData.class , getPrimaryKey().getMap().get("id"), "area_id" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.PlanoRiscosData >(); + if ( getPrimaryKey() != null ) { - throw new RuntimeException( edex ); + try + { + result = fromReference( db.data.siprp.outer.PlanoRiscosData.class , getPrimaryKey().getMap().get("id"), "area_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } @@ -232,7 +244,6 @@ public class PlanoAreas extends com.evolute.entity.evo.EvoDataObjectfromPlanoPostosTrabalho_medida_id() { - java.util.List result = null; - try + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.PlanoPostosTrabalhoData >(); + if ( getPrimaryKey() != null ) { - result = fromReference( db.data.siprp.outer.PlanoPostosTrabalhoData.class , getPrimaryKey().getMap().get("id"), "medida_id" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) - { - throw new RuntimeException( edex ); + try + { + result = fromReference( db.data.siprp.outer.PlanoPostosTrabalhoData.class , getPrimaryKey().getMap().get("id"), "medida_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } @@ -249,7 +249,6 @@ public class PlanoMedidas extends com.evolute.entity.evo.EvoDataObject LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); @@ -54,15 +56,18 @@ public class PlanoPostosTrabalho extends com.evolute.entity.evo.EvoDataObject LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); @@ -104,20 +108,27 @@ public class PlanoRiscos extends com.evolute.entity.evo.EvoDataObjectfromPlanoMedidas_risco_id() { - java.util.List result = null; - try - { - result = fromReference( db.data.siprp.outer.PlanoMedidasData.class , getPrimaryKey().getMap().get("id"), "risco_id" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) - { - throw new RuntimeException( edex ); + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.PlanoMedidasData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.PlanoMedidasData.class , getPrimaryKey().getMap().get("id"), "risco_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } @@ -328,7 +341,6 @@ public class PlanoRiscos extends com.evolute.entity.evo.EvoDataObject (can't touch this) +*/ +package db.data.siprp.inner; + + +public class PlanoValoresQualitativos extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( PlanoValoresQualitativos.ID, PlanoValoresQualitativos.ID_INDEX ); + FIELD_INDEXES.put( PlanoValoresQualitativos.ID_FULL, PlanoValoresQualitativos.ID_INDEX ); + FIELD_INDEXES.put( PlanoValoresQualitativos.DESCRICAO, PlanoValoresQualitativos.DESCRICAO_INDEX ); + FIELD_INDEXES.put( PlanoValoresQualitativos.DESCRICAO_FULL, PlanoValoresQualitativos.DESCRICAO_INDEX ); + FIELD_INDEXES.put( PlanoValoresQualitativos.DELETED_STAMP, PlanoValoresQualitativos.DELETED_STAMP_INDEX ); + FIELD_INDEXES.put( PlanoValoresQualitativos.DELETED_STAMP_FULL, PlanoValoresQualitativos.DELETED_STAMP_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "plano_valores_qualitativos"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.plano_valores_qualitativos"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "plano_valores_qualitativos.id"; + public static final int ID_INDEX = 0; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "plano_valores_qualitativos.descricao"; + public static final int DESCRICAO_INDEX = 1; + public static final String DELETED_STAMP = "deleted_stamp"; + public static final String DELETED_STAMP_FULL = "plano_valores_qualitativos.deleted_stamp"; + public static final int DELETED_STAMP_INDEX = 2; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRICAO, DELETED_STAMP, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRICAO, TABLENAME + "." + DELETED_STAMP, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESCRICAO, DELETED_STAMP, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESCRICAO, DELETED_STAMP, }; + + private Integer id; + private String descricao; + private java.sql.Timestamp deleted_stamp; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public PlanoValoresQualitativos() + { + super(); + dirtyProperties = new boolean[]{ false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_stamp() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_STAMP ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_stamp; + } + + public void setDeleted_stamp( java.sql.Timestamp deleted_stamp ) + { + try + { + preProcess( DELETED_STAMP, deleted_stamp ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_stamp = deleted_stamp; + LAZY_LOADED_OBJECTS.put( DELETED_STAMP, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoValoresQualitativos.ID_INDEX: + value = getId(); + break; + case PlanoValoresQualitativos.DESCRICAO_INDEX: + value = getDescricao(); + break; + case PlanoValoresQualitativos.DELETED_STAMP_INDEX: + value = getDeleted_stamp(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoValoresQualitativos.ID_INDEX: + value = this.id; + break; + case PlanoValoresQualitativos.DESCRICAO_INDEX: + value = this.descricao; + break; + case PlanoValoresQualitativos.DELETED_STAMP_INDEX: + value = this.deleted_stamp; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoValoresQualitativos.ID_INDEX: + setId( ( Integer ) value ); + break; + case PlanoValoresQualitativos.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case PlanoValoresQualitativos.DELETED_STAMP_INDEX: + setDeleted_stamp( ( java.sql.Timestamp ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoValoresQualitativos.ID_INDEX: + this.id = ( Integer ) value; + break; + case PlanoValoresQualitativos.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case PlanoValoresQualitativos.DELETED_STAMP_INDEX: + this.deleted_stamp = ( java.sql.Timestamp ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case PlanoValoresQualitativos.ID_INDEX: + theClass = Integer.class; + break; + case PlanoValoresQualitativos.DESCRICAO_INDEX: + theClass = String.class; + break; + case PlanoValoresQualitativos.DELETED_STAMP_INDEX: + theClass = java.sql.Timestamp.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : PlanoValoresQualitativos._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, PlanoValoresQualitativos.PK_FIELD_NAMES ); + primaryKey.set( 0, getId() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/db/data/siprp/inner/PlanosActuacao.java b/trunk/AnaliseAcidentesTrabalho/src/java/db/data/siprp/inner/PlanosActuacao.java index 1955fc7b..24e80e7c 100644 --- a/trunk/AnaliseAcidentesTrabalho/src/java/db/data/siprp/inner/PlanosActuacao.java +++ b/trunk/AnaliseAcidentesTrabalho/src/java/db/data/siprp/inner/PlanosActuacao.java @@ -87,6 +87,14 @@ public class PlanosActuacao extends com.evolute.entity.evo.EvoDataObject LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); @@ -215,6 +223,18 @@ public class PlanosActuacao extends com.evolute.entity.evo.EvoDataObjectfromPlanoAreas_plano_id() { - java.util.List result = null; - try - { - result = fromReference( db.data.siprp.outer.PlanoAreasData.class , getPrimaryKey().getMap().get("id"), "plano_id" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.PlanoAreasData >(); + if ( getPrimaryKey() != null ) { - throw new RuntimeException( edex ); + try + { + result = fromReference( db.data.siprp.outer.PlanoAreasData.class , getPrimaryKey().getMap().get("id"), "plano_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } @@ -1206,7 +1210,6 @@ public class PlanosActuacao extends com.evolute.entity.evo.EvoDataObjectfromAnalisesAcidentes_seccao_id() { - java.util.List result = null; - try + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.AnalisesAcidentesData >(); + if ( getPrimaryKey() != null ) { - result = fromReference( db.data.siprp.outer.AnalisesAcidentesData.class , getPrimaryKey().getMap().get("id"), "seccao_id" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) - { - throw new RuntimeException( edex ); + try + { + result = fromReference( db.data.siprp.outer.AnalisesAcidentesData.class , getPrimaryKey().getMap().get("id"), "seccao_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } @@ -148,7 +150,6 @@ public class Seccoes extends com.evolute.entity.evo.EvoDataObjectfromExamesPerfis_tipo() { - java.util.List result = null; - try + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.ExamesPerfisData >(); + if ( getPrimaryKey() != null ) { - result = fromReference( db.data.siprp.outer.ExamesPerfisData.class , getPrimaryKey().getMap().get("id"), "tipo" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) - { - throw new RuntimeException( edex ); + try + { + result = fromReference( db.data.siprp.outer.ExamesPerfisData.class , getPrimaryKey().getMap().get("id"), "tipo" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } @@ -132,7 +134,6 @@ public class TiposExamesComp extends com.evolute.entity.evo.EvoDataObjectfromAvisos_trabalhador_id() { - java.util.List result = null; - try - { - result = fromReference( db.data.siprp.outer.AvisosData.class , getPrimaryKey().getMap().get("id"), "trabalhador_id" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) - { - throw new RuntimeException( edex ); + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.AvisosData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.AvisosData.class , getPrimaryKey().getMap().get("id"), "trabalhador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } public java.util.ListfromExames_trabalhador_id() { - java.util.List result = null; - try - { - result = fromReference( db.data.siprp.outer.ExamesData.class , getPrimaryKey().getMap().get("id"), "trabalhador_id" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) - { - throw new RuntimeException( edex ); + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.ExamesData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.ExamesData.class , getPrimaryKey().getMap().get("id"), "trabalhador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } public java.util.ListfromMarcacoesTrabalhador_trabalhador_id() { - java.util.List result = null; - try - { - result = fromReference( db.data.siprp.outer.MarcacoesTrabalhadorData.class , getPrimaryKey().getMap().get("id"), "trabalhador_id" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) - { - throw new RuntimeException( edex ); + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.MarcacoesTrabalhadorData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.MarcacoesTrabalhadorData.class , getPrimaryKey().getMap().get("id"), "trabalhador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } @@ -259,7 +267,6 @@ public class Trabalhadores extends com.evolute.entity.evo.EvoDataObject LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); @@ -126,21 +128,27 @@ public class Utilizadores extends com.evolute.entity.evo.EvoDataObjectfromPlanosActuacao_user_dir_loja() { - java.util.List result = null; - try - { - result = fromReference( db.data.siprp.outer.PlanosActuacaoData.class , getPrimaryKey().getMap().get("id"), "user_dir_loja" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) - { - throw new RuntimeException( edex ); + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.PlanosActuacaoData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.PlanosActuacaoData.class , getPrimaryKey().getMap().get("id"), "user_dir_loja" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } public java.util.ListfromPlanosActuacao_user_dns() { - java.util.List result = null; - try - { - result = fromReference( db.data.siprp.outer.PlanosActuacaoData.class , getPrimaryKey().getMap().get("id"), "user_dns" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) - { - throw new RuntimeException( edex ); + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.PlanosActuacaoData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.PlanosActuacaoData.class , getPrimaryKey().getMap().get("id"), "user_dns" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } public java.util.ListfromPlanosActuacao_user_hs() { - java.util.List result = null; - try - { - result = fromReference( db.data.siprp.outer.PlanosActuacaoData.class , getPrimaryKey().getMap().get("id"), "user_hs" ); - } - catch( com.evolute.entity.evo.EvoDataException edex ) - { - throw new RuntimeException( edex ); + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.PlanosActuacaoData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.PlanosActuacaoData.class , getPrimaryKey().getMap().get("id"), "user_hs" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } } return result; } @@ -273,7 +291,6 @@ public class Utilizadores extends com.evolute.entity.evo.EvoDataObject + + + + + + + + + + + + @@ -1074,6 +1086,14 @@ + + + + + + + + @@ -1122,6 +1142,10 @@ + + + + @@ -1183,6 +1207,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -1324,6 +1371,22 @@ + + + + + + + + + + + + + + + + @@ -1485,7 +1548,7 @@ - + @@ -1552,6 +1615,10 @@ + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/db/data/siprp/outer/PlanoValoresQualitativosData.java b/trunk/AnaliseAcidentesTrabalho/src/java/db/data/siprp/outer/PlanoValoresQualitativosData.java new file mode 100644 index 00000000..014e7762 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/db/data/siprp/outer/PlanoValoresQualitativosData.java @@ -0,0 +1,18 @@ +/* +* PlanoValoresQualitativosData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class PlanoValoresQualitativosData extends db.data.siprp.inner.PlanoValoresQualitativos +{ + + public PlanoValoresQualitativosData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/db/providers/AnalisesDataProvider.java b/trunk/AnaliseAcidentesTrabalho/src/java/db/providers/AnalisesDataProvider.java index ae25ba63..5e74e101 100644 --- a/trunk/AnaliseAcidentesTrabalho/src/java/db/providers/AnalisesDataProvider.java +++ b/trunk/AnaliseAcidentesTrabalho/src/java/db/providers/AnalisesDataProvider.java @@ -1527,6 +1527,9 @@ public class AnalisesDataProvider extends GenericDataProvider a.setConcluido_por_desactivacao( rs.getBoolean( "concluido_por_desactivacao" ) ); a.setData_desactivacao( rs.getDate( "data_desactivacao" ) ); a.setComentario_desactivacao( rs.getString( "comentario_desactivacao" ) ); + a.setParticipado( "y".equals( rs.getString( "participado" ) ) ); + a.setNomeResponsavelParticipacao( rs.getString( "nome_responsavel_participacao" ) ); + a.setDataParticipacao( rs.getDate( "data_participacao" ) ); list.add( a ); } while ( rs.next() ); @@ -3359,6 +3362,9 @@ public class AnalisesDataProvider extends GenericDataProvider analise.setData_assinatura_superior( analiseBean.getData_assinatura_superior() ); analise.setRh_fase4( analiseBean.getRh_fase4() ); } + analise.setParticipado( ( analiseBean.getParticipado() != null && analiseBean.getParticipado() ) ? "y" : "n" ); + analise.setNome_responsavel_participacao( analiseBean.getNomeResponsavelParticipacao() ); + analise.setData_participacao( analiseBean.getDataParticipacao() ); return analise; } diff --git a/trunk/AnaliseAcidentesTrabalho/web/AnaliseAcidenteTrabalho.jsp b/trunk/AnaliseAcidentesTrabalho/web/AnaliseAcidenteTrabalho.jsp index db422ad8..b33306f0 100644 --- a/trunk/AnaliseAcidentesTrabalho/web/AnaliseAcidenteTrabalho.jsp +++ b/trunk/AnaliseAcidentesTrabalho/web/AnaliseAcidenteTrabalho.jsp @@ -1408,7 +1408,7 @@ + id="gridAssinaturasView" style="height: 24px; width: 100%" width="240"> + + + + + + + + + + + + + + + + @@ -245,6 +249,10 @@ text="#{currentRow.value['desactivadoLabel']}" style="color: rgb( 255, 0, 0 );" rendered="#{currentRow.value['concluido_por_desactivacao']}" /> + + + diff --git a/trunk/AnaliseAcidentesTrabalho/web/FormDirSiprp.jsp b/trunk/AnaliseAcidentesTrabalho/web/FormDirSiprp.jsp index 1b5c1769..26a254ff 100755 --- a/trunk/AnaliseAcidentesTrabalho/web/FormDirSiprp.jsp +++ b/trunk/AnaliseAcidentesTrabalho/web/FormDirSiprp.jsp @@ -156,6 +156,10 @@ + + + @@ -255,6 +259,10 @@ text="#{currentRow.value['desactivadoLabel']}" style="color: rgb( 255, 0, 0 );" rendered="#{currentRow.value['concluido_por_desactivacao']}" /> + + + diff --git a/trunk/AnaliseAcidentesTrabalho/web/FormHS.jsp b/trunk/AnaliseAcidentesTrabalho/web/FormHS.jsp index a853059f..c15d574b 100644 --- a/trunk/AnaliseAcidentesTrabalho/web/FormHS.jsp +++ b/trunk/AnaliseAcidentesTrabalho/web/FormHS.jsp @@ -139,6 +139,10 @@ + + + @@ -211,6 +215,10 @@ sort="nome_estabelecimento" width="15%"> + + + @@ -301,6 +309,10 @@ text="#{currentRow.value['desactivadoLabel']}" style="color: rgb( 255, 0, 0 );" rendered="#{currentRow.value['concluido_por_desactivacao']}" /> + + + diff --git a/trunk/AnaliseAcidentesTrabalho/web/FormRH.jsp b/trunk/AnaliseAcidentesTrabalho/web/FormRH.jsp index b9b88ae9..a19e312d 100644 --- a/trunk/AnaliseAcidentesTrabalho/web/FormRH.jsp +++ b/trunk/AnaliseAcidentesTrabalho/web/FormRH.jsp @@ -139,6 +139,10 @@ sort="nome_estabelecimento"> + + + @@ -208,6 +212,10 @@ sort="nome_estabelecimento"> + + + @@ -299,6 +307,10 @@ text="#{currentRow.value['desactivadoLabel']}" style="color: rgb( 255, 0, 0 );" rendered="#{currentRow.value['concluido_por_desactivacao']}" /> + + + diff --git a/trunk/AnaliseAcidentesTrabalho/web/ViewAnaliseAcidenteTrabalho.jsp b/trunk/AnaliseAcidentesTrabalho/web/ViewAnaliseAcidenteTrabalho.jsp index 4fab955d..88b6a222 100644 --- a/trunk/AnaliseAcidentesTrabalho/web/ViewAnaliseAcidenteTrabalho.jsp +++ b/trunk/AnaliseAcidentesTrabalho/web/ViewAnaliseAcidenteTrabalho.jsp @@ -438,6 +438,20 @@ id="gridAssinaturasView" style="height: 24px; width: 100%" width="240"/> + + + + + + + + + + + +