bug#10822
dev:thiago qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@81498 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
20a7ed461d
commit
f46e67b9d1
|
@ -0,0 +1,7 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.IntegracaoTotvs;
|
||||
|
||||
public interface IntegracaoTotvsDAO extends GenericDAO<IntegracaoTotvs, Integer> {
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.hibernate.GenericHibernateDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.IntegracaoTotvs;
|
||||
|
||||
@Repository("IntgeracaoTotvsDAO")
|
||||
public class IntgeracaoTotvsHibernateDAO extends GenericHibernateDAO<IntegracaoTotvs, Integer>
|
||||
implements IntegracaoTotvsDAO {
|
||||
|
||||
@Autowired
|
||||
public IntgeracaoTotvsHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
}
|
|
@ -271,14 +271,14 @@ public class Caja implements java.io.Serializable {
|
|||
private String ccf;
|
||||
|
||||
@Temporal(TemporalType.DATE)
|
||||
@Column(name = "FECHORVENTA_H", length = 7)
|
||||
@Column(name = "FECHORVENTA_H")
|
||||
private Date fechorventaH;
|
||||
|
||||
@Column(name = "SERIEIMPFISCALORIGINAL", length = 6)
|
||||
private String serieimpfiscaloriginal;
|
||||
|
||||
@Column(name = "INDINTEGRADOAG", nullable = false, precision = 1, scale = 0)
|
||||
private boolean indintegradoag;
|
||||
@Column(name = "INDINTEGRADOAG", precision = 1, scale = 0)
|
||||
private Boolean indintegradoag;
|
||||
|
||||
@Column(name = "TRANSACAO_ID", precision = 15, scale = 0)
|
||||
private Long transacaoId;
|
||||
|
@ -313,6 +313,12 @@ public class Caja implements java.io.Serializable {
|
|||
@OneToMany(mappedBy = "caja")
|
||||
private List<CajaFormaPago> cajaFormaPago;
|
||||
|
||||
@Column(name = "INTEGRADOTOTVS", precision = 1, scale = 0)
|
||||
private Integer integradoTotvs;
|
||||
|
||||
@Column(name = "ERRO", precision = 1, scale = 0)
|
||||
private String erro;
|
||||
|
||||
public Caja() {
|
||||
}
|
||||
|
||||
|
@ -340,7 +346,7 @@ public class Caja implements java.io.Serializable {
|
|||
Integer levanteId, Integer rutaId, String serieimpfiscal, Date fecintegracion, Integer ptovtaventaId,
|
||||
Boolean indremotoinverso, Date fecnacimiento, String dispositivoembarcada, Long numerobilheteembarcada,
|
||||
String numasientovinculado, String ccf, Date fechorventaH, String serieimpfiscaloriginal,
|
||||
boolean indintegradoag, Long transacaoId, Long transacaooriginalId, String descnumdoc, String descnumdoc2,
|
||||
Boolean indintegradoag, Long transacaoId, Long transacaooriginalId, String descnumdoc, String descnumdoc2,
|
||||
String desctipodoc, String desctipodoc2, String desctelefono, Long aidfId, String nacionalidad,
|
||||
String sexo) {
|
||||
this.cajaId = cajaId;
|
||||
|
@ -1103,11 +1109,11 @@ public class Caja implements java.io.Serializable {
|
|||
this.serieimpfiscaloriginal = serieimpfiscaloriginal;
|
||||
}
|
||||
|
||||
public boolean isIndintegradoag() {
|
||||
public Boolean isIndintegradoag() {
|
||||
return this.indintegradoag;
|
||||
}
|
||||
|
||||
public void setIndintegradoag(boolean indintegradoag) {
|
||||
public void setIndintegradoag(Boolean indintegradoag) {
|
||||
this.indintegradoag = indintegradoag;
|
||||
}
|
||||
|
||||
|
@ -1199,4 +1205,20 @@ public class Caja implements java.io.Serializable {
|
|||
this.cajaFormaPago = cajaFormaPago;
|
||||
}
|
||||
|
||||
public Integer getIntegradoTotvs() {
|
||||
return integradoTotvs;
|
||||
}
|
||||
|
||||
public void setIntegradoTotvs(Integer integradoTotvs) {
|
||||
this.integradoTotvs = integradoTotvs;
|
||||
}
|
||||
|
||||
public String getErro() {
|
||||
return erro;
|
||||
}
|
||||
|
||||
public void setErro(String erro) {
|
||||
this.erro = erro;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,134 @@
|
|||
package com.rjconsultores.ventaboletos.entidad;
|
||||
|
||||
public class IntegracaoTotvs {
|
||||
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.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@SequenceGenerator(name = "INTEGRACAOTOTVS_SEQ", sequenceName = "INTEGRACAOTOTVS_SEQ", allocationSize = 1)
|
||||
@Table(name = "INTEGRACAO_TOTVS")
|
||||
public class IntegracaoTotvs implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "INTEGRACAOTOTVS_SEQ")
|
||||
@Column(name = "INTEGRACAOTOTVS_ID")
|
||||
private Integer integracaoTotvsId;
|
||||
@Column(name = "DESC_INTEGRACAO")
|
||||
private String descIntegracao;
|
||||
@Column(name = "ESQUEMACORRIDA_ID")
|
||||
private Integer esquemaCorridaId;
|
||||
@Column(name = "FECFIN")
|
||||
private Date fecFin;
|
||||
@Column(name = "FECINI")
|
||||
private Date fecInicio;
|
||||
@Column(name = "FECMODIF")
|
||||
private Date fecmodif;
|
||||
@Column(name = "PUNTOVENTA_ID")
|
||||
private Integer puntoVentaId;
|
||||
@Column(name = "EMPRESA_ID")
|
||||
private Integer empresaId;
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
@Column(name = "QTDEREGISTROSATUALIZADOS")
|
||||
private Integer qtdadeResgistrosAtualizados;
|
||||
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
|
||||
public Integer getIntegracaoTotvsId() {
|
||||
return integracaoTotvsId;
|
||||
}
|
||||
|
||||
public void setIntegracaoTotvsId(Integer integracaoTotvsId) {
|
||||
this.integracaoTotvsId = integracaoTotvsId;
|
||||
}
|
||||
|
||||
public String getDescIntegracao() {
|
||||
return descIntegracao;
|
||||
}
|
||||
|
||||
public void setDescIntegracao(String descIntegracao) {
|
||||
this.descIntegracao = descIntegracao;
|
||||
}
|
||||
|
||||
public Integer getEsquemaCorridaId() {
|
||||
return esquemaCorridaId;
|
||||
}
|
||||
|
||||
public void setEsquemaCorridaId(Integer esquemaCorridaId) {
|
||||
this.esquemaCorridaId = esquemaCorridaId;
|
||||
}
|
||||
|
||||
public Date getFecFin() {
|
||||
return fecFin;
|
||||
}
|
||||
|
||||
public void setFecFin(Date fecFin) {
|
||||
this.fecFin = fecFin;
|
||||
}
|
||||
|
||||
public Date getFecInicio() {
|
||||
return fecInicio;
|
||||
}
|
||||
|
||||
public void setFecInicio(Date fecInicio) {
|
||||
this.fecInicio = fecInicio;
|
||||
}
|
||||
|
||||
public Date getFecmodif() {
|
||||
return fecmodif;
|
||||
}
|
||||
|
||||
public void setFecmodif(Date fecmodif) {
|
||||
this.fecmodif = fecmodif;
|
||||
}
|
||||
|
||||
public Integer getPuntoVentaId() {
|
||||
return puntoVentaId;
|
||||
}
|
||||
|
||||
public void setPuntoVentaId(Integer puntoVentaId) {
|
||||
this.puntoVentaId = puntoVentaId;
|
||||
}
|
||||
|
||||
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 getQtdadeResgistrosAtualizados() {
|
||||
return qtdadeResgistrosAtualizados;
|
||||
}
|
||||
|
||||
public void setQtdadeResgistrosAtualizados(Integer qtdadeResgistrosAtualizados) {
|
||||
this.qtdadeResgistrosAtualizados = qtdadeResgistrosAtualizados;
|
||||
}
|
||||
|
||||
public Integer getEmpresaId() {
|
||||
return empresaId;
|
||||
}
|
||||
|
||||
public void setEmpresaId(Integer empresaId) {
|
||||
this.empresaId = empresaId;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.entidad.Usuario;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
|
||||
public interface IntegracaoTotvsService {
|
||||
|
@ -16,4 +17,6 @@ public interface IntegracaoTotvsService {
|
|||
|
||||
public List<PuntoVenta> buscaPuntoVentaEmpresa(Empresa empresa) throws Exception;
|
||||
|
||||
public Integer solicitaReIntegracaoBilhete(Empresa empresa, Date dataInicial, Date dataFinal, PuntoVenta puntoVenta, Usuario usuario) throws BusinessException;
|
||||
|
||||
}
|
|
@ -11,7 +11,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
|
@ -5,21 +5,27 @@ import java.util.List;
|
|||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.CajaDAO;
|
||||
import com.rjconsultores.ventaboletos.dao.CorridaDAO;
|
||||
import com.rjconsultores.ventaboletos.dao.EsquemaCorridaDAO;
|
||||
import com.rjconsultores.ventaboletos.dao.IntegracaoTotvsDAO;
|
||||
import com.rjconsultores.ventaboletos.dao.MarcaDAO;
|
||||
import com.rjconsultores.ventaboletos.dao.PuntoVentaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.IntegracaoTotvs;
|
||||
import com.rjconsultores.ventaboletos.entidad.Marca;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.entidad.Usuario;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
import com.rjconsultores.ventaboletos.service.IntegracaoTotvsService;
|
||||
|
||||
@Service("integracaoTotvsService")
|
||||
public class IntegracaoTotvsServiceImpl implements IntegracaoTotvsService {
|
||||
|
||||
private static final String BILHETE = "BILHETE";
|
||||
|
||||
@Autowired
|
||||
CajaDAO cajaDao;
|
||||
|
||||
|
@ -35,6 +41,9 @@ public class IntegracaoTotvsServiceImpl implements IntegracaoTotvsService {
|
|||
@Autowired
|
||||
EsquemaCorridaDAO esquemaCorridaDao;
|
||||
|
||||
@Autowired
|
||||
IntegracaoTotvsDAO integracaoTotvsDAO;
|
||||
|
||||
@Override
|
||||
public Integer atualizaStstausBilhetesIntegrar(Empresa empresa, Date dataInicial, Date dataFinal, PuntoVenta puntoVenta) throws BusinessException {
|
||||
Marca marca = null;
|
||||
|
@ -50,6 +59,26 @@ public class IntegracaoTotvsServiceImpl implements IntegracaoTotvsService {
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Integer solicitaReIntegracaoBilhete(Empresa empresa, Date dataInicial, Date dataFinal, PuntoVenta puntoVenta, Usuario usuario) throws BusinessException {
|
||||
Integer retorno = atualizaStstausBilhetesIntegrar(empresa, dataInicial, dataFinal, puntoVenta);
|
||||
if (retorno.intValue() > 0) {
|
||||
IntegracaoTotvs integracaoTotvs = new IntegracaoTotvs();
|
||||
integracaoTotvs.setDescIntegracao(BILHETE);
|
||||
integracaoTotvs.setFecInicio(dataInicial);
|
||||
integracaoTotvs.setFecFin(dataFinal);
|
||||
integracaoTotvs.setFecmodif(new Date());
|
||||
integracaoTotvs.setPuntoVentaId(puntoVenta.getPuntoventaId());
|
||||
integracaoTotvs.setEmpresaId(empresa.getEmpresaId());
|
||||
integracaoTotvs.setUsuarioId(usuario.getUsuarioId());
|
||||
integracaoTotvs.setActivo(Boolean.TRUE);
|
||||
integracaoTotvs.setQtdadeResgistrosAtualizados(retorno);
|
||||
integracaoTotvsDAO.suscribir(integracaoTotvs);
|
||||
}
|
||||
return retorno;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer atualizaStstausServicosIntegrar(Empresa empresa, Integer numServico) throws BusinessException {
|
||||
Marca marca = null;
|
||||
|
|
|
@ -251,6 +251,14 @@ public final class DateUtil {
|
|||
return null;
|
||||
}
|
||||
|
||||
public static String getStringDateHour(java.util.Date d) {
|
||||
if (d != null) {
|
||||
DateFormat df = new SimpleDateFormat(ddMMaaHHmm);
|
||||
return df.format(d);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getStringDate(java.util.Date d) {
|
||||
return getStringDate(d, "dd/MM/yyyy");
|
||||
}
|
||||
|
@ -660,6 +668,7 @@ public final class DateUtil {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Date getYesterdayDate() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DATE, -1);
|
||||
|
@ -668,6 +677,7 @@ public final class DateUtil {
|
|||
Date yesterday = calendar.getTime();
|
||||
return yesterday;
|
||||
}
|
||||
|
||||
public static String getYesterdayDateString() {
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
|
||||
Calendar cal = Calendar.getInstance();
|
||||
|
|
|
@ -196,6 +196,7 @@ public class MoneyHelper {
|
|||
|
||||
/**
|
||||
* Converte uma string no formato de moeda em um {@link BigDecimal}
|
||||
*
|
||||
* @param valor
|
||||
* @return
|
||||
*/
|
||||
|
@ -213,6 +214,11 @@ public class MoneyHelper {
|
|||
return null;
|
||||
}
|
||||
|
||||
public static String getValor(BigDecimal valor) {
|
||||
NumberFormat nf = NumberFormat.getInstance(Locale.getDefault());
|
||||
return nf.format(valor);
|
||||
}
|
||||
|
||||
public static BigDecimal arredondar(BigDecimal aNumber, int customScale) {
|
||||
return aNumber.setScale(customScale, ROUNDING_MODE);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue