From ca24e1c7367662ee104941181e42a66bb77d5205 Mon Sep 17 00:00:00 2001 From: "lucas.taia" Date: Mon, 29 Jun 2015 14:53:28 +0000 Subject: [PATCH] correcao (fixes bug 6396) git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@45497 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../rjconsultores/ventaboletos/entidad/Corrida.java | 6 +++--- .../service/impl/CorridaServiceImpl.java | 12 ++++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/com/rjconsultores/ventaboletos/entidad/Corrida.java b/src/com/rjconsultores/ventaboletos/entidad/Corrida.java index bc40bc09e..b05f59424 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/Corrida.java +++ b/src/com/rjconsultores/ventaboletos/entidad/Corrida.java @@ -116,7 +116,7 @@ public class Corrida implements Serializable { @Temporal(TemporalType.TIMESTAMP) private Date fechortarjetaviaje; @Column(name = "ACTIVO") - private Boolean activo; + private Integer activo; @Column(name = "FECMODIF") @Temporal(TemporalType.TIMESTAMP) private Date fecmodif; @@ -312,11 +312,11 @@ public class Corrida implements Serializable { this.fecmodif = fecmodif; } - public Boolean getActivo() { + public Integer getActivo() { return activo; } - public void setActivo(Boolean activo) { + public void setActivo(Integer activo) { this.activo = activo; } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CorridaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CorridaServiceImpl.java index 1c441d318..92a4d9a7c 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/CorridaServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/CorridaServiceImpl.java @@ -107,6 +107,9 @@ public class CorridaServiceImpl implements CorridaService { private int cantCorridaCommit; @Autowired private FeriadoCache feriadoCache; + public static final Integer ATIVO = 1; + public static final Integer INATIVO = 2; + public static final Integer EXCLUIDO = 0; @Autowired public CorridaServiceImpl(@Qualifier("transactionManager") PlatformTransactionManager transactionManager) { @@ -147,7 +150,7 @@ public class CorridaServiceImpl implements CorridaService { public Corrida suscribir(Corrida entidad) { entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setFecmodif(Calendar.getInstance().getTime()); - entidad.setActivo(Boolean.TRUE); + entidad.setActivo(ATIVO); return corridaDAO.suscribir(entidad); } @@ -156,7 +159,7 @@ public class CorridaServiceImpl implements CorridaService { public Corrida actualizacion(Corrida entidad) { entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setFecmodif(Calendar.getInstance().getTime()); - entidad.setActivo(Boolean.TRUE); + entidad.setActivo(ATIVO); return corridaDAO.actualizacion(entidad); } @@ -165,7 +168,7 @@ public class CorridaServiceImpl implements CorridaService { public void borrar(Corrida entidad) { entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setFecmodif(Calendar.getInstance().getTime()); - entidad.setActivo(Boolean.FALSE); + entidad.setActivo(ATIVO); corridaDAO.actualizacion(entidad); } @@ -519,8 +522,10 @@ public class CorridaServiceImpl implements CorridaService { if(esquemaCorrida.getStatusCorrida().equals("A")){ corrida.setIndstatuscorrida("H"); + corrida.setActivo(ATIVO); }else if (esquemaCorrida.getStatusCorrida().equals("L")){ corrida.setIndstatuscorrida("P"); + corrida.setActivo(INATIVO); } corrida.setMarca(esquemaCorrida.getMarca()); @@ -635,7 +640,6 @@ public class CorridaServiceImpl implements CorridaService { } corrida.setCorridaTramoList(lsCorridaTramo); // - corrida.setActivo(Boolean.TRUE); corrida.setFecmodif(Calendar.getInstance().getTime()); if (UsuarioLogado.getUsuarioLogado() != null) { corrida.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());