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-87c2c4800839master
parent
ba0953d500
commit
befe62b597
|
@ -18,6 +18,11 @@ public class BusinessException extends Exception {
|
||||||
public BusinessException(String message) {
|
public BusinessException(String message) {
|
||||||
super(Labels.getLabel(message));
|
super(Labels.getLabel(message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BusinessException(String message, Boolean label) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param message- La clave del archivo de traducción
|
* @param message- La clave del archivo de traducción
|
||||||
|
|
|
@ -11,6 +11,7 @@ import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.zkoss.util.resource.Labels;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.EstacionDAO;
|
import com.rjconsultores.ventaboletos.dao.EstacionDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Estacion;
|
import com.rjconsultores.ventaboletos.entidad.Estacion;
|
||||||
|
@ -48,7 +49,9 @@ public class EstacionServiceImpl implements EstacionService {
|
||||||
|
|
||||||
@Transactional(rollbackFor = BusinessException.class)
|
@Transactional(rollbackFor = BusinessException.class)
|
||||||
public Estacion suscribirActualizar(Estacion estacion) throws BusinessException {
|
public Estacion suscribirActualizar(Estacion estacion) throws BusinessException {
|
||||||
|
String nomeEstacao = "";
|
||||||
|
Long numeroCaixa = 0l;
|
||||||
|
|
||||||
validarEstoqueUpdate(estacion);
|
validarEstoqueUpdate(estacion);
|
||||||
|
|
||||||
Boolean esMacDuplicado = Boolean.FALSE;
|
Boolean esMacDuplicado = Boolean.FALSE;
|
||||||
|
@ -56,12 +59,16 @@ public class EstacionServiceImpl implements EstacionService {
|
||||||
if (!lsEstacionMac.isEmpty()) {
|
if (!lsEstacionMac.isEmpty()) {
|
||||||
for (Estacion est : lsEstacionMac) {
|
for (Estacion est : lsEstacionMac) {
|
||||||
if (!est.getEstacionId().equals(estacion.getEstacionId())) {
|
if (!est.getEstacionId().equals(estacion.getEstacionId())) {
|
||||||
|
nomeEstacao = est.getDescestacion();
|
||||||
|
numeroCaixa = est.getNumcaja();
|
||||||
esMacDuplicado = Boolean.TRUE;
|
esMacDuplicado = Boolean.TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (esMacDuplicado) {
|
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;
|
boolean esCajaDuplicado = false;
|
||||||
|
|
Loading…
Reference in New Issue