fixes bug#24733
dev: Wallace qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@113560 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
288c0b72fe
commit
6a333e7692
|
@ -5,6 +5,7 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.ArquivoRemessa;
|
||||
import com.rjconsultores.ventaboletos.blocos.DetalheRetorno;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.FechamentoBoleto;
|
||||
|
||||
|
@ -34,5 +35,6 @@ public interface RemessaCNABBancosDAO extends GenericDAO<FechamentoBoleto, Long>
|
|||
|
||||
public FechamentoBoleto obtenerFechamentoBoletoPorNossoNumero(String nossoNumero, Integer empresaId);
|
||||
|
||||
public boolean quitarFechamentoBoleto(Long fechamentoboletoId, Integer usuarioId) throws SQLException;
|
||||
public boolean quitarFechamentoBoleto(Long fechamentoboletoId, Integer usuarioId, DetalheRetorno detalhe) throws SQLException;
|
||||
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ import com.rjconsultores.ventaboletos.ArquivoRemessa;
|
|||
import com.rjconsultores.ventaboletos.ArquivoRemessaItem;
|
||||
import com.rjconsultores.ventaboletos.ArquivoRemessaItemInteface;
|
||||
import com.rjconsultores.ventaboletos.blocos.DetalheObrigatorio;
|
||||
import com.rjconsultores.ventaboletos.blocos.DetalheRetorno;
|
||||
import com.rjconsultores.ventaboletos.blocos.RodapeRemessaPadrao;
|
||||
import com.rjconsultores.ventaboletos.blocos.bancobrasil.ArquivoRemessaBancoBrasil;
|
||||
import com.rjconsultores.ventaboletos.blocos.bancobrasil.CabecalhoLoteRemessaBancoBrasil;
|
||||
|
@ -1719,7 +1720,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean quitarFechamentoBoleto(Long fechamentoboletoId, Integer usuarioId) throws SQLException {
|
||||
public boolean quitarFechamentoBoleto(Long fechamentoboletoId, Integer usuarioId, DetalheRetorno detalhe) throws SQLException {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
Connection con = getSession().connection();
|
||||
|
@ -1729,8 +1730,16 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
StringBuilder qry = new StringBuilder();
|
||||
qry.append(" update FECHAMENTO_BOLETO set INDBOLETOQUITADO = 1, ");
|
||||
qry.append(" FECMODIF = SYSDATE, ");
|
||||
qry.append(" USUARIO_ID_QUITA = ").append(usuarioId);
|
||||
qry.append(" where FECHAMENTOBOLETO_ID = ").append(fechamentoboletoId);
|
||||
qry.append(" USUARIO_ID_QUITA = ").append(usuarioId);
|
||||
qry.append(" , FECBAIXA = sysdate ");
|
||||
|
||||
if( detalhe.getValorJuros() != null) {
|
||||
qry.append(" , VALOR_JUROS = ").append(detalhe.getValorJuros());
|
||||
}else {
|
||||
qry.append(" , VALOR_JUROS = 0 ");
|
||||
}
|
||||
|
||||
qry.append(" where FECHAMENTOBOLETO_ID = ").append(fechamentoboletoId);
|
||||
qry.append(" AND ACTIVO = 1 ");
|
||||
|
||||
|
||||
|
|
|
@ -42,9 +42,16 @@ public class FechamentoBoleto implements java.io.Serializable{
|
|||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date fecvencimento;
|
||||
|
||||
@Column(name = "FECBAIXA", length = 7)
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date fecbaixa;
|
||||
|
||||
@Column(name = "VALORDOCUMENTO")
|
||||
private BigDecimal valordocumento;
|
||||
|
||||
@Column(name = "VALOR_JUROS")
|
||||
private BigDecimal valorjuros;
|
||||
|
||||
@Column(name = "DESCONTOS")
|
||||
private BigDecimal descontos;
|
||||
|
||||
|
@ -91,6 +98,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
|||
public Long getFechamentoboletoId() {
|
||||
return fechamentoboletoId;
|
||||
}
|
||||
|
||||
public void setFechamentoboletoId(Long fechamentoboletoId) {
|
||||
this.fechamentoboletoId = fechamentoboletoId;
|
||||
}
|
||||
|
@ -98,6 +106,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
|||
public FechamentoCntcorrente getFechamentoCntcorrente() {
|
||||
return fechamentoCntcorrente;
|
||||
}
|
||||
|
||||
public void setFechamentoCntcorrente(FechamentoCntcorrente fechamentoCntcorrente) {
|
||||
this.fechamentoCntcorrente = fechamentoCntcorrente;
|
||||
}
|
||||
|
@ -105,6 +114,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
|||
public String getNossonumero() {
|
||||
return nossonumero;
|
||||
}
|
||||
|
||||
public void setNossonumero(String nossonumero) {
|
||||
this.nossonumero = nossonumero;
|
||||
}
|
||||
|
@ -112,6 +122,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
|||
public Date getFecdocumento() {
|
||||
return fecdocumento;
|
||||
}
|
||||
|
||||
public void setFecdocumento(Date fecdocumento) {
|
||||
this.fecdocumento = fecdocumento;
|
||||
}
|
||||
|
@ -119,6 +130,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
|||
public Date getFecvencimento() {
|
||||
return fecvencimento;
|
||||
}
|
||||
|
||||
public void setFecvencimento(Date fecvencimento) {
|
||||
this.fecvencimento = fecvencimento;
|
||||
}
|
||||
|
@ -126,6 +138,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
|||
public BigDecimal getValordocumento() {
|
||||
return valordocumento;
|
||||
}
|
||||
|
||||
public void setValordocumento(BigDecimal valordocumento) {
|
||||
this.valordocumento = valordocumento;
|
||||
}
|
||||
|
@ -133,6 +146,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
|||
public BigDecimal getDescontos() {
|
||||
return descontos;
|
||||
}
|
||||
|
||||
public void setDescontos(BigDecimal descontos) {
|
||||
this.descontos = descontos;
|
||||
}
|
||||
|
@ -140,6 +154,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
|||
public BigDecimal getDeducoes() {
|
||||
return deducoes;
|
||||
}
|
||||
|
||||
public void setDeducoes(BigDecimal deducoes) {
|
||||
this.deducoes = deducoes;
|
||||
}
|
||||
|
@ -147,6 +162,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
|||
public BigDecimal getMora() {
|
||||
return mora;
|
||||
}
|
||||
|
||||
public void setMora(BigDecimal mora) {
|
||||
this.mora = mora;
|
||||
}
|
||||
|
@ -154,6 +170,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
|||
public BigDecimal getAcrescimos() {
|
||||
return acrescimos;
|
||||
}
|
||||
|
||||
public void setAcrescimos(BigDecimal acrescimos) {
|
||||
this.acrescimos = acrescimos;
|
||||
}
|
||||
|
@ -161,6 +178,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
|||
public BigDecimal getValorCobrado() {
|
||||
return valorCobrado;
|
||||
}
|
||||
|
||||
public void setValorCobrado(BigDecimal valorCobrado) {
|
||||
this.valorCobrado = valorCobrado;
|
||||
}
|
||||
|
@ -168,6 +186,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
|||
public Date getFecmodif() {
|
||||
return fecmodif;
|
||||
}
|
||||
|
||||
public void setFecmodif(Date fecmodif) {
|
||||
this.fecmodif = fecmodif;
|
||||
}
|
||||
|
@ -175,6 +194,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
|||
public Integer getUsuarioId() {
|
||||
return usuarioId;
|
||||
}
|
||||
|
||||
public void setUsuarioId(Integer usuarioId) {
|
||||
this.usuarioId = usuarioId;
|
||||
}
|
||||
|
@ -182,6 +202,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
|||
public Boolean getActivo() {
|
||||
return activo;
|
||||
}
|
||||
|
||||
public void setActivo(Boolean activo) {
|
||||
this.activo = activo;
|
||||
}
|
||||
|
@ -189,36 +210,47 @@ public class FechamentoBoleto implements java.io.Serializable{
|
|||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Long getRemessaId() {
|
||||
return remessaId;
|
||||
}
|
||||
|
||||
public void setRemessaId(Long remessaId) {
|
||||
this.remessaId = remessaId;
|
||||
}
|
||||
|
||||
public BigDecimal getPorcentagemMulta() {
|
||||
return porcentagemMulta;
|
||||
}
|
||||
|
||||
public void setPorcentagemMulta(BigDecimal porcentagemMulta) {
|
||||
this.porcentagemMulta = porcentagemMulta;
|
||||
}
|
||||
|
||||
public BigDecimal getPorcentagemMora() {
|
||||
return porcentagemMora;
|
||||
}
|
||||
|
||||
public void setPorcentagemMora(BigDecimal porcentagemMora) {
|
||||
this.porcentagemMora = porcentagemMora;
|
||||
}
|
||||
|
||||
public Boolean getIndBoletoQuitado() {
|
||||
return indBoletoQuitado;
|
||||
}
|
||||
|
||||
public void setIndBoletoQuitado(Boolean indBoletoQuitado) {
|
||||
this.indBoletoQuitado = indBoletoQuitado;
|
||||
}
|
||||
|
||||
public Integer getUsuarioQuitacao() {
|
||||
return usuarioQuitacao;
|
||||
}
|
||||
|
||||
public void setUsuarioQuitacao(Integer usuarioQuitacao) {
|
||||
this.usuarioQuitacao = usuarioQuitacao;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.io.BufferedReader;
|
|||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
@ -134,6 +135,7 @@ public class ImportacaoRetornoBancarioServiceImpl implements ImportacaoRetornoBa
|
|||
if(linha.startsWith("1")) { //detalhe
|
||||
DetalheRetornoItau detalhe = new DetalheRetornoItau();
|
||||
detalhe.setCodigoOcorrencia(linha.substring(108, 110));
|
||||
detalhe.setValorJuros( new BigDecimal(linha.substring(263, 279)).divide(new BigDecimal(100)) );
|
||||
detalhe.setNossoNumero(linha.substring(85, 93)+"-"+linha.substring(93, 94));
|
||||
arquivo.addTitulo(detalhe);
|
||||
continue;
|
||||
|
@ -163,7 +165,7 @@ public class ImportacaoRetornoBancarioServiceImpl implements ImportacaoRetornoBa
|
|||
throw new RuntimeException("Boleto já quitado para a empresa com o nosso numero: "+detalhe.getNossoNumero());
|
||||
}
|
||||
|
||||
return remessaCNABBancosDAO.quitarFechamentoBoleto( boleto.getFechamentoboletoId(), usuarioId );
|
||||
return remessaCNABBancosDAO.quitarFechamentoBoleto( boleto.getFechamentoboletoId(), usuarioId, detalhe );
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -206,6 +206,16 @@ public final class DateUtil {
|
|||
d = df.parse(data);
|
||||
return d;
|
||||
}
|
||||
|
||||
public static java.sql.Timestamp getTimestampFromString(String data, String formato) throws java.text.ParseException {
|
||||
Date d = new Date();
|
||||
DateFormat df = new SimpleDateFormat(formato);
|
||||
|
||||
d = df.parse(data);
|
||||
return new java.sql.Timestamp(d.getTime());
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static int compareDate(java.util.Date d1) {
|
||||
return compareDate(d1, new java.util.Date());
|
||||
|
|
Loading…
Reference in New Issue