git-svn-id: https://svn.coded.pt/svn/SIPRP@1170 bb69d46d-e84e-40c8-a05a-06db0d633741

0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Tiago Simão 16 years ago
parent 2826caeb9e
commit 0fdfce15aa

@ -85,7 +85,7 @@ public class SIPRPDataLoader implements CompanyDataLoader
Singleton.setInstance( SingletonConstants.WEB_URL, "www.evolute.pt:5436" );
Singleton.setInstance( SingletonConstants.WEB_DB_NAME, "siprp" );
Singleton.setInstance( SingletonConstants.WEB_DRIVER_NAME, "org.postgresql.Driver" );
//
// Singleton.setInstance( SingletonConstants.LOCAL_USER, "siprp" );
// Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "rg2h-opksiprp" );
// Singleton.setInstance( SingletonConstants.LOCAL_URL_PREFIX, "jdbc:postgresql://" );
@ -93,12 +93,12 @@ public class SIPRPDataLoader implements CompanyDataLoader
// Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local_3" );
// Singleton.setInstance( SingletonConstants.LOCAL_DRIVER_NAME, "org.postgresql.Driver" );
Singleton.setInstance( SingletonConstants.LOCAL_USER, "postgres" );
Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "Typein" );
Singleton.setInstance( SingletonConstants.LOCAL_URL_PREFIX, "jdbc:postgresql://" );
Singleton.setInstance( SingletonConstants.LOCAL_URL, "10.158.2.2:5432" );
Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local" );
Singleton.setInstance( SingletonConstants.LOCAL_DRIVER_NAME, "org.postgresql.Driver" );
// Singleton.setInstance( SingletonConstants.LOCAL_USER, "postgres" );
// Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "Typein" );
// Singleton.setInstance( SingletonConstants.LOCAL_URL_PREFIX, "jdbc:postgresql://" );
// Singleton.setInstance( SingletonConstants.LOCAL_URL, "10.158.2.2:5432" );
// Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local" );
// Singleton.setInstance( SingletonConstants.LOCAL_DRIVER_NAME, "org.postgresql.Driver" );
// Singleton.setInstance( SingletonConstants.LOCAL_USER, "postgres" );
// Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "Typein" );
@ -136,12 +136,12 @@ public class SIPRPDataLoader implements CompanyDataLoader
// Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local3" );
// Singleton.setInstance( SingletonConstants.LOCAL_DRIVER_NAME, "org.postgresql.Driver" );
// Singleton.setInstance( SingletonConstants.LOCAL_USER, "postgres" );
// Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "Typein" );
// Singleton.setInstance( SingletonConstants.LOCAL_URL_PREFIX, "jdbc:postgresql://" );
// Singleton.setInstance( SingletonConstants.LOCAL_URL, "localhost:5432" );
// Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local" );
// Singleton.setInstance( SingletonConstants.LOCAL_DRIVER_NAME, "org.postgresql.Driver" );
Singleton.setInstance( SingletonConstants.LOCAL_USER, "postgres" );
Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "Typein" );
Singleton.setInstance( SingletonConstants.LOCAL_URL_PREFIX, "jdbc:postgresql://" );
Singleton.setInstance( SingletonConstants.LOCAL_URL, "ws-fpalma.redeapdp:5432" );
Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local" );
Singleton.setInstance( SingletonConstants.LOCAL_DRIVER_NAME, "org.postgresql.Driver" );
// Singleton.setInstance( SingletonConstants.LOCAL_USER, "postgres" );
// Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "Typein" );

@ -70,7 +70,7 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe
private static final String DEFAULT_FUNCIONARIOS_TEXT = "A empresa supracitada possui ? funcionários, sendo que ? destes exercem actividades na zona de produtos frescos.";
private static final String ICON_NAME_SAVE = "siprp/higiene/gestao/riscos/save.png";
private static final String ICON_NAME_REVERT = "siprp/higiene/gestao/riscos/revert.png";
public static final String ICON_NAME_REVERT = "siprp/higiene/gestao/riscos/revert.png";
private static final String ICON_NAME_SUBMIT = "siprp/higiene/relatorio/submit.png";
private static final String ICON_NAME_PDF = "siprp/higiene/relatorio/adobe_reader.png";
private static final String ICON_NAME_UNDO = "siprp/higiene/relatorio/revert.png";

@ -5,19 +5,28 @@ import info.clearthought.layout.TableLayoutConstraints;
import java.awt.CardLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import leaf.data.Pair;
import com.evolute.utils.error.ErrorLogger;
import leaf.ui.LeafButton;
import leaf.ui.LeafIconButton;
import siprp.database.cayenne.objects.Estabelecimentos;
import siprp.database.cayenne.objects.HsArea;
import siprp.database.cayenne.objects.HsPosto;
import siprp.database.cayenne.objects.HsPostoEstabelecimento;
import siprp.database.cayenne.objects.HsRelatorio;
import siprp.database.cayenne.objects.HsRelatorioArea;
import siprp.database.cayenne.objects.HsRelatorioPosto;
import siprp.database.cayenne.objects.HsRelatorioPostoMedida;
import siprp.database.cayenne.objects.HsRelatorioPostoRisco;
import siprp.database.cayenne.objects.MarcacoesEstabelecimento;
import siprp.logic.HigieneSegurancaLogic;
public class PlanoActuacaoPanel extends JPanel
@ -39,14 +48,14 @@ public class PlanoActuacaoPanel extends JPanel
private final GerirMedidaRelatorioPanel valoresMedida = new GerirMedidaRelatorioPanel();
private final LeafButton refreshAreasButton = LeafIconButton.createButton( "Actualizar nomes", PanelRelatorio.ICON_NAME_REVERT );
private final JPanel emptyPanel = new JPanel();
private final JPanel valoresPanel = new JPanel();
private final CardLayout cards = new CardLayout();
private HsRelatorio relatorio = null;
public PlanoActuacaoPanel()
@ -115,6 +124,113 @@ public class PlanoActuacaoPanel extends JPanel
riscos.refresh();
}
} );
refreshAreasButton.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
try
{
refreshAreas();
}
catch ( Exception ex )
{
ErrorLogger.logException( ex );
}
}
} );
}
private void refreshAreas()
{
if( relatorio != null )
{
MarcacoesEstabelecimento marcacao = relatorio.getToHsMarcacoesEstabelecimento();
if( marcacao != null )
{
Estabelecimentos estabelecimento = marcacao.getToEstabelecimentos();
if( estabelecimento != null )
{
for( HsPostoEstabelecimento postoEstabelecimento : estabelecimento.getHsPostoEstabelecimentoArray() )
{
refreshPostoEstabelecimento( postoEstabelecimento );
}
areas.refresh();
}
}
}
}
private void refreshPostoEstabelecimento( HsPostoEstabelecimento postoEstabelecimento )
{
if( postoEstabelecimento != null )
{
HsPosto posto = postoEstabelecimento.getToHsPosto();
if( posto != null )
{
HsArea area = posto.getToHsArea();
if( area != null )
{
refreshArea( area );
}
refreshPosto( posto );
}
}
}
private void refreshArea( HsArea area )
{
HsRelatorioArea relatorioArea = getAreaInRelatorio( relatorio, area.getId() );
if( relatorioArea != null )
{
relatorioArea.setDescription( area.getDescription() );
}
}
private HsRelatorioArea getAreaInRelatorio( HsRelatorio relatorio, Integer softRefId )
{
HsRelatorioArea result = null;
if( relatorio != null && softRefId != null )
{
for( HsRelatorioArea relatArea : relatorio.getHsRelatorioArea() )
{
if( softRefId.equals( relatArea.getHsAreaId() ) )
{
result = relatArea;
break;
}
}
}
return result;
}
private void refreshPosto( HsPosto posto )
{
HsRelatorioPosto relatorioPosto = getPostoInRelatorio( relatorio, posto.getId() );
if( relatorioPosto != null )
{
relatorioPosto.setDescription( posto.getDescription() );
}
}
private HsRelatorioPosto getPostoInRelatorio( HsRelatorio relatorio, Integer softRefId )
{
HsRelatorioPosto result = null;
if( relatorio != null && softRefId != null )
{
for( HsRelatorioArea relatArea : relatorio.getHsRelatorioArea() )
{
for( HsRelatorioPosto relatPosto : relatArea.getHsRelatorioPostoArray() )
{
if( softRefId.equals( relatPosto.getHsPostoId() ) )
{
result = relatPosto;
break;
}
}
}
}
return result;
}
private void startupComponents()
@ -148,7 +264,7 @@ public class PlanoActuacaoPanel extends JPanel
private void setEnabled()
{
refreshAreasButton.setEnabled(relatorio != null && relatorio.getIsSubmetido() == null );
}
public void setRelatorio( HsRelatorio relatorio )

