fixed bug #9045
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@70606 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
5b1e210257
commit
21525227e5
|
@ -22,6 +22,8 @@ public interface ConferenciaComissaoDAO extends GenericDAO<Conferencia, Long> {
|
||||||
|
|
||||||
public List<ConferenciaComissaoVO> carregarConferenciaComissao(String competencia, Empresa empresa, PuntoVenta puntoVenta, Date dataMovimento) throws BusinessException;
|
public List<ConferenciaComissaoVO> carregarConferenciaComissao(String competencia, Empresa empresa, PuntoVenta puntoVenta, Date dataMovimento) throws BusinessException;
|
||||||
|
|
||||||
|
public List<ConferenciaComissaoVO> carregarConferenciaComissao(Date dataInicial, Date dataFinal, Empresa empresa, PuntoVenta puntoVenta, Date dataMovimento) throws BusinessException;
|
||||||
|
|
||||||
public Conferencia confirmarChegadaMalote(Conferencia conferencia) throws BusinessException;
|
public Conferencia confirmarChegadaMalote(Conferencia conferencia) throws BusinessException;
|
||||||
|
|
||||||
public Conferencia encerrarMovimentoDiario(Conferencia conferencia) throws BusinessException;
|
public Conferencia encerrarMovimentoDiario(Conferencia conferencia) throws BusinessException;
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.FechamentoParamptovta;
|
import com.rjconsultores.ventaboletos.entidad.FechamentoParamptovta;
|
||||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
|
|
||||||
|
@ -10,5 +11,6 @@ public interface FechamentoParamptovtaDAO extends GenericDAO<FechamentoParamptov
|
||||||
public List<FechamentoParamptovta> buscaParametrosPorEmpresas(List<Integer> empresasId);
|
public List<FechamentoParamptovta> buscaParametrosPorEmpresas(List<Integer> empresasId);
|
||||||
public List<FechamentoParamptovta> buscaParametrosPorEmpresa(Integer empresasId);
|
public List<FechamentoParamptovta> buscaParametrosPorEmpresa(Integer empresasId);
|
||||||
public List<FechamentoParamptovta> buscaParametrosPorPuntoventa(PuntoVenta puntoventa);
|
public List<FechamentoParamptovta> buscaParametrosPorPuntoventa(PuntoVenta puntoventa);
|
||||||
|
public FechamentoParamptovta buscaParametrosPorPuntoventa(PuntoVenta puntoventa, Empresa empresa);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
@ -82,8 +83,8 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
List<ConferenciaComissaoVO> lsConferencias = new ArrayList<ConferenciaComissaoVO>();
|
List<ConferenciaComissaoVO> lsConferencias = new ArrayList<ConferenciaComissaoVO>();
|
||||||
|
|
||||||
carregarPuntoVentas(lsConferencias, competencia, empresa, puntoVenta, dataMovimento);
|
carregarPuntoVentas(lsConferencias, competencia, empresa, puntoVenta, dataMovimento);
|
||||||
carregarConferenciasRegistradas(lsConferencias, competencia, empresa, puntoVenta, dataMovimento);
|
carregarConferenciasRegistradas(lsConferencias, competencia, empresa, puntoVenta, dataMovimento, null);
|
||||||
carregarMovimentoVendas(con, lsConferencias, competencia, empresa, puntoVenta, dataMovimento);
|
carregarMovimentoVendas(con, lsConferencias, competencia, empresa, puntoVenta, dataMovimento, null, null);
|
||||||
carregarDiasSemMovimento(lsConferencias, competencia, empresa, puntoVenta, dataMovimento);
|
carregarDiasSemMovimento(lsConferencias, competencia, empresa, puntoVenta, dataMovimento);
|
||||||
|
|
||||||
Collections.sort(lsConferencias);
|
Collections.sort(lsConferencias);
|
||||||
|
@ -106,6 +107,56 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<ConferenciaComissaoVO> carregarConferenciaComissao(Date dataInicial, Date dataFinal,
|
||||||
|
Empresa empresa, PuntoVenta puntoVenta, Date dataMovimento) throws BusinessException {
|
||||||
|
Connection con = null;
|
||||||
|
try {
|
||||||
|
con = getConnection();
|
||||||
|
|
||||||
|
List<ConferenciaComissaoVO> lsConferencias = new ArrayList<ConferenciaComissaoVO>();
|
||||||
|
Map<String, Object> parametros = carregarParametros(dataInicial, dataFinal, null, empresa, puntoVenta, dataMovimento);
|
||||||
|
|
||||||
|
SimpleDateFormat format = new SimpleDateFormat("MM/yyyy");
|
||||||
|
String competencia = format.format(dataInicial);
|
||||||
|
|
||||||
|
carregarPuntoVentas(lsConferencias, dataInicial, dataFinal, empresa, puntoVenta, dataMovimento);
|
||||||
|
carregarConferenciasRegistradas(lsConferencias, null, empresa, puntoVenta, dataMovimento, parametros);
|
||||||
|
carregarMovimentoVendas(con, lsConferencias, null, empresa, puntoVenta, dataMovimento, dataInicial, dataFinal);
|
||||||
|
carregarDiasSemMovimento(lsConferencias, competencia, empresa, puntoVenta, dataMovimento);
|
||||||
|
|
||||||
|
return lsConferencias;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
throw new BusinessException(e.getMessage(), e);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if (con != null && !con.isClosed()) {
|
||||||
|
con.close();
|
||||||
|
}
|
||||||
|
} catch (SQLException e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void carregarPuntoVentas(List<ConferenciaComissaoVO> lsConferencias, Date dataInicial, Date dataFinal,
|
||||||
|
Empresa empresa, PuntoVenta puntoVenta, Date dataMovimento) throws BusinessException {
|
||||||
|
|
||||||
|
Set<Integer> diasSemMovimentos = DateUtil.carregarDiasCompetencia(dataInicial, dataFinal, dataMovimento);
|
||||||
|
ConferenciaComissaoVO conferenciaComissao = new ConferenciaComissaoVO();
|
||||||
|
conferenciaComissao.setPuntoventaId(puntoVenta.getPuntoventaId());
|
||||||
|
conferenciaComissao.setNombpuntoventa(puntoVenta.getNombpuntoventa());
|
||||||
|
conferenciaComissao.setNumPuntoVenta(puntoVenta.getNumPuntoVenta());
|
||||||
|
conferenciaComissao.setDataInicial(dataInicial);
|
||||||
|
conferenciaComissao.setDataFinal(dataFinal);
|
||||||
|
conferenciaComissao.setDiasSemMovimentos(diasSemMovimentos);
|
||||||
|
lsConferencias.add(conferenciaComissao);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
private void carregarPuntoVentas(List<ConferenciaComissaoVO> lsConferencias, String competencia,
|
private void carregarPuntoVentas(List<ConferenciaComissaoVO> lsConferencias, String competencia,
|
||||||
Empresa empresa, PuntoVenta puntoVenta, Date dataMovimento) throws BusinessException {
|
Empresa empresa, PuntoVenta puntoVenta, Date dataMovimento) throws BusinessException {
|
||||||
try {
|
try {
|
||||||
|
@ -145,7 +196,7 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
.setResultTransformer(Transformers.aliasToBean(ConferenciaComissaoVO.class));
|
.setResultTransformer(Transformers.aliasToBean(ConferenciaComissaoVO.class));
|
||||||
setParametros(qr, parametros);
|
setParametros(qr, parametros);
|
||||||
|
|
||||||
processarQueryConferenciaComissao(qr.list(), lsConferencias, competencia, dataMovimento);
|
processarQueryConferenciaComissao(qr.list(), lsConferencias, competencia, dataMovimento, null, null);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
|
@ -154,9 +205,11 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
}
|
}
|
||||||
|
|
||||||
private void carregarConferenciasRegistradas(List<ConferenciaComissaoVO> lsConferencias,
|
private void carregarConferenciasRegistradas(List<ConferenciaComissaoVO> lsConferencias,
|
||||||
String competencia, Empresa empresa, PuntoVenta puntoVenta, Date dataMovimento) throws BusinessException {
|
String competencia, Empresa empresa, PuntoVenta puntoVenta, Date dataMovimento, Map<String, Object> parametros) throws BusinessException {
|
||||||
try {
|
try {
|
||||||
Map<String, Object> parametros = carregarParametros(competencia, empresa, puntoVenta, dataMovimento);
|
if(parametros == null){
|
||||||
|
parametros = carregarParametros(null, null, competencia, empresa, puntoVenta, dataMovimento);
|
||||||
|
}
|
||||||
StringBuilder sQuery = new StringBuilder("SELECT co FROM Conferencia co ");
|
StringBuilder sQuery = new StringBuilder("SELECT co FROM Conferencia co ");
|
||||||
sQuery.append("JOIN co.empresa em ").append("JOIN co.puntoVenta pv ")
|
sQuery.append("JOIN co.empresa em ").append("JOIN co.puntoVenta pv ")
|
||||||
.append("WHERE co.activo = 1 ");
|
.append("WHERE co.activo = 1 ");
|
||||||
|
@ -174,7 +227,7 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
|
|
||||||
Query qr = getSession().createQuery(sQuery.toString());
|
Query qr = getSession().createQuery(sQuery.toString());
|
||||||
setParametros(qr, parametros);
|
setParametros(qr, parametros);
|
||||||
processarQueryConferencia(qr.list(), lsConferencias, competencia, dataMovimento);
|
processarQueryConferencia(qr.list(), lsConferencias, competencia, dataMovimento, (Date) parametros.get("dataInicial"),(Date) parametros.get("dataFinal"));
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
|
@ -197,13 +250,14 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
}
|
}
|
||||||
|
|
||||||
private void carregarMovimentoVendas(Connection con, List<ConferenciaComissaoVO> lsConferencias,
|
private void carregarMovimentoVendas(Connection con, List<ConferenciaComissaoVO> lsConferencias,
|
||||||
String competencia, Empresa empresa, PuntoVenta puntoVenta, Date dataMovimento)
|
String competencia, Empresa empresa, PuntoVenta puntoVenta, Date dataMovimento, Date dataInicialDate, Date dataFinalDate)
|
||||||
throws BusinessException, SQLException {
|
throws BusinessException, SQLException {
|
||||||
PreparedStatement stmt = null;
|
PreparedStatement stmt = null;
|
||||||
ResultSet rset = null;
|
ResultSet rset = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Map<String, Object> parametros = carregarParametros(competencia, empresa, puntoVenta, dataMovimento);
|
|
||||||
|
Map<String, Object> parametros = carregarParametros(dataInicialDate, dataFinalDate, competencia, empresa, puntoVenta, dataMovimento);
|
||||||
|
|
||||||
StringBuilder sQuery = new StringBuilder()
|
StringBuilder sQuery = new StringBuilder()
|
||||||
.append("SELECT PV.PUNTOVENTA_ID AS \"puntoventaId\", PV.NUMPUNTOVENTA as \"numPuntoVenta\", ")
|
.append("SELECT PV.PUNTOVENTA_ID AS \"puntoventaId\", PV.NUMPUNTOVENTA as \"numPuntoVenta\", ")
|
||||||
.append("PV.NOMBPUNTOVENTA as \"nombpuntoventa\", TO_DATE(C.FECHORVENTA, 'DD/MM/YY') as \"datamovimento\" ")
|
.append("PV.NOMBPUNTOVENTA as \"nombpuntoventa\", TO_DATE(C.FECHORVENTA, 'DD/MM/YY') as \"datamovimento\" ")
|
||||||
|
@ -226,10 +280,14 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
stmt = con.prepareStatement(sQuery.toString());
|
stmt = con.prepareStatement(sQuery.toString());
|
||||||
String dataIncial = null;
|
String dataIncial = null;
|
||||||
String dataFinal = null;
|
String dataFinal = null;
|
||||||
if(parametros.get("dataInicial") instanceof String){
|
|
||||||
|
if (dataInicialDate != null) {
|
||||||
|
dataIncial = DateUtil.getStringDate(DateUtil.inicioFecha(dataInicialDate), "dd/MM/yyyy HH:mm");
|
||||||
|
dataFinal = DateUtil.getStringDate(DateUtil.fimFecha(dataFinalDate), "dd/MM/yyyy HH:mm");
|
||||||
|
} else if (parametros.get("dataInicial") instanceof String) {
|
||||||
dataIncial = (String) parametros.get("dataInicial");
|
dataIncial = (String) parametros.get("dataInicial");
|
||||||
dataFinal = (String) parametros.get("dataFinal");
|
dataFinal = (String) parametros.get("dataFinal");
|
||||||
}else{
|
} else {
|
||||||
dataIncial = DateUtil.getStringDate(DateUtil.inicioFecha((Date) parametros.get("dataInicial")), "dd/MM/yyyy HH:mm");
|
dataIncial = DateUtil.getStringDate(DateUtil.inicioFecha((Date) parametros.get("dataInicial")), "dd/MM/yyyy HH:mm");
|
||||||
dataFinal = DateUtil.getStringDate(DateUtil.fimFecha((Date) parametros.get("dataFinal")), "dd/MM/yyyy HH:mm");
|
dataFinal = DateUtil.getStringDate(DateUtil.fimFecha((Date) parametros.get("dataFinal")), "dd/MM/yyyy HH:mm");
|
||||||
}
|
}
|
||||||
|
@ -254,7 +312,7 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
movimentos.add(conferenciaComissao);
|
movimentos.add(conferenciaComissao);
|
||||||
}
|
}
|
||||||
|
|
||||||
processarQueryConferenciaComissao(movimentos, lsConferencias, competencia, dataMovimento);
|
processarQueryConferenciaComissao(movimentos, lsConferencias, competencia, dataMovimento, dataInicialDate, dataFinalDate);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
|
@ -281,16 +339,19 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
* @throws ParseException
|
* @throws ParseException
|
||||||
*/
|
*/
|
||||||
private void processarQueryConferenciaComissao(List<ConferenciaComissaoVO> lsQuery,
|
private void processarQueryConferenciaComissao(List<ConferenciaComissaoVO> lsQuery,
|
||||||
List<ConferenciaComissaoVO> lsConferencias, String competencia, Date dataMovimento ) throws ParseException {
|
List<ConferenciaComissaoVO> lsConferencias, String competencia, Date dataMovimento, Date dataInicial, Date dataFinal) throws ParseException {
|
||||||
Set<Integer> diasSemMovimentos = DateUtil.carregarDiasCompetencia(competencia, dataMovimento);
|
|
||||||
|
// Set<Integer> diasSemMovimentos = DateUtil.carregarDiasCompetencia(competencia, dataMovimento);
|
||||||
|
|
||||||
for (ConferenciaComissaoVO conferenciaComissaoMovimentoDiario : lsQuery) {
|
for (ConferenciaComissaoVO conferenciaComissaoMovimentoDiario : lsQuery) {
|
||||||
ConferenciaComissaoVO conferenciaComissao = new ConferenciaComissaoVO();
|
ConferenciaComissaoVO conferenciaComissao = new ConferenciaComissaoVO();
|
||||||
conferenciaComissao.setCompetencia(competencia);
|
conferenciaComissao.setCompetencia(competencia);
|
||||||
|
conferenciaComissao.setDataInicial(dataInicial);
|
||||||
|
conferenciaComissao.setDataFinal(dataFinal);
|
||||||
conferenciaComissao.setPuntoventaId(conferenciaComissaoMovimentoDiario.getPuntoventaId());
|
conferenciaComissao.setPuntoventaId(conferenciaComissaoMovimentoDiario.getPuntoventaId());
|
||||||
conferenciaComissao.setNumPuntoVenta(conferenciaComissaoMovimentoDiario.getNumPuntoVenta());
|
conferenciaComissao.setNumPuntoVenta(conferenciaComissaoMovimentoDiario.getNumPuntoVenta());
|
||||||
conferenciaComissao.setNombpuntoventa(conferenciaComissaoMovimentoDiario.getNombpuntoventa());
|
conferenciaComissao.setNombpuntoventa(conferenciaComissaoMovimentoDiario.getNombpuntoventa());
|
||||||
conferenciaComissao.setDiasSemMovimentos(new TreeSet<Integer>(diasSemMovimentos));
|
// conferenciaComissao.setDiasSemMovimentos(new TreeSet<Integer>(diasSemMovimentos));
|
||||||
|
|
||||||
if (lsConferencias.contains(conferenciaComissao)) {
|
if (lsConferencias.contains(conferenciaComissao)) {
|
||||||
conferenciaComissao = lsConferencias.get(lsConferencias.indexOf(conferenciaComissao));
|
conferenciaComissao = lsConferencias.get(lsConferencias.indexOf(conferenciaComissao));
|
||||||
|
@ -332,16 +393,21 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
* @throws ParseException
|
* @throws ParseException
|
||||||
*/
|
*/
|
||||||
private void processarQueryConferencia(List<Conferencia> lsQuery,
|
private void processarQueryConferencia(List<Conferencia> lsQuery,
|
||||||
List<ConferenciaComissaoVO> lsConferencias, String competencia, Date dataMovimento) throws ParseException {
|
List<ConferenciaComissaoVO> lsConferencias, String competencia, Date dataMovimento, Date dataInicial, Date dataFinal) throws ParseException {
|
||||||
if(lsQuery != null && !lsQuery.isEmpty()){
|
if (lsQuery != null && !lsQuery.isEmpty()) {
|
||||||
Set<Integer> diasSemMovimentos = DateUtil.carregarDiasCompetencia(competencia, dataMovimento);
|
Set<Integer> diasSemMovimentos = null;
|
||||||
|
if (competencia != null) {
|
||||||
|
diasSemMovimentos = DateUtil.carregarDiasCompetencia(competencia, dataMovimento);
|
||||||
|
}
|
||||||
for (Conferencia conferencia : lsQuery) {
|
for (Conferencia conferencia : lsQuery) {
|
||||||
ConferenciaComissaoVO conferenciaComissao = new ConferenciaComissaoVO();
|
ConferenciaComissaoVO conferenciaComissao = new ConferenciaComissaoVO();
|
||||||
conferenciaComissao.setCompetencia(competencia);
|
conferenciaComissao.setCompetencia(competencia);
|
||||||
|
conferenciaComissao.setDataInicial(dataInicial);
|
||||||
|
conferenciaComissao.setDataFinal(dataFinal);
|
||||||
conferenciaComissao.setPuntoventaId(conferencia.getPuntoVenta().getPuntoventaId());
|
conferenciaComissao.setPuntoventaId(conferencia.getPuntoVenta().getPuntoventaId());
|
||||||
conferenciaComissao.setNumPuntoVenta(conferencia.getPuntoVenta().getNumPuntoVenta());
|
conferenciaComissao.setNumPuntoVenta(conferencia.getPuntoVenta().getNumPuntoVenta());
|
||||||
conferenciaComissao.setNombpuntoventa(conferencia.getPuntoVenta().getNombpuntoventa());
|
conferenciaComissao.setNombpuntoventa(conferencia.getPuntoVenta().getNombpuntoventa());
|
||||||
conferenciaComissao.setDiasSemMovimentos(new TreeSet<Integer>(diasSemMovimentos));
|
conferenciaComissao.setDiasSemMovimentos(diasSemMovimentos == null ? null : new TreeSet<Integer>(diasSemMovimentos));
|
||||||
|
|
||||||
if (lsConferencias.contains(conferenciaComissao)) {
|
if (lsConferencias.contains(conferenciaComissao)) {
|
||||||
conferenciaComissao = lsConferencias.get(lsConferencias.indexOf(conferenciaComissao));
|
conferenciaComissao = lsConferencias.get(lsConferencias.indexOf(conferenciaComissao));
|
||||||
|
@ -354,9 +420,9 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
DiaConferenciaComissaoVO diaConferenciaComissao = new DiaConferenciaComissaoVO();
|
DiaConferenciaComissaoVO diaConferenciaComissao = new DiaConferenciaComissaoVO();
|
||||||
diaConferenciaComissao.setConferenciaId(conferencia.getConferenciaId());
|
diaConferenciaComissao.setConferenciaId(conferencia.getConferenciaId());
|
||||||
diaConferenciaComissao.setDia(dia);
|
diaConferenciaComissao.setDia(dia);
|
||||||
if(competencia !=null){
|
if (competencia != null) {
|
||||||
diaConferenciaComissao.setData(DateUtil.getDateFromString(dia + "/" + competencia, "dd/MM/yyyy"));
|
diaConferenciaComissao.setData(DateUtil.getDateFromString(dia + "/" + competencia, "dd/MM/yyyy"));
|
||||||
}else{
|
} else {
|
||||||
diaConferenciaComissao.setData(dataMovimento);
|
diaConferenciaComissao.setData(dataMovimento);
|
||||||
}
|
}
|
||||||
diaConferenciaComissao.setIndboletogerado(conferencia.getIndboletogerado());
|
diaConferenciaComissao.setIndboletogerado(conferencia.getIndboletogerado());
|
||||||
|
@ -387,9 +453,9 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
for (Integer diaSemMovimento : conferenciaComissao.getDiasSemMovimentos()) {
|
for (Integer diaSemMovimento : conferenciaComissao.getDiasSemMovimentos()) {
|
||||||
DiaConferenciaComissaoVO diaConferenciaComissao = new DiaConferenciaComissaoVO();
|
DiaConferenciaComissaoVO diaConferenciaComissao = new DiaConferenciaComissaoVO();
|
||||||
diaConferenciaComissao.setDia(diaSemMovimento);
|
diaConferenciaComissao.setDia(diaSemMovimento);
|
||||||
if(competencia ==null && diaSemMovimento!=null ){
|
if (competencia == null && diaSemMovimento != null) {
|
||||||
diaConferenciaComissao.setData(dataMovimento);
|
diaConferenciaComissao.setData(dataMovimento);
|
||||||
}else{
|
} else {
|
||||||
diaConferenciaComissao.setData(DateUtil.getDateFromString(diaSemMovimento + "/" + competencia, "dd/MM/yyyy"));
|
diaConferenciaComissao.setData(DateUtil.getDateFromString(diaSemMovimento + "/" + competencia, "dd/MM/yyyy"));
|
||||||
}
|
}
|
||||||
diaConferenciaComissao.setIndsemmovimento(true);
|
diaConferenciaComissao.setIndsemmovimento(true);
|
||||||
|
@ -403,7 +469,7 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String, Object> carregarParametros(String competencia, Empresa empresa,
|
private Map<String, Object> carregarParametros(Date dataInicial, Date dataFinal, String competencia, Empresa empresa,
|
||||||
PuntoVenta puntoVenta, Date datamovimento) throws ParseException {
|
PuntoVenta puntoVenta, Date datamovimento) throws ParseException {
|
||||||
Map<String, Object> parametros = new HashMap<String, Object>();
|
Map<String, Object> parametros = new HashMap<String, Object>();
|
||||||
if (empresa != null) {
|
if (empresa != null) {
|
||||||
|
@ -429,6 +495,10 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
parametros.put("dataFinal", DateUtil.getDateFromString(
|
parametros.put("dataFinal", DateUtil.getDateFromString(
|
||||||
cal.getActualMaximum(Calendar.DAY_OF_MONTH) + "/" + competencia + " 23:59:59", "dd/MM/yyyy hh:mm:ss"));
|
cal.getActualMaximum(Calendar.DAY_OF_MONTH) + "/" + competencia + " 23:59:59", "dd/MM/yyyy hh:mm:ss"));
|
||||||
}
|
}
|
||||||
|
if(parametros.get("dataInicial") == null && dataInicial != null){
|
||||||
|
parametros.put("dataInicial", dataInicial);
|
||||||
|
parametros.put("dataFinal", dataFinal);
|
||||||
|
}
|
||||||
|
|
||||||
return parametros;
|
return parametros;
|
||||||
}
|
}
|
||||||
|
@ -493,7 +563,7 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
private boolean isMovimentoDiarioBoletoGerado(Conferencia conferencia)
|
private boolean isMovimentoDiarioBoletoGerado(Conferencia conferencia)
|
||||||
throws BusinessException {
|
throws BusinessException {
|
||||||
try {
|
try {
|
||||||
Map<String, Object> parametros = carregarParametros(null, conferencia.getEmpresa(), conferencia.getPuntoVenta(), null);
|
Map<String, Object> parametros = carregarParametros(null, null, null, conferencia.getEmpresa(), conferencia.getPuntoVenta(), null);
|
||||||
StringBuilder sQuery = new StringBuilder()
|
StringBuilder sQuery = new StringBuilder()
|
||||||
.append("SELECT FECHAMENTOCNTCORRENTE_ID ")
|
.append("SELECT FECHAMENTOCNTCORRENTE_ID ")
|
||||||
.append("FROM FECHAMENTO_CNTCORRENTE ")
|
.append("FROM FECHAMENTO_CNTCORRENTE ")
|
||||||
|
@ -531,7 +601,7 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
public List<EventosFinanceirosVO> carregarEventosFinanceiros(Conferencia conferencia)
|
public List<EventosFinanceirosVO> carregarEventosFinanceiros(Conferencia conferencia)
|
||||||
throws BusinessException {
|
throws BusinessException {
|
||||||
try {
|
try {
|
||||||
Map<String, Object> parametros = carregarParametros(null, conferencia.getEmpresa(),
|
Map<String, Object> parametros = carregarParametros(null, null, null, conferencia.getEmpresa(),
|
||||||
conferencia.getPuntoVenta(), conferencia.getDatamovimento());
|
conferencia.getPuntoVenta(), conferencia.getDatamovimento());
|
||||||
StringBuilder sQuery = new StringBuilder()
|
StringBuilder sQuery = new StringBuilder()
|
||||||
.append("SELECT EE.BOLETO_ID AS \"boletoId\", EE.EVENTOEXTRA_ID AS \"eventoextraId\", EE.NUMDOCUMENTO AS \"numdocumento\", ")
|
.append("SELECT EE.BOLETO_ID AS \"boletoId\", EE.EVENTOEXTRA_ID AS \"eventoextraId\", EE.NUMDOCUMENTO AS \"numdocumento\", ")
|
||||||
|
@ -584,7 +654,13 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
.setResultTransformer(Transformers.aliasToBean(EventosFinanceirosVO.class));
|
.setResultTransformer(Transformers.aliasToBean(EventosFinanceirosVO.class));
|
||||||
setParametros(qr, parametros);
|
setParametros(qr, parametros);
|
||||||
|
|
||||||
return qr.list();
|
List<EventosFinanceirosVO> result = qr.list();
|
||||||
|
|
||||||
|
for(EventosFinanceirosVO e : result){
|
||||||
|
e.setConferencia(conferencia);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
|
@ -640,7 +716,13 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
.setResultTransformer(Transformers.aliasToBean(LogConferenciaVO.class));
|
.setResultTransformer(Transformers.aliasToBean(LogConferenciaVO.class));
|
||||||
qr.setParameter("conferenciaId", conferencia.getConferenciaId());
|
qr.setParameter("conferenciaId", conferencia.getConferenciaId());
|
||||||
|
|
||||||
return qr.list();
|
List<LogConferenciaVO> result = qr.list();
|
||||||
|
|
||||||
|
for(LogConferenciaVO l : result){
|
||||||
|
l.setConferencia(conferencia);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
|
@ -704,7 +786,7 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
public List<BoletoComissao> carregarBilhetesComissao(Conferencia conferencia)
|
public List<BoletoComissao> carregarBilhetesComissao(Conferencia conferencia)
|
||||||
throws BusinessException {
|
throws BusinessException {
|
||||||
try {
|
try {
|
||||||
Map<String, Object> parametros = carregarParametros(null, conferencia.getEmpresa(),
|
Map<String, Object> parametros = carregarParametros(null, null, null, conferencia.getEmpresa(),
|
||||||
conferencia.getPuntoVenta(), conferencia.getDatamovimento());
|
conferencia.getPuntoVenta(), conferencia.getDatamovimento());
|
||||||
|
|
||||||
StringBuilder sQuery = new StringBuilder()
|
StringBuilder sQuery = new StringBuilder()
|
||||||
|
@ -795,6 +877,7 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
for (BoletoComissao boletoComissao : auxLsBoletoComissao) {
|
for (BoletoComissao boletoComissao : auxLsBoletoComissao) {
|
||||||
if (boletoComissao.getFormapagos() == null) {
|
if (boletoComissao.getFormapagos() == null) {
|
||||||
boletoComissao.setFormapagos(new ArrayList<FormapagoVO>());
|
boletoComissao.setFormapagos(new ArrayList<FormapagoVO>());
|
||||||
|
boletoComissao.setConferencia(conferencia);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lsBoletoComissao.contains(boletoComissao)) {
|
if (lsBoletoComissao.contains(boletoComissao)) {
|
||||||
|
@ -837,7 +920,7 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
@Override
|
@Override
|
||||||
public List<OcdVO> carregarOcds(Conferencia conferencia) throws BusinessException {
|
public List<OcdVO> carregarOcds(Conferencia conferencia) throws BusinessException {
|
||||||
try {
|
try {
|
||||||
Map<String, Object> parametros = carregarParametros(null, conferencia.getEmpresa(),
|
Map<String, Object> parametros = carregarParametros(null, null, null, conferencia.getEmpresa(),
|
||||||
conferencia.getPuntoVenta(), conferencia.getDatamovimento());
|
conferencia.getPuntoVenta(), conferencia.getDatamovimento());
|
||||||
|
|
||||||
StringBuilder sQuery = new StringBuilder()
|
StringBuilder sQuery = new StringBuilder()
|
||||||
|
@ -882,7 +965,13 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
.setResultTransformer(Transformers.aliasToBean(OcdVO.class));
|
.setResultTransformer(Transformers.aliasToBean(OcdVO.class));
|
||||||
setParametros(qr, parametros);
|
setParametros(qr, parametros);
|
||||||
|
|
||||||
return qr.list();
|
List<OcdVO> result = qr.list();
|
||||||
|
|
||||||
|
for(OcdVO ocd : result){
|
||||||
|
ocd.setConferencia(conferencia);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
|
@ -988,7 +1077,7 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
try {
|
try {
|
||||||
List<ConferenciaComissaoVO> lsConferencias = new ArrayList<ConferenciaComissaoVO>();
|
List<ConferenciaComissaoVO> lsConferencias = new ArrayList<ConferenciaComissaoVO>();
|
||||||
|
|
||||||
carregarConferenciasRegistradas(lsConferencias, competencia, empresa, puntoVenta, null);
|
carregarConferenciasRegistradas(lsConferencias, competencia, empresa, puntoVenta, null, null);
|
||||||
carregarDiasSemMovimento(lsConferencias, competencia, empresa, puntoVenta, null);
|
carregarDiasSemMovimento(lsConferencias, competencia, empresa, puntoVenta, null);
|
||||||
|
|
||||||
for (ConferenciaComissaoVO conferenciaComissao : lsConferencias) {
|
for (ConferenciaComissaoVO conferenciaComissao : lsConferencias) {
|
||||||
|
@ -1029,7 +1118,7 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
Empresa empresa, PuntoVenta puntoVenta) throws BusinessException {
|
Empresa empresa, PuntoVenta puntoVenta) throws BusinessException {
|
||||||
try {
|
try {
|
||||||
String competencia = DateUtil.getStringDate(datamovimento, "MM/yyyy");
|
String competencia = DateUtil.getStringDate(datamovimento, "MM/yyyy");
|
||||||
Map<String, Object> parametros = carregarParametros(competencia, empresa, puntoVenta, null);
|
Map<String, Object> parametros = carregarParametros(null, null, competencia, empresa, puntoVenta, null);
|
||||||
StringBuilder sQuery = new StringBuilder("SELECT co FROM Conferencia co ")
|
StringBuilder sQuery = new StringBuilder("SELECT co FROM Conferencia co ")
|
||||||
.append("JOIN co.empresa em ").append("JOIN co.puntoVenta pv ")
|
.append("JOIN co.empresa em ").append("JOIN co.puntoVenta pv ")
|
||||||
.append("WHERE co.activo = 1 ")
|
.append("WHERE co.activo = 1 ")
|
||||||
|
@ -1048,7 +1137,7 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
qr.setParameter("dataFinal", datamovimento);
|
qr.setParameter("dataFinal", datamovimento);
|
||||||
|
|
||||||
List<ConferenciaComissaoVO> lsConferenciaComissao = new ArrayList<ConferenciaComissaoVO>();
|
List<ConferenciaComissaoVO> lsConferenciaComissao = new ArrayList<ConferenciaComissaoVO>();
|
||||||
processarQueryConferencia(qr.list(), lsConferenciaComissao, competencia, datamovimento);
|
processarQueryConferencia(qr.list(), lsConferenciaComissao, competencia, datamovimento, null, null);
|
||||||
|
|
||||||
if (!lsConferenciaComissao.isEmpty()) {
|
if (!lsConferenciaComissao.isEmpty()) {
|
||||||
for (DiaConferenciaComissaoVO diaConferenciaComissao : lsConferenciaComissao
|
for (DiaConferenciaComissaoVO diaConferenciaComissao : lsConferenciaComissao
|
||||||
|
|
|
@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.FechamentoParamptovtaDAO;
|
import com.rjconsultores.ventaboletos.dao.FechamentoParamptovtaDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.FechamentoParamptovta;
|
import com.rjconsultores.ventaboletos.entidad.FechamentoParamptovta;
|
||||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
@ -72,4 +73,14 @@ public class FechamentoParamptovtaHibernateDAO extends GenericHibernateDAO<Fecha
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FechamentoParamptovta buscaParametrosPorPuntoventa(PuntoVenta puntoventa, Empresa empresa) {
|
||||||
|
Criteria query = getSession().createCriteria(getPersistentClass());
|
||||||
|
query.add(Restrictions.eq("puntoventa", puntoventa));
|
||||||
|
query.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
query.add(Restrictions.eq("empresa", empresa));
|
||||||
|
|
||||||
|
return (FechamentoParamptovta) query.uniqueResult();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,8 @@ public interface ConferenciaComissaoService extends GenericService<Conferencia,
|
||||||
|
|
||||||
public List<ConferenciaComissaoVO> carregarConferenciaComissao(String competencia, Empresa empresa, PuntoVenta puntoVenta, Date dataMovimento) throws BusinessException;
|
public List<ConferenciaComissaoVO> carregarConferenciaComissao(String competencia, Empresa empresa, PuntoVenta puntoVenta, Date dataMovimento) throws BusinessException;
|
||||||
|
|
||||||
|
public List<ConferenciaComissaoVO> carregarConferenciaComissao(Date dataInicial, Date dataFinal, Empresa empresa, PuntoVenta puntoVenta, Date dataMovimento) throws BusinessException;
|
||||||
|
|
||||||
public Conferencia confirmarChegadaMalote(Conferencia conferencia) throws BusinessException;
|
public Conferencia confirmarChegadaMalote(Conferencia conferencia) throws BusinessException;
|
||||||
|
|
||||||
public Conferencia encerrarMovimentoDiario(Conferencia conferencia) throws BusinessException;
|
public Conferencia encerrarMovimentoDiario(Conferencia conferencia) throws BusinessException;
|
||||||
|
@ -43,6 +45,8 @@ public interface ConferenciaComissaoService extends GenericService<Conferencia,
|
||||||
|
|
||||||
public List<BoletoComissao> carregarBilhetesComissao(List<BoletoComissao> boletoComissaos, Conferencia conferencia, BoletoStatusComissao boletoStatusComissao, boolean carregarDadosFaltantes) throws BusinessException;
|
public List<BoletoComissao> carregarBilhetesComissao(List<BoletoComissao> boletoComissaos, Conferencia conferencia, BoletoStatusComissao boletoStatusComissao, boolean carregarDadosFaltantes) throws BusinessException;
|
||||||
|
|
||||||
|
public List<BoletoComissao> carregarBilhetesComissao(List<BoletoComissao> boletoComissaos, List<Conferencia> conferencias, BoletoStatusComissao boletoStatusComissao, boolean carregarDadosFaltantes) throws BusinessException;
|
||||||
|
|
||||||
public List<OcdVO> carregarOcds(Conferencia conferencia) throws BusinessException;
|
public List<OcdVO> carregarOcds(Conferencia conferencia) throws BusinessException;
|
||||||
|
|
||||||
public Conferencia reabrirMovimentoDiario(Conferencia conferencia) throws BusinessException;
|
public Conferencia reabrirMovimentoDiario(Conferencia conferencia) throws BusinessException;
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.FechamentoParamptovta;
|
import com.rjconsultores.ventaboletos.entidad.FechamentoParamptovta;
|
||||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
|
|
||||||
|
@ -11,5 +12,6 @@ public interface FechamentoParamptovtaService extends GenericService<FechamentoP
|
||||||
public List<FechamentoParamptovta> buscaParametrosPorEmpresa(Integer empresasId);
|
public List<FechamentoParamptovta> buscaParametrosPorEmpresa(Integer empresasId);
|
||||||
public FechamentoParamptovta suscribirOrActualizacion(FechamentoParamptovta FechamentoParamptovta);
|
public FechamentoParamptovta suscribirOrActualizacion(FechamentoParamptovta FechamentoParamptovta);
|
||||||
public List<FechamentoParamptovta> buscaParametrosPorPuntoventa(PuntoVenta puntoventa);
|
public List<FechamentoParamptovta> buscaParametrosPorPuntoventa(PuntoVenta puntoventa);
|
||||||
|
public FechamentoParamptovta buscaParametrosPorPuntoventaEmpresa(PuntoVenta puntoventa, Empresa empresa);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,6 +115,11 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
|
||||||
return conferenciaComissaoDAO.carregarConferenciaComissao(competencia, empresa, puntoVenta, dataMovimento);
|
return conferenciaComissaoDAO.carregarConferenciaComissao(competencia, empresa, puntoVenta, dataMovimento);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ConferenciaComissaoVO> carregarConferenciaComissao(Date dataInicial, Date dataFinal, Empresa empresa, PuntoVenta puntoVenta, Date dataMovimento) throws BusinessException {
|
||||||
|
return conferenciaComissaoDAO.carregarConferenciaComissao(dataInicial, dataFinal, empresa, puntoVenta, dataMovimento);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Conferencia confirmarChegadaMalote(Conferencia conferencia) throws BusinessException {
|
public Conferencia confirmarChegadaMalote(Conferencia conferencia) throws BusinessException {
|
||||||
conferencia.setDatamalote(new Date());
|
conferencia.setDatamalote(new Date());
|
||||||
|
@ -172,6 +177,68 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
|
||||||
return conferenciaComissaoDAO.obtenerLogConferenciaID(logconferenciaId);
|
return conferenciaComissaoDAO.obtenerLogConferenciaID(logconferenciaId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BoletoComissao> carregarBilhetesComissao(List<BoletoComissao> boletoComissaos, List<Conferencia> conferencias, BoletoStatusComissao boletoStatusComissao, boolean carregarDadosFaltantes) throws BusinessException {
|
||||||
|
|
||||||
|
List<BoletoComissao> retorno = new ArrayList<BoletoComissao>();
|
||||||
|
Boolean retornar = false;
|
||||||
|
|
||||||
|
for (Conferencia c : conferencias) {
|
||||||
|
|
||||||
|
if(retornar){
|
||||||
|
return retorno;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (boletoComissaos == null || boletoComissaos.isEmpty()) {
|
||||||
|
boletoComissaos = conferenciaComissaoDAO.carregarBilhetesComissao(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(boletoStatusComissao == null){
|
||||||
|
retorno.addAll(boletoComissaos);
|
||||||
|
boletoComissaos = null;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Empresa empresa = empresaDAO.obtenerID(c.getEmpresa().getEmpresaId());
|
||||||
|
ComEmpConferencia comEmpConferencia = null;
|
||||||
|
if (empresa.getComEmpConferencias() != null && !empresa.getComEmpConferencias().isEmpty()) {
|
||||||
|
comEmpConferencia = empresa.getComEmpConferencias().iterator().next();
|
||||||
|
}
|
||||||
|
retornar = true;
|
||||||
|
switch (boletoStatusComissao) {
|
||||||
|
case BOLETOS_VENDIDOS:
|
||||||
|
retorno.addAll(carregarBilhetesVendidos(boletoComissaos, comEmpConferencia, carregarDadosFaltantes));
|
||||||
|
break;
|
||||||
|
case BOLETO_MANUAL:
|
||||||
|
retorno.addAll(carregarBilhetesManuais(boletoComissaos, comEmpConferencia));
|
||||||
|
break;
|
||||||
|
case BOLETO_CANCELADO:
|
||||||
|
retorno.addAll(carregarBilhetesCancelados(boletoComissaos, comEmpConferencia, carregarDadosFaltantes));
|
||||||
|
break;
|
||||||
|
case BOLETO_DEVOLVIDO:
|
||||||
|
retorno.addAll(carregarBilhetesDevolvidos(boletoComissaos, StringUtils.isNotBlank(c.getNumfoliosistema()), comEmpConferencia, carregarDadosFaltantes));
|
||||||
|
break;
|
||||||
|
case GAP_VENDIDOS:
|
||||||
|
retorno.addAll(carregarBilhetesGapsVendidos(boletoComissaos, comEmpConferencia));
|
||||||
|
break;
|
||||||
|
case GAP_CANCELADO:
|
||||||
|
retorno.addAll(carregarBilhetesGapCancelados(boletoComissaos, comEmpConferencia));
|
||||||
|
break;
|
||||||
|
case GAP_DEVOLVIDO:
|
||||||
|
retorno.addAll(carregarBilhetesGapDevolvidos(boletoComissaos, comEmpConferencia));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return retorno;
|
||||||
|
}
|
||||||
|
|
||||||
|
return retorno;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BoletoComissao> carregarBilhetesComissao(List<BoletoComissao> boletoComissaos, Conferencia conferencia, BoletoStatusComissao boletoStatusComissao, boolean carregarDadosFaltantes) throws BusinessException {
|
public List<BoletoComissao> carregarBilhetesComissao(List<BoletoComissao> boletoComissaos, Conferencia conferencia, BoletoStatusComissao boletoStatusComissao, boolean carregarDadosFaltantes) throws BusinessException {
|
||||||
if (boletoComissaos == null) {
|
if (boletoComissaos == null) {
|
||||||
|
|
|
@ -8,6 +8,7 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.FechamentoParamptovtaDAO;
|
import com.rjconsultores.ventaboletos.dao.FechamentoParamptovtaDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.FechamentoParamptovta;
|
import com.rjconsultores.ventaboletos.entidad.FechamentoParamptovta;
|
||||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
import com.rjconsultores.ventaboletos.service.FechamentoParamptovtaService;
|
import com.rjconsultores.ventaboletos.service.FechamentoParamptovtaService;
|
||||||
|
@ -78,4 +79,9 @@ public class FechamentoParamptovtaServiceImpl implements FechamentoParamptovtaSe
|
||||||
List<FechamentoParamptovta> params = fechamentoParamptovtaDAO.buscaParametrosPorPuntoventa(puntoventa);
|
List<FechamentoParamptovta> params = fechamentoParamptovtaDAO.buscaParametrosPorPuntoventa(puntoventa);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FechamentoParamptovta buscaParametrosPorPuntoventaEmpresa(PuntoVenta puntoventa, Empresa empresa) {
|
||||||
|
return fechamentoParamptovtaDAO.buscaParametrosPorPuntoventa(puntoventa, empresa);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -612,6 +612,24 @@ public final class DateUtil {
|
||||||
return diasCompetencia;
|
return diasCompetencia;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Set<Integer> carregarDiasCompetencia(Date dataInicial, Date dataFinal, Date dataMovimento) {
|
||||||
|
Set<Integer> diasCompetencia = new TreeSet<Integer>();
|
||||||
|
|
||||||
|
Calendar cal = Calendar.getInstance();
|
||||||
|
|
||||||
|
cal.setTime(dataInicial);
|
||||||
|
Integer diaInicial = cal.get(Calendar.DAY_OF_MONTH);
|
||||||
|
|
||||||
|
cal.setTime(dataFinal);
|
||||||
|
Integer diaFinal = cal.get(Calendar.DAY_OF_MONTH);
|
||||||
|
|
||||||
|
for (int i = diaInicial; i <= diaFinal; i++) {
|
||||||
|
diasCompetencia.add(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
return diasCompetencia;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isCompetenciaValida(String competencia) {
|
public static boolean isCompetenciaValida(String competencia) {
|
||||||
if (StringUtils.isNotBlank(competencia)) {
|
if (StringUtils.isNotBlank(competencia)) {
|
||||||
String mesString = competencia.split("/")[0].replaceAll("_", "");
|
String mesString = competencia.split("/")[0].replaceAll("_", "");
|
||||||
|
|
|
@ -8,6 +8,7 @@ import org.apache.commons.lang.StringUtils;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.constantes.Constantes;
|
import com.rjconsultores.ventaboletos.constantes.Constantes;
|
||||||
import com.rjconsultores.ventaboletos.constantes.DescricaoTipoVenta;
|
import com.rjconsultores.ventaboletos.constantes.DescricaoTipoVenta;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Conferencia;
|
||||||
import com.rjconsultores.ventaboletos.enums.IndStatusBoleto;
|
import com.rjconsultores.ventaboletos.enums.IndStatusBoleto;
|
||||||
import com.rjconsultores.ventaboletos.enums.comissao.StatusLogConferencia;
|
import com.rjconsultores.ventaboletos.enums.comissao.StatusLogConferencia;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||||
|
@ -82,6 +83,8 @@ public class BoletoComissao {
|
||||||
|
|
||||||
private Long cajaId;
|
private Long cajaId;
|
||||||
|
|
||||||
|
private Conferencia conferencia;
|
||||||
|
|
||||||
public Integer getEmpresaId() {
|
public Integer getEmpresaId() {
|
||||||
return empresaId;
|
return empresaId;
|
||||||
}
|
}
|
||||||
|
@ -809,6 +812,10 @@ public class BoletoComissao {
|
||||||
return "C";
|
return "C";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getOrderDataMovimento(){
|
||||||
|
return conferencia.getDatamovimento();
|
||||||
|
}
|
||||||
|
|
||||||
/** Define bilhete na aba de venda manual */
|
/** Define bilhete na aba de venda manual */
|
||||||
public boolean isAbaBilheteManual() {
|
public boolean isAbaBilheteManual() {
|
||||||
return isBilhetesManualVendido() ||
|
return isBilhetesManualVendido() ||
|
||||||
|
@ -994,4 +1001,12 @@ public class BoletoComissao {
|
||||||
this.cajaId = cajaId;
|
this.cajaId = cajaId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Conferencia getConferencia() {
|
||||||
|
return conferencia;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConferencia(Conferencia conferencia) {
|
||||||
|
this.conferencia = conferencia;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,8 @@ public class ConferenciaComissaoVO implements Comparable<ConferenciaComissaoVO>
|
||||||
private String numPuntoVenta;
|
private String numPuntoVenta;
|
||||||
private String competencia;
|
private String competencia;
|
||||||
private Date datamovimento;
|
private Date datamovimento;
|
||||||
|
private Date dataInicial;
|
||||||
|
private Date dataFinal;
|
||||||
|
|
||||||
private Set<Integer> diasSemMovimentos;
|
private Set<Integer> diasSemMovimentos;
|
||||||
|
|
||||||
|
@ -105,7 +107,9 @@ public class ConferenciaComissaoVO implements Comparable<ConferenciaComissaoVO>
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<DiaConferenciaComissaoVO> getDiasOrdenado() {
|
public List<DiaConferenciaComissaoVO> getDiasOrdenado() {
|
||||||
|
if(getDias() != null){
|
||||||
Collections.sort(getDias());
|
Collections.sort(getDias());
|
||||||
|
}
|
||||||
return getDias();
|
return getDias();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,4 +126,20 @@ public class ConferenciaComissaoVO implements Comparable<ConferenciaComissaoVO>
|
||||||
this.datamovimento = datamovimento;
|
this.datamovimento = datamovimento;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getDataInicial() {
|
||||||
|
return dataInicial;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataInicial(Date dataInicial) {
|
||||||
|
this.dataInicial = dataInicial;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataFinal() {
|
||||||
|
return dataFinal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataFinal(Date dataFinal) {
|
||||||
|
this.dataFinal = dataFinal;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import java.util.Date;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.zkoss.util.resource.Labels;
|
import org.zkoss.util.resource.Labels;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Conferencia;
|
||||||
import com.rjconsultores.ventaboletos.enums.comissao.StatusLogConferencia;
|
import com.rjconsultores.ventaboletos.enums.comissao.StatusLogConferencia;
|
||||||
|
|
||||||
public class EventosFinanceirosVO {
|
public class EventosFinanceirosVO {
|
||||||
|
@ -35,6 +36,8 @@ public class EventosFinanceirosVO {
|
||||||
|
|
||||||
private String numFolioSistema;
|
private String numFolioSistema;
|
||||||
|
|
||||||
|
private Conferencia conferencia;
|
||||||
|
|
||||||
|
|
||||||
public Long getEventoextraId() {
|
public Long getEventoextraId() {
|
||||||
return eventoextraId;
|
return eventoextraId;
|
||||||
|
@ -207,6 +210,10 @@ public class EventosFinanceirosVO {
|
||||||
return "C";
|
return "C";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getOrderDataMovimento(){
|
||||||
|
return conferencia.getDatamovimento();
|
||||||
|
}
|
||||||
|
|
||||||
public Long getBoletoId() {
|
public Long getBoletoId() {
|
||||||
return boletoId;
|
return boletoId;
|
||||||
}
|
}
|
||||||
|
@ -223,5 +230,12 @@ public class EventosFinanceirosVO {
|
||||||
this.numFolioSistema = numFolioSistema;
|
this.numFolioSistema = numFolioSistema;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Conferencia getConferencia() {
|
||||||
|
return conferencia;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConferencia(Conferencia conferencia) {
|
||||||
|
this.conferencia = conferencia;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.constantes.DescricaoTipoVenta;
|
import com.rjconsultores.ventaboletos.constantes.DescricaoTipoVenta;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Conferencia;
|
||||||
import com.rjconsultores.ventaboletos.enums.comissao.StatusLogConferencia;
|
import com.rjconsultores.ventaboletos.enums.comissao.StatusLogConferencia;
|
||||||
import com.rjconsultores.ventaboletos.enums.comissao.TipoLogConferencia;
|
import com.rjconsultores.ventaboletos.enums.comissao.TipoLogConferencia;
|
||||||
|
|
||||||
|
@ -33,6 +34,7 @@ public class LogConferenciaVO {
|
||||||
private String descpendencia;
|
private String descpendencia;
|
||||||
private String descComportamentoData;
|
private String descComportamentoData;
|
||||||
private Long cajaId;
|
private Long cajaId;
|
||||||
|
private Conferencia conferencia;
|
||||||
private Integer pendenciaId;
|
private Integer pendenciaId;
|
||||||
|
|
||||||
public LogConferenciaVO() {
|
public LogConferenciaVO() {
|
||||||
|
@ -296,6 +298,18 @@ public class LogConferenciaVO {
|
||||||
this.cajaId = cajaId;
|
this.cajaId = cajaId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Conferencia getConferencia() {
|
||||||
|
return conferencia;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConferencia(Conferencia conferencia) {
|
||||||
|
this.conferencia = conferencia;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getOrderDataMovimento(){
|
||||||
|
return conferencia.getDatamovimento();
|
||||||
|
}
|
||||||
|
|
||||||
public Integer getPendenciaId() {
|
public Integer getPendenciaId() {
|
||||||
return pendenciaId;
|
return pendenciaId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import java.util.Date;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.zkoss.util.resource.Labels;
|
import org.zkoss.util.resource.Labels;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Conferencia;
|
||||||
import com.rjconsultores.ventaboletos.enums.comissao.StatusLogConferencia;
|
import com.rjconsultores.ventaboletos.enums.comissao.StatusLogConferencia;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.BigDecimalUtil;
|
import com.rjconsultores.ventaboletos.utilerias.BigDecimalUtil;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.LocaleUtil;
|
import com.rjconsultores.ventaboletos.utilerias.LocaleUtil;
|
||||||
|
@ -44,6 +45,8 @@ public class OcdVO {
|
||||||
|
|
||||||
private boolean exigeConferenciaAba;
|
private boolean exigeConferenciaAba;
|
||||||
|
|
||||||
|
private Conferencia conferencia;
|
||||||
|
|
||||||
public Long getOcdId() {
|
public Long getOcdId() {
|
||||||
return ocdId;
|
return ocdId;
|
||||||
}
|
}
|
||||||
|
@ -272,4 +275,16 @@ public class OcdVO {
|
||||||
return "C";
|
return "C";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Conferencia getConferencia() {
|
||||||
|
return conferencia;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConferencia(Conferencia conferencia) {
|
||||||
|
this.conferencia = conferencia;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getOrderDataMovimento(){
|
||||||
|
return conferencia.getDatamovimento();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue