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;