@ -26,6 +26,7 @@ import siprp.update.updates.V11_1_To_V11_2;
import siprp.update.updates.V11_2_To_V11_3;
import siprp.update.updates.V11_3_To_V11_4;
import siprp.update.updates.V11_4_To_V11_5;
import siprp.update.updates.V11_5_To_V11_6;
import siprp.update.updates.V6_1_To_V7_0;
import siprp.update.updates.V7_0_To_V7_2;
import siprp.update.updates.V7_2_To_V7_4;
@ -95,7 +96,8 @@ public class UpdateList
new V10_7_To_V10_8(), new V10_8_To_V10_9(),
new V10_9_To_V11_0(), new V11_0_To_V11_1(),
new V11_1_To_V11_2(), new V11_2_To_V11_3(),
new V11_3_To_V11_4(), new V11_4_To_V11_5()
new V11_3_To_V11_4(), new V11_4_To_V11_5(),
new V11_5_To_V11_6()
};
protected static Executer EXECUTER;

@ -0,0 +1,54 @@
package siprp.update.updates;
import siprp.higiene.gestao.importacao.Importador;
import com.evolute.utils.Singleton;
import com.evolute.utils.db.DBManager;
import com.evolute.utils.db.Executer;
public class V11_5_To_V11_6 implements siprp.update.Update
{
public V11_5_To_V11_6()
{
}
public String []listChanges()
{
return new String[]{
"Adicionadas soft-references aos itens dos relatorios de H&S"
};
}
public double getStartVersion()
{
return 11.5;
}
public double getEndVersion()
{
return 11.6;
}
public void doUpdate() throws Exception
{
DBManager dbm = ( DBManager ) Singleton.getInstance( Singleton.DEFAULT_DBMANAGER );
Executer executer = dbm.getSharedExecuter();
com.evolute.utils.sql.Update update =
new com.evolute.utils.sql.Update(
"alter table hs_relatorio_risco add column hs_risco_id int4; " +
"alter table hs_relatorio_posto add column hs_posto_id int4; " +
"alter table hs_relatorio_medida add column hs_medida_id int4; " +
"alter table hs_relatorio_equipamento add column hs_equipamento_id int4; " +
"alter table hs_relatorio_area add column hs_area_id int4; "
);
executer.executeQuery( update );
new Importador( executer ).importar();
}
public String toString()
{
return "v" + getStartVersion() + " para v" + getEndVersion();
}
}

@ -339,6 +339,7 @@
<db-entity name="hs_relatorio_area" schema="public">
<db-attribute name="deleted_date" type="TIMESTAMP" length="29"/>
<db-attribute name="description" type="VARCHAR" isMandatory="true" length="1024"/>
<db-attribute name="hs_area_id" type="INTEGER" length="10"/>
<db-attribute name="id" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
<db-attribute name="ordem" type="INTEGER"/>
<db-attribute name="relatorio_id" type="INTEGER" length="10"/>
@ -350,6 +351,7 @@
</db-entity>
<db-entity name="hs_relatorio_equipamento" schema="public">
<db-attribute name="hs_equipamento" type="INTEGER" isMandatory="true" length="10"/>
<db-attribute name="hs_equipamento_id" type="INTEGER" length="10"/>
<db-attribute name="hs_relatorio_id" type="INTEGER" isMandatory="true" length="10"/>
<db-attribute name="id" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
<db-attribute name="marca" type="VARCHAR" length="256"/>
@ -377,6 +379,7 @@
<db-entity name="hs_relatorio_medida" schema="public">
<db-attribute name="deleted_date" type="TIMESTAMP"/>
<db-attribute name="description" type="VARCHAR" isMandatory="true" length="8192"/>
<db-attribute name="hs_medida_id" type="INTEGER" length="10"/>
<db-attribute name="id" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
<db-attribute name="requesitos_legais" type="VARCHAR" isMandatory="true" length="8192"/>
<db-attribute name="risco_id" type="INTEGER" isMandatory="true" length="10"/>
@ -403,6 +406,7 @@
<db-attribute name="area_id" type="INTEGER" length="10"/>
<db-attribute name="deleted_date" type="TIMESTAMP" length="29"/>
<db-attribute name="description" type="VARCHAR" isMandatory="true" length="1024"/>
<db-attribute name="hs_posto_id" type="INTEGER" length="10"/>
<db-attribute name="id" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
<db-attribute name="is_principal" type="BOOLEAN"/>
<db-key-generator>
@ -432,6 +436,7 @@
<db-entity name="hs_relatorio_risco" schema="public">
<db-attribute name="deleted_date" type="TIMESTAMP"/>
<db-attribute name="description" type="VARCHAR" isMandatory="true" length="8192"/>
<db-attribute name="hs_risco_id" type="INTEGER" length="10"/>
<db-attribute name="id" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
<db-attribute name="relatorio_id" type="INTEGER" isMandatory="true" length="10"/>
<db-key-generator>
@ -959,6 +964,7 @@
<obj-attribute name="deletedDate" type="java.util.Date" db-attribute-path="deleted_date"/>
<obj-attribute name="description" type="java.lang.String" db-attribute-path="description"/>
<obj-attribute name="empresaId" type="java.lang.Integer" db-attribute-path="empresa_id"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="order" type="java.lang.Integer" db-attribute-path="ordem"/>
</obj-entity>
<obj-entity name="HsEmail" className="siprp.database.cayenne.objects.HsEmail" dbEntityName="hs_email" superClassName="siprp.database.cayenne.objects.BaseObject">
@ -1008,6 +1014,7 @@
<obj-entity name="HsPosto" className="siprp.database.cayenne.objects.HsPosto" dbEntityName="hs_posto" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="deletedDate" type="java.util.Date" db-attribute-path="deleted_date"/>
<obj-attribute name="description" type="java.lang.String" db-attribute-path="description"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="isPrincipal" type="java.lang.Boolean" db-attribute-path="is_principal"/>
</obj-entity>
<obj-entity name="HsPostoEstabelecimento" className="siprp.database.cayenne.objects.HsPostoEstabelecimento" dbEntityName="hs_posto_estabelecimento" superClassName="siprp.database.cayenne.objects.BaseObject">
@ -1038,10 +1045,12 @@
<obj-entity name="HsRelatorioArea" className="siprp.database.cayenne.objects.HsRelatorioArea" dbEntityName="hs_relatorio_area" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="deletedDate" type="java.util.Date" db-attribute-path="deleted_date"/>
<obj-attribute name="description" type="java.lang.String" db-attribute-path="description"/>
<obj-attribute name="hsAreaId" type="java.lang.Integer" db-attribute-path="hs_area_id"/>
<obj-attribute name="order" type="java.lang.Integer" db-attribute-path="ordem"/>
</obj-entity>
<obj-entity name="HsRelatorioEquipamento" className="siprp.database.cayenne.objects.HsRelatorioEquipamento" dbEntityName="hs_relatorio_equipamento" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="hsEquipamento" type="java.lang.Integer" db-attribute-path="hs_equipamento"/>
<obj-attribute name="hsEquipamentoId" type="java.lang.Integer" db-attribute-path="hs_equipamento_id"/>
<obj-attribute name="hsRelatorioId" type="java.lang.Integer" db-attribute-path="hs_relatorio_id"/>
<obj-attribute name="marca" type="java.lang.String" db-attribute-path="marca"/>
<obj-attribute name="modelo" type="java.lang.String" db-attribute-path="modelo"/>
@ -1056,6 +1065,7 @@
<obj-entity name="HsRelatorioMedida" className="siprp.database.cayenne.objects.HsRelatorioMedida" dbEntityName="hs_relatorio_medida" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="deletedDate" type="java.util.Date" db-attribute-path="deleted_date"/>
<obj-attribute name="description" type="java.lang.String" db-attribute-path="description"/>
<obj-attribute name="hsMedidaId" type="java.lang.Integer" db-attribute-path="hs_medida_id"/>
<obj-attribute name="requesitosLegais" type="java.lang.String" db-attribute-path="requesitos_legais"/>
</obj-entity>
<obj-entity name="HsRelatorioNormalizacao" className="siprp.database.cayenne.objects.HsRelatorioNormalizacao" dbEntityName="hs_relatorio_normalizacao" superClassName="siprp.database.cayenne.objects.BaseObject">
@ -1067,6 +1077,7 @@
<obj-entity name="HsRelatorioPosto" className="siprp.database.cayenne.objects.HsRelatorioPosto" dbEntityName="hs_relatorio_posto" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="deletedDate" type="java.util.Date" db-attribute-path="deleted_date"/>
<obj-attribute name="description" type="java.lang.String" db-attribute-path="description"/>
<obj-attribute name="hsPostoId" type="java.lang.Integer" db-attribute-path="hs_posto_id"/>
<obj-attribute name="isPrincipal" type="java.lang.Boolean" db-attribute-path="is_principal"/>
</obj-entity>
<obj-entity name="HsRelatorioPostoMedida" className="siprp.database.cayenne.objects.HsRelatorioPostoMedida" dbEntityName="hs_relatorio_posto_medida" superClassName="siprp.database.cayenne.objects.BaseObject">
@ -1080,6 +1091,7 @@
<obj-entity name="HsRelatorioRisco" className="siprp.database.cayenne.objects.HsRelatorioRisco" dbEntityName="hs_relatorio_risco" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="deletedDate" type="java.util.Date" db-attribute-path="deleted_date"/>
<obj-attribute name="description" type="java.lang.String" db-attribute-path="description"/>
<obj-attribute name="hsRiscoId" type="java.lang.Integer" db-attribute-path="hs_risco_id"/>
</obj-entity>
<obj-entity name="HsRelatorioRiscoValorQualitativo" className="siprp.database.cayenne.objects.HsRelatorioRiscoValorQualitativo" dbEntityName="hs_relatorio_risco_valor_qualitativo" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="description" type="java.lang.String" db-attribute-path="description"/>

@ -18,6 +18,7 @@ public abstract class _HsArea extends BaseObject {
public static final String DELETED_DATE_PROPERTY = "deletedDate";
public static final String DESCRIPTION_PROPERTY = "description";
public static final String EMPRESA_ID_PROPERTY = "empresaId";
public static final String ID_PROPERTY = "id";
public static final String ORDER_PROPERTY = "order";
public static final String HS_POSTO_ARRAY_PROPERTY = "hsPostoArray";
public static final String TO_EMPRESAS_PROPERTY = "toEmpresas";
@ -45,6 +46,13 @@ public abstract class _HsArea extends BaseObject {
return (Integer)readProperty("empresaId");
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setOrder(Integer order) {
writeProperty("order", order);
}

@ -19,6 +19,7 @@ public abstract class _HsPosto extends BaseObject {
public static final String DELETED_DATE_PROPERTY = "deletedDate";
public static final String DESCRIPTION_PROPERTY = "description";
public static final String ID_PROPERTY = "id";
public static final String IS_PRINCIPAL_PROPERTY = "isPrincipal";
public static final String HS_POSTO_ESTABELECIMENTO_ARRAY_PROPERTY = "hsPostoEstabelecimentoArray";
public static final String HS_POSTO_MEDIDA_ARRAY_PROPERTY = "hsPostoMedidaArray";
@ -41,6 +42,13 @@ public abstract class _HsPosto extends BaseObject {
return (String)readProperty("description");
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setIsPrincipal(Boolean isPrincipal) {
writeProperty("isPrincipal", isPrincipal);
}

@ -17,6 +17,7 @@ public abstract class _HsRelatorioArea extends BaseObject {
public static final String DELETED_DATE_PROPERTY = "deletedDate";
public static final String DESCRIPTION_PROPERTY = "description";
public static final String HS_AREA_ID_PROPERTY = "hsAreaId";
public static final String ORDER_PROPERTY = "order";
public static final String HS_RELATORIO_POSTO_ARRAY_PROPERTY = "hsRelatorioPostoArray";
public static final String TO_HS_RELATORIO_PROPERTY = "toHsRelatorio";
@ -37,6 +38,13 @@ public abstract class _HsRelatorioArea extends BaseObject {
return (String)readProperty("description");
}
public void setHsAreaId(Integer hsAreaId) {
writeProperty("hsAreaId", hsAreaId);
}
public Integer getHsAreaId() {
return (Integer)readProperty("hsAreaId");
}
public void setOrder(Integer order) {
writeProperty("order", order);
}

@ -12,6 +12,7 @@ import siprp.database.cayenne.objects.HsRelatorio;
public abstract class _HsRelatorioEquipamento extends BaseObject {
public static final String HS_EQUIPAMENTO_PROPERTY = "hsEquipamento";
public static final String HS_EQUIPAMENTO_ID_PROPERTY = "hsEquipamentoId";
public static final String HS_RELATORIO_ID_PROPERTY = "hsRelatorioId";
public static final String MARCA_PROPERTY = "marca";
public static final String MODELO_PROPERTY = "modelo";
@ -27,6 +28,13 @@ public abstract class _HsRelatorioEquipamento extends BaseObject {
return (Integer)readProperty("hsEquipamento");
}
public void setHsEquipamentoId(Integer hsEquipamentoId) {
writeProperty("hsEquipamentoId", hsEquipamentoId);
}
public Integer getHsEquipamentoId() {
return (Integer)readProperty("hsEquipamentoId");
}
public void setHsRelatorioId(Integer hsRelatorioId) {
writeProperty("hsRelatorioId", hsRelatorioId);
}

@ -17,6 +17,7 @@ public abstract class _HsRelatorioMedida extends BaseObject {
public static final String DELETED_DATE_PROPERTY = "deletedDate";
public static final String DESCRIPTION_PROPERTY = "description";
public static final String HS_MEDIDA_ID_PROPERTY = "hsMedidaId";
public static final String REQUESITOS_LEGAIS_PROPERTY = "requesitosLegais";
public static final String HS_RELATORIO_POSTO_MEDIDA_ARRAY_PROPERTY = "hsRelatorioPostoMedidaArray";
public static final String TO_HS_RELATORIO_RISCO_PROPERTY = "toHsRelatorioRisco";
@ -37,6 +38,13 @@ public abstract class _HsRelatorioMedida extends BaseObject {
return (String)readProperty("description");
}
public void setHsMedidaId(Integer hsMedidaId) {
writeProperty("hsMedidaId", hsMedidaId);
}
public Integer getHsMedidaId() {
return (Integer)readProperty("hsMedidaId");
}
public void setRequesitosLegais(String requesitosLegais) {
writeProperty("requesitosLegais", requesitosLegais);
}

@ -18,6 +18,7 @@ public abstract class _HsRelatorioPosto extends BaseObject {
public static final String DELETED_DATE_PROPERTY = "deletedDate";
public static final String DESCRIPTION_PROPERTY = "description";
public static final String HS_POSTO_ID_PROPERTY = "hsPostoId";
public static final String IS_PRINCIPAL_PROPERTY = "isPrincipal";
public static final String HS_RELATORIO_POSTO_MEDIDA_ARRAY_PROPERTY = "hsRelatorioPostoMedidaArray";
public static final String HS_RELATORIO_POSTO_RISCO_ARRAY_PROPERTY = "hsRelatorioPostoRiscoArray";
@ -39,6 +40,13 @@ public abstract class _HsRelatorioPosto extends BaseObject {
return (String)readProperty("description");
}
public void setHsPostoId(Integer hsPostoId) {
writeProperty("hsPostoId", hsPostoId);
}
public Integer getHsPostoId() {
return (Integer)readProperty("hsPostoId");
}
public void setIsPrincipal(Boolean isPrincipal) {
writeProperty("isPrincipal", isPrincipal);
}

@ -18,6 +18,7 @@ public abstract class _HsRelatorioRisco extends BaseObject {
public static final String DELETED_DATE_PROPERTY = "deletedDate";
public static final String DESCRIPTION_PROPERTY = "description";
public static final String HS_RISCO_ID_PROPERTY = "hsRiscoId";
public static final String HS_RELATORIO_MEDIDA_ARRAY_PROPERTY = "hsRelatorioMedidaArray";
public static final String HS_RELATORIO_POSTO_RISCO_ARRAY_PROPERTY = "hsRelatorioPostoRiscoArray";
public static final String TO_HS_RELATORIO_PROPERTY = "toHsRelatorio";
@ -38,6 +39,13 @@ public abstract class _HsRelatorioRisco extends BaseObject {
return (String)readProperty("description");
}
public void setHsRiscoId(Integer hsRiscoId) {
writeProperty("hsRiscoId", hsRiscoId);
}
public Integer getHsRiscoId() {
return (Integer)readProperty("hsRiscoId");
}
public void addToHsRelatorioMedidaArray(HsRelatorioMedida obj) {
addToManyTarget("hsRelatorioMedidaArray", obj, true);
}

@ -245,7 +245,8 @@ public class HigieneSegurancaLogic
HsPosto posto = rel.getToHsPosto();
HsRelatorioPosto rPosto = new HsRelatorioPosto();
rPosto.setDescription( posto.getDescription() );
rPosto.setIsPrincipal(posto.getIsPrincipal());
rPosto.setIsPrincipal( posto.getIsPrincipal() );
rPosto.setHsPostoId( posto.getId() );
HsArea area = posto.getToHsArea();
HsRelatorioArea rArea = areasInserted.get( area );
if( rArea == null )
@ -254,10 +255,11 @@ public class HigieneSegurancaLogic
rArea.setDescription( area.getDescription() );
rArea.setOrder( area.getOrder() );
rArea.setToHsRelatorio( relatorio );
areasInserted.put(area,rArea);
rArea.setHsAreaId( area.getId() );
areasInserted.put( area, rArea );
}
rPosto.setToHsRelatorioArea( rArea );
revertMedidasAndRiscos(posto,rPosto);
revertMedidasAndRiscos( posto, rPosto );
}
}
@ -296,7 +298,7 @@ public class HigieneSegurancaLogic
}
}
public static void revertMedidasAndRiscos( HsPosto posto, HsRelatorioPosto rPosto )
private static void revertMedidasAndRiscos( HsPosto posto, HsRelatorioPosto rPosto )
{
revertMedidasAndRiscos(posto.getHsPostoRiscoArray(),rPosto);
}

Loading…
Cancel
Save