git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@33636 d1611594-4594-4d17-8e1d-87c2c4800839
parent
354f4e63a6
commit
86daea938a
|
@ -11,6 +11,8 @@ 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 org.zkoss.zul.Messagebox;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.ParadaDAO;
|
import com.rjconsultores.ventaboletos.dao.ParadaDAO;
|
||||||
import com.rjconsultores.ventaboletos.dao.TramoDAO;
|
import com.rjconsultores.ventaboletos.dao.TramoDAO;
|
||||||
|
@ -30,6 +32,8 @@ import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
@Service("paradaService")
|
@Service("paradaService")
|
||||||
public class ParadaServiceImpl implements ParadaService {
|
public class ParadaServiceImpl implements ParadaService {
|
||||||
|
|
||||||
|
private static final int MAX_ANTT = 99999;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ParadaDAO paradaDAO;
|
private ParadaDAO paradaDAO;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -42,6 +46,13 @@ public class ParadaServiceImpl implements ParadaService {
|
||||||
@Transactional
|
@Transactional
|
||||||
public Parada suscribirActualizar(Parada entidad) throws BusinessException {
|
public Parada suscribirActualizar(Parada entidad) throws BusinessException {
|
||||||
|
|
||||||
|
Integer antt = entidad.getCodantt() != null ? entidad.getCodantt() : null;
|
||||||
|
if (antt != null) {
|
||||||
|
if (antt.equals(MAX_ANTT)) {
|
||||||
|
throw new BusinessException("editarCatalogoDeParadaController.MSG.maxAntt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
List<Parada> lsParadas = paradaDAO.buscar(entidad.getCodantt());
|
List<Parada> lsParadas = paradaDAO.buscar(entidad.getCodantt());
|
||||||
|
|
||||||
if (!lsParadas.isEmpty()) {
|
if (!lsParadas.isEmpty()) {
|
||||||
|
@ -66,7 +77,6 @@ public class ParadaServiceImpl implements ParadaService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
lsParadas = buscarCVE(entidad.getCveparada());
|
lsParadas = buscarCVE(entidad.getCveparada());
|
||||||
|
|
||||||
if (!lsParadas.isEmpty()) {
|
if (!lsParadas.isEmpty()) {
|
||||||
|
|
Loading…
Reference in New Issue