|
|
|
@ -64,6 +64,7 @@ public class PlanosActuacao {
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
list = pdp.getPlanosOnline();
|
|
|
|
list = pdp.getPlanosOnline();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch(Exception ex)
|
|
|
|
catch(Exception ex)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -106,14 +107,21 @@ public class PlanosActuacao {
|
|
|
|
System.out.println("CREATE PLANO - RELATORIO ID : " + relatorio.getId().toString());
|
|
|
|
System.out.println("CREATE PLANO - RELATORIO ID : " + relatorio.getId().toString());
|
|
|
|
PlanoActuacao p = new PlanoActuacao();
|
|
|
|
PlanoActuacao p = new PlanoActuacao();
|
|
|
|
p.setData_visita(relatorio.getToHsMarcacoesEstabelecimento().getData());
|
|
|
|
p.setData_visita(relatorio.getToHsMarcacoesEstabelecimento().getData());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//////////
|
|
|
|
|
|
|
|
if(relatorio.getToHsMarcacoesEstabelecimento().getToMarcacoesTecnicosHst() != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
p.setTecnico_hs_id(relatorio.getToHsMarcacoesEstabelecimento().getToMarcacoesTecnicosHst().getId());
|
|
|
|
|
|
|
|
p.setTecnico_hs_nome(relatorio.getToHsMarcacoesEstabelecimento().getToMarcacoesTecnicosHst().getNome());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/////////
|
|
|
|
p.setFase(new Integer(Global.FASE_SEGURANCA_PREENCHIMENTO));
|
|
|
|
p.setFase(new Integer(Global.FASE_SEGURANCA_PREENCHIMENTO));
|
|
|
|
p.setEstabelecimento_id(relatorio.getToHsMarcacoesEstabelecimento().getToEstabelecimentos().getId());
|
|
|
|
p.setEstabelecimento_id(relatorio.getToHsMarcacoesEstabelecimento().getToEstabelecimentos().getId());
|
|
|
|
System.out.println("EMPRESA ID : " + relatorio.getToHsMarcacoesEstabelecimento().getToEstabelecimentos().getToEmpresas().getId().intValue());
|
|
|
|
|
|
|
|
p.setEmpresa_id(relatorio.getToHsMarcacoesEstabelecimento().getToEstabelecimentos().getToEmpresas().getId());
|
|
|
|
p.setEmpresa_id(relatorio.getToHsMarcacoesEstabelecimento().getToEstabelecimentos().getToEmpresas().getId());
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
p.setNome_empresa(utils.Utils.unicodeToHTML(rdp.getEmpresaNome(p.getEmpresa_id())));
|
|
|
|
p.setNome_empresa(utils.Utils.unicodeToHTML(rdp.getEmpresaNome(p.getEmpresa_id())));
|
|
|
|
System.out.println("NOME EMPRESA : " + p.getNome_empresa());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch(Exception ex)
|
|
|
|
catch(Exception ex)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -123,8 +131,12 @@ public class PlanosActuacao {
|
|
|
|
p = rdp.getFullPlano(p, relatorio.getId());
|
|
|
|
p = rdp.getFullPlano(p, relatorio.getId());
|
|
|
|
|
|
|
|
|
|
|
|
p.setId(pdp.createPlano(p));
|
|
|
|
p.setId(pdp.createPlano(p));
|
|
|
|
|
|
|
|
if(p.getAreas() != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
createAreas(p.getId(), p.getAreas());
|
|
|
|
createAreas(p.getId(), p.getAreas());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println("CREATE PLANO - PLANO ID : " + p.getId().toString());
|
|
|
|
return p;
|
|
|
|
return p;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -134,8 +146,12 @@ public class PlanosActuacao {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
a.setPlano_id(plano_id);
|
|
|
|
a.setPlano_id(plano_id);
|
|
|
|
a.setId(pdp.createArea(a));
|
|
|
|
a.setId(pdp.createArea(a));
|
|
|
|
|
|
|
|
if(a.getRiscos() != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
createRiscos(a.getId(), a.getRiscos());
|
|
|
|
createRiscos(a.getId(), a.getRiscos());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void createRiscos(Integer area_id, List<Risco> riscos) throws Exception
|
|
|
|
private void createRiscos(Integer area_id, List<Risco> riscos) throws Exception
|
|
|
|
@ -144,8 +160,12 @@ public class PlanosActuacao {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
r.setArea_id(area_id);
|
|
|
|
r.setArea_id(area_id);
|
|
|
|
r.setId(pdp.createRisco(r));
|
|
|
|
r.setId(pdp.createRisco(r));
|
|
|
|
|
|
|
|
if(r.getValores() != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
createValores(r.getId(), r.getValores());
|
|
|
|
createValores(r.getId(), r.getValores());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void createValores(Integer risco_id, List<Valor> valores) throws Exception
|
|
|
|
private void createValores(Integer risco_id, List<Valor> valores) throws Exception
|
|
|
|
@ -154,8 +174,12 @@ public class PlanosActuacao {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
v.setRisco_id(risco_id);
|
|
|
|
v.setRisco_id(risco_id);
|
|
|
|
v.setId(pdp.createValor(v));
|
|
|
|
v.setId(pdp.createValor(v));
|
|
|
|
|
|
|
|
if(v.getMedidas() != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
createMedidas(v.getId(), v.getMedidas());
|
|
|
|
createMedidas(v.getId(), v.getMedidas());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void createMedidas(Integer valor_id, List<Medida> medidas) throws Exception
|
|
|
|
private void createMedidas(Integer valor_id, List<Medida> medidas) throws Exception
|
|
|
|
@ -164,8 +188,12 @@ public class PlanosActuacao {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m.setValor_id(valor_id);
|
|
|
|
m.setValor_id(valor_id);
|
|
|
|
m.setId(pdp.createMedida(m));
|
|
|
|
m.setId(pdp.createMedida(m));
|
|
|
|
|
|
|
|
if(m.getPostos() != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
createPostos(m.getId(), m.getPostos());
|
|
|
|
createPostos(m.getId(), m.getPostos());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void createPostos(Integer medida_id, List<PostoTrabalho> postos) throws Exception
|
|
|
|
private void createPostos(Integer medida_id, List<PostoTrabalho> postos) throws Exception
|
|
|
|
|