fixes bug#0014687
qua:junia dev:thiago git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@94608 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
1f63933cbd
commit
14e60cc033
|
@ -34,6 +34,8 @@ public class CtrlSerieBPeHibernateDAO extends GenericHibernateDAO<CtrlSerieBPe,
|
||||||
Boolean retorno = Boolean.FALSE;
|
Boolean retorno = Boolean.FALSE;
|
||||||
Connection conn = null;
|
Connection conn = null;
|
||||||
|
|
||||||
|
log.info(String.format("Gerando sequence empresaId:%s, estado:%s, minvalue:%s",empresaId,estado,minvalue));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
conn = dataSource.getConnection();
|
conn = dataSource.getConnection();
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package com.rjconsultores.ventaboletos.service.impl;
|
package com.rjconsultores.ventaboletos.service.impl;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
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;
|
||||||
|
@ -14,6 +16,9 @@ import com.rjconsultores.ventaboletos.vo.embarcada.SerieEmbarcada;
|
||||||
|
|
||||||
@Service("controleSerieEmbarcadaService")
|
@Service("controleSerieEmbarcadaService")
|
||||||
public class ControleSerieEmbarcadaServiceImpl implements ControleSerieEmbarcadaService {
|
public class ControleSerieEmbarcadaServiceImpl implements ControleSerieEmbarcadaService {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(ControleSerieEmbarcadaServiceImpl.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private CtrlSerieEmbarcadaDAO ctrlSerieEmbarcadaDAO;
|
private CtrlSerieEmbarcadaDAO ctrlSerieEmbarcadaDAO;
|
||||||
|
|
||||||
|
@ -25,6 +30,8 @@ public class ControleSerieEmbarcadaServiceImpl implements ControleSerieEmbarcada
|
||||||
public SerieEmbarcada buscarSerieEmbarcada(CtrlSerieEmbarcada controleSerieEmbarcada) {
|
public SerieEmbarcada buscarSerieEmbarcada(CtrlSerieEmbarcada controleSerieEmbarcada) {
|
||||||
SerieEmbarcada serieembarcada = null;
|
SerieEmbarcada serieembarcada = null;
|
||||||
|
|
||||||
|
log.info(String.format("Empresa:%s Estado:%s" , controleSerieEmbarcada.getEmpresa().getEmpresaId(),controleSerieEmbarcada.getEstado()));
|
||||||
|
|
||||||
// Verificando se há Serie Embarcada disponível para reaproveitamento
|
// Verificando se há Serie Embarcada disponível para reaproveitamento
|
||||||
int tentativas = 0;
|
int tentativas = 0;
|
||||||
|
|
||||||
|
@ -49,9 +56,9 @@ public class ControleSerieEmbarcadaServiceImpl implements ControleSerieEmbarcada
|
||||||
|
|
||||||
Integer serie = (ctrlSerieBpe == null ? 1 : Integer.valueOf(ctrlSerieBpe.getSerie()) + 1);
|
Integer serie = (ctrlSerieBpe == null ? 1 : Integer.valueOf(ctrlSerieBpe.getSerie()) + 1);
|
||||||
|
|
||||||
try {
|
|
||||||
ctrlSerieBPeDAO.gerarSeqSerieBPe(controleSerieEmbarcada.getEmpresa().getEmpresaId(), controleSerieEmbarcada.getEstado().getCveestado(), serie);
|
ctrlSerieBPeDAO.gerarSeqSerieBPe(controleSerieEmbarcada.getEmpresa().getEmpresaId(), controleSerieEmbarcada.getEstado().getCveestado(), serie);
|
||||||
} catch (Exception e) {}
|
|
||||||
|
|
||||||
serie = ctrlSerieBPeDAO.buscarSequencia(controleSerieEmbarcada.getEmpresa().getEmpresaId(), controleSerieEmbarcada.getEstado().getCveestado());
|
serie = ctrlSerieBPeDAO.buscarSequencia(controleSerieEmbarcada.getEmpresa().getEmpresaId(), controleSerieEmbarcada.getEstado().getCveestado());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue