fixes bug#6270
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@44157 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
a6ee66b16b
commit
93336503df
|
@ -7,17 +7,19 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
|
|
||||||
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
|
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource;
|
import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource;
|
||||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
||||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioEmpresaCorridaBean;
|
import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioEmpresaCorridaBean;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
|
import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
|
||||||
|
|
||||||
public class RelatorioEmpresaCorrida extends Relatorio {
|
public class RelatorioEmpresaCorrida extends Relatorio {
|
||||||
|
private Logger log = LoggerFactory.getLogger(RelatorioEmpresaCorrida.class);
|
||||||
private List<RelatorioEmpresaCorridaBean> lsDadosRelatorio;
|
private List<RelatorioEmpresaCorridaBean> lsDadosRelatorio;
|
||||||
|
|
||||||
public RelatorioEmpresaCorrida(Map<String, Object> parametros, Connection conexao) throws Exception {
|
public RelatorioEmpresaCorrida(Map<String, Object> parametros, Connection conexao) throws Exception {
|
||||||
|
@ -35,8 +37,9 @@ public class RelatorioEmpresaCorrida extends Relatorio {
|
||||||
String fecFinal = parametros.get("fecFinal").toString() + " 23:59:59";
|
String fecFinal = parametros.get("fecFinal").toString() + " 23:59:59";
|
||||||
String empresa = parametros.get("empresa") != null ? parametros.get("empresa").toString() : "";
|
String empresa = parametros.get("empresa") != null ? parametros.get("empresa").toString() : "";
|
||||||
|
|
||||||
|
log.info("empresa:"+empresa+";fecinicio:"+fecInicio+";fecFinal:"+fecFinal);
|
||||||
String sql = getSql(empresa);
|
String sql = getSql(empresa);
|
||||||
System.out.println(sql);
|
log.info(sql);
|
||||||
|
|
||||||
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
|
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
|
||||||
ResultSet rset = null;
|
ResultSet rset = null;
|
||||||
|
@ -47,10 +50,13 @@ public class RelatorioEmpresaCorrida extends Relatorio {
|
||||||
if (empresa != null && !empresa.equals("")) {
|
if (empresa != null && !empresa.equals("")) {
|
||||||
stmt.setInt("empresa_id", Integer.parseInt(empresa));
|
stmt.setInt("empresa_id", Integer.parseInt(empresa));
|
||||||
}
|
}
|
||||||
|
log.info("Antes de enviar consulta para o banco:"+ System.currentTimeMillis());
|
||||||
rset = stmt.executeQuery();
|
rset = stmt.executeQuery();
|
||||||
|
log.info("Depois de enviar consulta para o banco:"+ System.currentTimeMillis());
|
||||||
|
|
||||||
lsDadosRelatorio = new ArrayList<RelatorioEmpresaCorridaBean>();
|
lsDadosRelatorio = new ArrayList<RelatorioEmpresaCorridaBean>();
|
||||||
|
|
||||||
|
log.info("Preenchendo bean:"+ System.currentTimeMillis());
|
||||||
while (rset.next()) {
|
while (rset.next()) {
|
||||||
RelatorioEmpresaCorridaBean empresaCorridaBean = new RelatorioEmpresaCorridaBean();
|
RelatorioEmpresaCorridaBean empresaCorridaBean = new RelatorioEmpresaCorridaBean();
|
||||||
empresaCorridaBean.setAbonos(rset.getBigDecimal("abonos"));
|
empresaCorridaBean.setAbonos(rset.getBigDecimal("abonos"));
|
||||||
|
@ -64,6 +70,7 @@ public class RelatorioEmpresaCorrida extends Relatorio {
|
||||||
|
|
||||||
lsDadosRelatorio.add(empresaCorridaBean);
|
lsDadosRelatorio.add(empresaCorridaBean);
|
||||||
}
|
}
|
||||||
|
log.info("Fim bean:"+ System.currentTimeMillis());
|
||||||
|
|
||||||
if (lsDadosRelatorio.size() > 0) {
|
if (lsDadosRelatorio.size() > 0) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue