Fixes bug#13471

dev: Aristides
qua: 


git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@90737 d1611594-4594-4d17-8e1d-87c2c4800839
master
fabio 2019-03-13 21:57:25 +00:00
parent c151d72bec
commit 9c8446480a
12 changed files with 1560 additions and 1 deletions

View File

@ -0,0 +1,211 @@
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 org.apache.log4j.Logger;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioGratuidadeAGERBean;
import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
public class RelatorioGratuidadeAGER extends Relatorio {
private List<RelatorioGratuidadeAGERBean> lsDadosRelatorio;
private static Logger log = Logger.getLogger(RelatorioGratuidadeAGER.class);
public RelatorioGratuidadeAGER(Map<String, Object> parametros, Connection conexao) throws Exception {
super(parametros, conexao);
this.setCustomDataSource(new DataSource(this) {
@Override
public void initDados() throws Exception {
try {
Connection conexao = this.relatorio.getConexao();
Map<String, Object> parametros = this.relatorio.getParametros();
String fecInicioVenda = null;
if (parametros.get("fecInicioVenda") != null) {
fecInicioVenda = parametros.get("fecInicioVenda").toString() + " 00:00:00";
}
String fecFinalVenda = null;
if (parametros.get("fecFinalVenda") != null) {
fecFinalVenda = parametros.get("fecFinalVenda").toString() + " 23:59:59";
}
String tipGratuIds = parametros.get("tipGratuIds").toString();
String linhaIds = parametros.get("linhaIds").toString();
String empresa = parametros.get("empresa") != null ? parametros.get("empresa").toString() : "";
String codOrgaoConcedente = parametros.get("CodOrgaoConcedente").toString();
String sql = getSql(fecInicioVenda, fecFinalVenda, linhaIds, tipGratuIds, empresa, codOrgaoConcedente);
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss");
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
if (fecInicioVenda != null) {
stmt.setTimestamp("fecInicioVenda", new java.sql.Timestamp(sdf.parse(fecInicioVenda).getTime()));
}
if (fecFinalVenda != null) {
stmt.setTimestamp("fecFinalVenda", new java.sql.Timestamp(sdf.parse(fecFinalVenda).getTime()));
}
if (empresa != null && !empresa.equals("")) {
stmt.setInt("empresa_id", Integer.parseInt(empresa));
}
if (codOrgaoConcedente != null) {
stmt.setString("codOrgaoConcedente", codOrgaoConcedente);
}
ResultSet rset = null;
rset = stmt.executeQuery();
lsDadosRelatorio = new ArrayList<RelatorioGratuidadeAGERBean>();
while (rset.next()) {
RelatorioGratuidadeAGERBean bean = new RelatorioGratuidadeAGERBean();
bean.setEmpresa(rset.getString("empresa"));
bean.setOrgao(rset.getString("ORGAO"));
bean.setDataViagem(rset.getString("dataViagem"));
bean.setHoraViagem(rset.getString("horaViagem"));
bean.setCodOrigem(rset.getString("codOrigem"));
bean.setDescOrigem(rset.getString("descOrigem"));
bean.setCodDestino(rset.getString("codDestino"));
bean.setDescDestino(rset.getString("descDestino"));
bean.setPoltrona(rset.getString("poltrona"));
bean.setLinha(rset.getString("linha"));
bean.setNumBilhete(rset.getString("numBilhete"));
bean.setNomeIdoso(rset.getString("NOMBPASAJERO"));
bean.setRG(rset.getString("RG"));
bean.setUfOrgaoDoc(rset.getString("uforgaodoc"));
bean.setCPF(rset.getString("CPF"));
bean.setTel(rset.getString("tel"));
bean.setEmail(rset.getString("email"));
bean.setEndereco(rset.getString("endereco"));
bean.setDesistencia(rset.getBoolean("desistencia"));
bean.setOcupacao(rset.getString("ocupacao"));
bean.setVlrGratuidade(rset.getBigDecimal("vlrGratuidade"));
lsDadosRelatorio.add(bean);
}
log.info("TAMANHO == null ? " + lsDadosRelatorio == null);
if (lsDadosRelatorio.size() > 0) {
log.info("TAMANHO DA LISTA: " + lsDadosRelatorio.size());
setLsDadosRelatorio(lsDadosRelatorio);
}
} catch (Exception e) {
log.error("Erro na geração do relatorio AGER: \n" + e);
e.printStackTrace();
throw e;
}
}
});
}
public void setLsDadosRelatorio(List<RelatorioGratuidadeAGERBean> lsDadosRelatorio) {
log.info("Setando dados do relatorio AGER");
this.setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio));
this.lsDadosRelatorio = lsDadosRelatorio;
log.info("depois de Setar dados do relatorio AGER");
}
@Override
protected void processaParametros() throws Exception {
}
private String getSql(String fecInicioVenda, String fecFinalVenda, String linha, String tipoGratu, String empresa, String codOrgaoConcedente) {
StringBuilder sql = new StringBuilder();
sql.append("SELECT OC.DESCORGAO AS ORGAO, ");
sql.append("O.CODEMPRESAPORORGAO AS empresa,");
sql.append("TO_CHAR(B.FECHORVIAJE, 'DD/MM/YY') AS dataViagem, ");
sql.append("TO_CHAR(b.FECHORVIAJE, 'HH24:MI') AS horaViagem, ");
sql.append("ori.cveparada AS codorigem, ");
sql.append("ori.descparada AS descorigem, ");
sql.append("des.cveparada AS coddestino, ");
sql.append("des.descparada AS descdestino, ");
sql.append("B.NUMASIENTO AS POLTRONA, ");
sql.append("b.NUMFOLIOSISTEMA AS NUMBILHETE, ");
sql.append("b.NOMBPASAJERO AS NOMBPASAJERO, ");
sql.append("CASE ");
sql.append("WHEN b.DESCNUMDOC IS NOT NULL ");
sql.append("THEN b.DESCNUMDOC ELSE c.NUMIDENTIFICAUNO ");
sql.append("END AS RG, ");
sql.append("b.descorgaodoc uforgaodoc, ");
sql.append("CASE ");
sql.append("WHEN b.DESCNUMDOC2 IS NOT NULL ");
sql.append("THEN b.DESCNUMDOC2 ELSE c.NUMIDENTIFICADOS ");
sql.append("END AS CPF, ");
sql.append("r.PREFIXO AS LINHA, ");
sql.append("cd.DESCCALLE || ', ' || cd.NUMEXTERIOR || '-' || ");
sql.append("cd.DESCIUDAD || '/' || cd.DESESTADO AS ENDERECO, ");
sql.append("c.NUMTELEFONO AS tel,");
sql.append("c.DESCCORREO AS email, ");
sql.append("toc.DESCTIPO AS ocupacao, ");
sql.append("CASE ");
sql.append("WHEN B.MOTIVOCANCELACION_ID IN (31, 32, 90) ");
sql.append("THEN 1 ELSE 0 ");
sql.append("END AS DESISTENCIA, ");
sql.append(" (COALESCE(T.PRECIO, 0) + COALESCE(T.IMPORTEPEDAGIO,0)) ");
sql.append("-(COALESCE(b.PRECIOPAGADO, 0) + COALESCE(b.IMPORTEPEDAGIO,0)) AS vlrGratuidade ");
sql.append("FROM BOLETO b ");
sql.append("LEFT JOIN categoria ca ON b.categoria_id = ca.categoria_id ");
sql.append("LEFT JOIN empresa e ON e.empresa_id = b.EMPRESACORRIDA_ID ");
sql.append("LEFT JOIN marca m ON m.EMPRESA_ID = e.EMPRESA_ID ");
sql.append("LEFT JOIN parada ori ON ori.parada_id = b.origen_id ");
sql.append("LEFT JOIN parada des ON des.parada_id = b.destino_id ");
sql.append("LEFT JOIN ruta r ON r.ruta_id = b.ruta_id ");
sql.append("LEFT JOIN cliente c ON c.cliente_id = b.cliente_id ");
sql.append("LEFT JOIN CLIENTE_DIRECCION cd ON cd.cliente_id = c.cliente_id AND cd.ACTIVO = 1 ");
sql.append("LEFT JOIN TIPO_OCUPACION toc ON toc.TIPOOCUPACION_ID = b.TIPOOCUPACION_ID ");
sql.append("LEFT JOIN ORGAO_CONCEDENTE OC ON r.ORGAOCONCEDENTE_ID = OC.ORGAOCONCEDENTE_ID ");
sql.append("LEFT JOIN ORGAO_EMP_PARAM O ON e.empresa_id = O.EMPRESA_ID AND OC.ORGAOCONCEDENTE_ID = O.ORGAOCONCEDENTE_ID AND O.ACTIVO = 1 ");
sql.append("LEFT JOIN TARIFA T ON r.RUTA_ID = T.RUTA_ID AND b.ORIGEN_ID = T.ORIGEN_ID AND b.DESTINO_ID = T.DESTINO_ID AND b.CLASESERVICIO_ID = T.CLASESERVICIO_ID AND m.MARCA_ID = T.MARCA_ID AND o.ORGAOCONCEDENTE_ID = T.ORGAOCONCEDENTE_ID ");
sql.append("INNER JOIN VIGENCIA_TARIFA vt ON vt.VIGENCIATARIFA_ID = t.VIGENCIATARIFA_ID AND b.FECHORVIAJE BETWEEN vt.FECINICIOVIGENCIA AND vt.FECFINVIGENCIA ");
sql.append("WHERE b.MOTIVOCANCELACION_ID IS NULL ");
sql.append("AND b.fechorventa BETWEEN :fecInicioVenda AND :fecFinalVenda ");
if (tipoGratu != null) {
sql.append(" AND b.CATEGORIA_ID in (").append(tipoGratu).append(") ");
}
if (linha != null && !linha.equals("Todas")) {
sql.append(" AND r.ruta_id in (").append(linha).append(") ");
}
if (!empresa.isEmpty()) {
sql.append("AND b.empresacorrida_id = :empresa_id ");
}
if(codOrgaoConcedente != null) {
sql.append(" AND OC.ORGAOCONCEDENTE_ID = :codOrgaoConcedente");
}
sql.append(" group by OC.DESCORGAO, O.CODEMPRESAPORORGAO, B.FECHORVIAJE, ca.desccategoria, ");
sql.append(" ori.cveparada, ori.descparada, des.cveparada, B.NUMASIENTO, des.descparada, ");
sql.append(" b.FECCORRIDA, C.NUMTELEFONO,toc.DESCTIPO, c.DESCCORREO, CASE WHEN b.DESCNUMDOC IS NOT NULL THEN b.DESCNUMDOC ELSE c.NUMIDENTIFICAUNO END, ");
sql.append(" b.NUMFOLIOSISTEMA, CASE WHEN b.DESCNUMDOC2 IS NOT NULL THEN b.DESCNUMDOC2 ELSE c.NUMIDENTIFICADOS END, b.NOMBPASAJERO, b.NUMIDENTIFICACION, T.PRECIO, b.PRECIOPAGADO, b.descorgaodoc, r.PREFIXO, cd.DESCCALLE || ', ' || cd.NUMEXTERIOR || '-' || cd.DESCIUDAD || '/' || cd.DESESTADO, B.MOTIVOCANCELACION_ID, ");
sql.append(" T.IMPORTEOUTROS, T.IMPORTEPEDAGIO, T.IMPORTESEGURO, T.IMPORTETAXAEMBARQUE, T.IMPORTETPP, b.descorgaodoc, ");
sql.append(" b.IMPORTECATEGORIA, b.IMPORTEOUTROS, b.IMPORTEPEDAGIO, b.IMPORTESEGURO, b.IMPORTETAXAEMBARQUE, b.IMPORTETPP ");
sql.append(" ORDER BY OC.DESCORGAO, O.CODEMPRESAPORORGAO, b.FECHORVIAJE, descorigem, descdestino ");
return sql.toString();
}
}

View File

@ -0,0 +1,36 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
msg.a=à
#Labels header
header.periodo=Período:
header.data.hora=Data/Hora\:
header.pagina=Página\:
header.filtro=Filtro\:
header.filtro.servico=Serviço\:
header.filtro.linha=Linha\:
header.filtro.grupo=Grupo de Linhas\:
header.empresa=Empresa\:
header.periodo.viagem=Período Viagem
header.periodo.venda=Período Venda
#Labels detail
detail.tipopassagem=Tipo Passagem
detail.empresa=Empresa
detail.dataViagem=Data Viagem
detail.horaViagem=Horário da Viagem
detail.origem=Origem
detail.destino=Destino
detail.poltrona=Poltrona
detail.linha=Linha
detail.numBilhete=N° Bilhete
detail.nome=Nome
detail.rg=RG
detail.ufOrgaoEmissor=UF do órgão emissor
detail.cpf=CPF
detail.endereco=Endereço
detail.ocupacao=Ocupaccion
detail.telEmail=Tel/E-mail
detail.desistencia=Houve Desistência?
detail.gratuidade=Valor Gratuidade concedida

View File

@ -0,0 +1,39 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
msg.a=à
#Labels header
header.periodo=Período:
header.data.hora=Data/Hora\:
header.pagina=Página\:
header.filtro=Filtro\:
header.filtro.servico=Serviço\:
header.filtro.linha=Linha\:
header.filtro.grupo=Grupo de Linhas\:
header.empresa=Empresa\:
header.periodo.viagem=Período Viagem\:
header.periodo.venda=Período Venda\:
header.orgaoConcedente=Orgão Concedente\:
header.tipopassagem=Tipo Passagem\:
#Labels detail
detail.empresa=Empresa
detail.dataViagem=Data Viagem
detail.horaViagem=Horário da Viagem
detail.origem=Origem
detail.destino=Destino
detail.poltrona=Poltrona
detail.linha=Linha
detail.numBilhete=N° Bilhete
detail.nome=Nome
detail.rg=RG
detail.ufOrgaoEmissor=UF do órgão emissor
detail.cpf=CPF
detail.endereco=Endereço
detail.ocupacao=Ocupação
detail.telEmail=Tel/\nE-mail
detail.desistencia=Houve Desistência?
detail.gratuidade=Valor Gratuidade concedida
detail.total=Total

