fixes bug #6688
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@49091 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
50896cf57b
commit
5d96ad4ee6
|
@ -15,18 +15,26 @@ public class Constantes {
|
|||
public static final Long MVO_CANCEL_CANCELACION = new Long(31);
|
||||
public static final Long MVO_CANCEL_DEVOLUCAO = new Long(32);
|
||||
|
||||
public static Long TPV_DIRECTO_NORMAL = new Long(1);
|
||||
public static Long TPV_MANUAL = new Long(3);
|
||||
public static Long TPV_BOLETO_REMOTO = new Long(18);
|
||||
public static Long TPV_TRANSFERENCIAS = new Long(8); // é a troca de passagens
|
||||
public static Long TPV_CAMBIO_VIAJE = new Long(81); // é a transferência de passagens
|
||||
public static Long TPV_CHECKIN_VIAGEM = new Long(41); // chekin boletos
|
||||
public static Long TPV_BOLETO_ABIERTO = new Long(9);
|
||||
|
||||
public static Long TPV_RESERVACION_POR_INTERNET = new Long(16);
|
||||
public static Long TPV_POR_INTERNET = new Long(12);
|
||||
public static Long TPV_AGENCIA_WEB = new Long(19);
|
||||
|
||||
public static Integer TIPO_OPERACION_CC_LQ = new Integer(1);
|
||||
|
||||
public static Short TURNO_AUTOMATICO = new Short("99");
|
||||
|
||||
public static List<Integer> ORGAOS_CONCEDENTES_CALCULO_ARTESP = new ArrayList<Integer>(Arrays.asList(new Integer[]{21})) ;
|
||||
public static List<Integer> ORGAOS_CONCEDENTES_CALCULO_ANTT = new ArrayList<Integer>(Arrays.asList(new Integer[]{3,9,15}));
|
||||
|
||||
public static String CLAVE_EDITAR_COMISSAO = "COM.RJCONSULTORES.ADMINISTRACION.PUNTOVENTA.EDITARCOMISSAO";
|
||||
public static String CLAVE_REABRIR_MOVIMENTODIARIO = "COM.RJCONSULTORES.ADMINISTRACION.GUI.COMISSAO.MENU.CONFERENCIACOMISSAO.REABRIRMOVIMENTODIARIO";
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
package com.rjconsultores.ventaboletos.constantes;
|
||||
|
||||
public class DescricaoTipoVenta {
|
||||
|
||||
public static String getDescricaoTipoVenta(Integer tipoVentaId) {
|
||||
if(Constantes.TPV_DIRECTO_NORMAL.intValue() == tipoVentaId) {
|
||||
return "NORMAL";
|
||||
} else if(Constantes.TPV_MANUAL.intValue() == tipoVentaId) {
|
||||
return "MANUAL";
|
||||
} else if(Constantes.TPV_BOLETO_REMOTO.intValue() == tipoVentaId) {
|
||||
return "GAP";
|
||||
} else if(Constantes.TPV_TRANSFERENCIAS.intValue() == tipoVentaId) {
|
||||
return "TRANSFERENCIA";
|
||||
} else if(Constantes.TPV_CAMBIO_VIAJE.intValue() == tipoVentaId) {
|
||||
return "TROCA PASSAGEM";
|
||||
} else if(Constantes.TPV_CHECKIN_VIAGEM.intValue() == tipoVentaId) {
|
||||
return "CHECKIN VIAGEM";
|
||||
} else if(Constantes.TPV_BOLETO_ABIERTO.intValue() == tipoVentaId) {
|
||||
return "BOLETO ABERTO";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Conferencia;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.LogConferencia;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.enums.comissao.BoletoStatusComissao;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.BoletoComissao;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.ConferenciaComissaoVO;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.EventosFinanceirosVO;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.LogConferenciaVO;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.OcdVO;
|
||||
|
||||
public interface ConferenciaComissaoDAO extends GenericDAO<Conferencia, Long> {
|
||||
|
||||
public Conferencia suscribirOrActualizacion(Conferencia entidad);
|
||||
|
||||
public List<ConferenciaComissaoVO> carregarConferenciaComissao(String competencia, Empresa empresa, PuntoVenta puntoVenta) throws BusinessException;
|
||||
|
||||
public Conferencia confirmarChegadaMalote(Conferencia conferencia) throws BusinessException;
|
||||
|
||||
public Conferencia encerrarMovimentoDiario(Conferencia conferencia) throws BusinessException;
|
||||
|
||||
public List<EventosFinanceirosVO> carregarEventosFinanceiros(Conferencia conferencia) throws BusinessException;
|
||||
|
||||
public List<LogConferenciaVO> carregarLogConferencia(Conferencia conferencia) throws BusinessException;
|
||||
|
||||
public LogConferencia suscribirLogConferencia(LogConferencia logConferencia) throws BusinessException;
|
||||
|
||||
public void borrarLogConferencia(LogConferencia logConferencia) throws BusinessException;
|
||||
|
||||
public LogConferencia obtenerLogConferenciaID(Long logconferenciaId);
|
||||
|
||||
public List<BoletoComissao> carregarBilhetesComissao(Conferencia conferencia, BoletoStatusComissao boletoStatusComissao) throws BusinessException;
|
||||
|
||||
public List<OcdVO> carregarOcds(Conferencia conferencia) throws BusinessException;
|
||||
|
||||
public Conferencia reabrirMovimentoDiario(Conferencia conferencia) throws BusinessException;
|
||||
|
||||
public Conferencia obtenerConferenciaDataMovimento(Date datamovimento) throws BusinessException;
|
||||
|
||||
public List<LogConferencia> carregarLogConferencia(Long conferenciaId) throws BusinessException;
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.ContaCorrentePtoVta;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
|
||||
public interface ContaCorrenteAgenciaDAO extends GenericDAO<ContaCorrentePtoVta, Long> {
|
||||
|
||||
public ContaCorrentePtoVta gravarContaCorrente(Integer itemPuntoVentaId, String descOperacion, Date fecCorte, Integer usuarioId, Integer tipoOperacionCCId,
|
||||
Integer empresaId, short turnoId, BigDecimal importeTotalTarifa, BigDecimal importeTotalPedagio, BigDecimal importeTotalTasaAbordaje,
|
||||
BigDecimal importeTotalSeguro, BigDecimal importeTotalIngreso, BigDecimal importeTotalEgreso, BigDecimal importeTotalDevolucion,
|
||||
BigDecimal importeTotalTransferencia, BigDecimal importeFinal, boolean corteAutomatico,
|
||||
BigDecimal totalVentaSegOpcional, BigDecimal totalCancSegOpcional, BigDecimal importeTotalEfectivo ) throws BusinessException;
|
||||
|
||||
}
|
|
@ -0,0 +1,742 @@
|
|||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.hibernate.Hibernate;
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.Query;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.transform.Transformers;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.rjconsultores.ventaboletos.constantes.Constantes;
|
||||
import com.rjconsultores.ventaboletos.dao.ConferenciaComissaoDAO;
|
||||
import com.rjconsultores.ventaboletos.dao.ContaCorrenteAgenciaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Conferencia;
|
||||
import com.rjconsultores.ventaboletos.entidad.ContaCorrentePtoVta;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.LogConferencia;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.enums.comissao.BoletoStatusComissao;
|
||||
import com.rjconsultores.ventaboletos.enums.comissao.StatusLogConferencia;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.BoletoComissao;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.ConferenciaComissaoVO;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.DiaConferenciaComissaoVO;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.EventosFinanceirosVO;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.LogConferenciaVO;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.OcdVO;
|
||||
|
||||
@Repository("conferenciaComissaoDAO")
|
||||
public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Conferencia, Long> implements ConferenciaComissaoDAO {
|
||||
|
||||
private static Logger log = Logger.getLogger(ConferenciaComissaoHibernateDAO.class);
|
||||
|
||||
@Autowired
|
||||
private ContaCorrenteAgenciaDAO contaCorrenteAgenciaDAO;
|
||||
|
||||
@Autowired
|
||||
public ConferenciaComissaoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ConferenciaComissaoVO> carregarConferenciaComissao(String competencia, Empresa empresa, PuntoVenta puntoVenta) throws BusinessException {
|
||||
try {
|
||||
List<ConferenciaComissaoVO> lsConferencias = new ArrayList<ConferenciaComissaoVO>();
|
||||
|
||||
carregarConferenciasRegistradas(lsConferencias, competencia, empresa, puntoVenta);
|
||||
carregarMovimentoVendas(lsConferencias, competencia, empresa, puntoVenta);
|
||||
carregarDiasSemMovimento(lsConferencias, competencia, empresa, puntoVenta);
|
||||
|
||||
Collections.sort(lsConferencias);
|
||||
|
||||
return lsConferencias;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void carregarConferenciasRegistradas(List<ConferenciaComissaoVO> lsConferencias, String competencia, Empresa empresa, PuntoVenta puntoVenta) throws BusinessException {
|
||||
try {
|
||||
Map<String, Object> parametros = carregarParametros(competencia, empresa, puntoVenta);
|
||||
StringBuilder sQuery = new StringBuilder("SELECT DISTINCT co FROM Conferencia co ");
|
||||
sQuery.append("JOIN co.empresa em ")
|
||||
.append("JOIN co.puntoVenta pv ")
|
||||
.append("WHERE co.activo = 1 ")
|
||||
.append("AND co.datamovimento BETWEEN :dataInicial AND :dataFinal ");
|
||||
|
||||
if(parametros.containsKey("empresaId")) {
|
||||
sQuery.append("AND em.empresaId = :empresaId ");
|
||||
}
|
||||
|
||||
if(parametros.containsKey("puntoventaId")) {
|
||||
sQuery.append("AND pv.puntoventaId = :puntoventaId ");
|
||||
}
|
||||
|
||||
log.info(sQuery.toString());
|
||||
Query qr = getSession().createQuery(sQuery.toString());
|
||||
setParametros(qr, parametros);
|
||||
processarQueryConferencia(qr.list(), lsConferencias, competencia);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private void setParametros(Query qr, Map<String, Object> parametros) {
|
||||
for (Entry<String, Object> parametro : parametros.entrySet()) {
|
||||
if(parametro.getValue() instanceof Collection) {
|
||||
qr.setParameterList(parametro.getKey(), (Collection) parametro.getValue());
|
||||
} else if(parametro.getValue() instanceof List) {
|
||||
qr.setParameterList(parametro.getKey(), (List) parametro.getValue());
|
||||
} else {
|
||||
qr.setParameter(parametro.getKey(), parametro.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "deprecation" })
|
||||
private void carregarMovimentoVendas(List<ConferenciaComissaoVO> lsConferencias, String competencia, Empresa empresa, PuntoVenta puntoVenta) throws BusinessException {
|
||||
try {
|
||||
Map<String, Object> parametros = carregarParametros(competencia, empresa, puntoVenta);
|
||||
StringBuilder sQuery = new StringBuilder("SELECT DISTINCT PV.PUNTOVENTA_ID AS \"puntoventaId\", PV.NUMPUNTOVENTA as \"numPuntoVenta\", PV.NOMBPUNTOVENTA as \"nombpuntoventa\", TO_DATE(C.FECHORVENTA, 'DD/MM/YY') as \"datamovimento\" ");
|
||||
sQuery.append("FROM PUNTO_VENTA PV ")
|
||||
.append("JOIN PTOVTA_EMPRESA PTE ON PTE.PUNTOVENTA_ID = PV.PUNTOVENTA_ID ")
|
||||
.append("LEFT JOIN CAJA C ON C.PUNTOVENTA_ID = PV.PUNTOVENTA_ID AND ")
|
||||
.append(" C.FECHORVENTA BETWEEN :dataInicial AND :dataFinal ")
|
||||
.append("WHERE PV.ACTIVO = 1 ");
|
||||
|
||||
if(parametros.containsKey("empresaId")) {
|
||||
sQuery.append("AND PTE.EMPRESA_ID = :empresaId ");
|
||||
}
|
||||
|
||||
if(parametros.containsKey("puntoventaId")) {
|
||||
sQuery.append("AND PV.PUNTOVENTA_ID = :puntoventaId ");
|
||||
}
|
||||
|
||||
log.info(sQuery.toString());
|
||||
Query qr = getSession().createSQLQuery(sQuery.toString())
|
||||
.addScalar("puntoventaId", Hibernate.INTEGER)
|
||||
.addScalar("numPuntoVenta", Hibernate.STRING)
|
||||
.addScalar("nombpuntoventa", Hibernate.STRING)
|
||||
.addScalar("datamovimento", Hibernate.DATE)
|
||||
.setResultTransformer(Transformers.aliasToBean(ConferenciaComissaoVO.class));
|
||||
setParametros(qr, parametros);
|
||||
|
||||
processarQueryConferenciaComissao(qr.list(), lsConferencias, competencia);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Carrega a {@link ConferenciaComissaoVO} a partir de uma consulta com sql nativo, transformando o resultado em uma coleção de {@link ConferenciaComissaoVO}
|
||||
* @param lsQuery
|
||||
* @param lsConferencias
|
||||
* @param competencia
|
||||
* @param corPadrao
|
||||
*/
|
||||
private void processarQueryConferenciaComissao(List<ConferenciaComissaoVO> lsQuery, List<ConferenciaComissaoVO> lsConferencias, String competencia) {
|
||||
Set<Integer> diasSemMovimentos = carregarDiasSemMovimento(competencia);
|
||||
|
||||
for (ConferenciaComissaoVO conferenciaComissaoMovimentoDiario : lsQuery) {
|
||||
ConferenciaComissaoVO conferenciaComissao = new ConferenciaComissaoVO();
|
||||
conferenciaComissao.setCompetencia(competencia);
|
||||
conferenciaComissao.setPuntoventaId(conferenciaComissaoMovimentoDiario.getPuntoventaId());
|
||||
conferenciaComissao.setNumPuntoVenta(conferenciaComissaoMovimentoDiario.getNumPuntoVenta());
|
||||
conferenciaComissao.setNombpuntoventa(conferenciaComissaoMovimentoDiario.getNombpuntoventa());
|
||||
conferenciaComissao.setDiasSemMovimentos(new TreeSet<Integer>(diasSemMovimentos));
|
||||
|
||||
if(lsConferencias.contains(conferenciaComissao)) {
|
||||
conferenciaComissao = lsConferencias.get(lsConferencias.indexOf(conferenciaComissao));
|
||||
}
|
||||
|
||||
if(conferenciaComissaoMovimentoDiario.getDatamovimento() != null) {
|
||||
Integer dia = Integer.valueOf(DateUtil.getStringDate(conferenciaComissaoMovimentoDiario.getDatamovimento(), "dd"));
|
||||
if(conferenciaComissao.getDiasSemMovimentos().contains(dia)) {
|
||||
|
||||
DiaConferenciaComissaoVO diaConferenciaComissao = new DiaConferenciaComissaoVO();
|
||||
diaConferenciaComissao.setDia(dia);
|
||||
|
||||
if(conferenciaComissao.getDias() == null) {
|
||||
conferenciaComissao.setDias(new ArrayList<DiaConferenciaComissaoVO>());
|
||||
}
|
||||
|
||||
conferenciaComissao.getDias().add(diaConferenciaComissao);
|
||||
conferenciaComissao.getDiasSemMovimentos().remove(diaConferenciaComissao.getDia());
|
||||
}
|
||||
}
|
||||
|
||||
if(!lsConferencias.contains(conferenciaComissao)) {
|
||||
lsConferencias.add(conferenciaComissao);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Carrega a {@link ConferenciaComissaoVO} a partir dos registros da tabela {@link Conferencia}
|
||||
* @param lsQuery
|
||||
* @param lsConferencias
|
||||
* @param competencia
|
||||
*/
|
||||
private void processarQueryConferencia(List<Conferencia> lsQuery, List<ConferenciaComissaoVO> lsConferencias, String competencia) {
|
||||
Set<Integer> diasSemMovimentos = carregarDiasSemMovimento(competencia);
|
||||
|
||||
for (Conferencia conferencia : lsQuery) {
|
||||
ConferenciaComissaoVO conferenciaComissao = new ConferenciaComissaoVO();
|
||||
conferenciaComissao.setCompetencia(competencia);
|
||||
conferenciaComissao.setPuntoventaId(conferencia.getPuntoVenta().getPuntoventaId());
|
||||
conferenciaComissao.setNumPuntoVenta(conferencia.getPuntoVenta().getNumPuntoVenta());
|
||||
conferenciaComissao.setNombpuntoventa(conferencia.getPuntoVenta().getNombpuntoventa());
|
||||
conferenciaComissao.setDiasSemMovimentos(new TreeSet<Integer>(diasSemMovimentos));
|
||||
|
||||
if(lsConferencias.contains(conferenciaComissao)) {
|
||||
conferenciaComissao = lsConferencias.get(lsConferencias.indexOf(conferenciaComissao));
|
||||
}
|
||||
|
||||
if(conferencia.getDatamovimento() != null) {
|
||||
Integer dia = Integer.valueOf(DateUtil.getStringDate(conferencia.getDatamovimento(), "dd"));
|
||||
if(conferenciaComissao.getDiasSemMovimentos().contains(dia)) {
|
||||
|
||||
DiaConferenciaComissaoVO diaConferenciaComissao = new DiaConferenciaComissaoVO();
|
||||
diaConferenciaComissao.setConferenciaId(conferencia.getConferenciaId());
|
||||
diaConferenciaComissao.setDia(dia);
|
||||
diaConferenciaComissao.setIndboletogerado(conferencia.getIndboletogerado());
|
||||
diaConferenciaComissao.setIndconferido(conferencia.getIndconferido());
|
||||
diaConferenciaComissao.setIndmaloterecebido(conferencia.getIndmaloterecebido());
|
||||
diaConferenciaComissao.setIndpendencia(conferencia.getIndpendencia());
|
||||
diaConferenciaComissao.setIndsemmovimento(conferencia.getIndsemmovimento());
|
||||
|
||||
if(conferenciaComissao.getDias() == null) {
|
||||
conferenciaComissao.setDias(new ArrayList<DiaConferenciaComissaoVO>());
|
||||
}
|
||||
|
||||
conferenciaComissao.getDias().add(diaConferenciaComissao);
|
||||
conferenciaComissao.getDiasSemMovimentos().remove(diaConferenciaComissao.getDia());
|
||||
}
|
||||
}
|
||||
|
||||
if(!lsConferencias.contains(conferenciaComissao)) {
|
||||
lsConferencias.add(conferenciaComissao);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void carregarDiasSemMovimento(List<ConferenciaComissaoVO> lsConferencias, String competencia, Empresa empresa, PuntoVenta puntoVenta) {
|
||||
for (ConferenciaComissaoVO conferenciaComissao : lsConferencias) {
|
||||
for (Integer diaSemMovimento : conferenciaComissao.getDiasSemMovimentos()) {
|
||||
DiaConferenciaComissaoVO diaConferenciaComissao = new DiaConferenciaComissaoVO();
|
||||
diaConferenciaComissao.setDia(diaSemMovimento);
|
||||
diaConferenciaComissao.setIndsemmovimento(true);
|
||||
|
||||
if(conferenciaComissao.getDias() == null) {
|
||||
conferenciaComissao.setDias(new ArrayList<DiaConferenciaComissaoVO>());
|
||||
}
|
||||
conferenciaComissao.getDias().add(diaConferenciaComissao);
|
||||
}
|
||||
conferenciaComissao.getDiasSemMovimentos().clear();
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String, Object> carregarParametros(String competencia, Empresa empresa, PuntoVenta puntoVenta) throws ParseException {
|
||||
Map<String, Object> parametros = new HashMap<String, Object>();
|
||||
if(empresa != null) {
|
||||
parametros.put("empresaId", empresa.getEmpresaId());
|
||||
}
|
||||
if(puntoVenta != null) {
|
||||
parametros.put("puntoventaId", puntoVenta.getPuntoventaId());
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(competencia)) {
|
||||
String[] vetCompetencia = competencia.split("/");
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.set(Calendar.MONTH, Integer.valueOf(vetCompetencia[0]) - 1);
|
||||
cal.set(Calendar.YEAR, Integer.valueOf(vetCompetencia[1]));
|
||||
|
||||
parametros.put("dataInicial", DateUtil.getDateFromString(cal.getActualMinimum(Calendar.DAY_OF_MONTH) + "/" + competencia, "dd/MM/yyyy"));
|
||||
parametros.put("dataFinal", DateUtil.getDateFromString(cal.getActualMaximum(Calendar.DAY_OF_MONTH) + "/" + competencia, "dd/MM/yyyy"));
|
||||
}
|
||||
|
||||
return parametros;
|
||||
}
|
||||
|
||||
private Set<Integer> carregarDiasSemMovimento(String competencia) {
|
||||
Set<Integer> diasSemMovimento = new TreeSet<Integer>();
|
||||
|
||||
String[] vetCompetencia = competencia.split("/");
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.set(Calendar.MONTH, Integer.valueOf(vetCompetencia[0]) - 1);
|
||||
cal.set(Calendar.YEAR, Integer.valueOf(vetCompetencia[1]));
|
||||
|
||||
for (int i = 1; i <= cal.getActualMaximum(Calendar.DAY_OF_MONTH); i++) {
|
||||
diasSemMovimento.add(i);
|
||||
}
|
||||
|
||||
return diasSemMovimento;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Conferencia confirmarChegadaMalote(Conferencia conferencia) throws BusinessException {
|
||||
try {
|
||||
conferencia.setIndmaloterecebido(Boolean.TRUE);
|
||||
return suscribirOrActualizacion(conferencia);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Conferencia suscribirOrActualizacion(Conferencia entidad) {
|
||||
if(entidad.getConferenciaId() == null) {
|
||||
return suscribir(entidad);
|
||||
} else {
|
||||
return actualizacion(entidad);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Conferencia encerrarMovimentoDiario(Conferencia conferencia) throws BusinessException {
|
||||
try {
|
||||
conferencia.setIndconferido(Boolean.TRUE);
|
||||
conferencia.setIndpendencia(isMovimentoDiarioPendencia(conferencia));
|
||||
conferencia.setIndboletogerado(isMovimentoDiarioBoletoGerado(conferencia));
|
||||
|
||||
gerarLancamentoContaCorrente(conferencia);
|
||||
return suscribirOrActualizacion(conferencia);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Conferencia reabrirMovimentoDiario(Conferencia conferencia) throws BusinessException {
|
||||
try {
|
||||
conferencia.setIndconferido(Boolean.FALSE);
|
||||
return suscribirOrActualizacion(conferencia);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isMovimentoDiarioBoletoGerado(Conferencia conferencia) throws BusinessException {
|
||||
try {
|
||||
Map<String, Object> parametros = carregarParametros(null, conferencia.getEmpresa(), conferencia.getPuntoVenta());
|
||||
StringBuilder sQuery = new StringBuilder();
|
||||
sQuery.append("SELECT DISTINCT FECHAMENTOCNTCORRENTE_ID ")
|
||||
.append("FROM FECHAMENTO_CNTCORRENTE ")
|
||||
.append("WHERE ACTIVO = 1 ")
|
||||
.append("AND :datamovimento BETWEEN FECINIFECHAMENTO AND FECFINFECHAMENTO ");
|
||||
|
||||
parametros.put("datamovimento", conferencia.getDatamovimento());
|
||||
|
||||
if(parametros.containsKey("empresaId")) {
|
||||
sQuery.append("AND EMPRESA_ID = :empresaId ");
|
||||
}
|
||||
|
||||
if(parametros.containsKey("puntoventaId")) {
|
||||
sQuery.append("AND PUNTOVENTA_ID = :puntoventaId ");
|
||||
}
|
||||
|
||||
log.info(sQuery.toString());
|
||||
|
||||
Query qr = getSession().createSQLQuery(sQuery.toString());
|
||||
setParametros(qr, parametros);
|
||||
|
||||
return !qr.list().isEmpty();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isMovimentoDiarioPendencia(Conferencia conferencia) {
|
||||
Query qr = getSession().createQuery("SELECT COUNT(log) FROM LogConferencia log WHERE log.activo = 1 AND log.conferencia.conferenciaId = :conferenciaId AND log.status = :status");
|
||||
qr.setParameter("conferenciaId", conferencia.getConferenciaId());
|
||||
qr.setParameter("status", StatusLogConferencia.PENDENCIA);
|
||||
return !qr.list().isEmpty() && ((Long)qr.list().get(0)) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "deprecation" })
|
||||
public List<EventosFinanceirosVO> carregarEventosFinanceiros(Conferencia conferencia) throws BusinessException {
|
||||
try {
|
||||
Map<String, Object> parametros = carregarParametros(null, conferencia.getEmpresa(), conferencia.getPuntoVenta());
|
||||
StringBuilder sQuery = new StringBuilder();
|
||||
sQuery.append("SELECT DISTINCT EE.EVENTOEXTRA_ID AS \"eventoextraId\", EE.NUMDOCUMENTO AS \"numdocumento\", ")
|
||||
.append("EE.IMPINGRESO AS \"impingreso\", TEE.DESCTIPOEVENTO AS \"desctipoevento\", EE.DESCINFO AS \"descinfo\", ")
|
||||
.append("LOG.STATUS AS \"status\" ")
|
||||
.append("FROM EVENTO_EXTRA EE ")
|
||||
.append("JOIN TIPO_EVENTO_EXTRA TEE ON EE.TIPOEVENTOEXTRA_ID = TEE.TIPOEVENTOEXTRA_ID ")
|
||||
.append("LEFT JOIN LOG_CONFERENCIA LOG ON LOG.EVENTOEXTRA_ID = EE.EVENTOEXTRA_ID ")
|
||||
.append("WHERE EE.ACTIVO = 1 ")
|
||||
.append("AND TO_DATE(EE.FECHORINGRESO,'DD/MM/YY') = :datamovimento ");
|
||||
|
||||
parametros.put("datamovimento", conferencia.getDatamovimento());
|
||||
|
||||
if(parametros.containsKey("empresaId")) {
|
||||
sQuery.append("AND EE.EMPRESA_ID = :empresaId ");
|
||||
}
|
||||
|
||||
if(parametros.containsKey("puntoventaId")) {
|
||||
sQuery.append("AND EE.PUNTOVENTA_ID = :puntoventaId ");
|
||||
}
|
||||
|
||||
sQuery.append("ORDER BY TEE.DESCTIPOEVENTO ");
|
||||
|
||||
log.info(sQuery.toString());
|
||||
|
||||
Query qr = getSession().createSQLQuery(sQuery.toString())
|
||||
.addScalar("eventoextraId", Hibernate.LONG)
|
||||
.addScalar("numdocumento", Hibernate.STRING)
|
||||
.addScalar("impingreso", Hibernate.BIG_DECIMAL)
|
||||
.addScalar("desctipoevento", Hibernate.STRING)
|
||||
.addScalar("descinfo", Hibernate.STRING)
|
||||
.addScalar("status", Hibernate.INTEGER)
|
||||
.setResultTransformer(Transformers.aliasToBean(EventosFinanceirosVO.class));
|
||||
setParametros(qr, parametros);
|
||||
|
||||
return qr.list();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "deprecation", "unchecked" })
|
||||
public List<LogConferenciaVO> carregarLogConferencia(Conferencia conferencia) throws BusinessException {
|
||||
try {
|
||||
if(conferencia != null && conferencia.getConferenciaId() != null) {
|
||||
StringBuilder sQuery = new StringBuilder();
|
||||
sQuery.append("SELECT LOG.LOGCONFERENCIA_ID AS \"logconferenciaId\", LOG.OBSERVACAO AS \"observacao\", LOG.PRECO AS \"preco\", ")
|
||||
.append("LOG.STATUS AS \"status\", B.NUMFOLIOSISTEMA AS \"numfoliosistema\", LOG.TIPO AS \"tipo\", ")
|
||||
.append("O.NUMOPERACION AS \"numoperacion\", TEE.DESCTIPOEVENTO AS \"desctipoevento\", U.NOMBUSUARIO AS \"nombusuario\", ")
|
||||
.append("LOG.FECMODIF AS \"fecmodif\", B.BOLETO_ID AS \"boletoId\", O.OCD_ID AS \"ocdId\", EE.EVENTOEXTRA_ID AS \"eventoextraId\" ")
|
||||
.append("FROM LOG_CONFERENCIA LOG ")
|
||||
.append("LEFT JOIN BOLETO B ON B.BOLETO_ID = LOG.BOLETO_ID ")
|
||||
.append("LEFT JOIN EVENTO_EXTRA EE ON EE.EVENTOEXTRA_ID = LOG.EVENTOEXTRA_ID ")
|
||||
.append("LEFT JOIN TIPO_EVENTO_EXTRA TEE ON TEE.TIPOEVENTOEXTRA_ID = EE.TIPOEVENTOEXTRA_ID ")
|
||||
.append("LEFT JOIN OCD O ON O.OCD_ID = LOG.OCD_ID ")
|
||||
.append("JOIN USUARIO U ON U.USUARIO_ID = LOG.USUARIO_ID ")
|
||||
.append("WHERE LOG.ACTIVO = 1 ")
|
||||
.append("AND LOG.CONFERENCIA_ID = :conferenciaId ");
|
||||
|
||||
Query qr = getSession().createSQLQuery(sQuery.toString())
|
||||
.addScalar("logconferenciaId", Hibernate.LONG)
|
||||
.addScalar("observacao", Hibernate.STRING)
|
||||
.addScalar("preco", Hibernate.BIG_DECIMAL)
|
||||
.addScalar("status", Hibernate.INTEGER)
|
||||
.addScalar("numfoliosistema", Hibernate.STRING)
|
||||
.addScalar("tipo", Hibernate.INTEGER)
|
||||
.addScalar("numoperacion", Hibernate.STRING)
|
||||
.addScalar("desctipoevento", Hibernate.STRING)
|
||||
.addScalar("nombusuario", Hibernate.STRING)
|
||||
.addScalar("fecmodif", Hibernate.TIMESTAMP)
|
||||
.addScalar("boletoId", Hibernate.LONG)
|
||||
.addScalar("ocdId", Hibernate.LONG)
|
||||
.addScalar("eventoextraId", Hibernate.LONG)
|
||||
.setResultTransformer(Transformers.aliasToBean(LogConferenciaVO.class));
|
||||
qr.setParameter("conferenciaId", conferencia.getConferenciaId());
|
||||
|
||||
return qr.list();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
|
||||
return new ArrayList<LogConferenciaVO>();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public LogConferencia suscribirLogConferencia(LogConferencia logConferencia) throws BusinessException {
|
||||
try {
|
||||
if(logConferencia.getConferencia().getConferenciaId() == null) {
|
||||
logConferencia.setConferencia(confirmarChegadaMalote(logConferencia.getConferencia()));
|
||||
}
|
||||
|
||||
getSession().save(logConferencia);
|
||||
return logConferencia;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void borrarLogConferencia(LogConferencia logConferencia) throws BusinessException {
|
||||
try {
|
||||
if(logConferencia.getContaCorrentePtoVta() != null) {
|
||||
ContaCorrentePtoVta contaCorrentePtoVta = logConferencia.getContaCorrentePtoVta();
|
||||
contaCorrentePtoVta.setActivo(Boolean.FALSE);
|
||||
contaCorrentePtoVta.setFecmodif(logConferencia.getFecmodif());
|
||||
contaCorrentePtoVta.setUsuario(logConferencia.getUsuario());
|
||||
|
||||
contaCorrenteAgenciaDAO.borrar(contaCorrentePtoVta);
|
||||
}
|
||||
getSession().merge(logConferencia);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public LogConferencia obtenerLogConferenciaID(Long logconferenciaId) {
|
||||
try {
|
||||
return (LogConferencia) this.getHibernateTemplate().get(LogConferencia.class.getName(), logconferenciaId);
|
||||
} catch (final HibernateException ex) {
|
||||
throw convertHibernateAccessException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "deprecation" })
|
||||
public List<BoletoComissao> carregarBilhetesComissao(Conferencia conferencia, BoletoStatusComissao boletoStatusComissao) throws BusinessException {
|
||||
try {
|
||||
Map<String, Object> parametros = carregarParametros(null, conferencia.getEmpresa(), conferencia.getPuntoVenta());
|
||||
|
||||
StringBuilder sQuery = new StringBuilder();
|
||||
sQuery.append("SELECT B.BOLETO_ID AS \"boletoId\", B.NUMASIENTO AS \"numAsiento\", B.NUMFOLIOSISTEMA AS \"numFolioSistema\", B.NUMSERIEPREIMPRESA AS \"numSeriePreimpresa\", ")
|
||||
.append("B.NUMFOLIOPREIMPRESO AS \"numFolioPreImpreso\", EST.CVEESTADO AS \"uf\", CAT.DESCCATEGORIA AS \"desccategoria\", ")
|
||||
.append("NVL(B.PRECIOPAGADO,0) AS \"valorpagado\", NVL(B.IMPORTEOUTROS,0) AS \"seguroOutros\", ")
|
||||
.append("NVL(B.IMPORTEPEDAGIO,0) AS \"pedagio\", NVL(B.IMPORTESEGURO,0) AS \"seguro\", ")
|
||||
.append("B.TIPOVENTA_ID AS \"tipoVenta\", B.INDSTATUSBOLETO AS \"indstatusboleto\", LOG.STATUS AS \"status\" ")
|
||||
.append("FROM BOLETO B ")
|
||||
.append("LEFT JOIN PARADA ORI ON ORI.PARADA_ID = B.ORIGEN_ID ")
|
||||
.append("LEFT JOIN CIUDAD CID ON CID.CIUDAD_ID = ORI.PARADA_ID ")
|
||||
.append("LEFT JOIN ESTADO EST ON EST.ESTADO_ID = CID.ESTADO_ID ")
|
||||
.append("LEFT JOIN CATEGORIA CAT ON CAT.CATEGORIA_ID = B.CATEGORIA_ID ")
|
||||
.append("LEFT JOIN LOG_CONFERENCIA LOG ON LOG.BOLETO_ID = B.BOLETO_ID ")
|
||||
.append("WHERE B.ACTIVO = 1 ")
|
||||
.append("AND TO_DATE(B.FECHORVENTA,'DD/MM/YY') = :datamovimento ");
|
||||
|
||||
parametros.put("datamovimento", conferencia.getDatamovimento());
|
||||
|
||||
if(parametros.containsKey("empresaId")) {
|
||||
sQuery.append("AND B.EMPRESACORRIDA_ID = :empresaId ");
|
||||
}
|
||||
|
||||
if(parametros.containsKey("puntoventaId")) {
|
||||
sQuery.append("AND B.PUNTOVENTA_ID = :puntoventaId ");
|
||||
}
|
||||
|
||||
if(BoletoStatusComissao.BOLETOS.equals(boletoStatusComissao)) {
|
||||
sQuery.append("AND B.TIPOVENTA_ID NOT IN (:tipoVenta) ")
|
||||
.append("AND B.MOTIVOCANCELACION_ID IS NULL ")
|
||||
.append("AND B.INDSTATUSBOLETO = 'V' ");
|
||||
parametros.put("tipoVenta", Arrays.asList(Constantes.TPV_BOLETO_REMOTO,Constantes.TPV_MANUAL));
|
||||
}
|
||||
|
||||
if(BoletoStatusComissao.BOLETO_MANUAL.equals(boletoStatusComissao)) {
|
||||
sQuery.append("AND B.TIPOVENTA_ID = :tipoVenta ");
|
||||
parametros.put("tipoVenta", Constantes.TPV_MANUAL);
|
||||
}
|
||||
|
||||
if(BoletoStatusComissao.BOLETO_CANCELADO.equals(boletoStatusComissao) || BoletoStatusComissao.BOLETO_DEVOLVIDO.equals(boletoStatusComissao)) {
|
||||
sQuery.append("AND B.TIPOVENTA_ID = :tipoVenta ")
|
||||
.append("AND B.INDSTATUSBOLETO = 'C' ")
|
||||
.append("AND B.MOTIVOCANCELACION_ID = :motivocancelacionId ");
|
||||
parametros.put("motivocancelacionId", BoletoStatusComissao.BOLETO_CANCELADO.equals(boletoStatusComissao) ? Constantes.MVO_CANCEL_CANCELACION : Constantes.MVO_CANCEL_DEVOLUCAO);
|
||||
parametros.put("tipoVenta", Constantes.TPV_DIRECTO_NORMAL);
|
||||
}
|
||||
|
||||
if(BoletoStatusComissao.GAP.equals(boletoStatusComissao)) {
|
||||
sQuery.append("AND B.TIPOVENTA_ID = :tipoVenta ")
|
||||
.append("AND B.INDSTATUSBOLETO = 'V' ")
|
||||
.append("AND B.MOTIVOCANCELACION_ID IS NULL ");
|
||||
parametros.put("tipoVenta", Constantes.TPV_BOLETO_REMOTO);
|
||||
}
|
||||
|
||||
if(BoletoStatusComissao.GAP_CANCELADO.equals(boletoStatusComissao) || BoletoStatusComissao.GAP_DEVOLVIDO.equals(boletoStatusComissao)) {
|
||||
sQuery.append("AND B.TIPOVENTA_ID = :tipoVenta ")
|
||||
.append("AND B.INDSTATUSBOLETO = 'C' ")
|
||||
.append("AND B.MOTIVOCANCELACION_ID = :motivocancelacionId ");
|
||||
parametros.put("motivocancelacionId", BoletoStatusComissao.GAP_CANCELADO.equals(boletoStatusComissao) ? Constantes.MVO_CANCEL_CANCELACION : Constantes.MVO_CANCEL_DEVOLUCAO);
|
||||
parametros.put("tipoVenta", Constantes.TPV_BOLETO_REMOTO);
|
||||
}
|
||||
|
||||
log.info(sQuery.toString());
|
||||
|
||||
Query qr = getSession().createSQLQuery(sQuery.toString())
|
||||
.addScalar("boletoId", Hibernate.LONG)
|
||||
.addScalar("numAsiento", Hibernate.STRING)
|
||||
.addScalar("numFolioSistema", Hibernate.STRING)
|
||||
.addScalar("numSeriePreimpresa", Hibernate.STRING)
|
||||
.addScalar("numFolioPreImpreso", Hibernate.STRING)
|
||||
.addScalar("uf", Hibernate.STRING)
|
||||
.addScalar("desccategoria", Hibernate.STRING)
|
||||
.addScalar("valorpagado", Hibernate.BIG_DECIMAL)
|
||||
.addScalar("seguroOutros", Hibernate.BIG_DECIMAL)
|
||||
.addScalar("pedagio", Hibernate.BIG_DECIMAL)
|
||||
.addScalar("seguro", Hibernate.BIG_DECIMAL)
|
||||
.addScalar("tipoVenta", Hibernate.INTEGER)
|
||||
.addScalar("indstatusboleto", Hibernate.STRING)
|
||||
.addScalar("status", Hibernate.INTEGER)
|
||||
.setResultTransformer(Transformers.aliasToBean(BoletoComissao.class));
|
||||
setParametros(qr, parametros);
|
||||
|
||||
return qr.list();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "deprecation" })
|
||||
public List<OcdVO> carregarOcds(Conferencia conferencia) throws BusinessException {
|
||||
try {
|
||||
Map<String, Object> parametros = carregarParametros(null, conferencia.getEmpresa(), conferencia.getPuntoVenta());
|
||||
|
||||
StringBuilder sQuery = new StringBuilder();
|
||||
sQuery.append("SELECT O.OCD_ID AS \"ocdId\", O.NUMOPERACION AS \"numoperacion\", O.FECINC AS \"fecinc\", O.FECPAGAR AS \"fecpagar\", O.FECPAGO AS \"fecpago\", ")
|
||||
.append("O.INDPAGO AS \"indpago\", O.VALOR_PAGAR AS \"valorPagar\", O.PENALIZACION AS \"penalizacion\", LOG.STATUS AS \"status\" ")
|
||||
.append("FROM OCD O ")
|
||||
.append("LEFT JOIN BOLETO B ON B.BOLETO_ID = O.BOLETO_ID ")
|
||||
.append("LEFT JOIN LOG_CONFERENCIA LOG ON LOG.OCD_ID = O.OCD_ID ")
|
||||
.append("WHERE O.ACTIVO = 1 ")
|
||||
.append("AND TO_DATE(O.FECINC,'DD/MM/YY') = :datamovimento ");
|
||||
|
||||
parametros.put("datamovimento", conferencia.getDatamovimento());
|
||||
|
||||
if(parametros.containsKey("empresaId")) {
|
||||
sQuery.append("AND B.EMPRESACORRIDA_ID = :empresaId ");
|
||||
}
|
||||
|
||||
if(parametros.containsKey("puntoventaId")) {
|
||||
sQuery.append("AND O.PUNTOVENTA_ID = :puntoventaId ");
|
||||
}
|
||||
|
||||
log.info(sQuery.toString());
|
||||
|
||||
Query qr = getSession().createSQLQuery(sQuery.toString())
|
||||
.addScalar("ocdId", Hibernate.LONG)
|
||||
.addScalar("numoperacion", Hibernate.STRING)
|
||||
.addScalar("fecinc", Hibernate.DATE)
|
||||
.addScalar("fecpagar", Hibernate.DATE)
|
||||
.addScalar("fecpago", Hibernate.DATE)
|
||||
.addScalar("indpago", Hibernate.BOOLEAN)
|
||||
.addScalar("valorPagar", Hibernate.BIG_DECIMAL)
|
||||
.addScalar("penalizacion", Hibernate.BIG_DECIMAL)
|
||||
.addScalar("status", Hibernate.INTEGER)
|
||||
.setResultTransformer(Transformers.aliasToBean(OcdVO.class));
|
||||
setParametros(qr, parametros);
|
||||
|
||||
return qr.list();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Conferencia obtenerConferenciaDataMovimento(Date datamovimento) throws BusinessException {
|
||||
try {
|
||||
StringBuilder sQuery = new StringBuilder();
|
||||
sQuery.append("SELECT DISTINCT co ")
|
||||
.append("FROM Conferencia co ")
|
||||
.append("WHERE co.activo = 1 ")
|
||||
.append("AND co.datamovimento = :datamovimento ");
|
||||
|
||||
log.info(sQuery.toString());
|
||||
Query qr = getSession().createQuery(sQuery.toString());
|
||||
qr.setParameter("datamovimento", datamovimento);
|
||||
qr.setMaxResults(1);
|
||||
return (Conferencia) qr.uniqueResult();
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
private void gerarLancamentoContaCorrente(Conferencia conferencia) throws BusinessException {
|
||||
try {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.add(Calendar.DAY_OF_MONTH, 1);
|
||||
|
||||
List<LogConferencia> lsLogConferencia = carregarLogConferencia(conferencia.getConferenciaId());
|
||||
String sDataMovimento = DateUtil.getStringDate(conferencia.getDatamovimento(), "dd/MM/yyyy");
|
||||
String descOperacion = "CONFERENCIA MOVIMENTO DIA - " + sDataMovimento;
|
||||
|
||||
for (LogConferencia logConferencia : lsLogConferencia) {
|
||||
if(logConferencia.getStatus().equals(StatusLogConferencia.CONFERIDO)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ContaCorrentePtoVta contaCorrentePtoVta = contaCorrenteAgenciaDAO.gravarContaCorrente(conferencia.getPuntoVenta().getPuntoventaId(),
|
||||
descOperacion, cal.getTime(), conferencia.getUsuarioId(),
|
||||
Constantes.TIPO_OPERACION_CC_LQ, conferencia.getEmpresa().getEmpresaId(),
|
||||
Constantes.TURNO_AUTOMATICO, BigDecimal.ZERO,
|
||||
BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO,
|
||||
BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO,
|
||||
BigDecimal.ZERO, logConferencia.getPreco(), false,
|
||||
BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO);
|
||||
|
||||
logConferencia.setContaCorrentePtoVta(contaCorrentePtoVta);
|
||||
suscribirLogConferencia(logConferencia);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<LogConferencia> carregarLogConferencia(Long conferenciaId) throws BusinessException {
|
||||
try {
|
||||
StringBuilder sQuery = new StringBuilder();
|
||||
sQuery.append("SELECT DISTINCT log ")
|
||||
.append("FROM LogConferencia log ")
|
||||
.append("LEFT JOIN log.contaCorrentePtoVta co ")
|
||||
.append("WHERE log.activo = 1 ")
|
||||
.append("AND log.conferencia.conferenciaId = :conferenciaId ")
|
||||
.append("AND (co.contaCorrentePtoVtaId is null OR co.activo = 0) ");
|
||||
Query qr = getSession().createQuery(sQuery.toString());
|
||||
qr.setParameter("conferenciaId", conferenciaId);
|
||||
return qr.list();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.ContaCorrenteAgenciaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.ContaCorrentePtoVta;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoOperacionCC;
|
||||
import com.rjconsultores.ventaboletos.entidad.Turno;
|
||||
import com.rjconsultores.ventaboletos.entidad.Usuario;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
|
||||
@Repository("contaCorrenteAgenciaDAO")
|
||||
public class ContaCorrenteAgenciaHibernateDAO extends GenericHibernateDAO<ContaCorrentePtoVta, Long> implements ContaCorrenteAgenciaDAO {
|
||||
|
||||
private static Logger log = Logger.getLogger(ContaCorrenteAgenciaHibernateDAO.class);
|
||||
|
||||
@Autowired
|
||||
public ContaCorrenteAgenciaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public ContaCorrentePtoVta gravarContaCorrente(Integer puntoVentaId, String descOperacion, Date fecCorte, Integer usuarioId, Integer tipoOperacionCCId, Integer empresaId, short turnoId, BigDecimal importeTotalTarifa, BigDecimal importeTotalPedagio, BigDecimal importeTotalTasaAbordaje, BigDecimal importeTotalSeguro, BigDecimal importeTotalIngreso, BigDecimal importeTotalEgreso, BigDecimal importeTotalDevolucion, BigDecimal importeTotalTransferencia, BigDecimal importeFinal, boolean corteAutomatico, BigDecimal totalVentaSegOpcional, BigDecimal totalCancSegOpcional, BigDecimal importeTotalEfectivo) throws BusinessException {
|
||||
try {
|
||||
|
||||
ContaCorrentePtoVta ccPtoVta = new ContaCorrentePtoVta();
|
||||
ccPtoVta.setActivo(Boolean.TRUE);
|
||||
ccPtoVta.setDescOperacion(descOperacion);
|
||||
ccPtoVta.setEmpresa(new Empresa(empresaId));
|
||||
ccPtoVta.setFecmodif(Calendar.getInstance().getTime());
|
||||
ccPtoVta.setImporteTotalTarifa(importeTotalTarifa);
|
||||
ccPtoVta.setImporteTotalPedagio(importeTotalPedagio);
|
||||
ccPtoVta.setImporteTotalTasaAbordaje(importeTotalTasaAbordaje);
|
||||
ccPtoVta.setImporteTotalSeguro(importeTotalSeguro);
|
||||
ccPtoVta.setImporteTotalIngreso(importeTotalIngreso);
|
||||
ccPtoVta.setImporteTotalEgreso(importeTotalEgreso);
|
||||
ccPtoVta.setImporteTotalDevolucion(importeTotalDevolucion);
|
||||
ccPtoVta.setImporteTotalTransferencia(importeTotalTransferencia);
|
||||
ccPtoVta.setImporte(importeFinal);
|
||||
ccPtoVta.setImporteTotalEfectivo(importeTotalEfectivo);
|
||||
ccPtoVta.setPuntoVenta(new PuntoVenta(puntoVentaId));
|
||||
ccPtoVta.setTurno(new Turno(turnoId));
|
||||
ccPtoVta.setUsuarioModifId(usuarioId);
|
||||
ccPtoVta.setUsuario(new Usuario(usuarioId));
|
||||
ccPtoVta.setTipoOperacionCC(new TipoOperacionCC(tipoOperacionCCId));
|
||||
ccPtoVta.setFecCorte(fecCorte);
|
||||
ccPtoVta.setFecHorOperacion(fecCorte);
|
||||
ccPtoVta.setTotalVentaSegOpcional(totalVentaSegOpcional);
|
||||
ccPtoVta.setTotalCancSegOpcional(totalCancSegOpcional);
|
||||
|
||||
getSession().save(ccPtoVta);
|
||||
|
||||
return ccPtoVta;
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,210 @@
|
|||
package com.rjconsultores.ventaboletos.entidad;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import com.rjconsultores.ventaboletos.enums.comissao.CoresConferencia;
|
||||
|
||||
@Entity
|
||||
@Table(name = "CONFERENCIA")
|
||||
@SequenceGenerator(name = "CONFERENCIA_SEQ", sequenceName = "CONFERENCIA_SEQ", allocationSize = 1)
|
||||
public class Conferencia implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "CONFERENCIA_SEQ")
|
||||
@Column(name = "CONFERENCIA_ID")
|
||||
private Long conferenciaId;
|
||||
|
||||
@Temporal(TemporalType.DATE)
|
||||
@Column(name = "DATAMOVIMENTO")
|
||||
private Date datamovimento;
|
||||
|
||||
@Column(name = "INDBOLETOGERADO")
|
||||
private Boolean indboletogerado;
|
||||
|
||||
@Column(name = "INDCONFERIDO")
|
||||
private Boolean indconferido;
|
||||
|
||||
@Column(name = "INDPENDENCIA")
|
||||
private Boolean indpendencia;
|
||||
|
||||
@Column(name = "INDSEMMOVIMENTO")
|
||||
private Boolean indsemmovimento;
|
||||
|
||||
@Column(name = "INDMALOTERECEBIDO")
|
||||
private Boolean indmaloterecebido;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "PUNTOVENTA_ID")
|
||||
private PuntoVenta puntoVenta;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "EMPRESA_ID")
|
||||
private Empresa empresa;
|
||||
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
|
||||
@Column(name = "FECMODIF")
|
||||
private Date fecmodif;
|
||||
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
|
||||
@Transient
|
||||
private CoresConferencia cor;
|
||||
|
||||
public Conferencia() {
|
||||
super();
|
||||
this.indboletogerado = Boolean.FALSE;
|
||||
this.indconferido = Boolean.FALSE;
|
||||
this.indpendencia = Boolean.FALSE;
|
||||
this.indsemmovimento = Boolean.FALSE;
|
||||
this.indmaloterecebido = Boolean.FALSE;
|
||||
}
|
||||
|
||||
public Long getConferenciaId() {
|
||||
return conferenciaId;
|
||||
}
|
||||
|
||||
public void setConferenciaId(Long conferenciaId) {
|
||||
this.conferenciaId = conferenciaId;
|
||||
}
|
||||
|
||||
public Date getDatamovimento() {
|
||||
return datamovimento;
|
||||
}
|
||||
|
||||
public void setDatamovimento(Date datamovimento) {
|
||||
this.datamovimento = datamovimento;
|
||||
}
|
||||
|
||||
public Boolean getIndboletogerado() {
|
||||
return indboletogerado;
|
||||
}
|
||||
|
||||
public void setIndboletogerado(Boolean indboletogerado) {
|
||||
this.indboletogerado = indboletogerado;
|
||||
}
|
||||
|
||||
public Boolean getIndconferido() {
|
||||
return indconferido;
|
||||
}
|
||||
|
||||
public void setIndconferido(Boolean indconferido) {
|
||||
this.indconferido = indconferido;
|
||||
}
|
||||
|
||||
public Boolean getIndpendencia() {
|
||||
return indpendencia;
|
||||
}
|
||||
|
||||
public void setIndpendencia(Boolean indpendencia) {
|
||||
this.indpendencia = indpendencia;
|
||||
}
|
||||
|
||||
public Boolean getIndsemmovimento() {
|
||||
return indsemmovimento;
|
||||
}
|
||||
|
||||
public void setIndsemmovimento(Boolean indsemmovimento) {
|
||||
this.indsemmovimento = indsemmovimento;
|
||||
}
|
||||
|
||||
public Boolean getIndmaloterecebido() {
|
||||
return indmaloterecebido;
|
||||
}
|
||||
|
||||
public void setIndmaloterecebido(Boolean indmaloterecebido) {
|
||||
this.indmaloterecebido = indmaloterecebido;
|
||||
}
|
||||
|
||||
public PuntoVenta getPuntoVenta() {
|
||||
return puntoVenta;
|
||||
}
|
||||
|
||||
public void setPuntoVenta(PuntoVenta puntoVenta) {
|
||||
this.puntoVenta = puntoVenta;
|
||||
}
|
||||
|
||||
public Empresa getEmpresa() {
|
||||
return empresa;
|
||||
}
|
||||
|
||||
public void setEmpresa(Empresa empresa) {
|
||||
this.empresa = empresa;
|
||||
}
|
||||
|
||||
public boolean isActivo() {
|
||||
return activo;
|
||||
}
|
||||
|
||||
public void setActivo(boolean activo) {
|
||||
this.activo = activo;
|
||||
}
|
||||
|
||||
public Date getFecmodif() {
|
||||
return fecmodif;
|
||||
}
|
||||
|
||||
public void setFecmodif(Date fecmodif) {
|
||||
this.fecmodif = fecmodif;
|
||||
}
|
||||
|
||||
public Integer getUsuarioId() {
|
||||
return usuarioId;
|
||||
}
|
||||
|
||||
public void setUsuarioId(Integer usuarioId) {
|
||||
this.usuarioId = usuarioId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((conferenciaId == null) ? 0 : conferenciaId.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
Conferencia other = (Conferencia) obj;
|
||||
if (conferenciaId == null) {
|
||||
if (other.conferenciaId != null)
|
||||
return false;
|
||||
} else if (!conferenciaId.equals(other.conferenciaId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public CoresConferencia getCor() {
|
||||
return cor;
|
||||
}
|
||||
|
||||
public void setCor(CoresConferencia cor) {
|
||||
this.cor = cor;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,371 @@
|
|||
package com.rjconsultores.ventaboletos.entidad;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
@Entity
|
||||
@Table(name = "CONTA_CORRENTE_PTOVTA")
|
||||
@SequenceGenerator(name = "CONTA_CORRENTE_PTOVTA_SEQ", sequenceName = "CONTA_CORRENTE_PTOVTA_SEQ", allocationSize = 1)
|
||||
public class ContaCorrentePtoVta implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "CONTA_CORRENTE_PTOVTA_SEQ")
|
||||
@Column(name = "CONTACORRENTEPTOVTA_ID")
|
||||
private Long contaCorrentePtoVtaId;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "PUNTOVENTA_ID")
|
||||
private PuntoVenta puntoVenta;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "EMPRESA_ID")
|
||||
private Empresa empresa;
|
||||
|
||||
@Temporal(TemporalType.DATE)
|
||||
@Column(name = "FECHOROPERACION")
|
||||
private Date fecHorOperacion;
|
||||
|
||||
@Column(name = "DESCOPERACION")
|
||||
private String descOperacion;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "TURNO_ID")
|
||||
private Turno turno;
|
||||
|
||||
@Temporal(TemporalType.DATE)
|
||||
@Column(name = "FECCORTE")
|
||||
private Date fecCorte;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "USUARIO_ID")
|
||||
private Usuario usuario;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "TIPOOPERACIONCC_ID")
|
||||
private TipoOperacionCC tipoOperacionCC;
|
||||
|
||||
@Column(name = "IMPORTE")
|
||||
private BigDecimal importe;
|
||||
|
||||
@Column(name = "IMPORTETARIFA")
|
||||
private BigDecimal importeTotalTarifa;
|
||||
|
||||
@Column(name = "IMPORTEPEDAGIO")
|
||||
private BigDecimal importeTotalPedagio;
|
||||
|
||||
@Column(name = "IMPORTETAXAEMBARQUE")
|
||||
private BigDecimal importeTotalTasaAbordaje;
|
||||
|
||||
@Column(name = "IMPORTESEGURO")
|
||||
private BigDecimal importeTotalSeguro;
|
||||
|
||||
@Column(name = "IMPORTEINGRESO")
|
||||
private BigDecimal importeTotalIngreso;
|
||||
|
||||
@Column(name = "IMPORTEEGRESO")
|
||||
private BigDecimal importeTotalEgreso;
|
||||
|
||||
@Column(name = "IMPORTEDEVOLUCION")
|
||||
private BigDecimal importeTotalDevolucion;
|
||||
|
||||
@Column(name = "IMPORTETROCA")
|
||||
private BigDecimal importeTotalTransferencia;
|
||||
|
||||
@Column(name = "IMPORTETOTALEFECTIVO")
|
||||
private BigDecimal importeTotalEfectivo;
|
||||
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
|
||||
@Column(name = "FECMODIF")
|
||||
private Date fecmodif;
|
||||
|
||||
@Column(name = "USUARIOMODIF_ID")
|
||||
private Integer usuarioModifId;
|
||||
|
||||
@Column(name = "TOTALVENTA_SEGOPCIONAL")
|
||||
private BigDecimal totalVentaSegOpcional;
|
||||
|
||||
@Column(name = "TOTALCANC_SEGOPCIONAL")
|
||||
private BigDecimal totalCancSegOpcional;
|
||||
|
||||
@Column(name = "FECHAMENTOCNTCORRENTE_ID")
|
||||
private Long fechamentocntcorrenteId;
|
||||
|
||||
public ContaCorrentePtoVta() {
|
||||
super();
|
||||
}
|
||||
|
||||
public ContaCorrentePtoVta(Long contaCorrentePtoVtaId) {
|
||||
this();
|
||||
this.contaCorrentePtoVtaId = contaCorrentePtoVtaId;
|
||||
}
|
||||
|
||||
public Long getContaCorrentePtoVtaId() {
|
||||
return contaCorrentePtoVtaId;
|
||||
}
|
||||
|
||||
public void setContaCorrentePtoVtaId(Long contaCorrentePtoVtaId) {
|
||||
this.contaCorrentePtoVtaId = contaCorrentePtoVtaId;
|
||||
}
|
||||
|
||||
public PuntoVenta getPuntoVenta() {
|
||||
return puntoVenta;
|
||||
}
|
||||
|
||||
public void setPuntoVenta(PuntoVenta puntoVenta) {
|
||||
this.puntoVenta = puntoVenta;
|
||||
}
|
||||
|
||||
public Empresa getEmpresa() {
|
||||
return empresa;
|
||||
}
|
||||
|
||||
public void setEmpresa(Empresa empresa) {
|
||||
this.empresa = empresa;
|
||||
}
|
||||
|
||||
public Date getFecHorOperacion() {
|
||||
return fecHorOperacion;
|
||||
}
|
||||
|
||||
public void setFecHorOperacion(Date fecHorOperacion) {
|
||||
this.fecHorOperacion = fecHorOperacion;
|
||||
}
|
||||
|
||||
public String getDescOperacion() {
|
||||
return descOperacion;
|
||||
}
|
||||
|
||||
public void setDescOperacion(String descOperacion) {
|
||||
this.descOperacion = descOperacion;
|
||||
}
|
||||
|
||||
public Turno getTurno() {
|
||||
return turno;
|
||||
}
|
||||
|
||||
public void setTurno(Turno turno) {
|
||||
this.turno = turno;
|
||||
}
|
||||
|
||||
public Date getFecCorte() {
|
||||
return fecCorte;
|
||||
}
|
||||
|
||||
public void setFecCorte(Date fecCorte) {
|
||||
this.fecCorte = fecCorte;
|
||||
}
|
||||
|
||||
public BigDecimal getImporte() {
|
||||
return importe;
|
||||
}
|
||||
|
||||
public void setImporte(BigDecimal importe) {
|
||||
this.importe = importe;
|
||||
}
|
||||
|
||||
public TipoOperacionCC getTipoOperacionCC() {
|
||||
return tipoOperacionCC;
|
||||
}
|
||||
|
||||
public void setTipoOperacionCC(TipoOperacionCC tipoOperacionCC) {
|
||||
this.tipoOperacionCC = tipoOperacionCC;
|
||||
}
|
||||
|
||||
public Boolean getActivo() {
|
||||
return activo;
|
||||
}
|
||||
|
||||
public void setActivo(Boolean activo) {
|
||||
this.activo = activo;
|
||||
}
|
||||
|
||||
public Date getFecmodif() {
|
||||
return fecmodif;
|
||||
}
|
||||
|
||||
public void setFecmodif(Date fecmodif) {
|
||||
this.fecmodif = fecmodif;
|
||||
}
|
||||
|
||||
public Integer getUsuarioModifId() {
|
||||
return usuarioModifId;
|
||||
}
|
||||
|
||||
public void setUsuarioModifId(Integer usuarioModifId) {
|
||||
this.usuarioModifId = usuarioModifId;
|
||||
}
|
||||
|
||||
public Usuario getUsuario() {
|
||||
return usuario;
|
||||
}
|
||||
|
||||
public void setUsuario(Usuario usuario) {
|
||||
this.usuario = usuario;
|
||||
}
|
||||
|
||||
public BigDecimal getImporteTotalTarifa() {
|
||||
return importeTotalTarifa;
|
||||
}
|
||||
|
||||
public void setImporteTotalTarifa(BigDecimal importeTotalTarifa) {
|
||||
this.importeTotalTarifa = importeTotalTarifa;
|
||||
}
|
||||
|
||||
public BigDecimal getImporteTotalPedagio() {
|
||||
return importeTotalPedagio;
|
||||
}
|
||||
|
||||
public void setImporteTotalPedagio(BigDecimal importeTotalPedagio) {
|
||||
this.importeTotalPedagio = importeTotalPedagio;
|
||||
}
|
||||
|
||||
public BigDecimal getImporteTotalTasaAbordaje() {
|
||||
return importeTotalTasaAbordaje;
|
||||
}
|
||||
|
||||
public void setImporteTotalTasaAbordaje(BigDecimal importeTotalTasaAbordaje) {
|
||||
this.importeTotalTasaAbordaje = importeTotalTasaAbordaje;
|
||||
}
|
||||
|
||||
public BigDecimal getImporteTotalSeguro() {
|
||||
return importeTotalSeguro;
|
||||
}
|
||||
|
||||
public void setImporteTotalSeguro(BigDecimal importeTotalSeguro) {
|
||||
this.importeTotalSeguro = importeTotalSeguro;
|
||||
}
|
||||
|
||||
public BigDecimal getImporteTotalIngreso() {
|
||||
return importeTotalIngreso;
|
||||
}
|
||||
|
||||
public void setImporteTotalIngreso(BigDecimal importeTotalIngreso) {
|
||||
this.importeTotalIngreso = importeTotalIngreso;
|
||||
}
|
||||
|
||||
public BigDecimal getImporteTotalEgreso() {
|
||||
return importeTotalEgreso;
|
||||
}
|
||||
|
||||
public void setImporteTotalEgreso(BigDecimal importeTotalEgreso) {
|
||||
this.importeTotalEgreso = importeTotalEgreso;
|
||||
}
|
||||
|
||||
public BigDecimal getImporteTotalDevolucion() {
|
||||
return importeTotalDevolucion;
|
||||
}
|
||||
|
||||
public void setImporteTotalDevolucion(BigDecimal importeTotalDevolucion) {
|
||||
this.importeTotalDevolucion = importeTotalDevolucion;
|
||||
}
|
||||
|
||||
public BigDecimal getImporteTotalTransferencia() {
|
||||
return importeTotalTransferencia;
|
||||
}
|
||||
|
||||
public void setImporteTotalTransferencia(BigDecimal importeTotalTransferencia) {
|
||||
this.importeTotalTransferencia = importeTotalTransferencia;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((contaCorrentePtoVtaId == null) ? 0 : contaCorrentePtoVtaId.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
ContaCorrentePtoVta other = (ContaCorrentePtoVta) obj;
|
||||
if (contaCorrentePtoVtaId == null) {
|
||||
if (other.contaCorrentePtoVtaId != null)
|
||||
return false;
|
||||
} else if (!contaCorrentePtoVtaId.equals(other.contaCorrentePtoVtaId))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
try {
|
||||
return "ContaCorrentePtoVta [contaCorrentePtoVtaId="
|
||||
+ contaCorrentePtoVtaId + ", puntoVenta=" + puntoVenta.getPuntoventaId()
|
||||
+ ", empresa=" + empresa.getEmpresaId() + ", fecHorOperacion="
|
||||
+ fecHorOperacion + ", descOperacion=" + descOperacion
|
||||
+ ", turno=" + turno.getTurnoId() + ", fecCorte=" + fecCorte + ", usuario="
|
||||
+ usuario.getUsuarioId() + ", tipoOperacionCC=" + tipoOperacionCC.getTipoOperacionCCId()
|
||||
+ ", importe=" + importe + ", importeTotalTarifa="
|
||||
+ importeTotalTarifa + ", importeTotalPedagio="
|
||||
+ importeTotalPedagio + ", importeTotalTasaAbordaje="
|
||||
+ importeTotalTasaAbordaje + ", importeTotalSeguro="
|
||||
+ importeTotalSeguro + ", importeTotalIngreso="
|
||||
+ importeTotalIngreso + ", importeTotalEgreso="
|
||||
+ importeTotalEgreso + ", importeTotalDevolucion="
|
||||
+ importeTotalDevolucion + ", importeTotalTransferencia="
|
||||
+ importeTotalTransferencia + ", activo=" + activo
|
||||
+ ", fecmodif=" + fecmodif + ", usuarioModifId="
|
||||
+ usuarioModifId + "]";
|
||||
} catch (Throwable e) {
|
||||
return super.toString();
|
||||
}
|
||||
}
|
||||
|
||||
public BigDecimal getTotalVentaSegOpcional() {
|
||||
return totalVentaSegOpcional;
|
||||
}
|
||||
|
||||
public void setTotalVentaSegOpcional(BigDecimal totalVentaSegOpcional) {
|
||||
this.totalVentaSegOpcional = totalVentaSegOpcional;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalCancSegOpcional() {
|
||||
return totalCancSegOpcional;
|
||||
}
|
||||
|
||||
public void setTotalCancSegOpcional(BigDecimal totalCancSegOpcional) {
|
||||
this.totalCancSegOpcional = totalCancSegOpcional;
|
||||
}
|
||||
|
||||
public BigDecimal getImporteTotalEfectivo() {
|
||||
return importeTotalEfectivo;
|
||||
}
|
||||
|
||||
public void setImporteTotalEfectivo(BigDecimal importeTotalEfectivo) {
|
||||
this.importeTotalEfectivo = importeTotalEfectivo;
|
||||
}
|
||||
|
||||
public Long getFechamentocntcorrenteId() {
|
||||
return fechamentocntcorrenteId;
|
||||
}
|
||||
|
||||
public void setFechamentocntcorrenteId(Long fechamentocntcorrenteId) {
|
||||
this.fechamentocntcorrenteId = fechamentocntcorrenteId;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,208 @@
|
|||
package com.rjconsultores.ventaboletos.entidad;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
import com.rjconsultores.ventaboletos.enums.comissao.StatusLogConferencia;
|
||||
import com.rjconsultores.ventaboletos.enums.comissao.TipoLogConferencia;
|
||||
|
||||
@Entity
|
||||
@Table(name = "LOG_CONFERENCIA")
|
||||
@SequenceGenerator(name = "LOG_CONFERENCIA_SEQ", sequenceName = "LOG_CONFERENCIA_SEQ", allocationSize = 1)
|
||||
public class LogConferencia implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "LOG_CONFERENCIA_SEQ")
|
||||
@Column(name = "LOGCONFERENCIA_ID")
|
||||
private Long logconferenciaId;
|
||||
|
||||
@Column(name = "OBSERVACAO")
|
||||
private String observacao;
|
||||
|
||||
@Column(name = "PRECO")
|
||||
private BigDecimal preco;
|
||||
|
||||
@Column(name = "ACTIVO")
|
||||
private boolean activo;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "FECMODIF")
|
||||
private Date fecmodif;
|
||||
|
||||
@Column(name = "BOLETO_ID")
|
||||
private Long boletoId;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "USUARIO_ID")
|
||||
private Usuario usuario;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "CONFERENCIA_ID")
|
||||
private Conferencia conferencia;
|
||||
|
||||
@Enumerated(EnumType.ORDINAL)
|
||||
@Column(name = "STATUS")
|
||||
private StatusLogConferencia status;
|
||||
|
||||
@Column(name = "EVENTOEXTRA_ID")
|
||||
private Long eventoextraId;
|
||||
|
||||
@Column(name = "OCD_ID")
|
||||
private Long ocdId;
|
||||
|
||||
@Enumerated(EnumType.ORDINAL)
|
||||
@Column(name = "TIPO")
|
||||
private TipoLogConferencia tipo;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "CONTACORRENTEPTOVTA_ID")
|
||||
private ContaCorrentePtoVta contaCorrentePtoVta;
|
||||
|
||||
public Long getLogconferenciaId() {
|
||||
return logconferenciaId;
|
||||
}
|
||||
|
||||
public void setLogconferenciaId(Long logconferenciaId) {
|
||||
this.logconferenciaId = logconferenciaId;
|
||||
}
|
||||
|
||||
public String getObservacao() {
|
||||
return observacao;
|
||||
}
|
||||
|
||||
public void setObservacao(String observacao) {
|
||||
this.observacao = observacao;
|
||||
}
|
||||
|
||||
public BigDecimal getPreco() {
|
||||
return preco;
|
||||
}
|
||||
|
||||
public void setPreco(BigDecimal preco) {
|
||||
this.preco = preco;
|
||||
}
|
||||
|
||||
public boolean isActivo() {
|
||||
return activo;
|
||||
}
|
||||
|
||||
public void setActivo(boolean activo) {
|
||||
this.activo = activo;
|
||||
}
|
||||
|
||||
public Date getFecmodif() {
|
||||
return fecmodif;
|
||||
}
|
||||
|
||||
public void setFecmodif(Date fecmodif) {
|
||||
this.fecmodif = fecmodif;
|
||||
}
|
||||
|
||||
public Usuario getUsuario() {
|
||||
return usuario;
|
||||
}
|
||||
|
||||
public void setUsuario(Usuario usuario) {
|
||||
this.usuario = usuario;
|
||||
}
|
||||
|
||||
public Conferencia getConferencia() {
|
||||
return conferencia;
|
||||
}
|
||||
|
||||
public void setConferencia(Conferencia conferencia) {
|
||||
this.conferencia = conferencia;
|
||||
}
|
||||
|
||||
public StatusLogConferencia getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(StatusLogConferencia status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((logconferenciaId == null) ? 0 : logconferenciaId.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
LogConferencia other = (LogConferencia) obj;
|
||||
if (logconferenciaId == null) {
|
||||
if (other.logconferenciaId != null)
|
||||
return false;
|
||||
} else if (!logconferenciaId.equals(other.logconferenciaId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public Long getEventoextraId() {
|
||||
return eventoextraId;
|
||||
}
|
||||
|
||||
public void setEventoextraId(Long eventoextraId) {
|
||||
this.eventoextraId = eventoextraId;
|
||||
}
|
||||
|
||||
public Long getOcdId() {
|
||||
return ocdId;
|
||||
}
|
||||
|
||||
public void setOcdId(Long ocdId) {
|
||||
this.ocdId = ocdId;
|
||||
}
|
||||
|
||||
public TipoLogConferencia getTipo() {
|
||||
return tipo;
|
||||
}
|
||||
|
||||
public void setTipo(TipoLogConferencia tipo) {
|
||||
this.tipo = tipo;
|
||||
}
|
||||
|
||||
public Long getBoletoId() {
|
||||
return boletoId;
|
||||
}
|
||||
|
||||
public void setBoletoId(Long boletoId) {
|
||||
this.boletoId = boletoId;
|
||||
}
|
||||
|
||||
public ContaCorrentePtoVta getContaCorrentePtoVta() {
|
||||
return contaCorrentePtoVta;
|
||||
}
|
||||
|
||||
public void setContaCorrentePtoVta(ContaCorrentePtoVta contaCorrentePtoVta) {
|
||||
this.contaCorrentePtoVta = contaCorrentePtoVta;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,131 @@
|
|||
package com.rjconsultores.ventaboletos.entidad;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
@Entity
|
||||
@Table(name = "TIPO_OPERACION_CC")
|
||||
public class TipoOperacionCC implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@Column(name = "TIPOOPERACIONCC_ID")
|
||||
private Integer tipoOperacionCCId;
|
||||
|
||||
@Column(name = "DESCTIPO")
|
||||
private String descTipo;
|
||||
|
||||
@Column(name = "CVETIPO")
|
||||
private String cveTipo;
|
||||
|
||||
@Column(name = "INDCREDITO")
|
||||
private Boolean indCredito;
|
||||
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
|
||||
@Temporal(TemporalType.DATE)
|
||||
@Column(name = "FECMODIF")
|
||||
private Date fecmodif;
|
||||
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
|
||||
public TipoOperacionCC() {
|
||||
super();
|
||||
}
|
||||
|
||||
public TipoOperacionCC(Integer tipoOperacionCCId) {
|
||||
this();
|
||||
this.tipoOperacionCCId = tipoOperacionCCId;
|
||||
}
|
||||
|
||||
public Integer getTipoOperacionCCId() {
|
||||
return tipoOperacionCCId;
|
||||
}
|
||||
|
||||
public void setTipoOperacionCCId(Integer tipoOperacionCCId) {
|
||||
this.tipoOperacionCCId = tipoOperacionCCId;
|
||||
}
|
||||
|
||||
public String getDescTipo() {
|
||||
return descTipo;
|
||||
}
|
||||
|
||||
public void setDescTipo(String descTipo) {
|
||||
this.descTipo = descTipo;
|
||||
}
|
||||
|
||||
public String getCveTipo() {
|
||||
return cveTipo;
|
||||
}
|
||||
|
||||
public void setCveTipo(String cveTipo) {
|
||||
this.cveTipo = cveTipo;
|
||||
}
|
||||
|
||||
public Boolean getIndCredito() {
|
||||
return indCredito;
|
||||
}
|
||||
|
||||
public void setIndCredito(Boolean indCredito) {
|
||||
this.indCredito = indCredito;
|
||||
}
|
||||
|
||||
public Boolean getActivo() {
|
||||
return activo;
|
||||
}
|
||||
|
||||
public void setActivo(Boolean activo) {
|
||||
this.activo = activo;
|
||||
}
|
||||
|
||||
public Date getFecmodif() {
|
||||
return fecmodif;
|
||||
}
|
||||
|
||||
public void setFecmodif(Date fecmodif) {
|
||||
this.fecmodif = fecmodif;
|
||||
}
|
||||
|
||||
public Integer getUsuarioId() {
|
||||
return usuarioId;
|
||||
}
|
||||
|
||||
public void setUsuarioId(Integer usuarioId) {
|
||||
this.usuarioId = usuarioId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((tipoOperacionCCId == null) ? 0 : tipoOperacionCCId.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
TipoOperacionCC other = (TipoOperacionCC) obj;
|
||||
if (tipoOperacionCCId == null) {
|
||||
if (other.tipoOperacionCCId != null)
|
||||
return false;
|
||||
} else if (!tipoOperacionCCId.equals(other.tipoOperacionCCId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -27,4 +27,26 @@ public enum IndStatusBoleto {
|
|||
return shortValue;
|
||||
}
|
||||
|
||||
public static IndStatusBoleto getIndStatusBoleto(String shortValue) {
|
||||
if(V.getShortValue().equals(shortValue)) {
|
||||
return V;
|
||||
} else if(C.getShortValue().equals(shortValue)) {
|
||||
return C;
|
||||
} else if(T.getShortValue().equals(shortValue)) {
|
||||
return T;
|
||||
} else if(E.getShortValue().equals(shortValue)) {
|
||||
return E;
|
||||
} else if(S.getShortValue().equals(shortValue)) {
|
||||
return S;
|
||||
} else if(X.getShortValue().equals(shortValue)) {
|
||||
return X;
|
||||
} else if(R.getShortValue().equals(shortValue)) {
|
||||
return R;
|
||||
} else if(M.getShortValue().equals(shortValue)) {
|
||||
return M;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.rjconsultores.ventaboletos.enums.comissao;
|
||||
|
||||
public enum BoletoStatusComissao {
|
||||
|
||||
BOLETOS,
|
||||
BOLETO_CANCELADO,
|
||||
BOLETO_DEVOLVIDO,
|
||||
BOLETO_MANUAL,
|
||||
GAP,
|
||||
GAP_CANCELADO,
|
||||
GAP_DEVOLVIDO;
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.rjconsultores.ventaboletos.enums.comissao;
|
||||
|
||||
public enum CoresConferencia {
|
||||
|
||||
AMARELO("/gui/img/comissao/amarelo.png"),
|
||||
AZUL("/gui/img/comissao/azul.png"),
|
||||
PRETO("/gui/img/comissao/preto.png"),
|
||||
BRANCO("/gui/img/comissao/branco.png"),
|
||||
LARANJA("/gui/img/comissao/laranja.png"),
|
||||
VERMELHO("/gui/img/comissao/vermelho.png");
|
||||
|
||||
private String url;
|
||||
|
||||
private CoresConferencia(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.rjconsultores.ventaboletos.enums.comissao;
|
||||
|
||||
public enum StatusLogConferencia {
|
||||
|
||||
CONFERIDO(0,"CONFERIDO"),
|
||||
PENDENCIA(1,"PENDÊNCIA");
|
||||
|
||||
private String descricao;
|
||||
private Integer value;
|
||||
|
||||
private StatusLogConferencia(Integer value, String descricao) {
|
||||
this.value = value;
|
||||
this.descricao = descricao;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.descricao;
|
||||
}
|
||||
|
||||
public static StatusLogConferencia getStatusLogConferencia(Integer value) {
|
||||
if(value == CONFERIDO.value) {
|
||||
return CONFERIDO;
|
||||
} else if(value == PENDENCIA.value) {
|
||||
return PENDENCIA;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.rjconsultores.ventaboletos.enums.comissao;
|
||||
|
||||
public enum TipoLogConferencia {
|
||||
|
||||
BOLETO(0, "Bilhete"),
|
||||
EVENTO_FINANCEIRO(1, "Evento Financeiro"),
|
||||
OCD(2, "OCD"),
|
||||
AVULSO(3, "Avulso");
|
||||
|
||||
private String descricao;
|
||||
private Integer value;
|
||||
|
||||
private TipoLogConferencia(Integer value, String descricao) {
|
||||
this.value = value;
|
||||
this.descricao = descricao;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.descricao;
|
||||
}
|
||||
|
||||
public static TipoLogConferencia getTipoLogConferencia(Integer value) {
|
||||
if(value == BOLETO.value) {
|
||||
return BOLETO;
|
||||
} else if(value == EVENTO_FINANCEIRO.value) {
|
||||
return EVENTO_FINANCEIRO;
|
||||
} else if(value == OCD.value) {
|
||||
return OCD;
|
||||
} else if(value == AVULSO.value) {
|
||||
return AVULSO;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Conferencia;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.LogConferencia;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.enums.comissao.BoletoStatusComissao;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.BoletoComissao;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.ConferenciaComissaoVO;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.EventosFinanceirosVO;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.LogConferenciaVO;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.OcdVO;
|
||||
|
||||
public interface ConferenciaComissaoService extends GenericService<Conferencia, Long> {
|
||||
|
||||
public Conferencia suscribirOrActualizacion(Conferencia entidad);
|
||||
|
||||
public List<ConferenciaComissaoVO> carregarConferenciaComissao(String competencia, Empresa empresa, PuntoVenta puntoVenta) throws BusinessException;
|
||||
|
||||
public Conferencia confirmarChegadaMalote(Conferencia conferencia) throws BusinessException;
|
||||
|
||||
public Conferencia encerrarMovimentoDiario(Conferencia conferencia) throws BusinessException;
|
||||
|
||||
public List<EventosFinanceirosVO> carregarEventosFinanceiros(Conferencia conferencia) throws BusinessException;
|
||||
|
||||
public List<LogConferenciaVO> carregarLogConferencia(Conferencia conferencia) throws BusinessException;
|
||||
|
||||
public LogConferencia suscribirLogConferencia(LogConferencia logConferencia) throws BusinessException;
|
||||
|
||||
public void borrarLogConferencia(LogConferencia logConferencia) throws BusinessException;
|
||||
|
||||
public LogConferencia obtenerLogConferenciaID(Long logconferenciaId);
|
||||
|
||||
public List<BoletoComissao> carregarBilhetesComissao(Conferencia conferencia, BoletoStatusComissao boletoStatusComissao) throws BusinessException;
|
||||
|
||||
public List<OcdVO> carregarOcds(Conferencia conferencia) throws BusinessException;
|
||||
|
||||
public Conferencia reabrirMovimentoDiario(Conferencia conferencia) throws BusinessException;
|
||||
|
||||
public Conferencia obtenerConferenciaDataMovimento(Date datamovimento) throws BusinessException;
|
||||
|
||||
}
|
|
@ -0,0 +1,137 @@
|
|||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.ConferenciaComissaoDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Conferencia;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.LogConferencia;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.enums.comissao.BoletoStatusComissao;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
import com.rjconsultores.ventaboletos.service.ConferenciaComissaoService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.BoletoComissao;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.ConferenciaComissaoVO;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.EventosFinanceirosVO;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.LogConferenciaVO;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.OcdVO;
|
||||
|
||||
@Service("conferenciaComissaoService")
|
||||
public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoService {
|
||||
|
||||
@Autowired
|
||||
private ConferenciaComissaoDAO conferenciaComissaoDAO;
|
||||
|
||||
@Override
|
||||
public List<Conferencia> obtenerTodos() {
|
||||
return conferenciaComissaoDAO.obtenerTodos();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Conferencia obtenerID(Long id) {
|
||||
return conferenciaComissaoDAO.obtenerID(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Conferencia suscribir(Conferencia entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
return conferenciaComissaoDAO.suscribir(entidad);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Conferencia actualizacion(Conferencia entidad) {
|
||||
return conferenciaComissaoDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void borrar(Conferencia entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.FALSE);
|
||||
conferenciaComissaoDAO.borrar(entidad);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ConferenciaComissaoVO> carregarConferenciaComissao(String competencia, Empresa empresa, PuntoVenta puntoVenta) throws BusinessException {
|
||||
return conferenciaComissaoDAO.carregarConferenciaComissao(competencia, empresa, puntoVenta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Conferencia confirmarChegadaMalote(Conferencia conferencia) throws BusinessException {
|
||||
return conferenciaComissaoDAO.confirmarChegadaMalote(conferencia);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Conferencia suscribirOrActualizacion(Conferencia entidad) {
|
||||
return conferenciaComissaoDAO.suscribirOrActualizacion(entidad);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Conferencia encerrarMovimentoDiario(Conferencia conferencia) throws BusinessException {
|
||||
conferencia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
conferencia.setFecmodif(Calendar.getInstance().getTime());
|
||||
return conferenciaComissaoDAO.encerrarMovimentoDiario(conferencia);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EventosFinanceirosVO> carregarEventosFinanceiros(Conferencia conferencia) throws BusinessException {
|
||||
return conferenciaComissaoDAO.carregarEventosFinanceiros(conferencia);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LogConferenciaVO> carregarLogConferencia(Conferencia conferencia) throws BusinessException {
|
||||
return conferenciaComissaoDAO.carregarLogConferencia(conferencia);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LogConferencia suscribirLogConferencia(LogConferencia logConferencia) throws BusinessException {
|
||||
logConferencia.setActivo(Boolean.TRUE);
|
||||
logConferencia.setUsuario(UsuarioLogado.getUsuarioLogado());
|
||||
logConferencia.setFecmodif(new Date());
|
||||
return conferenciaComissaoDAO.suscribirLogConferencia(logConferencia);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void borrarLogConferencia(LogConferencia logConferencia) throws BusinessException {
|
||||
logConferencia.setActivo(Boolean.FALSE);
|
||||
logConferencia.setUsuario(UsuarioLogado.getUsuarioLogado());
|
||||
logConferencia.setFecmodif(new Date());
|
||||
conferenciaComissaoDAO.borrarLogConferencia(logConferencia);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LogConferencia obtenerLogConferenciaID(Long logconferenciaId) {
|
||||
return conferenciaComissaoDAO.obtenerLogConferenciaID(logconferenciaId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BoletoComissao> carregarBilhetesComissao(Conferencia conferencia, BoletoStatusComissao boletoStatusComissao) throws BusinessException {
|
||||
return conferenciaComissaoDAO.carregarBilhetesComissao(conferencia, boletoStatusComissao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OcdVO> carregarOcds(Conferencia conferencia) throws BusinessException {
|
||||
return conferenciaComissaoDAO.carregarOcds(conferencia);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Conferencia reabrirMovimentoDiario(Conferencia conferencia) throws BusinessException {
|
||||
conferencia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
conferencia.setFecmodif(Calendar.getInstance().getTime());
|
||||
return conferenciaComissaoDAO.reabrirMovimentoDiario(conferencia);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Conferencia obtenerConferenciaDataMovimento(Date datamovimento) throws BusinessException {
|
||||
return conferenciaComissaoDAO.obtenerConferenciaDataMovimento(datamovimento);
|
||||
}
|
||||
|
||||
}
|
|
@ -237,9 +237,12 @@ public final class DateUtil {
|
|||
}
|
||||
|
||||
public static String getStringDate(java.util.Date d, String formato) {
|
||||
if(d != null) {
|
||||
DateFormat df = new SimpleDateFormat(formato);
|
||||
return df.format(d);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getStringDate(java.util.Date d) {
|
||||
return getStringDate(d, "dd/MM/yyyy");
|
||||
|
|
|
@ -7,6 +7,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||
|
||||
@XmlRootElement
|
||||
public class CajaVO {
|
||||
|
||||
private Long cajaId;
|
||||
private String numAsiento;
|
||||
private Integer categoriaId;
|
||||
|
@ -41,6 +42,9 @@ public class CajaVO {
|
|||
private Integer usuarioId;
|
||||
private String numAutorizacion;
|
||||
private String ordenSevicio;
|
||||
private String uf;
|
||||
private String desccategoria;
|
||||
|
||||
public Long getCajaId() {
|
||||
return cajaId;
|
||||
}
|
||||
|
@ -245,4 +249,16 @@ public class CajaVO {
|
|||
public void setNumPuntoVenta(String numPuntoVenta) {
|
||||
this.numPuntoVenta = numPuntoVenta;
|
||||
}
|
||||
public String getUf() {
|
||||
return uf;
|
||||
}
|
||||
public void setUf(String uf) {
|
||||
this.uf = uf;
|
||||
}
|
||||
public String getDesccategoria() {
|
||||
return desccategoria;
|
||||
}
|
||||
public void setDesccategoria(String desccategoria) {
|
||||
this.desccategoria = desccategoria;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,8 +2,11 @@ package com.rjconsultores.ventaboletos.vo.comissao;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.rjconsultores.ventaboletos.enums.comissao.StatusLogConferencia;
|
||||
|
||||
public class BoletoComissao {
|
||||
|
||||
private Long boletoId;
|
||||
private Integer empresaId;
|
||||
private Integer puntoVentaId;
|
||||
private String datavenda;
|
||||
|
@ -18,6 +21,13 @@ public class BoletoComissao {
|
|||
private BigDecimal seguroOpcional;
|
||||
private BigDecimal seguroOutros;
|
||||
private Boolean ptoVtaOrigem;
|
||||
private String numAsiento;
|
||||
private String numFolioSistema;
|
||||
private String numSeriePreimpresa;
|
||||
private String numFolioPreImpreso;
|
||||
private String uf;
|
||||
private String desccategoria;
|
||||
private Integer status;
|
||||
|
||||
public Integer getEmpresaId() {
|
||||
return empresaId;
|
||||
|
@ -131,4 +141,80 @@ public class BoletoComissao {
|
|||
this.indstatusboleto = indstatusboleto;
|
||||
}
|
||||
|
||||
public Long getBoletoId() {
|
||||
return boletoId;
|
||||
}
|
||||
|
||||
public void setBoletoId(Long boletoId) {
|
||||
this.boletoId = boletoId;
|
||||
}
|
||||
|
||||
public String getNumAsiento() {
|
||||
return numAsiento;
|
||||
}
|
||||
|
||||
public void setNumAsiento(String numAsiento) {
|
||||
this.numAsiento = numAsiento;
|
||||
}
|
||||
|
||||
public String getNumFolioSistema() {
|
||||
return numFolioSistema;
|
||||
}
|
||||
|
||||
public void setNumFolioSistema(String numFolioSistema) {
|
||||
this.numFolioSistema = numFolioSistema;
|
||||
}
|
||||
|
||||
public String getNumSeriePreimpresa() {
|
||||
return numSeriePreimpresa;
|
||||
}
|
||||
|
||||
public void setNumSeriePreimpresa(String numSeriePreimpresa) {
|
||||
this.numSeriePreimpresa = numSeriePreimpresa;
|
||||
}
|
||||
|
||||
public String getNumFolioPreImpreso() {
|
||||
return numFolioPreImpreso;
|
||||
}
|
||||
|
||||
public void setNumFolioPreImpreso(String numFolioPreImpreso) {
|
||||
this.numFolioPreImpreso = numFolioPreImpreso;
|
||||
}
|
||||
|
||||
public String getUf() {
|
||||
return uf;
|
||||
}
|
||||
|
||||
public void setUf(String uf) {
|
||||
this.uf = uf;
|
||||
}
|
||||
|
||||
public String getDesccategoria() {
|
||||
return desccategoria;
|
||||
}
|
||||
|
||||
public void setDesccategoria(String desccategoria) {
|
||||
this.desccategoria = desccategoria;
|
||||
}
|
||||
|
||||
public Boolean getPtoVtaOrigem() {
|
||||
return ptoVtaOrigem;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatusDescricao() {
|
||||
StatusLogConferencia statusLogConferencia = StatusLogConferencia.getStatusLogConferencia(status);
|
||||
if(statusLogConferencia != null) {
|
||||
return statusLogConferencia.toString();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,125 @@
|
|||
package com.rjconsultores.ventaboletos.vo.comissao;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class ConferenciaComissaoVO implements Comparable<ConferenciaComissaoVO> {
|
||||
|
||||
private Integer puntoventaId;
|
||||
private String nombpuntoventa;
|
||||
private String numPuntoVenta;
|
||||
private String competencia;
|
||||
private Date datamovimento;
|
||||
|
||||
private Set<Integer> diasSemMovimentos;
|
||||
|
||||
private List<DiaConferenciaComissaoVO> dias;
|
||||
|
||||
public ConferenciaComissaoVO() {
|
||||
super();
|
||||
}
|
||||
|
||||
public ConferenciaComissaoVO(Integer puntoventaId, String competencia) {
|
||||
this();
|
||||
this.puntoventaId = puntoventaId;
|
||||
this.competencia = competencia;
|
||||
}
|
||||
|
||||
public String getNombpuntoventa() {
|
||||
return nombpuntoventa;
|
||||
}
|
||||
|
||||
public void setNombpuntoventa(String nombpuntoventa) {
|
||||
this.nombpuntoventa = nombpuntoventa;
|
||||
}
|
||||
|
||||
public String getNumPuntoVenta() {
|
||||
return numPuntoVenta;
|
||||
}
|
||||
|
||||
public void setNumPuntoVenta(String numPuntoVenta) {
|
||||
this.numPuntoVenta = numPuntoVenta;
|
||||
}
|
||||
|
||||
public List<DiaConferenciaComissaoVO> getDias() {
|
||||
return dias;
|
||||
}
|
||||
|
||||
public void setDias(List<DiaConferenciaComissaoVO> dias) {
|
||||
this.dias = dias;
|
||||
}
|
||||
|
||||
public Integer getPuntoventaId() {
|
||||
return puntoventaId;
|
||||
}
|
||||
|
||||
public void setPuntoventaId(Integer puntoventaId) {
|
||||
this.puntoventaId = puntoventaId;
|
||||
}
|
||||
|
||||
public String getCompetencia() {
|
||||
return competencia;
|
||||
}
|
||||
|
||||
public void setCompetencia(String competencia) {
|
||||
this.competencia = competencia;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((competencia == null) ? 0 : competencia.hashCode());
|
||||
result = prime * result + ((puntoventaId == null) ? 0 : puntoventaId.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
ConferenciaComissaoVO other = (ConferenciaComissaoVO) obj;
|
||||
if (competencia == null) {
|
||||
if (other.competencia != null)
|
||||
return false;
|
||||
} else if (!competencia.equals(other.competencia))
|
||||
return false;
|
||||
if (puntoventaId == null) {
|
||||
if (other.puntoventaId != null)
|
||||
return false;
|
||||
} else if (!puntoventaId.equals(other.puntoventaId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public Set<Integer> getDiasSemMovimentos() {
|
||||
return diasSemMovimentos;
|
||||
}
|
||||
|
||||
public void setDiasSemMovimentos(Set<Integer> diasSemMovimentos) {
|
||||
this.diasSemMovimentos = diasSemMovimentos;
|
||||
}
|
||||
|
||||
public List<DiaConferenciaComissaoVO> getDiasOrdenado() {
|
||||
Collections.sort(getDias());
|
||||
return getDias();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(ConferenciaComissaoVO o) {
|
||||
return this.getNombpuntoventa().compareToIgnoreCase(o.getNombpuntoventa());
|
||||
}
|
||||
|
||||
public Date getDatamovimento() {
|
||||
return datamovimento;
|
||||
}
|
||||
|
||||
public void setDatamovimento(Date datamovimento) {
|
||||
this.datamovimento = datamovimento;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,140 @@
|
|||
package com.rjconsultores.ventaboletos.vo.comissao;
|
||||
|
||||
import com.rjconsultores.ventaboletos.enums.comissao.CoresConferencia;
|
||||
|
||||
public class DiaConferenciaComissaoVO implements Comparable<DiaConferenciaComissaoVO> {
|
||||
|
||||
private Integer dia;
|
||||
private Long conferenciaId;
|
||||
|
||||
private Boolean indboletogerado;
|
||||
private Boolean indconferido;
|
||||
private Boolean indpendencia;
|
||||
private Boolean indsemmovimento;
|
||||
private Boolean indmaloterecebido;
|
||||
|
||||
public DiaConferenciaComissaoVO() {
|
||||
super();
|
||||
}
|
||||
|
||||
public DiaConferenciaComissaoVO(Integer dia) {
|
||||
this();
|
||||
this.dia = dia;
|
||||
}
|
||||
|
||||
public Integer getDia() {
|
||||
return dia;
|
||||
}
|
||||
|
||||
public void setDia(Integer dia) {
|
||||
this.dia = dia;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((dia == null) ? 0 : dia.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
DiaConferenciaComissaoVO other = (DiaConferenciaComissaoVO) obj;
|
||||
if (dia == null) {
|
||||
if (other.dia != null)
|
||||
return false;
|
||||
} else if (!dia.equals(other.dia))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(DiaConferenciaComissaoVO o) {
|
||||
return this.getDia().compareTo(o.getDia());
|
||||
}
|
||||
|
||||
public CoresConferencia getCor() {
|
||||
CoresConferencia cor = CoresConferencia.BRANCO;
|
||||
|
||||
if (getIndsemmovimento() != null && getIndsemmovimento()) {
|
||||
cor = CoresConferencia.BRANCO;
|
||||
}
|
||||
|
||||
if ((getIndsemmovimento() == null || !getIndsemmovimento()) && (getIndmaloterecebido() == null || !getIndmaloterecebido())) {
|
||||
cor = CoresConferencia.PRETO;
|
||||
}
|
||||
|
||||
if (getIndmaloterecebido() != null && getIndmaloterecebido()) {
|
||||
if (getIndconferido() == null || !getIndconferido()) {
|
||||
cor = CoresConferencia.VERMELHO;
|
||||
}
|
||||
}
|
||||
|
||||
if (getIndconferido() != null && getIndconferido()) {
|
||||
if (getIndboletogerado() != null && getIndboletogerado()) {
|
||||
cor = CoresConferencia.AZUL;
|
||||
if (getIndpendencia() != null && getIndpendencia()) {
|
||||
cor = CoresConferencia.AMARELO;
|
||||
}
|
||||
} else if (getIndboletogerado() == null || !getIndboletogerado()) {
|
||||
cor = CoresConferencia.LARANJA;
|
||||
}
|
||||
}
|
||||
|
||||
return cor;
|
||||
}
|
||||
|
||||
public Boolean getIndboletogerado() {
|
||||
return indboletogerado;
|
||||
}
|
||||
|
||||
public void setIndboletogerado(Boolean indboletogerado) {
|
||||
this.indboletogerado = indboletogerado;
|
||||
}
|
||||
|
||||
public Boolean getIndconferido() {
|
||||
return indconferido;
|
||||
}
|
||||
|
||||
public void setIndconferido(Boolean indconferido) {
|
||||
this.indconferido = indconferido;
|
||||
}
|
||||
|
||||
public Boolean getIndpendencia() {
|
||||
return indpendencia;
|
||||
}
|
||||
|
||||
public void setIndpendencia(Boolean indpendencia) {
|
||||
this.indpendencia = indpendencia;
|
||||
}
|
||||
|
||||
public Boolean getIndsemmovimento() {
|
||||
return indsemmovimento;
|
||||
}
|
||||
|
||||
public void setIndsemmovimento(Boolean indsemmovimento) {
|
||||
this.indsemmovimento = indsemmovimento;
|
||||
}
|
||||
|
||||
public Boolean getIndmaloterecebido() {
|
||||
return indmaloterecebido;
|
||||
}
|
||||
|
||||
public void setIndmaloterecebido(Boolean indmaloterecebido) {
|
||||
this.indmaloterecebido = indmaloterecebido;
|
||||
}
|
||||
|
||||
public Long getConferenciaId() {
|
||||
return conferenciaId;
|
||||
}
|
||||
|
||||
public void setConferenciaId(Long conferenciaId) {
|
||||
this.conferenciaId = conferenciaId;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
package com.rjconsultores.ventaboletos.vo.comissao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.rjconsultores.ventaboletos.enums.comissao.StatusLogConferencia;
|
||||
|
||||
public class EventosFinanceirosVO {
|
||||
|
||||
private Long eventoextraId;
|
||||
private String numdocumento;
|
||||
private Date fechoringreso;
|
||||
private BigDecimal impingreso;
|
||||
private String desctipoevento;
|
||||
private String descinfo;
|
||||
private Integer status;
|
||||
|
||||
public Long getEventoextraId() {
|
||||
return eventoextraId;
|
||||
}
|
||||
|
||||
public void setEventoextraId(Long eventoextraId) {
|
||||
this.eventoextraId = eventoextraId;
|
||||
}
|
||||
|
||||
public String getNumdocumento() {
|
||||
return numdocumento;
|
||||
}
|
||||
|
||||
public void setNumdocumento(String numdocumento) {
|
||||
this.numdocumento = numdocumento;
|
||||
}
|
||||
|
||||
public Date getFechoringreso() {
|
||||
return fechoringreso;
|
||||
}
|
||||
|
||||
public void setFechoringreso(Date fechoringreso) {
|
||||
this.fechoringreso = fechoringreso;
|
||||
}
|
||||
|
||||
public BigDecimal getImpingreso() {
|
||||
return impingreso;
|
||||
}
|
||||
|
||||
public void setImpingreso(BigDecimal impingreso) {
|
||||
this.impingreso = impingreso;
|
||||
}
|
||||
|
||||
public String getDesctipoevento() {
|
||||
return desctipoevento;
|
||||
}
|
||||
|
||||
public void setDesctipoevento(String desctipoevento) {
|
||||
this.desctipoevento = desctipoevento;
|
||||
}
|
||||
|
||||
public String getDescinfo() {
|
||||
return descinfo;
|
||||
}
|
||||
|
||||
public void setDescinfo(String descinfo) {
|
||||
this.descinfo = descinfo;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatusDescricao() {
|
||||
StatusLogConferencia statusLogConferencia = StatusLogConferencia.getStatusLogConferencia(status);
|
||||
if(statusLogConferencia != null) {
|
||||
return statusLogConferencia.toString();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,181 @@
|
|||
package com.rjconsultores.ventaboletos.vo.comissao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.rjconsultores.ventaboletos.enums.comissao.StatusLogConferencia;
|
||||
import com.rjconsultores.ventaboletos.enums.comissao.TipoLogConferencia;
|
||||
|
||||
public class LogConferenciaVO {
|
||||
|
||||
private Long logconferenciaId;
|
||||
private String observacao;
|
||||
private BigDecimal preco;
|
||||
private Integer status;
|
||||
private String numfoliosistema;
|
||||
private Long boletoId;
|
||||
private Long eventoextraId;
|
||||
private Long ocdId;
|
||||
private Integer tipo;
|
||||
private String numoperacion;
|
||||
private String desctipoevento;
|
||||
private String nombusuario;
|
||||
private Date fecmodif;
|
||||
|
||||
public LogConferenciaVO() {
|
||||
super();
|
||||
}
|
||||
|
||||
public LogConferenciaVO(Long logconferenciaId, String observacao, BigDecimal preco, Integer status, String numfoliosistema) {
|
||||
this();
|
||||
this.logconferenciaId = logconferenciaId;
|
||||
this.observacao = observacao;
|
||||
this.preco = preco;
|
||||
this.status = status;
|
||||
this.numfoliosistema = numfoliosistema;
|
||||
}
|
||||
|
||||
public Long getLogconferenciaId() {
|
||||
return logconferenciaId;
|
||||
}
|
||||
|
||||
public void setLogconferenciaId(Long logconferenciaId) {
|
||||
this.logconferenciaId = logconferenciaId;
|
||||
}
|
||||
|
||||
public String getObservacao() {
|
||||
return observacao;
|
||||
}
|
||||
|
||||
public void setObservacao(String observacao) {
|
||||
this.observacao = observacao;
|
||||
}
|
||||
|
||||
public BigDecimal getPreco() {
|
||||
return preco;
|
||||
}
|
||||
|
||||
public void setPreco(BigDecimal preco) {
|
||||
this.preco = preco;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getNumfoliosistema() {
|
||||
return numfoliosistema;
|
||||
}
|
||||
|
||||
public void setNumfoliosistema(String numfoliosistema) {
|
||||
this.numfoliosistema = numfoliosistema;
|
||||
}
|
||||
|
||||
public String getStatusDescricao() {
|
||||
StatusLogConferencia statusLogConferencia = StatusLogConferencia.getStatusLogConferencia(status);
|
||||
if(statusLogConferencia != null) {
|
||||
return statusLogConferencia.toString();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public Long getEventoextraId() {
|
||||
return eventoextraId;
|
||||
}
|
||||
|
||||
public void setEventoextraId(Long eventoextraId) {
|
||||
this.eventoextraId = eventoextraId;
|
||||
}
|
||||
|
||||
public Long getOcdId() {
|
||||
return ocdId;
|
||||
}
|
||||
|
||||
public void setOcdId(Long ocdId) {
|
||||
this.ocdId = ocdId;
|
||||
}
|
||||
|
||||
public Integer getTipo() {
|
||||
return tipo;
|
||||
}
|
||||
|
||||
public void setTipo(Integer tipo) {
|
||||
this.tipo = tipo;
|
||||
}
|
||||
|
||||
public String getTipoDescricao() {
|
||||
TipoLogConferencia tipoLogConferencia = TipoLogConferencia.getTipoLogConferencia(tipo);
|
||||
if(tipoLogConferencia != null) {
|
||||
return tipoLogConferencia.toString();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getNumoperacion() {
|
||||
return numoperacion;
|
||||
}
|
||||
|
||||
public void setNumoperacion(String numoperacion) {
|
||||
this.numoperacion = numoperacion;
|
||||
}
|
||||
|
||||
public String getDesctipoevento() {
|
||||
return desctipoevento;
|
||||
}
|
||||
|
||||
public void setDesctipoevento(String desctipoevento) {
|
||||
this.desctipoevento = desctipoevento;
|
||||
}
|
||||
|
||||
public Long getBoletoId() {
|
||||
return boletoId;
|
||||
}
|
||||
|
||||
public void setBoletoId(Long boletoId) {
|
||||
this.boletoId = boletoId;
|
||||
}
|
||||
|
||||
public String getNombusuario() {
|
||||
return nombusuario;
|
||||
}
|
||||
|
||||
public void setNombusuario(String nombusuario) {
|
||||
this.nombusuario = nombusuario;
|
||||
}
|
||||
|
||||
public Date getFecmodif() {
|
||||
return fecmodif;
|
||||
}
|
||||
|
||||
public void setFecmodif(Date fecmodif) {
|
||||
this.fecmodif = fecmodif;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((logconferenciaId == null) ? 0 : logconferenciaId.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
LogConferenciaVO other = (LogConferenciaVO) obj;
|
||||
if (logconferenciaId == null) {
|
||||
if (other.logconferenciaId != null)
|
||||
return false;
|
||||
} else if (!logconferenciaId.equals(other.logconferenciaId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,179 @@
|
|||
package com.rjconsultores.ventaboletos.vo.comissao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.rjconsultores.ventaboletos.enums.comissao.StatusLogConferencia;
|
||||
|
||||
public class OcdVO {
|
||||
|
||||
private Long ocdId;
|
||||
|
||||
private Long boletoId;
|
||||
private Integer puntoventaId;
|
||||
|
||||
private String numoperacion;
|
||||
|
||||
private Date fecpagar;
|
||||
private BigDecimal valorPagar;
|
||||
private BigDecimal penalizacion;
|
||||
|
||||
private Integer usuarioIncId;
|
||||
private Date fecinc;
|
||||
|
||||
private Boolean indpago;
|
||||
private Integer usuarioPagoId;
|
||||
private Date fecpago;
|
||||
private Integer puntoventapagoId;
|
||||
|
||||
private Date fecmodif;
|
||||
private Integer usuarioId;
|
||||
private Boolean activo;
|
||||
|
||||
private Integer status;
|
||||
|
||||
public Long getOcdId() {
|
||||
return ocdId;
|
||||
}
|
||||
|
||||
public void setOcdId(Long ocdId) {
|
||||
this.ocdId = ocdId;
|
||||
}
|
||||
|
||||
public Long getBoletoId() {
|
||||
return boletoId;
|
||||
}
|
||||
|
||||
public void setBoletoId(Long boletoId) {
|
||||
this.boletoId = boletoId;
|
||||
}
|
||||
|
||||
public Integer getPuntoventaId() {
|
||||
return puntoventaId;
|
||||
}
|
||||
|
||||
public void setPuntoventaId(Integer puntoventaId) {
|
||||
this.puntoventaId = puntoventaId;
|
||||
}
|
||||
|
||||
public String getNumoperacion() {
|
||||
return numoperacion;
|
||||
}
|
||||
|
||||
public void setNumoperacion(String numoperacion) {
|
||||
this.numoperacion = numoperacion;
|
||||
}
|
||||
|
||||
public Date getFecpagar() {
|
||||
return fecpagar;
|
||||
}
|
||||
|
||||
public void setFecpagar(Date fecpagar) {
|
||||
this.fecpagar = fecpagar;
|
||||
}
|
||||
|
||||
public BigDecimal getValorPagar() {
|
||||
return valorPagar;
|
||||
}
|
||||
|
||||
public void setValorPagar(BigDecimal valorPagar) {
|
||||
this.valorPagar = valorPagar;
|
||||
}
|
||||
|
||||
public BigDecimal getPenalizacion() {
|
||||
return penalizacion;
|
||||
}
|
||||
|
||||
public void setPenalizacion(BigDecimal penalizacion) {
|
||||
this.penalizacion = penalizacion;
|
||||
}
|
||||
|
||||
public Integer getUsuarioIncId() {
|
||||
return usuarioIncId;
|
||||
}
|
||||
|
||||
public void setUsuarioIncId(Integer usuarioIncId) {
|
||||
this.usuarioIncId = usuarioIncId;
|
||||
}
|
||||
|
||||
public Date getFecinc() {
|
||||
return fecinc;
|
||||
}
|
||||
|
||||
public void setFecinc(Date fecinc) {
|
||||
this.fecinc = fecinc;
|
||||
}
|
||||
|
||||
public Boolean getIndpago() {
|
||||
return indpago;
|
||||
}
|
||||
|
||||
public void setIndpago(Boolean indpago) {
|
||||
this.indpago = indpago;
|
||||
}
|
||||
|
||||
public Integer getUsuarioPagoId() {
|
||||
return usuarioPagoId;
|
||||
}
|
||||
|
||||
public void setUsuarioPagoId(Integer usuarioPagoId) {
|
||||
this.usuarioPagoId = usuarioPagoId;
|
||||
}
|
||||
|
||||
public Date getFecpago() {
|
||||
return fecpago;
|
||||
}
|
||||
|
||||
public void setFecpago(Date fecpago) {
|
||||
this.fecpago = fecpago;
|
||||
}
|
||||
|
||||
public Integer getPuntoventapagoId() {
|
||||
return puntoventapagoId;
|
||||
}
|
||||
|
||||
public void setPuntoventapagoId(Integer puntoventapagoId) {
|
||||
this.puntoventapagoId = puntoventapagoId;
|
||||
}
|
||||
|
||||
public Date getFecmodif() {
|
||||
return fecmodif;
|
||||
}
|
||||
|
||||
public void setFecmodif(Date fecmodif) {
|
||||
this.fecmodif = fecmodif;
|
||||
}
|
||||
|
||||
public Integer getUsuarioId() {
|
||||
return usuarioId;
|
||||
}
|
||||
|
||||
public void setUsuarioId(Integer usuarioId) {
|
||||
this.usuarioId = usuarioId;
|
||||
}
|
||||
|
||||
public Boolean getActivo() {
|
||||
return activo;
|
||||
}
|
||||
|
||||
public void setActivo(Boolean activo) {
|
||||
this.activo = activo;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatusDescricao() {
|
||||
StatusLogConferencia statusLogConferencia = StatusLogConferencia.getStatusLogConferencia(status);
|
||||
if(statusLogConferencia != null) {
|
||||
return statusLogConferencia.toString();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue