From befe62b597404d8469bcb26318df5e64faa6490e Mon Sep 17 00:00:00 2001 From: frederico Date: Thu, 5 May 2016 19:40:04 +0000 Subject: [PATCH] =?UTF-8?q?fixed=20bug=20#7416=20-=20tela=20de=20Esta?= =?UTF-8?q?=C3=A7=C3=A3o:=20adi=C3=A7=C3=A3o=20informa=C3=A7=C3=B5es=20msg?= =?UTF-8?q?=20de=20erro=20MAC=20existente?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@55639 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../ventaboletos/exception/BusinessException.java | 5 +++++ .../service/impl/EstacionServiceImpl.java | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/com/rjconsultores/ventaboletos/exception/BusinessException.java b/src/com/rjconsultores/ventaboletos/exception/BusinessException.java index 9a318446b..dd665690a 100644 --- a/src/com/rjconsultores/ventaboletos/exception/BusinessException.java +++ b/src/com/rjconsultores/ventaboletos/exception/BusinessException.java @@ -18,6 +18,11 @@ public class BusinessException extends Exception { public BusinessException(String message) { super(Labels.getLabel(message)); } + + public BusinessException(String message, Boolean label) { + super(message); + } + /** * * @param message- La clave del archivo de traducción diff --git a/src/com/rjconsultores/ventaboletos/service/impl/EstacionServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/EstacionServiceImpl.java index 24cb03482..09d7d5878 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/EstacionServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/EstacionServiceImpl.java @@ -11,6 +11,7 @@ import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.zkoss.util.resource.Labels; import com.rjconsultores.ventaboletos.dao.EstacionDAO; import com.rjconsultores.ventaboletos.entidad.Estacion; @@ -48,7 +49,9 @@ public class EstacionServiceImpl implements EstacionService { @Transactional(rollbackFor = BusinessException.class) public Estacion suscribirActualizar(Estacion estacion) throws BusinessException { - + String nomeEstacao = ""; + Long numeroCaixa = 0l; + validarEstoqueUpdate(estacion); Boolean esMacDuplicado = Boolean.FALSE; @@ -56,12 +59,16 @@ public class EstacionServiceImpl implements EstacionService { if (!lsEstacionMac.isEmpty()) { for (Estacion est : lsEstacionMac) { if (!est.getEstacionId().equals(estacion.getEstacionId())) { + nomeEstacao = est.getDescestacion(); + numeroCaixa = est.getNumcaja(); esMacDuplicado = Boolean.TRUE; } } } if (esMacDuplicado) { - throw new BusinessException("estacionServiceImpl.msg.macDuplicado"); + throw new BusinessException(Labels.getLabel("estacionServiceImpl.msg.macDuplicado") + "\n" + + Labels.getLabel("estacionServiceImpl.msg.macDuplicado.descricaoEstacao") + nomeEstacao + "\n" + + Labels.getLabel("estacionServiceImpl.msg.macDuplicado.numeroCaixa") + numeroCaixa, Boolean.TRUE); } boolean esCajaDuplicado = false;