View File

@ -0,0 +1,526 @@
<?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="RelatorioGratuidadeAGER" pageWidth="950" pageHeight="595" orientation="Landscape" columnWidth="930" leftMargin="10" rightMargin="10" topMargin="20" bottomMargin="20" uuid="3ee05e26-199e-4ad2-a96b-dd421627aceb">
<property name="ireport.zoom" value="1.2396694214876045"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.2" value="columnHeader"/>
<property name="net.sf.jasperreports.export.xls.remove.empty.space.between.rows" value="true"/>
<property name="net.sf.jasperreports.export.xls.remove.empty.space.between.columns" value="true"/>
<parameter name="USUARIO_ID" class="java.lang.String"/>
<parameter name="linhas" class="java.lang.String"/>
<parameter name="TITULO" class="java.lang.String"/>
<parameter name="fecInicioVenda" class="java.lang.String"/>
<parameter name="fecFinalVenda" class="java.lang.String"/>
<parameter name="nomb_empresa" class="java.lang.String"/>
<parameter name="tipGratu" class="java.lang.String"/>
<parameter name="orgaoConcedente" class="java.lang.String"/>
<field name="codOrigem" class="java.lang.String"/>
<field name="descOrigem" class="java.lang.String"/>
<field name="codDestino" class="java.lang.String"/>
<field name="descDestino" class="java.lang.String"/>
<field name="empresa" class="java.lang.String"/>
<field name="dataViagem" class="java.lang.String"/>
<field name="horaViagem" class="java.lang.String"/>
<field name="poltrona" class="java.lang.String"/>
<field name="linha" class="java.lang.String"/>
<field name="numBilhete" class="java.lang.String"/>
<field name="nomeIdoso" class="java.lang.String"/>
<field name="RG" class="java.lang.String"/>
<field name="CPF" class="java.lang.String"/>
<field name="endereco" class="java.lang.String"/>
<field name="tel" class="java.lang.String"/>
<field name="email" class="java.lang.String"/>
<field name="desistencia" class="java.lang.Boolean"/>
<field name="vlrGratuidade" class="java.math.BigDecimal"/>
<field name="ufOrgaoDoc" class="java.lang.String"/>
<field name="ocupacao" class="java.lang.String"/>
<title>
<band height="136">
<textField>
<reportElement x="0" y="0" width="689" height="37" uuid="8c77b68e-7c9d-4b71-8cc1-fbb6aaf36f9c"/>
<textElement markup="styled">
<font size="22" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{TITULO}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy HH:mm">
<reportElement x="802" y="0" width="105" height="37" uuid="32538cdd-7697-4a03-8035-f9474e869395"/>
<textElement textAlignment="Left"/>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField>
<reportElement x="689" y="0" width="113" height="37" uuid="abc399f3-d012-46aa-b4e9-678ab812bee4"/>
<textFieldExpression><![CDATA[$R{header.data.hora}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="131" y="37" width="799" height="20" uuid="f25e6675-4dcb-4d37-8586-e50abe4013af"/>
<textFieldExpression><![CDATA[( $P{fecInicioVenda} != null ? ($P{fecInicioVenda} + " à " + $P{fecFinalVenda}) : "" )]]></textFieldExpression>
</textField>
<textField>
<reportElement x="1" y="37" width="130" height="20" uuid="e15cecc4-995a-4cbc-934e-44970c809849"/>
<textFieldExpression><![CDATA[$R{header.periodo.venda}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="2" y="96" width="130" height="20" isRemoveLineWhenBlank="true" uuid="234e6e88-b5a2-4793-a029-85f64b4cad85"/>
<textFieldExpression><![CDATA[$R{header.tipopassagem}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="2" y="56" width="130" height="20" isRemoveLineWhenBlank="true" uuid="d3d41ddb-2dbb-4b0e-bf82-02af7f81b63f"/>
<textFieldExpression><![CDATA[$R{header.empresa}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="131" y="116" width="799" height="20" isRemoveLineWhenBlank="true" uuid="c61794c6-537b-4cab-9a5c-41c3101cdaac"/>
<textFieldExpression><![CDATA[$P{orgaoConcedente}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="131" y="96" width="799" height="20" isRemoveLineWhenBlank="true" uuid="6b435ede-b8f2-46ee-8098-50d36c0d5e23"/>
<textFieldExpression><![CDATA[$P{tipGratu}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="2" y="116" width="130" height="20" isRemoveLineWhenBlank="true" uuid="7a4f4ad0-6b74-4194-b089-2bf61e0b7ce4"/>
<textFieldExpression><![CDATA[$R{header.orgaoConcedente}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="131" y="76" width="799" height="20" isRemoveLineWhenBlank="true" uuid="7bc881ef-b270-4178-8416-54ad2602eaab"/>
<textFieldExpression><![CDATA[$P{linhas}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="131" y="56" width="799" height="20" isRemoveLineWhenBlank="true" uuid="33bc773a-8bd3-4bc0-946c-664d78a19f5c"/>
<textFieldExpression><![CDATA[$P{nomb_empresa}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="2" y="76" width="130" height="20" isRemoveLineWhenBlank="true" uuid="c3b8e525-e015-4aaa-a505-1a92f3d6b0fb"/>
<textFieldExpression><![CDATA[$R{header.filtro.linha}]]></textFieldExpression>
</textField>
</band>
</title>
<columnHeader>
<band height="20">
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="89" y="0" width="42" height="20" uuid="f1fb4c10-0b23-48a3-ab44-ec9423860a3a"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.horaViagem}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="42" height="20" uuid="aa6e1262-d10a-466f-9b10-736d01b43c08"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.empresa}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="607" y="0" width="47" height="20" uuid="7cc48455-63db-458c-9a56-b479040b4d58"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.cpf}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="870" y="0" width="65" height="20" uuid="9156a7f6-7830-4dd0-aa56-8f98130e1fae"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.gratuidade}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="758" y="0" width="56" height="20" uuid="c95ac716-8516-4063-9409-d58b908e3deb"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.desistencia}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="42" y="0" width="47" height="20" uuid="9ef59886-6218-4cf5-8926-f7f2e1e95cc6"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.dataViagem}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="421" y="0" width="98" height="20" uuid="d36987f3-20aa-4e3d-8bb6-5cacf23aa933"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.nome}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="337" y="0" width="42" height="20" uuid="86f8576e-d934-4f0d-9b87-4a40bef953ab"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.linha}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="131" y="0" width="82" height="20" uuid="a1aab05d-496e-4fe5-9c2e-760b7592a7fd"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.origem}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="213" y="0" width="82" height="20" uuid="7778d2ac-5f98-4955-9bbf-e474a1f16dad"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.destino}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="379" y="0" width="42" height="20" uuid="3eb6f2e7-2aad-4354-8cff-3938c90800ee"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.numBilhete}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="716" y="0" width="42" height="20" uuid="cc34f975-2571-4e38-b4ba-fa5ecbde208b"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.telEmail}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="295" y="0" width="42" height="20" uuid="8aea1354-22f0-45a4-9382-21623ef9a45d"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.poltrona}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="654" y="0" width="62" height="20" uuid="163e03ed-32b8-4b99-b62f-ad886ac2a8fa"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.endereco}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="519" y="0" width="46" height="20" uuid="16db37b0-e079-4427-88f8-9b429db26ce3"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.rg}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="565" y="0" width="42" height="20" uuid="be434e4c-9dbc-435b-8177-f81919d62cd3"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.ufOrgaoEmissor}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="814" y="0" width="56" height="20" uuid="b0512b29-6755-4d45-95fb-b8c9a2a6985c"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.ocupacao}]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band height="20" splitType="Prevent">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="131" y="0" width="82" height="20" uuid="e91ddf3d-5ee2-42d3-b8d4-01c92a2f462a"/>
<box>
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{descOrigem}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="213" y="0" width="82" height="20" uuid="d9ec1d06-efc7-4a65-96a2-e88e89f4ca91"/>
<box>
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{descDestino}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="42" height="20" uuid="aeca5093-6645-4f7d-814f-48abec2773bc"/>
<box>
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{empresa}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="42" y="0" width="47" height="20" uuid="6a5746f1-e112-4ea2-ac52-f3c4bf6f7c96"/>
<box>
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{dataViagem}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="89" y="0" width="42" height="20" uuid="1ae38af7-3815-4fc0-ba8c-a87f6a26914a"/>
<box>
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{horaViagem}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="337" y="0" width="42" height="20" uuid="bde0e80b-872a-4b26-b882-83efc01c25b7"/>
<box>
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{linha}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="295" y="0" width="42" height="20" uuid="7e10a3dc-7e63-49cf-ab5a-87bd2e7aa213"/>
<box>
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{poltrona}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="421" y="0" width="98" height="20" uuid="0803ee7f-f5d1-4cfb-8fe5-a6109922ab26"/>
<box>
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{nomeIdoso}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="519" y="0" width="46" height="20" uuid="0aeeb871-0a94-4ce7-97b6-892a7d138ed0"/>
<box>
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{RG}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="607" y="0" width="47" height="20" uuid="91a52282-d145-4f43-9d74-76d287e8969e"/>
<box>
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{CPF}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="654" y="0" width="62" height="20" uuid="483d506e-f7db-4e85-a83e-c63b75b19d1c"/>
<box>
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{endereco}.equals(", -/") ? "" : $F{endereco}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="758" y="0" width="56" height="20" uuid="b95ba55d-899d-4143-bff4-25bdaa95ae12"/>
<box>
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{desistencia} == true ? "SIM" : "NÃO"]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="870" y="0" width="65" height="20" uuid="1d3977c6-190b-4465-a062-40bed4826c84"/>
<box>
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{vlrGratuidade}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="379" y="0" width="42" height="20" uuid="e4dc6a7f-049d-45e1-9c6d-231303fb288c"/>
<box>
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{numBilhete}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="716" y="0" width="42" height="20" uuid="55fcebd5-d720-4f93-8295-964b2d79a213"/>
<box>
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="7"/>
</textElement>
<textFieldExpression><![CDATA[($F{tel} == null
|| $F{tel}.replaceAll("-","").replaceAll("_","").isEmpty()
|| $F{tel}.equalsIgnoreCase("null"))
? $F{email} : $F{tel}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="565" y="0" width="42" height="20" uuid="02c27999-1a75-4530-bb30-75c2fb08e297"/>
<box>
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{ufOrgaoDoc}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="814" y="0" width="56" height="20" uuid="533e67b9-fdc4-483b-9348-67447f0c5e7e"/>
<box>
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{ocupacao}]]></textFieldExpression>
</textField>
</band>
</detail>
<noData>
<band height="22">
<textField>
<reportElement x="0" y="2" width="930" height="20" uuid="254c9278-71b2-4ffa-926c-5b0055e02cda"/>
<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
</textField>
</band>
</noData>
</jasperReport>

