fixes bug#23717

qua:
dev:Valdir

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@110065 d1611594-4594-4d17-8e1d-87c2c4800839
master
valdevir 2021-12-17 17:17:01 +00:00
parent 49956d0f49
commit 6b3fcf3ef5
17 changed files with 594 additions and 96 deletions

View File

@ -34,9 +34,7 @@ public class RelatorioCheckin extends Relatorio {
Date fecFinal = (Date) getParametros().get("DATA_FINAL");
fecInicio = DateUtil.inicioFecha(fecInicio);
fecFinal = DateUtil.fimFecha(fecFinal);
Boolean isCheckinEncerrado = (Boolean) getParametros().get("IS_CHECKIN_ENCERRADO");
Boolean isCheckinAberto = (Boolean) getParametros().get("IS_CHECKIN_ABERTO");
if (StringUtils.isNotBlank(idsBilheteiros)) {
String []ls = idsBilheteiros.split(",");
@ -46,7 +44,7 @@ public class RelatorioCheckin extends Relatorio {
}
}
String sql = getSql(corridaId, origenId, idsBilheteiros, isCheckinEncerrado, isCheckinAberto);
String sql = getSql(corridaId, origenId, idsBilheteiros);
PreparedStatement pstmt = getConexao().prepareStatement(sql);
@ -95,7 +93,7 @@ public class RelatorioCheckin extends Relatorio {
this.setCollectionDataSource(new JRBeanCollectionDataSource(checkins));
}
private String getSql(Integer corridaId, Integer origenId, String idsBilheteiros, Boolean indCheckinEncerrado, Boolean indCheckinAberto) {
private String getSql(Integer corridaId, Integer origenId, String idsBilheteiros) {
StringBuffer sql = new StringBuffer();
sql.append("select b.boleto_id, o.descparada, b.corrida_id, ");
@ -106,24 +104,14 @@ public class RelatorioCheckin extends Relatorio {
sql.append("inner join boleto_checkin bc on b.boleto_id = bc.boletooriginal_id ");
sql.append("inner join parada o on b.origen_id = o.parada_id ");
sql.append("inner join usuario u on bc.usuario_id = u.usuario_id ");
//Se a corrida_id e feccorrida existe na tabela checkin_cerrado = checkin encerrado
if(indCheckinEncerrado) {
sql.append("inner join checkin_cerrado cc on (b.corrida_id = cc.corrida_id and b.feccorrida=cc.feccorrida )");
}else {
//Se a corrida_id e feccorrida não existe na tabela checkin_cerrado = checkin aberto
if(indCheckinAberto) {
sql.append(" left join checkin_cerrado cc on (b.corrida_id = cc.corrida_id and b.feccorrida=cc.feccorrida ) ");
}
}
sql.append(" where b.activo = 1 ");
sql.append("and bc.FECMODIF between ? and ? ");
sql.append(corridaId == null ? "" : " and b.corrida_id = ? ");
sql.append(origenId == null ? "" : " and b.origen_id = ? ");
sql.append((lsInt == null || lsInt.size() == 0) ? "" : " and u.USUARIO_ID in ( "+ createIn(lsInt.size()) + ") ");
if(indCheckinAberto) {
sql.append(" and cc.corrida_id is null ");
}
sql.append(" order by bc.datacancelado desc");
return sql.toString();

View File

@ -0,0 +1,160 @@
package com.rjconsultores.ventaboletos.relatorios.impl;
import java.sql.Connection;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioCheckinAbertoBean;
import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
public class RelatorioCheckinAberto extends Relatorio {
public static final String DATA_INICIO_SERVICO = "DATA_INICIO_SERVICO";
public static final String DATA_FIM_SERVICO = "DATA_FIM_SERVICO";
public static final String DATA_INICIO_ENCERRAMENTO = "DATA_INICIO_ENCERRAMENTO";
public static final String DATA_FIM_ENCERRAMENTO = "DATA_FIM_ENCERRAMENTO";
private List<RelatorioCheckinAbertoBean> lsDadosRelatorio;
public RelatorioCheckinAberto(Map<String, Object> parametros, Connection conexao) throws Exception {
super(parametros, conexao);
this.setCustomDataSource(new DataSource(this) {
@Override
public void initDados() throws Exception {
Connection conexao = this.relatorio.getConexao();
Map<String, Object> parametros = this.relatorio.getParametros();
String dataInicioServico = null;
if (parametros.containsKey(DATA_INICIO_SERVICO)) {
dataInicioServico = parametros.get(DATA_INICIO_SERVICO).toString() + " 00:00";
}
String dataFimServico = null;
if (parametros.containsKey(DATA_FIM_SERVICO)) {
dataFimServico = parametros.get(DATA_FIM_SERVICO).toString() + " 23:59";
}
String dataInicioEncerramento = null;
if (parametros.containsKey(DATA_INICIO_ENCERRAMENTO)) {
dataInicioEncerramento = parametros.get(DATA_INICIO_ENCERRAMENTO).toString() + " 00:00";
}
String dataFimEncerramento = null;
if (parametros.containsKey(DATA_FIM_ENCERRAMENTO)) {
dataFimEncerramento = parametros.get(DATA_FIM_ENCERRAMENTO).toString() + " 23:59";
}
Integer empresa_id = (Integer) parametros.get("empresa_id");
Integer localidade_id = (Integer) parametros.get("localidade_id");
String sql = getSql(dataInicioServico, dataFimServico, dataInicioEncerramento, dataFimEncerramento, empresa_id, localidade_id);
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
if (dataInicioServico != null && dataFimServico != null) {
stmt.setString("dataInicioServico", dataInicioServico);
stmt.setString("dataFimServico", dataFimServico);
}
if (dataInicioEncerramento != null && dataFimEncerramento != null) {
stmt.setString("dataInicioEncerramento", dataInicioEncerramento);
stmt.setString("dataFimEncerramento", dataFimEncerramento);
}
if (empresa_id != null) {
stmt.setInt("empresa_id", empresa_id);
}
if (localidade_id != null) {
stmt.setInt("localidade_id", localidade_id);
}
ResultSet rs = stmt.executeQuery();
lsDadosRelatorio = new ArrayList<RelatorioCheckinAbertoBean>();
SimpleDateFormat formatadorData = new SimpleDateFormat("dd/MM/yyyy");
SimpleDateFormat formatadorDataHora = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
while (rs.next()) {
RelatorioCheckinAbertoBean bean = new RelatorioCheckinAbertoBean();
bean.setServico(rs.getInt("servico"));
bean.setDataServico(formatadorData.format(rs.getDate("data_servico")));
bean.setLocalidade(rs.getString("localidade"));
//bean.setUsuario(rs.getString("usuario"));
lsDadosRelatorio.add(bean);
}
if (lsDadosRelatorio.size() > 0) {
setLsDadosRelatorio(lsDadosRelatorio);
}
}
});
}
@Override
protected void processaParametros() throws Exception {
if (parametros.containsKey(DATA_INICIO_SERVICO) && parametros.containsKey(DATA_FIM_SERVICO)) {
this.parametros.put("PERIODO_SERVICO", parametros.get(DATA_INICIO_SERVICO) + " à " + parametros.get(DATA_FIM_SERVICO));
}
if (parametros.containsKey(DATA_INICIO_ENCERRAMENTO) && parametros.containsKey(DATA_FIM_ENCERRAMENTO)) {
this.parametros.put("PERIODO_ENCERRAMENTO", parametros.get(DATA_INICIO_ENCERRAMENTO) + " à " + parametros.get(DATA_FIM_ENCERRAMENTO));
}
}
private void setLsDadosRelatorio(List<RelatorioCheckinAbertoBean> lsDadosRelatorio) {
this.setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio));
this.lsDadosRelatorio = lsDadosRelatorio;
}
private String getSql(String dataInicioServico, String dataFimServico, String dataInicioEncerramento, String dataFimEncerramento, Integer empresa_id, Integer localidade_id) {
StringBuilder sb = new StringBuilder();
sb.append("select c.corrida_id as servico, ");
sb.append("c.feccorrida as data_servico, ");
sb.append("p.cveparada || ' - ' || p.descparada as localidade, ");
sb.append("cc.fechorcerrado as data_encerramento ");
sb.append("from corrida c ");
sb.append("join parada p on p.parada_id = c.origen_id ");
sb.append("left join checkin_cerrado cc on (c.corrida_id = cc.corrida_id and c.feccorrida=cc.feccorrida ) ");
if (empresa_id!=null) {
sb.append("join marca m on m.marca_id = c.marca_id ");
}
sb.append("where c.activo = 1 ");
sb.append(" and cc.corrida_id is null ");
if (dataInicioServico != null && dataFimServico != null) {
sb.append("and c.feccorrida between to_date(:dataInicioServico, 'dd/mm/yyyy hh24:mi') and to_date(:dataFimServico, 'dd/mm/yyyy hh24:mi') ");
}
if (dataInicioEncerramento != null && dataFimEncerramento != null) {
sb.append("and c.feccorrida between to_date(:dataInicioEncerramento, 'dd/mm/yyyy hh24:mi') and to_date(:dataFimEncerramento, 'dd/mm/yyyy hh24:mi') ");
}
if (empresa_id != null) {
sb.append("and m.empresa_id = :empresa_id ");
}
if (localidade_id != null) {
sb.append("and p.parada_id = :localidade_id ");
}
sb.append("order by 2, 1, 4, 3");
return sb.toString();
}
}

View File

@ -0,0 +1,18 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
msg.a=à
#Labels header
header.data.hora=Data/Hora\:
header.pagina=Página\:
header.periodo.servico=Período Serviço\:
header.periodo.encerramento=Período Encerramento\:
header.empresa=Empresa\:
#Labels detail
detail.servico=Serviço
detail.data.servico=Data Serviço
detail.localidade=Localidade
detail.data.encerramento=Data Encerramento
detail.usuario.operacao=Usuário da Operação
detail.imei=Dispositivo

View File

@ -0,0 +1,18 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
msg.a=à
#Labels header
header.data.hora=Data/Hora\:
header.pagina=Página\:
header.periodo.servico=Período Serviço\:
header.periodo.encerramento=Período Encerramento\:
header.empresa=Empresa\:
#Labels detail
detail.servico=Serviço
detail.data.servico=Data Serviço
detail.localidade=Origem do Serviço
detail.data.encerramento=Data Encerramento
detail.usuario.operacao=Usuário da Operação
detail.imei=Dispositivo

View File

@ -13,7 +13,7 @@ cabecalho.filtros=Filtros:
#Labels datail
datail.voucher=Nº Bilhete / Voucher
datail.origen=Origem
datail.origen=Origem do Serviço
datail.servicio=Serviço
datail.data.servicio=Data do Serviço
datail.data.checkin=Data Checkin

View File

@ -10,10 +10,16 @@ cabecalho.impressorPor=Impressor por:
cabecalho.pagina=Página
cabecalho.de=de
cabecalho.filtros=Filtros:
#Labels header
cabecalho.pagina=Página\:
cabecalho.empresa=Empresa\:
cabecalho.bilheteiro = Bilheteiro(s)\:
cabecalho.usuario = Usuário\:
#Labels datail
datail.voucher=Nº Bilhete / Voucher
datail.origen=Origem
datail.origen=Origem do Serviço
datail.servicio=Serviço
datail.data.servicio=Data do Serviço
datail.data.checkin=Data Checkin

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="RelatorioCheckin" pageWidth="675" pageHeight="842" whenNoDataType="NoDataSection" columnWidth="635" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="48d32af4-ba9f-41c2-91a5-5d2fe57e149c">
<property name="ireport.zoom" value="1.4641000000000008"/>
<property name="ireport.x" value="82"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<parameter name="NOME_RELATORIO" class="java.lang.String"/>
<parameter name="DATA_INICIAL" class="java.util.Date"/>
@ -9,6 +9,9 @@
<parameter name="CORRIDA_ID" class="java.lang.Long"/>
<parameter name="ORIGEN" class="java.lang.String"/>
<parameter name="IDS_BILHETEIROS" class="java.lang.String"/>
<parameter name="IS_CHECKIN_ABERTO" class="java.lang.Boolean"/>
<parameter name="nomb_empresa" class="java.lang.String"/>
<parameter name="nombUsuario" class="java.lang.String"/>
<queryString>
<![CDATA[]]>
</queryString>
@ -26,18 +29,74 @@
<band splitType="Stretch"/>
</background>
<title>
<band height="21" splitType="Stretch">
<textField pattern="" isBlankWhenNull="false">
<reportElement uuid="5ee43799-932b-4ce1-8056-df380a9050a8" mode="Transparent" x="0" y="0" width="338" height="20" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
<band height="83" splitType="Stretch">
<line>
<reportElement x="0" y="80" width="619" height="1" uuid="b28df970-c219-4853-afeb-6821e0a44f04"/>
</line>
<textField>
<reportElement mode="Opaque" x="0" y="0" width="476" height="30" backcolor="#D7D7D7" uuid="50c553a9-7292-44df-8b24-24eb14e98841"/>
<textElement markup="styled">
<font size="16" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{NOME_RELATORIO}]]></textFieldExpression>
</textField>
<line>
<reportElement uuid="b28df970-c219-4853-afeb-6821e0a44f04" x="0" y="20" width="619" height="1"/>
</line>
<textField>
<reportElement x="0" y="31" width="130" height="16" uuid="3cbad5ad-ea6f-4718-b7e5-a98dc6be0188"/>
<textElement>
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.periodo}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="130" y="31" width="505" height="16" uuid="6c12f1b5-cae1-4ea9-b674-703d0f3d2bdc"/>
<textFieldExpression><![CDATA[($P{DATA_INICIAL} != null ? new java.text.SimpleDateFormat("dd/MM/yyyy").format($P{DATA_INICIAL}) : "") +
" à " +
($P{DATA_FINAL} != null ? new java.text.SimpleDateFormat("dd/MM/yyyy").format($P{DATA_FINAL}) : "")]]></textFieldExpression>
</textField>
<textField>
<reportElement x="131" y="49" width="504" height="16" isRemoveLineWhenBlank="true" uuid="64d65c79-be80-4596-b84e-e2c3c3ddaa8a"/>
<textFieldExpression><![CDATA[$P{nombUsuario}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="49" width="130" height="16" isRemoveLineWhenBlank="true" uuid="cdd0af8e-575e-4afa-b68f-6d0812032d4b"/>
<textElement>
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.usuario}]]></textFieldExpression>
</textField>
<textField>
<reportElement mode="Opaque" x="577" y="15" width="29" height="15" backcolor="#D7D7D7" uuid="17fabb43-59cc-4375-86a8-793ff7a67f50"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}+" de"]]></textFieldExpression>
</textField>
<textField>
<reportElement mode="Opaque" x="476" y="15" width="62" height="15" backcolor="#D7D7D7" uuid="e0a35762-56d1-4da2-a945-8ae4d5348bb7"/>
<textElement>
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.pagina}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy HH:mm">
<reportElement mode="Opaque" x="538" y="0" width="97" height="15" backcolor="#D7D7D7" uuid="54f55cc3-21cb-482f-a58b-fca885e48517"/>
<textElement textAlignment="Left"/>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement mode="Opaque" x="606" y="15" width="29" height="15" backcolor="#D7D7D7" uuid="d0201aca-580e-4359-9503-c579a43dcccd"/>
<textElement textAlignment="Left"/>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField>
<reportElement mode="Opaque" x="476" y="0" width="62" height="15" backcolor="#D7D7D7" uuid="1ac071ee-3dcd-427a-909f-9d39e40c6708"/>
<textElement>
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.dataHora}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement mode="Opaque" x="538" y="15" width="39" height="15" backcolor="#D7D7D7" uuid="fb1a5b0c-1e7e-443e-b0ff-db26c4ed289d"/>
<textElement textAlignment="Right"/>
</textField>
</band>
</title>
<pageHeader>
@ -45,125 +104,125 @@
</pageHeader>
<columnHeader>
<band height="33" splitType="Stretch">
<textField>
<reportElement uuid="e4282770-fa67-4c58-a5aa-92e4d6f27166" x="0" y="0" width="100" height="30"/>
<textField isBlankWhenNull="false">
<reportElement x="0" y="0" width="100" height="30" isRemoveLineWhenBlank="true" uuid="e4282770-fa67-4c58-a5aa-92e4d6f27166"/>
<textElement markup="none">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{datail.voucher}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="1e0b20c0-f208-4853-8601-73cec6e1992e" x="100" y="0" width="134" height="30"/>
<textField isBlankWhenNull="true">
<reportElement x="246" y="0" width="96" height="30" uuid="1e0b20c0-f208-4853-8601-73cec6e1992e"/>
<textElement markup="none">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{datail.origen}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="32e830a3-6303-465c-85aa-12678fe6b80a" x="234" y="0" width="39" height="30"/>
<textField isBlankWhenNull="false">
<reportElement x="100" y="0" width="42" height="30" uuid="32e830a3-6303-465c-85aa-12678fe6b80a"/>
<textElement markup="none">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{datail.servicio}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="a5ac8565-1ca0-425b-9d25-97d26753e7ec" x="273" y="0" width="55" height="30" isPrintWhenDetailOverflows="true"/>
<textElement rotation="None" markup="none">
<font isBold="true" isUnderline="false"/>
</textElement>
<textFieldExpression><![CDATA[$R{datail.data.servicio}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="d937b8b4-5e49-4d0d-a211-42e3d3fb45ba" x="328" y="0" width="48" height="30" isPrintWhenDetailOverflows="true"/>
<reportElement x="342" y="0" width="48" height="30" isPrintWhenDetailOverflows="true" uuid="d937b8b4-5e49-4d0d-a211-42e3d3fb45ba"/>
<textElement markup="none">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{datail.data.checkin}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="44e42972-eac1-40e6-ba0e-7c83b208d41b" x="376" y="0" width="115" height="30"/>
<reportElement x="390" y="0" width="115" height="30" uuid="44e42972-eac1-40e6-ba0e-7c83b208d41b"/>
<textElement markup="none">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{datail.bilheteiro}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="29e15a6a-68ff-4f19-832f-ce0d7a7310ae" x="555" y="0" width="64" height="30" isPrintWhenDetailOverflows="true"/>
<reportElement x="569" y="0" width="64" height="30" isPrintWhenDetailOverflows="true" uuid="29e15a6a-68ff-4f19-832f-ce0d7a7310ae"/>
<textElement markup="none">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{datail.data.remarcada}]]></textFieldExpression>
</textField>
<line>
<reportElement uuid="acc2f86e-4ee2-4e61-807f-27fd740db652" x="0" y="30" width="619" height="1"/>
<reportElement x="0" y="30" width="619" height="1" uuid="acc2f86e-4ee2-4e61-807f-27fd740db652"/>
</line>
<textField>
<reportElement uuid="28a7ce94-e2d1-4a68-a816-185b176ba0a8" x="491" y="0" width="64" height="30" isPrintWhenDetailOverflows="true"/>
<reportElement x="505" y="0" width="64" height="30" isPrintWhenDetailOverflows="true" uuid="28a7ce94-e2d1-4a68-a816-185b176ba0a8"/>
<textElement markup="none">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{datail.cveusuario}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="148" y="0" width="89" height="30" isPrintWhenDetailOverflows="true" uuid="a5ac8565-1ca0-425b-9d25-97d26753e7ec"/>
<textElement rotation="None" markup="none">
<font isBold="true" isUnderline="false"/>
</textElement>
<textFieldExpression><![CDATA[$R{datail.data.servicio}]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band height="23" splitType="Stretch">
<textField isBlankWhenNull="true">
<reportElement uuid="82b42ca3-255a-4038-9730-35e2f9a1bb0f" x="0" y="0" width="100" height="20"/>
<textField isBlankWhenNull="false">
<reportElement isPrintRepeatedValues="false" x="0" y="0" width="100" height="20" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" uuid="82b42ca3-255a-4038-9730-35e2f9a1bb0f"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{numFolioSistema}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement uuid="c5cc5e04-b1fa-4ebc-b408-3810648fc7eb" x="100" y="0" width="134" height="20"/>
<reportElement x="246" y="0" width="96" height="20" uuid="c5cc5e04-b1fa-4ebc-b408-3810648fc7eb"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{origen}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement uuid="d4baaf3d-a171-4b29-8aa8-cef5b56a11b3" x="234" y="0" width="39" height="20"/>
<textField isBlankWhenNull="false">
<reportElement x="100" y="0" width="42" height="20" uuid="d4baaf3d-a171-4b29-8aa8-cef5b56a11b3"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{corridaId}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy" isBlankWhenNull="true">
<reportElement uuid="acbbd64d-1fbd-4b4f-b7d5-5a11005ae98e" x="273" y="0" width="55" height="20"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{feccorrida}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy" isBlankWhenNull="true">
<reportElement uuid="1ce5d236-a684-450f-8e63-1523f0c7e103" x="328" y="0" width="48" height="20"/>
<reportElement x="342" y="0" width="48" height="20" uuid="1ce5d236-a684-450f-8e63-1523f0c7e103"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{dataCancelado}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement uuid="64e2b043-f9cb-4211-852c-def2fed7ae2c" x="376" y="0" width="115" height="20"/>
<reportElement x="390" y="0" width="115" height="20" uuid="64e2b043-f9cb-4211-852c-def2fed7ae2c"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{nombUsuario}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy" isBlankWhenNull="true">
<reportElement uuid="648d03b0-ee8a-4b2f-af9f-c33c4d01f40e" x="555" y="0" width="64" height="20"/>
<reportElement x="569" y="0" width="64" height="20" uuid="648d03b0-ee8a-4b2f-af9f-c33c4d01f40e"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{dataRemarcacao}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy" isBlankWhenNull="true">
<reportElement uuid="80c86e43-26cc-428c-b2e5-99d685118a06" x="491" y="0" width="64" height="20"/>
<reportElement x="505" y="0" width="64" height="20" uuid="80c86e43-26cc-428c-b2e5-99d685118a06"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{cveusuario}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy" isBlankWhenNull="true">
<reportElement x="148" y="0" width="89" height="20" uuid="acbbd64d-1fbd-4b4f-b7d5-5a11005ae98e"/>
<textElement textAlignment="Left">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{feccorrida}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
@ -178,7 +237,7 @@
<noData>
<band height="38">
<textField>
<reportElement uuid="c68d03cd-3b82-4f22-ba2a-6bb344fd3944" x="15" y="11" width="530" height="20"/>
<reportElement x="0" y="11" width="530" height="20" uuid="c68d03cd-3b82-4f22-ba2a-6bb344fd3944"/>
<textElement markup="none">
<font size="11" isBold="true"/>
</textElement>

View File

@ -0,0 +1,168 @@
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="RelatorioEncerramentoCheckin" pageWidth="595" pageHeight="842" whenNoDataType="NoDataSection" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="0e8aff42-5ba8-48ac-9950-da8178561888">
<property name="ireport.zoom" value="1.7715610000000017"/>
<property name="ireport.x" value="26"/>
<property name="ireport.y" value="0"/>
<parameter name="TITULO" class="java.lang.String"/>
<parameter name="PERIODO_SERVICO" class="java.lang.String"/>
<parameter name="PERIODO_ENCERRAMENTO" class="java.lang.String"/>
<parameter name="EMPRESA" class="java.lang.String"/>
<field name="servico" class="java.lang.Integer"/>
<field name="dataServico" class="java.lang.String"/>
<field name="localidade" class="java.lang.String"/>
<field name="dataEncerramento" class="java.lang.String"/>
<field name="usuario" class="java.lang.String"/>
<field name="imei" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band splitType="Stretch"/>
</title>
<pageHeader>
<band height="82" splitType="Stretch">
<line>
<reportElement x="0" y="76" width="555" height="1" uuid="481b2107-ee62-4815-8a89-8435d34384c8"/>
</line>
<textField isBlankWhenNull="true">
<reportElement x="111" y="40" width="444" height="15" uuid="63ce47a3-7e94-42a2-8325-eceef777fbe2"/>
<textElement verticalAlignment="Middle">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$P{PERIODO_ENCERRAMENTO}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy">
<reportElement x="0" y="40" width="111" height="15" uuid="46ecd1c0-ef3e-4274-9094-1b2dbed2fc43"/>
<textElement textAlignment="Left" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$R{header.periodo.encerramento}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="454" y="0" width="44" height="10" uuid="33327397-2913-4d10-a128-6e18a85a33c7"/>
<textElement textAlignment="Right">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[$R{header.data.hora}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy">
<reportElement x="0" y="56" width="111" height="15" uuid="17a5536e-1cf6-48d8-91ad-53d8148af1d6"/>
<textElement textAlignment="Left" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$R{header.empresa}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="482" y="14" width="44" height="10" uuid="be33ee08-3388-45c3-a0b0-29f482d37076"/>
<textElement textAlignment="Right">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[$R{header.pagina} + "" + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy" isBlankWhenNull="true">
<reportElement x="111" y="56" width="444" height="15" uuid="48f1a994-4bbe-4b8e-948f-81542fa792c3"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$P{EMPRESA}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy" isBlankWhenNull="true">
<reportElement x="111" y="24" width="444" height="15" uuid="7f5ee01d-f86d-49a4-a2a1-f1c671621ef0"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$P{PERIODO_SERVICO}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy">
<reportElement x="0" y="0" width="454" height="20" uuid="9bc31956-04ad-43d0-bcee-08f7b5bf1145"/>
<textElement textAlignment="Left" verticalAlignment="Top">
<font size="14" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{TITULO}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy">
<reportElement x="0" y="24" width="111" height="15" uuid="4a51f623-fe84-4f71-8bfe-271f36619eb1"/>
<textElement textAlignment="Left" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$R{header.periodo.servico}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy HH:mm">
<reportElement x="499" y="0" width="56" height="10" uuid="34f65212-5ae5-4077-b4d8-64d55f0289a9"/>
<textElement textAlignment="Right">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement x="526" y="14" width="29" height="10" uuid="7883d71b-800c-4367-8c86-e8df1c9a8c35"/>
<textElement>
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[" de " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageHeader>
<columnHeader>
<band height="17" splitType="Stretch">
<line>
<reportElement x="0" y="14" width="555" height="1" uuid="cd1b96dd-2097-4af7-a025-7962bc5d7bee"/>
</line>
<textField>
<reportElement x="0" y="0" width="86" height="14" uuid="61efe86a-3f69-4010-ad07-57ade030c3c3"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.servico}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="86" y="0" width="94" height="14" uuid="dbf216e4-6896-4a81-8391-6a51b2703155"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.data.servico}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="180" y="0" width="133" height="14" uuid="7812f684-2bdd-4642-84f2-426c0fa9f826"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.localidade}]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band height="11" splitType="Stretch">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="86" height="10" uuid="6ef05dfb-fea9-451c-a45a-1dc3f766af84"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="7" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{servico}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToBandHeight" x="86" y="0" width="94" height="10" uuid="bb3d4047-5bea-4a27-8fbe-0f3ffc8e2c61"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="7" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{dataServico}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToBandHeight" x="180" y="0" width="133" height="10" uuid="75f7f9d7-1565-4fb2-81ae-2155c588c756"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="7" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{localidade}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band splitType="Stretch"/>
</columnFooter>
<summary>
<band splitType="Stretch"/>
</summary>
<noData>
<band height="20">
<textField>
<reportElement x="0" y="0" width="555" height="20" uuid="6320f11e-df43-4140-8144-55d84dc92ce6"/>
<textElement markup="none"/>
<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
</textField>
</band>
</noData>
</jasperReport>

