fixed bug #7416 - tela de Estação: adição informações msg de erro MAC existente

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@55639 d1611594-4594-4d17-8e1d-87c2c4800839
master
frederico 2016-05-05 19:40:04 +00:00
parent ba0953d500
commit befe62b597
2 changed files with 14 additions and 2 deletions

View File

@ -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

View File

@ -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,6 +49,8 @@ public class EstacionServiceImpl implements EstacionService {
@Transactional(rollbackFor = BusinessException.class)
public Estacion suscribirActualizar(Estacion estacion) throws BusinessException {
String nomeEstacao = "";
Long numeroCaixa = 0l;
validarEstoqueUpdate(estacion);
@ -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;