|
|
|
|
@ -56,10 +56,10 @@ public class PlanosActuacao {
|
|
|
|
|
// {
|
|
|
|
|
// estabelecimentoId = u.getEstabelecimento_id();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
List<Date> planosOnlineList = getPlanosOnline();
|
|
|
|
|
System.out.println("PLANOS ONLINE LIST : " + planosOnlineList.size());
|
|
|
|
|
List<HsRelatorio> listRelatorios = getRelatorios(planosOnlineList, estabelecimentoId);
|
|
|
|
|
//
|
|
|
|
|
// List<Date> planosOnlineList = getPlanosOnline(null);
|
|
|
|
|
// System.out.println("PLANOS ONLINE LIST : " + planosOnlineList.size());
|
|
|
|
|
List<HsRelatorio> listRelatorios = initRelatorios(null,null);
|
|
|
|
|
System.out.println("LIST RELATORIOS : " + listRelatorios.size());
|
|
|
|
|
putPlanosOnline(listRelatorios);
|
|
|
|
|
}
|
|
|
|
|
@ -78,11 +78,9 @@ public class PlanosActuacao {
|
|
|
|
|
{
|
|
|
|
|
estabelecimentoId = u.getEstabelecimento_id();
|
|
|
|
|
}
|
|
|
|
|
List<Date> planosOnlineList = getPlanosOnline();
|
|
|
|
|
List<Date> planosOnlineList = getPlanosOnline(estabelecimentoId);
|
|
|
|
|
System.out.println("PLANOS ONLINE LIST : " + planosOnlineList.size());
|
|
|
|
|
List<HsRelatorio> listRelatorios = getRelatorios(planosOnlineList, estabelecimentoId);
|
|
|
|
|
System.out.println("LIST RELATORIOS : " + listRelatorios.size());
|
|
|
|
|
putPlanosOnline(listRelatorios);
|
|
|
|
|
List<HsRelatorio> listRelatorios = initRelatorios(planosOnlineList, estabelecimentoId);
|
|
|
|
|
}
|
|
|
|
|
catch(Exception ex)
|
|
|
|
|
{
|
|
|
|
|
@ -90,13 +88,15 @@ public class PlanosActuacao {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<Date> getPlanosOnline()
|
|
|
|
|
private List<Date> getPlanosOnline(Integer estabelecimentoId)
|
|
|
|
|
{
|
|
|
|
|
List<Date> list = null;
|
|
|
|
|
List<Date> list = new ArrayList<Date>();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
list = cpdp.getPlanosOnline();
|
|
|
|
|
|
|
|
|
|
if( estabelecimentoId != null )
|
|
|
|
|
{
|
|
|
|
|
list = cpdp.getPlanosOnline(estabelecimentoId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch(Exception ex)
|
|
|
|
|
{
|
|
|
|
|
@ -105,10 +105,20 @@ public class PlanosActuacao {
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<HsRelatorio> getRelatorios(List<Date> list, Integer estabelecimentoId)
|
|
|
|
|
private void initRelatorios(List<Date> list, Integer estabelecimentoId)
|
|
|
|
|
{
|
|
|
|
|
List<HsRelatorio> listRelatorios = pa.getRelatoriosNotIn(list, estabelecimentoId);
|
|
|
|
|
return listRelatorios;
|
|
|
|
|
if( estabelecimentoId == null )
|
|
|
|
|
{
|
|
|
|
|
List<Integer> estabelecimentos = cpdp.getEstabelecimentosWithPlanos();
|
|
|
|
|
for( Integer estabelecimentoID : estabelecimentos )
|
|
|
|
|
{
|
|
|
|
|
putPlanosOnline(pa.getRelatoriosNotIn(cpdp.getPlanosOnline(estabelecimentoID), estabelecimentoID));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
putPlanosOnline(pa.getRelatoriosNotIn(list, estabelecimentoId));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void putPlanosOnline(List<HsRelatorio> listRelatorios)
|
|
|
|
|
|