View File

@ -0,0 +1,59 @@
package com.rjconsultores.ventaboletos.relatorios.utilitarios;
public class RelatorioCheckinAbertoBean {
private Integer servico;
private String dataServico;
private String localidade;
private String dataEncerramento;
private String usuario;
private String imei;
public Integer getServico() {
return servico;
}
public void setServico(Integer servico) {
this.servico = servico;
}
public String getDataServico() {
return dataServico;
}
public void setDataServico(String dataServico) {
this.dataServico = dataServico;
}
public String getLocalidade() {
return localidade;
}
public void setLocalidade(String localidade) {
this.localidade = localidade;
}
public String getDataEncerramento() {
return dataEncerramento;
}
public void setDataEncerramento(String dataEncerramento) {
this.dataEncerramento = dataEncerramento;
}
public String getUsuario() {
return usuario;
}
public void setUsuario(String usuario) {
this.usuario = usuario;
}
public String getImei() {
return imei;
}
public void setImei(String imei) {
this.imei = imei;
}
}

View File

@ -16,7 +16,6 @@ import org.zkoss.zhtml.Messagebox;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zul.Bandbox;
import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Comboitem;
import org.zkoss.zul.ComboitemRenderer;
import org.zkoss.zul.Datebox;
@ -28,6 +27,7 @@ import com.rjconsultores.ventaboletos.entidad.Parada;
import com.rjconsultores.ventaboletos.entidad.Usuario;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioCheckin;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParadaCve;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
@ -55,8 +55,7 @@ public class RelatorioCheckinController extends MyGenericForwardComposer {
private MyListbox usuarioSelList;
private MyComboboxParada cmbParadaOrigem;
private MyComboboxParadaCve cmbParadaOrigemCve;
private Checkbox chcEncerrado;
private Checkbox chcAberto;
@Autowired
@ -79,7 +78,7 @@ public class RelatorioCheckinController extends MyGenericForwardComposer {
usuarioList.setItemRenderer(new RenderRelatorioCheckinUsuario());
usuarioSelList.setItemRenderer(new RenderRelatorioCheckinUsuariosSelecionados());
}
public void onClick$btnPesquisa(Event ev) {
@ -136,9 +135,10 @@ public class RelatorioCheckinController extends MyGenericForwardComposer {
parametros.put("DATA_FINAL", datFinal.getValue());
parametros.put("ORIGEN_ID", origenId);
parametros.put("ORIGEN", origen);
parametros.put("IS_CHECKIN_ENCERRADO", chcEncerrado.isChecked());
parametros.put("IS_CHECKIN_ABERTO", chcAberto.isChecked());
parametros.put("NOME_RELATORIO", Labels.getLabel("indexController.mniRelatorioCheckin.label"));
parametros.put("nombUsuario", UsuarioLogado.getUsuarioLogado().getNombusuario().toString());
String nomeRelatorio = Labels.getLabel("indexController.mniRelatorioCheckin.label");
parametros.put("NOME_RELATORIO", nomeRelatorio);
String usuariosIds = "";
for (int i = 0; i < lsUsuariosSelecionados.size(); i++) {

View File

@ -14,10 +14,12 @@ import org.springframework.stereotype.Controller;
import org.zkoss.util.resource.Labels;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Datebox;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.Parada;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioCheckinAberto;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioEncerramentoCheckin;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.service.EmpresaService;
@ -31,7 +33,7 @@ import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
@Controller("relatorioEncerramentoCheckinController")
@Scope("prototype")
@SuppressWarnings("serial")
public class RelatorioEncerramentoCheckinController extends MyGenericForwardComposer {
public class RelatorioCheckinEnacerramentoAbertoController extends MyGenericForwardComposer {
@Autowired
private DataSource dataSourceRead;
@ -46,11 +48,14 @@ public class RelatorioEncerramentoCheckinController extends MyGenericForwardComp
private MyComboboxEstandar cmbEmpresa;
private MyComboboxParada cmbLocalidade;
private List<Empresa> lsEmpresas;
private Checkbox chcEncerrado;
private Checkbox chcAberto;
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
lsEmpresas = empresaService.obtenerTodos();
chcEncerrado.setChecked(Boolean.TRUE);
}
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
@ -59,7 +64,6 @@ public class RelatorioEncerramentoCheckinController extends MyGenericForwardComp
private void executarRelatorio() throws Exception {
Map<String, Object> parametros = new HashMap<String, Object>();
parametros.put("TITULO", Labels.getLabel("relatorioEncerramentoCheckinController.window.title"));
// Datas
putParametrosDate(parametros, RelatorioEncerramentoCheckin.DATA_INICIO_SERVICO, this.dataInicioServico.getValue());
@ -97,12 +101,25 @@ public class RelatorioEncerramentoCheckinController extends MyGenericForwardComp
parametros.put("localidade_id", ((Parada) cmbLocalidade.getSelectedItem().getValue()).getParadaId());
}
Relatorio relatorio = new RelatorioEncerramentoCheckin(parametros, dataSourceRead.getConnection());
Relatorio relatorio = null;
if(chcEncerrado.isChecked()) {
parametros.put("TITULO", Labels.getLabel("relatorioEncerramentoCheckinController.window.title"));
relatorio = new RelatorioEncerramentoCheckin(parametros, dataSourceRead.getConnection());
}else {
parametros.put("TITULO", Labels.getLabel("relatorioCheckinAbertoController.window.title"));
relatorio = new RelatorioCheckinAberto(parametros, dataSourceRead.getConnection());
}
Map<String, Object> args = new HashMap<String, Object>();
args.put("relatorio", relatorio);
openWindow("/component/reportView.zul", Labels.getLabel("relatorioEncerramentoCheckinController.window.title"), args, MODAL);
if(chcEncerrado.isChecked()) {
openWindow("/component/reportView.zul", Labels.getLabel("relatorioEncerramentoCheckinController.window.title"), args, MODAL);
}else {
openWindow("/component/reportView.zul", Labels.getLabel("relatorioCheckinAbertoController.window.title"), args, MODAL);
}
}
private void putParametrosDate(Map<String, Object> parametros, String nomeParametro, Date data) {

View File

@ -328,6 +328,8 @@ indexController.mniRelatorioVendasBilheteiroSintetico.label = Ventas por agentes
indexController.mniRelatorioAgenciasNaoImportadas.label = Reporte puntos venta no importados
indexController.mniRelatorioIntegracaoAntiFraude.label = Relatório de Integração com Antifraude
indexController.mniRelatorioCheckin.label = Checkin's
indexController.mniRelatorioCheckinAberto.label = Relatório Checkin's Abertos
indexController.mniRelatorioCheckinEncerrado.label = Relatório Checkin's Encerrados
indexController.mniFechamentoParamgeral.label = Cierre cuenta
indexController.mniFechamentoParamptovta.label = Cierre cuenta contábil punto de venta
indexController.mniRelatorioCorridas.label = Reporte de corridas

View File

@ -347,7 +347,9 @@ indexController.mniRelatorioVendasBilheteiroSintetico.label = Vendas por Bilhete
indexController.mniRelatorioCancelamentoAutomaticoECF.label = Relatório de Cancelamento Automatico ECF
indexController.mniRelatorioAgenciasNaoImportadas.label = Relatório de Agências não Importadas
indexController.mniRelatorioIntegracaoAntiFraude.label = Relatório de Integração com Antifraude
indexController.mniRelatorioCheckin.label = Checkin's
indexController.mniRelatorioCheckin.label = Relatório Checkin's
indexController.mniRelatorioCheckinAberto.label = Relatório Checkin's Abertos
indexController.mniRelatorioCheckinEncerrado.label = Relatório Checkin's Encerrados
indexController.mniFechamentoParamgeral.label = Configuração de Boleto
indexController.mniFechamentoParamptovta.label = Fechamento Conta Corrente Agência
indexController.mniRelatorioCorridas.label = Relatório de Serviços
@ -9794,6 +9796,7 @@ relatorioMovimentacaoBilheteController.lbAdicionarLinha.value = Adicionar Linha
# Relatório Encerramento do Checkin
relatorioEncerramentoCheckinController.window.title = Relatório Encerramento do Checkin
relatorioCheckinAbertoController.window.title = Relatório de Checkin em Aberto (Não Encerrados)
relatorioEncerramentoCheckinController.data.servico.obrigatoria = É necessário preencher a data inicial e final do serviço
relatorioEncerramentoCheckinController.data.encerramento.obrigatoria = É necessário preencher a data inicial e final do encerramento
relatorioEncerramentoCheckinController.data.obrigatoria = Data do Serviço ou Data do Encerramento são obrigatórias

View File

@ -55,25 +55,6 @@
<intbox width="99%" id="txtCorridaId" />
</row>
<row>
<label
value="${c:l('relatorioCheckinController.lblTipoCheckin.value')}" />
<cell >
<checkbox id="chcEncerrado"
label="${c:l('relatorioCheckinController.chcCheckinEncerrado.value')}" >
<attribute name="onCheck">
chcAberto.setChecked(false);
</attribute>
</checkbox>
<checkbox id="chcAberto"
label="${c:l('relatorioCheckinController.chcCheckinAberto.value')}" >
<attribute name="onCheck">
chcEncerrado.setChecked(false);
</attribute>
</checkbox>
</cell>
</row>
<row>

View File

@ -8,7 +8,7 @@
<window id="winFiltroRelatorioEncerramentoCheckin"
apply="${relatorioEncerramentoCheckinController}"
contentStyle="overflow:auto"
height="240px" width="560px" border="normal">
height="265px" width="560px" border="normal">
<grid fixedLayout="true">
<columns>
@ -70,6 +70,25 @@
mold="rounded" buttonVisible="true"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada" />
</row>
<row>
<label
value="${c:l('relatorioCheckinController.lblTipoCheckin.value')}" />
<cell >
<checkbox id="chcEncerrado"
label="${c:l('relatorioCheckinController.chcCheckinEncerrado.value')}" >
<attribute name="onCheck">
chcAberto.setChecked(false);
</attribute>
</checkbox>
<checkbox id="chcAberto"
label="${c:l('relatorioCheckinController.chcCheckinAberto.value')}" >
<attribute name="onCheck">
chcEncerrado.setChecked(false);
</attribute>
</checkbox>
</cell>
</row>
</rows>
</grid>