|
|
|
|
@ -14,6 +14,8 @@ import siprp.data.outer.HsLegislacaoCategoriaData;
|
|
|
|
|
import siprp.data.outer.HsLegislacaoData;
|
|
|
|
|
import siprp.data.outer.HsLegislacaoEmpresaData;
|
|
|
|
|
import siprp.data.outer.HsNormalizacaoData;
|
|
|
|
|
import siprp.data.outer.HsNormalizacaoEmpresaData;
|
|
|
|
|
import siprp.data.outer.HsNormalizacaoEstabelecimentoData;
|
|
|
|
|
import siprp.data.outer.HsPostoData;
|
|
|
|
|
import siprp.data.outer.HsPostoRiscoData;
|
|
|
|
|
import siprp.data.outer.HsRelatorioData;
|
|
|
|
|
@ -288,21 +290,62 @@ public class PlanoActuacaoDataProvider
|
|
|
|
|
}
|
|
|
|
|
return result == null ? new LinkedList<HsLegislacaoData>() : result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List< HsNormalizacaoData > getNormalizacao( boolean portuguesa )
|
|
|
|
|
|
|
|
|
|
public List<HsNormalizacaoData> getNormalizacaoForEstabelecimento( boolean portuguesa, EstabelecimentosData estabelecimento )
|
|
|
|
|
{
|
|
|
|
|
List< HsNormalizacaoData > result = null;
|
|
|
|
|
List<HsNormalizacaoData> result = null;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
result = ENTITY_PROVIDER.listLoad( HsNormalizacaoData.class,
|
|
|
|
|
new Object[] { null, portuguesa }, new String[] { HsNormalizacaoData.DELETED_DATE, HsNormalizacaoData.PORTUGUESA },
|
|
|
|
|
new String[] {} );
|
|
|
|
|
if( estabelecimento != null )
|
|
|
|
|
{
|
|
|
|
|
Expression where = new Field( HsNormalizacaoData.DELETED_DATE_FULL ).isEqual( null );
|
|
|
|
|
where = where.and( new Field( HsNormalizacaoEstabelecimentoData.ESTABELECIMENTO_ID_FULL ).isEqual( estabelecimento.getId() ) );
|
|
|
|
|
where = where.and( new Field( HsNormalizacaoData.PORTUGUESA_FULL ).isEqual( portuguesa ) );
|
|
|
|
|
List<ForeignKey> fks = new LinkedList<ForeignKey>();
|
|
|
|
|
fks.add( new ForeignKey( HsNormalizacaoData.class, HsNormalizacaoData.ID_FULL, HsNormalizacaoEstabelecimentoData.class, HsNormalizacaoEstabelecimentoData.NORMALIZACAO_ID_FULL ) );
|
|
|
|
|
result = ENTITY_PROVIDER.listLoad( HsNormalizacaoData.class, fks, where, new String[] { HsNormalizacaoData.DESCRICAO_FULL } );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
result = ENTITY_PROVIDER.listLoad( HsNormalizacaoData.class, new Object[]{ null, portuguesa }, new String[]{ HsNormalizacaoData.DELETED_DATE_FULL, HsNormalizacaoData.PORTUGUESA_FULL }, new String[] { HsNormalizacaoData.DESCRICAO_FULL } );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch ( Exception e )
|
|
|
|
|
{
|
|
|
|
|
ErrorLogger.logException( e );
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
return result == null ? new LinkedList<HsNormalizacaoData>() : result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<HsNormalizacaoData> getNormalizacaoForEmpresa( boolean portuguesa, EmpresasData empresa )
|
|
|
|
|
{
|
|
|
|
|
List<HsNormalizacaoData> result = null;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if( empresa != null )
|
|
|
|
|
{
|
|
|
|
|
Expression where = new Field( HsNormalizacaoData.DELETED_DATE_FULL ).isEqual( null );
|
|
|
|
|
where = where.and( new Field( HsNormalizacaoEmpresaData.EMPRESA_ID_FULL ).isEqual( empresa.getId() ) );
|
|
|
|
|
where = where.and( new Field( HsNormalizacaoData.PORTUGUESA_FULL ).isEqual( portuguesa ) );
|
|
|
|
|
List<ForeignKey> fks = new LinkedList<ForeignKey>();
|
|
|
|
|
fks.add( new ForeignKey( HsNormalizacaoData.class, HsNormalizacaoData.ID_FULL, HsNormalizacaoEmpresaData.class, HsNormalizacaoEmpresaData.NORMALIZACAO_ID_FULL ) );
|
|
|
|
|
result = ENTITY_PROVIDER.listLoad( HsNormalizacaoData.class, fks, where, new String[] { HsNormalizacaoData.DESCRICAO_FULL } );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
result = ENTITY_PROVIDER.listLoad( HsNormalizacaoData.class, new Object[]{ null, portuguesa }, new String[]{ HsNormalizacaoData.DELETED_DATE_FULL, HsNormalizacaoData.PORTUGUESA_FULL }, new String[] { HsNormalizacaoData.DESCRICAO_FULL } );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch ( Exception e )
|
|
|
|
|
{
|
|
|
|
|
ErrorLogger.logException( e );
|
|
|
|
|
}
|
|
|
|
|
return result == null ? new LinkedList<HsNormalizacaoData>() : result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<HsNormalizacaoData> getNormalizacao( boolean portuguesa )
|
|
|
|
|
{
|
|
|
|
|
return getNormalizacaoForEmpresa( portuguesa, (EmpresasData) null );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List< HsEquipamentoData > getAllEquipamentos()
|
|
|
|
|
|