View File

@ -0,0 +1,197 @@
package com.rjconsultores.ventaboletos.relatorios.utilitarios;
import java.math.BigDecimal;
public class RelatorioGratuidadeAGERBean {
private String empresa;
private String dataViagem;
private String orgao;
private String horaViagem;
private String codOrigem;
private String descOrigem;
private String codDestino;
private String descDestino;
private String poltrona;
private String linha;
private String numBilhete;
private String nomeIdoso;
private String RG;
private String ufOrgaoDoc;
private String CPF;
private String endereco;
private String tel;
private String email;
private String ocupacao;
private Boolean desistencia;
private BigDecimal vlrGratuidade;
public String getEmpresa() {
return empresa;
}
public void setEmpresa(String empresa) {
this.empresa = empresa;
}
public String getDataViagem() {
return dataViagem;
}
public void setDataViagem(String dataViagem) {
this.dataViagem = dataViagem;
}
public String getHoraViagem() {
return horaViagem;
}
public void setHoraViagem(String horaViagem) {
this.horaViagem = horaViagem;
}
public String getCodOrigem() {
return codOrigem;
}
public void setCodOrigem(String codOrigem) {
this.codOrigem = codOrigem;
}
public String getDescOrigem() {
return descOrigem;
}
public void setDescOrigem(String descOrigem) {
this.descOrigem = descOrigem;
}
public String getCodDestino() {
return codDestino;
}
public void setCodDestino(String codDestino) {
this.codDestino = codDestino;
}
public String getDescDestino() {
return descDestino;
}
public void setDescDestino(String descDestino) {
this.descDestino = descDestino;
}
public String getPoltrona() {
return poltrona;
}
public void setPoltrona(String poltrona) {
this.poltrona = poltrona;
}
public String getLinha() {
return linha;
}
public void setLinha(String linha) {
this.linha = linha;
}
public String getNumBilhete() {
return numBilhete;
}
public void setNumBilhete(String numBilhete) {
this.numBilhete = numBilhete;
}
public String getNomeIdoso() {
return nomeIdoso;
}
public void setNomeIdoso(String nomeIdoso) {
this.nomeIdoso = nomeIdoso;
}
public String getRG() {
return RG;
}
public void setRG(String rG) {
RG = rG;
}
public String getUfOrgaoDoc() {
return ufOrgaoDoc;
}
public void setUfOrgaoDoc(String ufOrgaoDoc) {
this.ufOrgaoDoc = ufOrgaoDoc;
}
public String getCPF() {
return CPF;
}
public void setCPF(String cPF) {
CPF = cPF;
}
public String getEndereco() {
return endereco;
}
public void setEndereco(String endereco) {
this.endereco = endereco;
}
public String getTel() {
return tel;
}
public void setTel(String tel) {
this.tel = tel;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Boolean getDesistencia() {
return desistencia;
}
public void setDesistencia(Boolean desistencia) {
this.desistencia = desistencia;
}
public BigDecimal getVlrGratuidade() {
return vlrGratuidade;
}
public void setVlrGratuidade(BigDecimal vlrGratuidade) {
this.vlrGratuidade = vlrGratuidade;
}
public String getOrgao() {
return orgao;
}
public void setOrgao(String orgao) {
this.orgao = orgao;
}
public String getOcupacao() {
return ocupacao;
}
public void setOcupacao(String ocupacao) {
this.ocupacao = ocupacao;
}
}

View File

@ -0,0 +1,316 @@
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.sql.DataSource;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.zkoss.util.resource.Labels;
import org.zkoss.zhtml.Messagebox;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zul.Datebox;
import org.zkoss.zul.Textbox;
import com.rjconsultores.ventaboletos.entidad.Categoria;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
import com.rjconsultores.ventaboletos.entidad.Ruta;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioGratuidadeAGER;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.service.CategoriaService;
import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
import com.rjconsultores.ventaboletos.service.RutaService;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRelatorioLinhaHorario;
@Controller("relatorioGratuidadeAGERController")
@Scope("prototype")
public class RelatorioGratuidadeAGERController extends MyGenericForwardComposer {
private static final long serialVersionUID = 1L;
@Autowired
private DataSource dataSourceRead;
@Autowired
private CategoriaService categoriaService;
@Autowired
private EmpresaService empresaService;
@Autowired
private RutaService rutaService;
@Autowired
private OrgaoConcedenteService orgaoConcedenteService;
private Datebox datInicialVenda;
private Datebox datFinalVenda;
private MyComboboxEstandar cmbEmpresa;
private MyComboboxEstandar cmbOrgaoConcedente;
private MyComboboxEstandar cmbTipoGratuidade;
private List<Categoria> lsCategorias;
private List<Empresa> lsEmpresas;
private List<OrgaoConcedente> lsOrgaosConcedentes;
private Textbox txtPalavraPesquisaLinha;
private MyListbox linhaList;
private MyListbox linhaListSelList;
private MyListbox selectedTipoGratuidadeList;
private List<Categoria> listSelectedTipoGratuidade;
private static Logger log = Logger.getLogger(RelatorioGratuidadeAGERController.class);
public void onClick$btnRemoveTipoGratuidade(Event ev) throws InterruptedException {
Categoria categoria = (Categoria) selectedTipoGratuidadeList.getSelectedItem().getValue();
listSelectedTipoGratuidade.remove(categoria);
selectedTipoGratuidadeList.setData(listSelectedTipoGratuidade);
}
public void onClick$btnAddTipoTipoGratuidade(Event ev) throws InterruptedException {
if (cmbTipoGratuidade.getSelectedItem() != null) {
listSelectedTipoGratuidade.add((Categoria) cmbTipoGratuidade.getSelectedItem().getValue());
selectedTipoGratuidadeList.setData(listSelectedTipoGratuidade);
selectedTipoGratuidadeList.setSelectedItem(null);
}
}
public void onClick$btnPesquisaLinha(Event ev) {
executarPesquisaLinha();
}
public void onClick$btnLimparLinha(Event ev) {
linhaList.clearSelection();
linhaListSelList.setData(new ArrayList<Ruta>());
linhaList.setItemRenderer(new RenderRelatorioLinhaHorario());
linhaListSelList.setItemRenderer(new RenderRelatorioLinhaHorario());
}
public void onDoubleClick$linhaList(Event ev) {
linhaListSelList.addItemNovo(linhaList.getSelected());
}
public MyListbox getSelectedTipoGratuidadeList() {
return selectedTipoGratuidadeList;
}
public void setSelectedTipoGratuidadeList(MyListbox selectedTipoGratuidadeList) {
this.selectedTipoGratuidadeList = selectedTipoGratuidadeList;
}
public List<Categoria> getListSelectedTipoGratuidade() {
return listSelectedTipoGratuidade;
}
public void setListSelectedTipoGratuidade(List<Categoria> listSelectedTipoGratuidade) {
this.listSelectedTipoGratuidade = listSelectedTipoGratuidade;
}
private void executarPesquisaLinha() {
String palavraPesquisaRuta = txtPalavraPesquisaLinha.getText();
linhaList.setData(rutaService.buscaRuta(palavraPesquisaRuta));
if (linhaList.getData().length == 0) {
try {
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("relatorioLinhasHorarioController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} catch (InterruptedException ex) {
}
}
}
private void executarRelatorio() throws Exception {
log.info("EXECUTANDO RELATORIO AGER");
Map<String, Object> parametros = new HashMap<String, Object>();
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
if (this.datInicialVenda.getValue() != null) {
parametros.put("fecInicioVenda", sdf.format(this.datInicialVenda.getValue()));
}
if (this.datFinalVenda.getValue() != null) {
parametros.put("fecFinalVenda", sdf.format(this.datFinalVenda.getValue()));
}
if (cmbOrgaoConcedente.getSelectedIndex() == -1) {
Messagebox.show(Labels.getLabel("relatorioGratuidadeAGERController.orgaoConcedente.obrigatorio"),
Labels.getLabel("relatorioGratuidadeController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
return;
}
if (parametros.get("fecInicioVenda") == null && parametros.get("datFinalVenda") == null) {
Messagebox.show(Labels.getLabel("relatorioGratuidadeAGERController.data.obrigatoria"),
Labels.getLabel("relatorioGratuidadeController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
return;
}
if (listSelectedTipoGratuidade.isEmpty()) {
Messagebox.show(Labels.getLabel("relatorioGratuidadeAGERController.tipo.obrigatoria"),
Labels.getLabel("relatorioGratuidadeController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
return;
}
StringBuilder tipGratu = new StringBuilder();
StringBuilder tipGratuIds = new StringBuilder();
for (Categoria categoria : listSelectedTipoGratuidade) {
tipGratu.append(categoria.getDesccategoria()).append(",");
tipGratuIds.append(categoria.getCategoriaId()).append(",");
}
// removendo ultima virgula
tipGratuIds = tipGratuIds.delete(tipGratuIds.length() - 1, tipGratuIds.length());
tipGratu = tipGratu.delete(tipGratu.length() - 1, tipGratu.length());
parametros.put("tipGratu", tipGratu.append(";").toString());
parametros.put("tipGratuIds", tipGratuIds.toString());
StringBuilder linhas = new StringBuilder();
StringBuilder linhaIds = new StringBuilder();
if (linhaListSelList.getListData().isEmpty()) {
linhas.append("Todas");
linhaIds.append("Todas");
} else {
for (Object obj : linhaListSelList.getListData()) {
Ruta ruta = (Ruta) obj;
linhas.append(ruta.getDescruta()).append(",");
linhaIds.append(ruta.getRutaId()).append(",");
}
// removendo ultima virgula
linhaIds = linhaIds.delete(linhaIds.length() - 1, linhaIds.length());
linhas = linhas.delete(linhas.length() - 1, linhas.length());
}
parametros.put("linhas", linhas.append(";").toString());
parametros.put("linhaIds", linhaIds.toString());
if (cmbEmpresa.getSelectedIndex() != -1) {
parametros.put("empresa", ((Empresa) cmbEmpresa.getSelectedItem().getValue()).getEmpresaId());
parametros.put("nomb_empresa", ((Empresa) cmbEmpresa.getSelectedItem().getValue()).getNombempresa());
} else {
parametros.put("nomb_empresa", "Todas");
}
if (cmbOrgaoConcedente.getSelectedIndex() != -1) {
parametros.put("orgaoConcedente", ((OrgaoConcedente) cmbOrgaoConcedente.getSelectedItem().getValue()).getDescOrgao());
parametros.put("CodOrgaoConcedente", ((OrgaoConcedente) cmbOrgaoConcedente.getSelectedItem().getValue()).getOrgaoConcedenteId());
}
parametros.put("TITULO", Labels.getLabel("relatorioGratuidadeAGERController.window.title"));
Relatorio relatorio = new RelatorioGratuidadeAGER(parametros, dataSourceRead.getConnection());
log.info("RELATORIO == NULL ? = " + relatorio == null);
Map<String, Object> args = new HashMap<String, Object>();
args.put("relatorio", relatorio);
log.info("ANTES DE ABRIR A TELA DO RELATORIO");
openWindow("/component/reportView.zul",
Labels.getLabel("relatorioGratuidadeAGERController.window.title"), args, MODAL);
}
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
executarRelatorio();
}
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
lsEmpresas = empresaService.obtenerTodos();
lsOrgaosConcedentes = orgaoConcedenteService.obtenerTodos();
lsCategorias = categoriaService.obtenerTodos();
listSelectedTipoGratuidade = new ArrayList<Categoria>();
linhaList.setItemRenderer(new RenderRelatorioLinhaHorario());
linhaListSelList.setItemRenderer(new RenderRelatorioLinhaHorario());
}
public List<Categoria> getLsCategorias() {
return lsCategorias;
}
public void setLsCategorias(List<Categoria> lsCategorias) {
this.lsCategorias = lsCategorias;
}
public Datebox getDatInicialVenda() {
return datInicialVenda;
}
public void setDatInicialVenda(Datebox datInicialVenda) {
this.datInicialVenda = datInicialVenda;
}
public Datebox getDatFinalVenda() {
return datFinalVenda;
}
public void setDatFinalVenda(Datebox datFinalVenda) {
this.datFinalVenda = datFinalVenda;
}
public MyComboboxEstandar getCmbTipoGratuidade() {
return cmbTipoGratuidade;
}
public void setCmbTipoGratuidade(MyComboboxEstandar cmbTipoGratuidade) {
this.cmbTipoGratuidade = cmbTipoGratuidade;
}
public MyListbox getLinhaListSelList() {
return linhaListSelList;
}
public void setLinhaListSelList(MyListbox linhaListSelList) {
this.linhaListSelList = linhaListSelList;
}
public Textbox getTxtPalavraPesquisaLinha() {
return txtPalavraPesquisaLinha;
}
public void setTxtPalavraPesquisaLinha(Textbox txtPalavraPesquisaLinha) {
this.txtPalavraPesquisaLinha = txtPalavraPesquisaLinha;
}
public List<Empresa> getLsEmpresas() {
return lsEmpresas;
}
public void setLsEmpresas(List<Empresa> lsEmpresas) {
this.lsEmpresas = lsEmpresas;
}
public List<OrgaoConcedente> getLsOrgaosConcedentes() {
return lsOrgaosConcedentes;
}
public void setLsOrgaosConcedentes(List<OrgaoConcedente> lsOrgaosConcedentes) {
this.lsOrgaosConcedentes = lsOrgaosConcedentes;
}
public MyComboboxEstandar getCmbOrgaoConcedente() {
return cmbOrgaoConcedente;
}
public void setCmbOrgaoConcedente(MyComboboxEstandar cmbOrgaoConcedente) {
this.cmbOrgaoConcedente = cmbOrgaoConcedente;
}
}

View File

@ -0,0 +1,25 @@
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios;
import org.zkoss.util.resource.Labels;
import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria;
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
public class ItemMenuRelatorioGratuidadeAGER extends DefaultItemMenuSistema {
public ItemMenuRelatorioGratuidadeAGER() {
super("indexController.mniRelatorioGratuidadeAGER.label");
}
@Override
public String getClaveMenu() {
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOGRATUIDADEAGER";
}
@Override
public void ejecutar() {
PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioGratuidadeAGER.zul",
Labels.getLabel("relatorioGratuidadeAGERController.window.title"), getArgs() ,desktop);
}
}

View File

@ -159,6 +159,7 @@ analitico.gerenciais.estatisticos.origemDestino=com.rjconsultores.ventaboletos.w
analitico.gerenciais.estatisticos.relatorioCorridas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioCorridas
analitico.gerenciais.estatisticos.gratuidades=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioGratuidadeANTT
analitico.gerenciais.estatisticos.gratuidadeARTESP=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioGratuidadeARTESP
analitico.gerenciais.estatisticos.gratuidadeAGER=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioGratuidadeAGER
analitico.gerenciais.estatisticos.gratuidadesANTT=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioGratuidade
analitico.gerenciais.estatisticos.gratuidadesIdosoDeficiente=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioGratuidadeIdosoDeficiente
analitico.gerenciais.estatisticos.relatorioMovimentoPorOrgaoConcedente=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioMovimentoPorOrgaoConcedente

View File

@ -7846,8 +7846,30 @@ relatorioGratuidadeARTESPController.lbTipoGratuidade.value = Tipo de alojamiento
relatorioGratuidadeARTESPController.lbDataIni.value = Fecha Inicio
relatorioGratuidadeARTESPController.lbDataFin.value = Fecha Final
relatorioGratuidadeARTESPController.lbOrgao.value = Instituición concedente
# Reporte Exportacao Idoso AGER
relatorioGratuidadeAGERController.window.title = Reporte Gratuidad AGER
relatorioGratuidadeAGERController.data.obrigatoria = Es necesario rellenar la fecha inicial y final
relatorioGratuidadeAGERController.tipo.obrigatoria = Tipo de pasaje es obligatorio
relatorioGratuidadeAGERController.lbEmpresa.value = Empresa
relatorioGratuidadeAGERController.lbAgencia.value = Punto Venta
relatorioGratuidadeAGERController.lbLinhas.value = Ruta
relatorioGratuidadeAGERController.lbOrigem.value = Origen
relatorioGratuidadeAGERController.lbDestino.value = Destino
relatorioGratuidadeAGERController.lbTipoGratuidade.value = Tipos de Pasajes
relatorioGratuidadeAGERController.btnPesquisa.value = Buscar
relatorioGratuidadeAGERController.btnLimpar.value = Limpiar
relatorioGratuidadeAGERController.lbNumRuta.value = Num. linea
relatorioGratuidadeAGERController.lbPrefixo.value = Prefijo
relatorioGratuidadeAGERController.lbTipoGratuidade.value = Tipo de alojamiento
relatorioGratuidadeAGERController.lbDataIni.value = Fecha Inicio
relatorioGratuidadeAGERController.lbDataFin.value = Fecha Final
relatorioGratuidadeAGERController.lbOrgao.value = Instituición concedente
editarEmpresaController.usarAliasMapaViagemVenda.ajuda = En la pantalla de Venta o botón de Tarjeta de Viagem deve usar Alias para as Ubicaciones.
<<<<<<< .mine
editarPtovtaAntifraudeController.window.title=Editar Chave Antifraude=======
editarPtovtaAntifraudeController.window.title=Editar Chave Antifraude
# Custom
@ -7866,4 +7888,4 @@ customController.btnSalvar.tooltiptext = Salvar
customController.MSG.suscribirOK = Customização Registrada com Sucesso.
customController.MSG.borrarPergunta = Eliminar customização?
customController.MSG.borrarOK = Customização Excluida com Sucesso.
customController.MSG.modificar = Cuidado! Ao alterar este valor o sistema será modificado automaticamente.
customController.MSG.modificar = Cuidado! Ao alterar este valor o sistema será modificado automaticamente.>>>>>>> .r90642

View File

@ -283,6 +283,7 @@ indexController.mniRelatorioOCD.label = Relatório de OCD
indexController.mniRelatorioGratuidade.label = Relatório Tipo Passagem
indexController.mniRelatorioGratuidadeANTT.label = Relatório Gratuidades ANTT
indexController.mniRelatorioGratuidadeARTESP.label = Relatório Gratuidade ARTESP
indexController.mniRelatorioGratuidadeAGER.label = Relatório Gratuidade AGER
indexController.mniRelatorioBilhetesVendidos.label = Bilhetes Vendidos
indexController.mniRelatorioGratuidadeIdosoDeficiente.label = Gratuidades Idoso/Deficiente
indexController.mniRelatorioVendasBilheteiro.label = Vendas por Bilheteiro
@ -8318,6 +8319,26 @@ relatorioGratuidadeARTESPController.lbNumRuta.value = Num. Linha
relatorioGratuidadeARTESPController.lbPrefixo.value = Prefixo
relatorioGratuidadeARTESPController.lvVenda = Venda
relatorioGratuidadeARTESPController.lbOrgao.value = Orgão Concedente
# Relatório Exportacao Idoso AGER
relatorioGratuidadeAGERController.window.title = Relatório Gratuidade AGER
relatorioGratuidadeAGERController.data.obrigatoria = Data inicial e Final são obrigatórias
relatorioGratuidadeAGERController.orgaoConcedente.obrigatorio = Orgão Concedente é obrigatório
relatorioGratuidadeAGERController.tipo.obrigatoria = Tipo de passagens é obrigatório
relatorioGratuidadeAGERController.lbEmpresa.value = Empresa
relatorioGratuidadeAGERController.lbAgencia.value = Agência
relatorioGratuidadeAGERController.lbLinha.value = Linha
relatorioGratuidadeAGERController.lbOrigem.value = Origem
relatorioGratuidadeAGERController.lbDestino.value = Destino
relatorioGratuidadeAGERController.lbTipoGratuidade.value = Tipos de Passagens
relatorioGratuidadeAGERController.lbDataIniVenda.value = Data Inicio
relatorioGratuidadeAGERController.lbDataFinVenda.value = Data Final
relatorioGratuidadeAGERController.btnPesquisa.value = Pesquisar
relatorioGratuidadeAGERController.btnLimpar.value = Limpar
relatorioGratuidadeAGERController.lbNumRuta.value = Num. Linha
relatorioGratuidadeAGERController.lbPrefixo.value = Prefixo
relatorioGratuidadeAGERController.lvVenda = Venda
relatorioGratuidadeAGERController.lbOrgao.value = Orgão Concedente
editarEmpresaController.usarAliasMapaViagemVenda.ajuda = Na tela de Venda o botão de Mapa de Viagem deve usar Alias para as Localidades.
editarClienteController.MSG.validacaoCPFInvalido = CPF inválido

View File

@ -0,0 +1,165 @@
<?xml version="1.0" encoding="UTF-8"?>
<?page contentType="text/html;charset=UTF-8"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="winFiltroRelatorioGratuidadeAGER"?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winFiltroRelatorioGratuidadeAGER"
apply="${relatorioGratuidadeAGERController}"
contentStyle="overflow:auto" height="435px" width="550px"
border="normal">
<grid fixedLayout="true">
<columns>
<column width="25%" />
<column width="75%" />
</columns>
<rows>
<row>
<label
value="${c:l('relatorioGratuidadeAGERController.lbDataIniVenda.value')}" />
<datebox id="datInicialVenda" width="30%"
mold="rounded" format="dd/MM/yyyy" maxlength="10" />
</row>
<row>
<label
value="${c:l('relatorioGratuidadeAGERController.lbDataFinVenda.value')}" />
<datebox id="datFinalVenda" width="30%"
mold="rounded" format="dd/MM/yyyy" maxlength="10" />
</row>
<row>
<label
value="${c:l('relatorioGratuidadeAGERController.lbOrgao.value')}" />
<combobox id="cmbOrgaoConcedente" width="100%"
maxlength="60" mold="rounded" buttonVisible="true"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
model="@{winFiltroRelatorioGratuidadeAGER$composer.lsOrgaosConcedentes}" />
</row>
<row>
<label
value="${c:l('relatorioGratuidadeAGERController.lbEmpresa.value')}" />
<combobox id="cmbEmpresa" width="100%"
maxlength="60" mold="rounded" buttonVisible="true"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
model="@{winFiltroRelatorioGratuidadeAGER$composer.lsEmpresas}" />
</row>
<row>
<label
value="${c:l('relatorioGratuidadeAGERController.lbLinha.value')}" />
<bandbox id="bbPesquisaLinha" width="100%"
mold="rounded" readonly="true">
<bandpopup>
<vbox>
<hbox>
<textbox
id="txtPalavraPesquisaLinha" />
<button id="btnPesquisaLinha"
image="/gui/img/find.png"
label="${c:l('relatorioGratuidadeAGERController.btnPesquisa.value')}" />
<button id="btnLimparLinha"
image="/gui/img/eraser.png"
label="${c:l('relatorioGratuidadeAGERController.btnLimpar.value')}" />
</hbox>
<listbox id="linhaList" mold="paging"
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
vflex="true" multiple="false" height="60%" width="410px">
<listhead>
<listheader
label="${c:l('relatorioGratuidadeAGERController.lbNumRuta.value')}"
width="18%" />
<listheader
label="${c:l('relatorioGratuidadeAGERController.lbPrefixo.value')}"
width="20%" />
<listheader
label="${c:l('lb.dec')}" width="35%" />
<listheader
label="${c:l('relatorioGratuidadeAGERController.lbOrgao.value')}"
width="27%" />
</listhead>
</listbox>
<paging id="pagingLinha" pageSize="10" />
</vbox>
</bandpopup>
</bandbox>
</row>
<row>
<cell colspan="2">
<borderlayout height="100px">
<center border="0">
<listbox id="linhaListSelList"
mold="paging"
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
vflex="true" multiple="true" height="60%" width="100%">
<listhead>
<listheader
label="${c:l('relatorioGratuidadeAGERController.lbNumRuta.value')}"
width="18%" />
<listheader
label="${c:l('relatorioGratuidadeAGERController.lbPrefixo.value')}"
width="20%" />
<listheader
label="${c:l('lb.dec')}" width="35%" />
<listheader
label="${c:l('relatorioGratuidadeAGERController.lbOrgao.value')}"
width="20%" />
<listheader width="7%" />
</listhead>
</listbox>
</center>
</borderlayout>
</cell>
</row>
<row>
<label
value="${c:l('relatorioGratuidadeAGERController.lbTipoGratuidade.value')}" />
<combobox id="cmbTipoGratuidade" width="100%"
maxlength="60" mold="rounded" buttonVisible="true"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
model="@{winFiltroRelatorioGratuidadeAGER$composer.lsCategorias}" />
</row>
</rows>
</grid>
<grid fixedLayout="true">
<columns>
<column width="100%" />
</columns>
<rows>
<row>
<toolbar>
<button id="btnRemoveTipoGratuidade" height="20"
image="/gui/img/remove.png" width="35px"
tooltiptext="${c:l('generarTarifaOrgaoController.labelRemoveRuta.value')}" />
<button id="btnAddTipoTipoGratuidade"
height="20" image="/gui/img/add.png" width="35px"
tooltiptext="${c:l('generarTarifaOrgaoController.labelAddRuta.value')}" />
</toolbar>
</row>
<row>
<listbox id="selectedTipoGratuidadeList"
mold="paging"
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
vflex="true" multiple="false" height="60%">
<listhead sizable="true">
<listheader image="/gui/img/builder.gif"
label="${c:l('generarTarifaOrgaoController.labelEmpresa.value')}"
width="100%" />
</listhead>
</listbox>
</row>
</rows>
</grid>
<toolbar>
<button id="btnExecutarRelatorio" image="/gui/img/find.png"
label="${c:l('relatorio.lb.btnExecutarRelatorio')}" />
</toolbar>
</window>
</zk>