fixed bug 0007112 - melhorias relatório tabela de preço
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@53412 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
d51a4c75e6
commit
c0a8cd539c
|
@ -11,7 +11,7 @@ import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
|
|||
|
||||
public class RelatorioTabelaPreco extends Relatorio {
|
||||
|
||||
public RelatorioTabelaPreco(Map<String, Object> parametros, Connection conexao) throws Exception {
|
||||
public RelatorioTabelaPreco(final Map<String, Object> parametros, Connection conexao) throws Exception {
|
||||
super(parametros, conexao);
|
||||
|
||||
this.setCustomDataSource(new ArrayDataSource(this) {
|
||||
|
@ -19,7 +19,6 @@ public class RelatorioTabelaPreco extends Relatorio {
|
|||
public void initDados() throws Exception {
|
||||
Connection conexao = this.relatorio.getConexao();
|
||||
NamedParameterStatement stmt = new NamedParameterStatement(conexao, getSql());
|
||||
|
||||
ResultSet rset = stmt.executeQuery();
|
||||
|
||||
while (rset.next()) {
|
||||
|
@ -71,14 +70,21 @@ public class RelatorioTabelaPreco extends Relatorio {
|
|||
sql.append(" vt.FECINICIOVIGENCIA as dataVigenciaInicial, ");
|
||||
sql.append(" r.RUTA_ID as idLinha ");
|
||||
sql.append("FROM TARIFA t ");
|
||||
sql.append("INNER JOIN PARADA pOrigem ON t.ORIGEN_ID = pOrigem.PARADA_ID ");
|
||||
sql.append("INNER JOIN PARADA pDestino ON t.DESTINO_ID = pDestino.PARADA_ID ");
|
||||
sql.append("INNER JOIN CLASE_SERVICIO cs ON cs.CLASESERVICIO_ID = t.CLASESERVICIO_ID ");
|
||||
sql.append("INNER JOIN RUTA r ON r.RUTA_ID = t.RUTA_ID ");
|
||||
sql.append("INNER JOIN MARCA m ON m.MARCA_ID = t.MARCA_ID ");
|
||||
sql.append("INNER JOIN EMPRESA e ON e.EMPRESA_ID = m.EMPRESA_ID ");
|
||||
sql.append("INNER JOIN VIGENCIA_TARIFA vt ON vt.VIGENCIATARIFA_ID = t.VIGENCIATARIFA_ID ");
|
||||
sql.append("WHERE (1 = 1) ");
|
||||
sql.append("INNER JOIN PARADA pOrigem ON t.ORIGEN_ID = pOrigem.PARADA_ID ");
|
||||
sql.append("INNER JOIN PARADA pDestino ON t.DESTINO_ID = pDestino.PARADA_ID ");
|
||||
sql.append("INNER JOIN CLASE_SERVICIO cs ON cs.CLASESERVICIO_ID = t.CLASESERVICIO_ID ");
|
||||
sql.append("INNER JOIN RUTA r ON r.RUTA_ID = t.RUTA_ID ");
|
||||
sql.append("INNER JOIN MARCA m ON m.MARCA_ID = t.MARCA_ID ");
|
||||
sql.append("INNER JOIN EMPRESA e ON e.EMPRESA_ID = m.EMPRESA_ID ");
|
||||
sql.append("INNER JOIN VIGENCIA_TARIFA vt ON vt.VIGENCIATARIFA_ID = t.VIGENCIATARIFA_ID ");
|
||||
sql.append("INNER JOIN RUTA_COMBINACION rc ON rc.RUTA_ID = r.RUTA_ID ");
|
||||
sql.append("INNER JOIN TRAMO tr ON tr.TRAMO_ID = rc.TRAMO_ID ");
|
||||
sql.append("INNER JOIN ORGAO_CONCEDENTE o ON o.ORGAOCONCEDENTE_ID = r.ORGAOCONCEDENTE_ID ");
|
||||
sql.append("WHERE rc.INDVENTA = 1 ");
|
||||
sql.append("AND rc.ACTIVO = 1 ");
|
||||
sql.append("AND tr.ACTIVO = 1 ");
|
||||
sql.append("AND tr.ORIGEN_ID = t.ORIGEN_ID ");
|
||||
sql.append("AND tr.DESTINO_ID = t.DESTINO_ID ");
|
||||
|
||||
if(parametros.get("VIGENCIA_ID") != null){
|
||||
sql.append(" AND vt.VIGENCIATARIFA_ID = " + parametros.get("VIGENCIA_ID"));
|
||||
|
@ -88,8 +94,12 @@ public class RelatorioTabelaPreco extends Relatorio {
|
|||
sql.append(" AND e.empresa_id = " + parametros.get("EMPRESA_ID"));
|
||||
}
|
||||
|
||||
if (parametros.get("RUTA_ID") != null) {
|
||||
sql.append(" AND r.RUTA_ID = " + parametros.get("RUTA_ID"));
|
||||
if (parametros.get("LINHAS_ID") != null) {
|
||||
sql.append(" AND r.RUTA_ID IN (" + parametros.get("LINHAS_ID") + ")");
|
||||
}
|
||||
|
||||
if(parametros.get("ORGAO_CONCEDENTE_ID") != null){
|
||||
sql.append(" AND r.ORGAOCONCEDENTE_ID = " + parametros.get("ORGAO_CONCEDENTE_ID"));
|
||||
}
|
||||
|
||||
sql.append( "ORDER BY r.RUTA_ID, vt.FECINICIOVIGENCIA ");
|
||||
|
|
|
@ -11,6 +11,7 @@ cabecalho.pagina=P
|
|||
cabecalho.de=de
|
||||
cabecalho.filtros=Filtros:
|
||||
|
||||
|
||||
#Labels header
|
||||
label.origem=Origem
|
||||
label.destino=Destino
|
||||
|
@ -20,7 +21,8 @@ label.taxaEmbarque=Taxa
|
|||
label.seguro=Seguro
|
||||
label.outros=Outros
|
||||
label.tipoClasse=Classe
|
||||
label.linha=Linha
|
||||
label.linha=Linha(s)
|
||||
label.empresa=Empresa
|
||||
label.dataVigencia=Vigência
|
||||
label.total = Total
|
||||
label.total=Total
|
||||
label.orgacaoConcedente=Orgão Concedente
|
|
@ -11,6 +11,7 @@ cabecalho.pagina=P
|
|||
cabecalho.de=de
|
||||
cabecalho.filtros=Filtros:
|
||||
|
||||
|
||||
#Labels header
|
||||
label.origem=Origem
|
||||
label.destino=Destino
|
||||
|
@ -20,7 +21,8 @@ label.taxaEmbarque=Taxa
|
|||
label.seguro=Seguro
|
||||
label.outros=Outros
|
||||
label.tipoClasse=Classe
|
||||
label.linha=Linha
|
||||
label.linha=Linha(s)
|
||||
label.empresa=Empresa
|
||||
label.dataVigencia=Vigência
|
||||
label.total = Total
|
||||
label.total=Total
|
||||
label.orgacaoConcedente=Orgão Concedente
|
Binary file not shown.
|
@ -1,8 +1,8 @@
|
|||
<?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="RelatorioTabelaPreco" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="c092ef85-9334-4225-93d7-1acb7cf4d021">
|
||||
<property name="ireport.zoom" value="1.3636363636363642"/>
|
||||
<property name="ireport.zoom" value="1.4641000000000008"/>
|
||||
<property name="ireport.x" value="0"/>
|
||||
<property name="ireport.y" value="2"/>
|
||||
<property name="ireport.y" value="65"/>
|
||||
<property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.2" value="pageHeader"/>
|
||||
<property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.1" value="columnHeader"/>
|
||||
<parameter name="NOME_RELATORIO" class="java.lang.String"/>
|
||||
|
@ -11,10 +11,12 @@
|
|||
<parameter name="EMPRESA_ID" class="java.lang.Integer"/>
|
||||
<parameter name="EMPRESA" class="java.lang.String"/>
|
||||
<parameter name="RUTA_ID" class="java.lang.Integer"/>
|
||||
<parameter name="RUTA" class="java.lang.String"/>
|
||||
<parameter name="LINHAS" class="java.lang.String"/>
|
||||
<parameter name="VIGENCIA_INICIAL" class="java.util.Date"/>
|
||||
<parameter name="VIGENCIA_FINAL" class="java.util.Date"/>
|
||||
<parameter name="VIGENCIA_ID" class="java.lang.Integer"/>
|
||||
<parameter name="ORGAO_CONCEDENTE" class="java.lang.String"/>
|
||||
<parameter name="ORGAO_CONCEDENTE_ID" class="java.lang.Integer"/>
|
||||
<queryString>
|
||||
<![CDATA[]]>
|
||||
</queryString>
|
||||
|
@ -35,7 +37,7 @@
|
|||
<group name="ruta">
|
||||
<groupExpression><![CDATA[$F{linha}]]></groupExpression>
|
||||
<groupHeader>
|
||||
<band height="18">
|
||||
<band height="36">
|
||||
<textField isStretchWithOverflow="true">
|
||||
<reportElement uuid="e3c11bc0-5229-4925-b7fe-6a1e572ce946" x="0" y="0" width="801" height="18"/>
|
||||
<textElement>
|
||||
|
@ -43,6 +45,107 @@
|
|||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{linha}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="" isBlankWhenNull="false">
|
||||
<reportElement uuid="d332e48b-a0ae-4382-96bd-cf5c708b560b" mode="Transparent" x="396" y="18" width="65" height="18" forecolor="#000000" backcolor="#FFFFFF"/>
|
||||
<box>
|
||||
<topPen lineWidth="1.0"/>
|
||||
<bottomPen lineWidth="0.0"/>
|
||||
</box>
|
||||
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
|
||||
<font fontName="SansSerif" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
|
||||
<paragraph lineSpacing="Single"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.tarifa}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isStretchWithOverflow="true">
|
||||
<reportElement uuid="5790b9cc-35da-4f6d-85da-66acc015483b" x="0" y="18" width="151" height="18" isPrintWhenDetailOverflows="true"/>
|
||||
<box>
|
||||
<topPen lineWidth="1.0"/>
|
||||
<bottomPen lineWidth="0.0"/>
|
||||
</box>
|
||||
<textElement textAlignment="Center" verticalAlignment="Top">
|
||||
<font size="10"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.origem}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement uuid="cc799fe5-534d-457f-bd27-6bd4f751e9f1" x="721" y="18" width="81" height="18"/>
|
||||
<box>
|
||||
<topPen lineWidth="1.0"/>
|
||||
<bottomPen lineWidth="0.0"/>
|
||||
</box>
|
||||
<textElement textAlignment="Right" verticalAlignment="Top">
|
||||
<font size="10"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.total}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement uuid="ac55c68a-58e3-4b69-a6f0-eba5cfb4e222" x="526" y="18" width="65" height="18"/>
|
||||
<box>
|
||||
<topPen lineWidth="1.0"/>
|
||||
<bottomPen lineWidth="0.0"/>
|
||||
</box>
|
||||
<textElement textAlignment="Right" verticalAlignment="Top">
|
||||
<font size="10"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.taxaEmbarque}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement uuid="ddc57a6d-d56b-418a-967d-c0b99ef3c047" x="591" y="18" width="65" height="18"/>
|
||||
<box>
|
||||
<topPen lineWidth="1.0"/>
|
||||
<bottomPen lineWidth="0.0"/>
|
||||
</box>
|
||||
<textElement textAlignment="Right" verticalAlignment="Top">
|
||||
<font size="10"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.seguro}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement uuid="d49e2013-dad9-4eda-9663-d4541c736bb8" x="656" y="18" width="65" height="18"/>
|
||||
<box>
|
||||
<topPen lineWidth="1.0"/>
|
||||
<bottomPen lineWidth="0.0"/>
|
||||
</box>
|
||||
<textElement textAlignment="Right" verticalAlignment="Top">
|
||||
<font size="10"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.outros}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement uuid="5231cff6-33f4-4afb-bdc1-e1bbc5fd27f8" x="302" y="18" width="94" height="18"/>
|
||||
<box>
|
||||
<topPen lineWidth="1.0"/>
|
||||
<bottomPen lineWidth="0.0"/>
|
||||
</box>
|
||||
<textElement textAlignment="Center" verticalAlignment="Top">
|
||||
<font size="10"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.tipoClasse}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement uuid="70beacf1-7122-49dc-bcde-524300505ee5" x="461" y="18" width="65" height="18"/>
|
||||
<box>
|
||||
<topPen lineWidth="1.0"/>
|
||||
<bottomPen lineWidth="0.0"/>
|
||||
</box>
|
||||
<textElement textAlignment="Right" verticalAlignment="Top">
|
||||
<font size="10"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.pedagio}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="" isBlankWhenNull="false">
|
||||
<reportElement uuid="0b205a4d-6128-4dac-bbd9-eb03ec6f3618" mode="Transparent" x="151" y="18" width="151" height="18" forecolor="#000000" backcolor="#FFFFFF"/>
|
||||
<box>
|
||||
<topPen lineWidth="1.0"/>
|
||||
<bottomPen lineWidth="0.0"/>
|
||||
</box>
|
||||
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
|
||||
<font fontName="SansSerif" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
|
||||
<paragraph lineSpacing="Single"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.destino}]]></textFieldExpression>
|
||||
</textField>
|
||||
</band>
|
||||
</groupHeader>
|
||||
</group>
|
||||
|
@ -75,7 +178,7 @@
|
|||
</groupHeader>
|
||||
</group>
|
||||
<title>
|
||||
<band height="119">
|
||||
<band height="130">
|
||||
<textField pattern="" isBlankWhenNull="false">
|
||||
<reportElement uuid="136a5066-d141-4362-af36-0780f0d16542" mode="Transparent" x="0" y="0" width="457" height="35" forecolor="#000000" backcolor="#FFFFFF"/>
|
||||
<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none">
|
||||
|
@ -141,7 +244,7 @@
|
|||
($P{EMPRESA_ID}.toString() + " - " + $P{EMPRESA})]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isStretchWithOverflow="true">
|
||||
<reportElement uuid="049832ef-f634-42f9-95b1-ac2e1fe23b10" x="0" y="75" width="102" height="18" isPrintWhenDetailOverflows="true"/>
|
||||
<reportElement uuid="049832ef-f634-42f9-95b1-ac2e1fe23b10" x="0" y="112" width="102" height="18" isPrintWhenDetailOverflows="true"/>
|
||||
<box>
|
||||
<bottomPen lineWidth="0.0"/>
|
||||
</box>
|
||||
|
@ -150,14 +253,13 @@
|
|||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.linha} + ":"]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement uuid="df6b8946-988c-479c-8eeb-c8d40c94734b" x="102" y="75" width="586" height="18"/>
|
||||
<textField isStretchWithOverflow="true">
|
||||
<reportElement uuid="df6b8946-988c-479c-8eeb-c8d40c94734b" x="102" y="112" width="586" height="18"/>
|
||||
<textElement/>
|
||||
<textFieldExpression><![CDATA[$P{RUTA_ID} == null ?
|
||||
"Todas" : $P{RUTA}]]></textFieldExpression>
|
||||
<textFieldExpression><![CDATA[$P{LINHAS}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isStretchWithOverflow="true">
|
||||
<reportElement uuid="2d048310-1ec5-4711-b402-75ef3d3500d4" x="0" y="93" width="102" height="18" isPrintWhenDetailOverflows="true"/>
|
||||
<reportElement uuid="2d048310-1ec5-4711-b402-75ef3d3500d4" x="0" y="76" width="102" height="18" isPrintWhenDetailOverflows="true"/>
|
||||
<box>
|
||||
<bottomPen lineWidth="0.0"/>
|
||||
</box>
|
||||
|
@ -167,28 +269,28 @@
|
|||
<textFieldExpression><![CDATA[$R{label.dataVigencia} + ":"]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="dd/MM/yyyy">
|
||||
<reportElement uuid="40c47b73-ef86-4b76-a4bb-ec284d4e6f59" x="102" y="93" width="70" height="18">
|
||||
<reportElement uuid="40c47b73-ef86-4b76-a4bb-ec284d4e6f59" x="102" y="76" width="70" height="18">
|
||||
<printWhenExpression><![CDATA[new Boolean($P{VIGENCIA_ID} != null)]]></printWhenExpression>
|
||||
</reportElement>
|
||||
<textElement textAlignment="Right"/>
|
||||
<textFieldExpression><![CDATA[$P{VIGENCIA_INICIAL}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="dd/MM/yyyy">
|
||||
<reportElement uuid="12564f32-d986-46a6-a184-23b23ba50bcb" x="190" y="93" width="70" height="18">
|
||||
<reportElement uuid="12564f32-d986-46a6-a184-23b23ba50bcb" x="190" y="76" width="70" height="18">
|
||||
<printWhenExpression><![CDATA[new Boolean($P{VIGENCIA_ID} != null)]]></printWhenExpression>
|
||||
</reportElement>
|
||||
<textElement/>
|
||||
<textFieldExpression><![CDATA[$P{VIGENCIA_FINAL}]]></textFieldExpression>
|
||||
</textField>
|
||||
<staticText>
|
||||
<reportElement uuid="bdfc1a2c-9e77-418f-8169-50c67ad7f116" x="172" y="93" width="18" height="18">
|
||||
<reportElement uuid="bdfc1a2c-9e77-418f-8169-50c67ad7f116" x="172" y="76" width="18" height="18">
|
||||
<printWhenExpression><![CDATA[new Boolean($P{VIGENCIA_ID} != null)]]></printWhenExpression>
|
||||
</reportElement>
|
||||
<textElement textAlignment="Center"/>
|
||||
<text><![CDATA[à]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement uuid="1bba53bd-7d81-491b-b1de-11a0c570c5c7" x="102" y="93" width="158" height="18">
|
||||
<reportElement uuid="1bba53bd-7d81-491b-b1de-11a0c570c5c7" x="102" y="76" width="158" height="18">
|
||||
<printWhenExpression><![CDATA[new Boolean($P{VIGENCIA_ID} == null)]]></printWhenExpression>
|
||||
</reportElement>
|
||||
<textElement/>
|
||||
|
@ -214,10 +316,26 @@
|
|||
<textElement textAlignment="Center"/>
|
||||
<textFieldExpression><![CDATA[$F{empresa}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement uuid="0241b100-99d6-4e53-abd1-0154defc75bc" x="102" y="94" width="586" height="18"/>
|
||||
<textElement/>
|
||||
<textFieldExpression><![CDATA[$P{ORGAO_CONCEDENTE_ID} == null ?
|
||||
"Todas" : $P{ORGAO_CONCEDENTE}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isStretchWithOverflow="true">
|
||||
<reportElement uuid="afabe5dc-df90-4120-a42a-af1d3e6df583" x="0" y="94" width="102" height="18" isPrintWhenDetailOverflows="true"/>
|
||||
<box>
|
||||
<bottomPen lineWidth="0.0"/>
|
||||
</box>
|
||||
<textElement textAlignment="Right" verticalAlignment="Top">
|
||||
<font size="10" isBold="true" pdfFontName="Helvetica-Bold"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.orgacaoConcedente} + ":"]]></textFieldExpression>
|
||||
</textField>
|
||||
</band>
|
||||
</title>
|
||||
<columnHeader>
|
||||
<band height="20" splitType="Stretch">
|
||||
<band height="18" splitType="Stretch">
|
||||
<textField isStretchWithOverflow="true">
|
||||
<reportElement uuid="337f441e-ca7f-402c-8407-f3406ec2b4b0" x="0" y="0" width="151" height="18" isPrintWhenDetailOverflows="true"/>
|
||||
<box>
|
||||
|
@ -376,7 +494,7 @@ $F{outros}.doubleValue()]]></textFieldExpression>
|
|||
</band>
|
||||
</detail>
|
||||
<noData>
|
||||
<band height="29">
|
||||
<band height="26">
|
||||
<textField>
|
||||
<reportElement uuid="6f13c961-dd50-4e44-ba73-65e0752b8b83" x="-101" y="0" width="802" height="26"/>
|
||||
<textElement textAlignment="Center" markup="none">
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -10,21 +12,31 @@ 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.Comboitem;
|
||||
import org.zkoss.zul.Paging;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
||||
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioTabelaPreco;
|
||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
||||
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
|
||||
import com.rjconsultores.ventaboletos.service.RutaService;
|
||||
import com.rjconsultores.ventaboletos.service.TarifaService;
|
||||
import com.rjconsultores.ventaboletos.service.VigenciaTarifaService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
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.MyTextbox;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderLinhaRelatorioTabelaPreco;
|
||||
|
||||
@Controller("relatorioTabelaPrecoController")
|
||||
@Scope("prototype")
|
||||
|
@ -36,8 +48,15 @@ public class RelatorioTabelaPrecoController extends MyGenericForwardComposer {
|
|||
private List<VigenciaTarifa> lsVigencia;
|
||||
private MyComboboxEstandar cmbEmpresa;
|
||||
private List<Empresa> lsEmpresa;
|
||||
private MyComboboxEstandar cmbRuta;
|
||||
private List<Ruta> lsRuta;
|
||||
private MyComboboxEstandar cmbOrgaoConcedente;
|
||||
private List<OrgaoConcedente> lsOrcaoConcedente;
|
||||
@Autowired
|
||||
private transient PagedListWrapper<Ruta> plwRuta;
|
||||
|
||||
private Paging pagingLinha;
|
||||
private MyTextbox txtLinha;
|
||||
private MyListbox linhaList;
|
||||
private MyListbox linhaSelList;
|
||||
|
||||
@Autowired
|
||||
private VigenciaTarifaService vigenciaTarifaService;
|
||||
|
@ -45,6 +64,11 @@ public class RelatorioTabelaPrecoController extends MyGenericForwardComposer {
|
|||
private EmpresaService empresaService;
|
||||
@Autowired
|
||||
private RutaService rutaService;
|
||||
@Autowired
|
||||
private OrgaoConcedenteService orgaocConcedenteService;
|
||||
@Autowired
|
||||
private TarifaService tarifaService;
|
||||
|
||||
@Autowired
|
||||
private DataSource dataSourceRead;
|
||||
|
||||
|
@ -52,8 +76,10 @@ public class RelatorioTabelaPrecoController extends MyGenericForwardComposer {
|
|||
public void doAfterCompose(Component comp) throws Exception {
|
||||
lsVigencia = vigenciaTarifaService.obtenerTodos();
|
||||
lsEmpresa = empresaService.obtenerTodos();
|
||||
lsRuta = rutaService.obtenerTodos();
|
||||
lsOrcaoConcedente = orgaocConcedenteService.obtenerTodos();
|
||||
super.doAfterCompose(comp);
|
||||
linhaList.setItemRenderer(new RenderLinhaRelatorioTabelaPreco());
|
||||
linhaSelList.setItemRenderer(new RenderLinhaRelatorioTabelaPreco());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -63,51 +89,110 @@ public class RelatorioTabelaPrecoController extends MyGenericForwardComposer {
|
|||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
private void executarRelatorio() throws Exception {
|
||||
{
|
||||
Relatorio relatorio;
|
||||
Relatorio relatorio;
|
||||
|
||||
Map<String, Object> parametros = new HashMap<String, Object>();
|
||||
Map<String, Object> parametros = new HashMap<String, Object>();
|
||||
|
||||
parametros.put("NOME_RELATORIO", Labels.getLabel("relatorioTabelaPrecoController.window.title"));
|
||||
parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getUsuarioId().toString());
|
||||
parametros.put("USUARIO_NOME", UsuarioLogado.getUsuarioLogado().getNombusuario());
|
||||
parametros.put("NOME_RELATORIO", Labels.getLabel("relatorioTabelaPrecoController.window.title"));
|
||||
parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getUsuarioId().toString());
|
||||
parametros.put("USUARIO_NOME", UsuarioLogado.getUsuarioLogado().getNombusuario());
|
||||
|
||||
Comboitem itemVigencia = cmbVigencia.getSelectedItem();
|
||||
if(itemVigencia != null){
|
||||
VigenciaTarifa vigencia = (VigenciaTarifa) itemVigencia.getValue();
|
||||
parametros.put("VIGENCIA_ID", vigencia.getVigenciatarifaId());
|
||||
parametros.put("VIGENCIA_INICIAL", vigencia.getFeciniciovigencia());
|
||||
parametros.put("VIGENCIA_FINAL", vigencia.getFecfinvigencia());
|
||||
Comboitem itemVigencia = cmbVigencia.getSelectedItem();
|
||||
if (itemVigencia != null) {
|
||||
VigenciaTarifa vigencia = (VigenciaTarifa) itemVigencia.getValue();
|
||||
parametros.put("VIGENCIA_ID", vigencia.getVigenciatarifaId());
|
||||
parametros.put("VIGENCIA_INICIAL", vigencia.getFeciniciovigencia());
|
||||
parametros.put("VIGENCIA_FINAL", vigencia.getFecfinvigencia());
|
||||
}
|
||||
|
||||
Comboitem itemEmpresa = cmbEmpresa.getSelectedItem();
|
||||
if (itemEmpresa != null) {
|
||||
Empresa empresa = (Empresa) itemEmpresa.getValue();
|
||||
parametros.put("EMPRESA_ID", empresa.getEmpresaId());
|
||||
parametros.put("EMPRESA", empresa.getNombempresa());
|
||||
}
|
||||
|
||||
String rutaIds = "";
|
||||
String rutas = "";
|
||||
List<Ruta> lsLinhasSelecionadas = new ArrayList(Arrays.asList(linhaSelList.getData()));
|
||||
if (lsLinhasSelecionadas.isEmpty()) {
|
||||
rutas = "Todas";
|
||||
} else {
|
||||
for (int i = 0; i < lsLinhasSelecionadas.size(); i++) {
|
||||
Ruta ruta = lsLinhasSelecionadas.get(i);
|
||||
rutas += ruta.getDescruta() + ", ";
|
||||
rutaIds += ruta.getRutaId() + ",";
|
||||
}
|
||||
// removendo ultima virgula
|
||||
rutaIds = rutaIds.substring(0, rutaIds.length() - 1);
|
||||
rutas = rutas.substring(0, rutas.length() - 2);
|
||||
parametros.put("LINHAS_ID", rutaIds);
|
||||
}
|
||||
|
||||
Comboitem itemEmpresa = cmbEmpresa.getSelectedItem();
|
||||
if (itemEmpresa != null) {
|
||||
Empresa empresa = (Empresa) itemEmpresa.getValue();
|
||||
parametros.put("EMPRESA_ID", empresa.getEmpresaId());
|
||||
parametros.put("EMPRESA", empresa.getNombempresa());
|
||||
}
|
||||
parametros.put("LINHAS", rutas);
|
||||
relatorio = new RelatorioTabelaPreco(parametros, dataSourceRead.getConnection());
|
||||
|
||||
Comboitem itemRuta = cmbRuta.getSelectedItem();
|
||||
if (itemRuta != null) {
|
||||
Ruta ruta = (Ruta) itemRuta.getValue();
|
||||
parametros.put("RUTA_ID", ruta.getRutaId());
|
||||
parametros.put("RUTA", ruta.getDescruta());
|
||||
}
|
||||
Map args = new HashMap();
|
||||
args.put("relatorio", relatorio);
|
||||
|
||||
relatorio = new RelatorioTabelaPreco(parametros, dataSourceRead.getConnection());
|
||||
|
||||
Map args = new HashMap();
|
||||
args.put("relatorio", relatorio);
|
||||
|
||||
openWindow("/component/reportView.zul",
|
||||
Labels.getLabel("relatorioTabelaPrecoController.window.title"), args, MODAL);
|
||||
}
|
||||
openWindow("/component/reportView.zul",
|
||||
Labels.getLabel("relatorioTabelaPrecoController.window.title"), args, MODAL);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void onClick$btnExecutarRelatorio(Event ev) throws Exception{
|
||||
executarRelatorio();
|
||||
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
|
||||
List<Ruta> lsLinhasSelecionadas = new ArrayList(Arrays.asList(linhaSelList.getData()));
|
||||
if (lsLinhasSelecionadas.isEmpty()) {
|
||||
Messagebox.show(Labels.getLabel("relatorioTabelaPrecoController.msg.informarLinha"),
|
||||
Labels.getLabel("relatorioTabelaPrecoController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
return;
|
||||
}
|
||||
if (cmbVigencia.getValue() != null
|
||||
&& cmbEmpresa.getValue() != null) {
|
||||
executarRelatorio();
|
||||
}
|
||||
}
|
||||
|
||||
public void onClick$btnPesquisa(Event ev) {
|
||||
executarPesquisa();
|
||||
}
|
||||
|
||||
public void onClick$btnLimpar(Event ev) {
|
||||
linhaList.setData(new ArrayList<Ruta>());
|
||||
txtLinha.setText("");
|
||||
}
|
||||
|
||||
public void onDoubleClick$linhaSelList(Event ev) {
|
||||
Ruta linha = (Ruta) linhaSelList.getSelected();
|
||||
linhaSelList.removeItem(linha);
|
||||
}
|
||||
|
||||
public void onDoubleClick$linhaList(Event ev) {
|
||||
Ruta ruta = (Ruta) linhaList.getSelected();
|
||||
linhaSelList.addItemNovo(ruta);
|
||||
}
|
||||
|
||||
private void executarPesquisa() {
|
||||
HibernateSearchObject<Ruta> rutaBusqueda =
|
||||
new HibernateSearchObject<Ruta>(Ruta.class, pagingLinha.getPageSize());
|
||||
|
||||
rutaBusqueda.addFilterILike("descruta", "%" + txtLinha.getValue() + "%");
|
||||
rutaBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
||||
|
||||
plwRuta.init(rutaBusqueda, linhaList, pagingLinha);
|
||||
|
||||
if (linhaList.getData().length == 0) {
|
||||
try {
|
||||
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
|
||||
Labels.getLabel("relatorioTabelaPrecoController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
} catch (InterruptedException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<Empresa> getLsEmpresa() {
|
||||
return lsEmpresa;
|
||||
|
@ -125,22 +210,6 @@ public class RelatorioTabelaPrecoController extends MyGenericForwardComposer {
|
|||
this.cmbEmpresa = cmbEmpresa;
|
||||
}
|
||||
|
||||
public MyComboboxEstandar getCmbRuta() {
|
||||
return cmbRuta;
|
||||
}
|
||||
|
||||
public void setCmbRuta(MyComboboxEstandar cmbRuta) {
|
||||
this.cmbRuta = cmbRuta;
|
||||
}
|
||||
|
||||
public List<Ruta> getLsRuta() {
|
||||
return lsRuta;
|
||||
}
|
||||
|
||||
public void setLsRuta(List<Ruta> lsRuta) {
|
||||
this.lsRuta = lsRuta;
|
||||
}
|
||||
|
||||
public MyComboboxEstandar getCmbVigencia() {
|
||||
return cmbVigencia;
|
||||
}
|
||||
|
@ -157,6 +226,20 @@ public class RelatorioTabelaPrecoController extends MyGenericForwardComposer {
|
|||
this.lsVigencia = lsVigencia;
|
||||
}
|
||||
|
||||
public MyComboboxEstandar getCmbOrgaoConcedente() {
|
||||
return cmbOrgaoConcedente;
|
||||
}
|
||||
|
||||
public void setCmbOrgaoConcedente(MyComboboxEstandar cmbOrgaoConcedente) {
|
||||
this.cmbOrgaoConcedente = cmbOrgaoConcedente;
|
||||
}
|
||||
|
||||
public List<OrgaoConcedente> getLsOrcaoConcedente() {
|
||||
return lsOrcaoConcedente;
|
||||
}
|
||||
|
||||
public void setLsOrcaoConcedente(List<OrgaoConcedente> lsOrcaoConcedente) {
|
||||
this.lsOrcaoConcedente = lsOrcaoConcedente;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||
|
||||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.ListitemRenderer;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||
|
||||
public class RenderLinhaRelatorioTabelaPreco implements ListitemRenderer {
|
||||
|
||||
@Override
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
Ruta ruta = (Ruta) o;
|
||||
|
||||
Listcell lc = new Listcell(ruta.getDescruta());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lstm.setAttribute("data", ruta);
|
||||
}
|
||||
|
||||
}
|
|
@ -4193,8 +4193,10 @@ relatorioCancelamentoTransacaoController.lbBilheteiro.value = Bilheteiro
|
|||
#Relatorio de Tabela Preco
|
||||
relatorioTabelaPrecoController.window.title = Relatório de Tabela de Preços
|
||||
relatorioTabelaPrecoController.vigencia = Vigência
|
||||
relatorioTabelaPrecoController.orgaoConcedente.value = Orgão Concedente
|
||||
relatorioTabelaPrecoController.lbEmpresa.value = Empresa
|
||||
relatorioTabelaPrecoController.lbLinha.value = Linha
|
||||
relatorioTabelaPrecoController.msg.informarLinha = É obrigatório informar pelo menos uma linha no filtro.
|
||||
|
||||
# Editar Motivo cancelación equivalencia
|
||||
editarMotivoCancelacionEquivalenciaController.window.title = Equivalencia motivo de cancelación
|
||||
|
|
|
@ -4255,8 +4255,10 @@ relatorioCancelamentoTransacaoController.lbBilheteiro.value = Bilheteiro
|
|||
#Relatorio de Tabela Preco
|
||||
relatorioTabelaPrecoController.window.title = Relatório de Tabela de Preços
|
||||
relatorioTabelaPrecoController.vigencia = Vigência
|
||||
relatorioTabelaPrecoController.orgaoConcedente.value = Orgão Concedente
|
||||
relatorioTabelaPrecoController.lbEmpresa.value = Empresa
|
||||
relatorioTabelaPrecoController.lbLinha.value = Linha
|
||||
relatorioTabelaPrecoController.msg.informarLinha = É obrigatório informar pelo menos uma linha no filtro.
|
||||
|
||||
# Editar Motivo cancelamento equivalencia
|
||||
editarMotivoCancelacionEquivalenciaController.window.title = Equivalencia Motivo de Cancelamento
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||
<window id="winFiltroRelatorioTabelaPreco"
|
||||
apply="${relatorioTabelaPrecoController}" contentStyle="overflow:auto"
|
||||
height="150px" width="550px" border="normal">
|
||||
height="312px" width="550px" border="normal">
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="25%" />
|
||||
|
@ -23,9 +23,18 @@
|
|||
buttonVisible="true"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
model="@{winFiltroRelatorioTabelaPreco$composer.lsVigencia}"
|
||||
width="100%"
|
||||
constraint="no empty" />
|
||||
</row>
|
||||
<row spans="1,3">
|
||||
<label
|
||||
value="${c:l('relatorioTabelaPrecoController.orgaoConcedente.value')}" />
|
||||
<combobox id="cmbOrgaoConcedente"
|
||||
buttonVisible="true"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
model="@{winFiltroRelatorioTabelaPreco$composer.lsOrcaoConcedente}"
|
||||
width="100%" />
|
||||
</row>
|
||||
|
||||
<row spans="1,3">
|
||||
<label
|
||||
value="${c:l('relatorioTabelaPrecoController.lbEmpresa.value')}" />
|
||||
|
@ -33,15 +42,53 @@
|
|||
buttonVisible="true"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
model="@{winFiltroRelatorioTabelaPreco$composer.lsEmpresa}"
|
||||
width="100%" />
|
||||
width="100%"
|
||||
constraint="no empty" />
|
||||
</row>
|
||||
<row spans="1,3">
|
||||
<label
|
||||
value="${c:l('relatorioTabelaPrecoController.lbLinha.value')}" />
|
||||
<combobox id="cmbRuta" buttonVisible="true"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
model="@{winFiltroRelatorioTabelaPreco$composer.lsRuta}"
|
||||
width="100%" />
|
||||
value="${c:l('relatorioTabelaPrecoController.lbLinha.value')}"/>
|
||||
<bandbox id="bbPesquisaLinha" width="100%"
|
||||
mold="rounded" readonly="true">
|
||||
<bandpopup>
|
||||
<vbox>
|
||||
<hbox>
|
||||
<label
|
||||
value="${c:l('relatorioTabelaPrecoController.lbLinha.value')}" />
|
||||
<textbox id="txtLinha"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
|
||||
width="300px" mold="rounded" />
|
||||
<button id="btnPesquisa"
|
||||
image="/gui/img/find.png"
|
||||
label="${c:l('relatorioCancelamentoVendaCartaoController.btnPesquisa.label')}" />
|
||||
<button id="btnLimpar"
|
||||
image="/gui/img/eraser.png"
|
||||
label="${c:l('relatorioCancelamentoVendaCartaoController.btnLimpar.label')}" />
|
||||
</hbox>
|
||||
<paging id="pagingLinha" pageSize="10" />
|
||||
<listbox id="linhaList"
|
||||
mold="paging"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
vflex="true" height="100%" width="700px">
|
||||
<listhead>
|
||||
<listheader
|
||||
label="${c:l('relatorioTabelaPrecoController.lbLinha.value')}" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
</vbox>
|
||||
</bandpopup>
|
||||
</bandbox>
|
||||
</row>
|
||||
<row spans="4">
|
||||
<listbox id="linhaSelList" mold="paging"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
vflex="true" height="100px" width="100%">
|
||||
<listhead>
|
||||
<listheader
|
||||
label="${c:l('relatorioTabelaPrecoController.lbLinha.value')}" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
<paging id="pagingSelLinha" pageSize="10" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
|
Loading…
Reference in New Issue