dev:emerson
qua:jose

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@91773 d1611594-4594-4d17-8e1d-87c2c4800839
master
frederico 2019-04-10 18:02:06 +00:00
parent 5454d35e69
commit 8ac12743ee
8 changed files with 303 additions and 6 deletions

View File

@ -0,0 +1,45 @@
package com.rjconsultores.ventaboletos.relatorios.impl;
import java.sql.Connection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.rjconsultores.ventaboletos.entidad.CtrlSerieEmbarcada;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.ArrayDataSource;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
public class RelatorioAutorizacaoUsoSerieEmbarcada extends Relatorio {
public RelatorioAutorizacaoUsoSerieEmbarcada(final List<CtrlSerieEmbarcada> listaSerieEmbarcada, Connection conexao, HashMap<String, Object> parametros) throws Exception {
super(parametros, conexao);
this.setCustomDataSource(new ArrayDataSource(this) {
public void initDados() throws Exception {
for(CtrlSerieEmbarcada c : listaSerieEmbarcada) {
Map<String, Object> dataResult = new HashMap<String, Object>();
dataResult.put("id", c.getCtrlSerieEmbarcadaId());
dataResult.put("empresa", c.getEmpresa().getNombempresa());
dataResult.put("uf", c.getEstado().getCveestado());
dataResult.put("serieBPe", c.getSerie());
dataResult.put("numeroBPe", c.getNumeroCorrente());
dataResult.put("descricao", c.getDispositivoEmbarcada() == null ? "" : c.getDispositivoEmbarcada().getDescricao());
dataResult.put("puntoVenta", c.getPuntoventa().getNombpuntoventa());
this.dados.add(dataResult);
}
}
});
}
@Override
protected void processaParametros() throws Exception {
}
}

View File

@ -0,0 +1,20 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
#Labels cabeçalho
cabecalho.relatorio=Relatório:
cabecalho.periodo=Período:
cabecalho.periodoA=à
cabecalho.dataHora=Data/Hora:
cabecalho.impressorPor=Impressor por:
cabecalho.pagina=Página
cabecalho.de=de
cabecalho.filtros=Filtros:
label.id=Id
label.empresa=Empresa
label.uf=UF
label.serieBPe=Série BPe
label.numeroBPe=Número BPe
label.puntoVenta=Agência
label.descricao=Descrição

View File

@ -0,0 +1,20 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
#Labels cabeçalho
cabecalho.relatorio=Relatório:
cabecalho.periodo=Período:
cabecalho.periodoA=à
cabecalho.dataHora=Data/Hora:
cabecalho.impressorPor=Impressor por:
cabecalho.pagina=Página
cabecalho.de=de
cabecalho.filtros=Filtros:
label.id=Id
label.empresa=Empresa
label.uf=UF
label.serieBPe=Série BPe
label.numeroBPe=Número BPe
label.puntoVenta=Agência
label.descricao=Descrição

View File

@ -0,0 +1,190 @@
<?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="RelatorioAutorizacaoUsoSerieEmbarcada" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="80333c1e-aee0-443d-a3e3-9f56f7537835">
<property name="ireport.zoom" value="1.7715610000000015"/>
<property name="ireport.x" value="194"/>
<property name="ireport.y" value="13"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.band.1" value="title"/>
<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="NOME_RELATORIO" class="java.lang.String"/>
<parameter name="USUARIO" class="java.lang.String"/>
<field name="id" class="java.lang.Long"/>
<field name="empresa" class="java.lang.String"/>
<field name="uf" class="java.lang.String"/>
<field name="serieBPe" class="java.lang.String"/>
<field name="numeroBPe" class="java.lang.String"/>
<field name="puntoVenta" class="java.lang.String"/>
<field name="descricao" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="57" splitType="Stretch">
<textField pattern="" isBlankWhenNull="false">
<reportElement uuid="6b9dfb4a-ddaf-4fbf-a0bf-97ed7880731e" mode="Transparent" x="0" y="0" width="266" height="41" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="14" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$P{NOME_RELATORIO}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement uuid="c5627956-e2cb-4070-883a-1ed2998db73a" mode="Transparent" x="266" y="25" width="267" height="16" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.pagina}+" "+$V{PAGE_NUMBER}+" "+$R{cabecalho.de}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement uuid="5095b103-3ebc-4cf5-82ae-7092660d11f3" mode="Transparent" x="451" y="42" width="104" height="15" forecolor="#000000" backcolor="#FFFFFF"/>
<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{cabecalho.impressorPor}+" "+$P{USUARIO}]]></textFieldExpression>
</textField>
<textField evaluationTime="Report" pattern="" isBlankWhenNull="false">
<reportElement uuid="0fa5256d-13fa-42d6-80ba-34ef46118d57" mode="Transparent" x="534" y="25" width="21" height="16" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="94271174-f7ce-4c3a-9069-c985501bf0b3" x="266" y="0" width="185" height="25"/>
<textElement textAlignment="Right">
<font size="9" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.dataHora}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy HH:mm" isBlankWhenNull="false">
<reportElement uuid="912b0160-b0a3-4755-a620-ba63174cf0bd" mode="Transparent" x="451" y="0" width="104" height="25" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
</band>
</title>
<columnHeader>
<band height="15">
<textField>
<reportElement uuid="e1ed78f4-b080-4ac6-86c4-067b4e92c6df" x="0" y="0" width="35" height="15"/>
<textElement>
<font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.id}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="19d02b6a-9f42-43ef-b6d5-5edfdef3cea6" x="35" y="0" width="111" height="15"/>
<textElement>
<font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.empresa}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="72d6c5c1-f8ee-4372-b28a-8dee03ccf53e" x="146" y="0" width="47" height="15"/>
<textElement>
<font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.uf}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="b8e37e21-ab81-4a48-88d7-bafe610d1ff7" x="193" y="0" width="57" height="15"/>
<textElement>
<font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.serieBPe}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="dc9e2ca1-f6d1-463f-83ab-2161737626ac" x="250" y="0" width="65" height="15"/>
<textElement>
<font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.numeroBPe}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="9be1c0db-1e38-4131-9c8c-6dbb67ff1bef" x="419" y="0" width="136" height="15"/>
<textElement>
<font size="8" isBold="true" isStrikeThrough="false" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.puntoVenta}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="7e035096-8647-4536-a198-ec2beab06011" x="315" y="0" width="104" height="15"/>
<textElement>
<font size="8" isBold="true" isStrikeThrough="false" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.descricao}]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band height="15" splitType="Stretch">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="606a9fa9-a504-4e44-8d5a-4bbfd15da803" stretchType="RelativeToTallestObject" x="0" y="0" width="35" height="15" isPrintWhenDetailOverflows="true"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{id}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="196d04fa-0c3d-4cf0-a303-00da088582a4" stretchType="RelativeToTallestObject" x="35" y="0" width="111" height="15" isPrintWhenDetailOverflows="true"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{empresa}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="31fb0756-5267-4baa-9f1c-f367560bd206" stretchType="RelativeToTallestObject" x="146" y="0" width="47" height="15" isPrintWhenDetailOverflows="true"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{uf}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="446b1abf-0ae2-41e1-bf1b-88a15f5629b3" stretchType="RelativeToTallestObject" x="193" y="0" width="57" height="15" isPrintWhenDetailOverflows="true"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{serieBPe}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="81f320e3-5034-466c-b493-93234ef81fed" stretchType="RelativeToTallestObject" x="250" y="0" width="65" height="15" isPrintWhenDetailOverflows="true"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{numeroBPe}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="fd601e31-56df-440d-a430-05d203674fb2" stretchType="RelativeToTallestObject" x="419" y="0" width="136" height="15" isPrintWhenDetailOverflows="true"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{puntoVenta}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="b43a3b63-7508-4978-ad7e-a4eb926be707" stretchType="RelativeToTallestObject" x="315" y="0" width="104" height="15" isPrintWhenDetailOverflows="true"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{descricao}]]></textFieldExpression>
</textField>
</band>
</detail>
<noData>
<band height="56">
<textField>
<reportElement uuid="13e0e8a7-14fd-4ee8-a79c-a99ecf77560a" x="0" y="30" width="555" height="26"/>
<textElement markup="none">
<font size="11" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
</textField>
</band>
</noData>
</jasperReport>

View File

@ -5,6 +5,8 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -23,6 +25,8 @@ import com.rjconsultores.ventaboletos.entidad.DispositivoEmbarcada;
import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.Estado; import com.rjconsultores.ventaboletos.entidad.Estado;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta; import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioAutorizacaoUsoSerieEmbarcada;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.service.EstadoService; import com.rjconsultores.ventaboletos.service.EstadoService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar; import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
@ -48,6 +52,9 @@ public class BusquedaAutorizacaoUsoSerieEmbarcadaController extends MyGenericFor
@Autowired @Autowired
private DispositivoEmbarcadaDAO dispositivoEmbarcadaDAO; private DispositivoEmbarcadaDAO dispositivoEmbarcadaDAO;
@Autowired
private DataSource dataSourceRead;
private MyComboboxEstandar cmbEmpresa; private MyComboboxEstandar cmbEmpresa;
private List<Empresa> lsEmpresa; private List<Empresa> lsEmpresa;
@ -194,13 +201,27 @@ public class BusquedaAutorizacaoUsoSerieEmbarcadaController extends MyGenericFor
refreshLista(); refreshLista();
} }
public void onClick$btnExportarPdf(Event ev) throws SQLException, Exception { @SuppressWarnings({ "unchecked", "rawtypes" })
public void onClick$btnExportar(Event ev) throws SQLException, Exception {
List<CtrlSerieEmbarcada> selecao = autorizacaoUsoSerieEmbarcadaList.getListData();
if (selecao == null || selecao.isEmpty()) {
return;
}
HashMap<String, Object> parametros = new HashMap<String, Object>();
parametros.put("NOME_RELATORIO", Labels.getLabel("autorizacaoUsoSerieEmbarcadaController.relatorio.titulo"));
parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getUsuarioId().toString());
parametros.put("USUARIO_NOME", UsuarioLogado.getUsuarioLogado().getNombusuario());
Relatorio relatorio = new RelatorioAutorizacaoUsoSerieEmbarcada(selecao, dataSourceRead.getConnection(), parametros);
Map args = new HashMap();
args.put("relatorio", relatorio);
openWindow("/component/reportView.zul",
Labels.getLabel("autorizacaoUsoSerieEmbarcadaController.relatorio.titulo"), args, MODAL);
} }
public void onClick$btnExportarXls(Event ev) throws SQLException, Exception {
}
public void onClick$btnNovo(Event ev) { public void onClick$btnNovo(Event ev) {
editar(new CtrlSerieEmbarcada()); editar(new CtrlSerieEmbarcada());

View File

@ -8043,6 +8043,7 @@ autorizacaoUsoSerieEmbarcadaController.descricao.value = Descrição
autorizacaoUsoSerieEmbarcadaController.serie.value = Série autorizacaoUsoSerieEmbarcadaController.serie.value = Série
autorizacaoUsoSerieEmbarcadaController.mac.value = MAC autorizacaoUsoSerieEmbarcadaController.mac.value = MAC
autorizacaoUsoSerieEmbarcadaController.mei.value = IMEI autorizacaoUsoSerieEmbarcadaController.mei.value = IMEI
autorizacaoUsoSerieEmbarcadaController.relatorio.titulo=Relatório Uso de Série por Dispositivo
autorizacaoUsoSerieEmbarcadaController.id.value=ID autorizacaoUsoSerieEmbarcadaController.id.value=ID
autorizacaoUsoSerieEmbarcadaController.empresa.value=EMPRESA autorizacaoUsoSerieEmbarcadaController.empresa.value=EMPRESA

View File

@ -8466,8 +8466,7 @@ dispositivoVendaEmbarcadaController.dataHora.value = Data/Hora
dispositivoVendaEmbarcadaController.tipoBloqueioDispositivoEmbarcada.value = Tipo Bloqueio dispositivoVendaEmbarcadaController.tipoBloqueioDispositivoEmbarcada.value = Tipo Bloqueio
dispositivoVendaEmbarcadaController.btnAdicionar.tooltiptext = Incluir dispositivoVendaEmbarcadaController.btnAdicionar.tooltiptext = Incluir
dispositivoVendaEmbarcadaController.btnRemover.tooltiptext = Eliminar dispositivoVendaEmbarcadaController.btnRemover.tooltiptext = Eliminar
dispositivoVendaEmbarcadaController.btnExportarPdf.label = Salvar PDF dispositivoVendaEmbarcadaController.btnExportar.label = Exportar Relatório
dispositivoVendaEmbarcadaController.btnExportarXls.label = Salvar XLS
dispositivoVendaEmbarcadaController.mniRelatorioDispositivoEmbarcada.label = Relatório Dispositivo Embarcada dispositivoVendaEmbarcadaController.mniRelatorioDispositivoEmbarcada.label = Relatório Dispositivo Embarcada
editarDispositivoVendaEmbarcadaController.MSG.suscribirOK = Dispositivo cadastrado com sucesso! editarDispositivoVendaEmbarcadaController.MSG.suscribirOK = Dispositivo cadastrado com sucesso!
editarDispositivoVendaEmbarcadaController.window.title = Cadastro Dispositivo Embarcada editarDispositivoVendaEmbarcadaController.window.title = Cadastro Dispositivo Embarcada
@ -8539,6 +8538,7 @@ autorizacaoUsoSerieEmbarcadaController.descricao.value = Descrição
autorizacaoUsoSerieEmbarcadaController.serie.value = Série autorizacaoUsoSerieEmbarcadaController.serie.value = Série
autorizacaoUsoSerieEmbarcadaController.mac.value = MAC autorizacaoUsoSerieEmbarcadaController.mac.value = MAC
autorizacaoUsoSerieEmbarcadaController.mei.value = IMEI autorizacaoUsoSerieEmbarcadaController.mei.value = IMEI
autorizacaoUsoSerieEmbarcadaController.relatorio.titulo=Relatório Uso de Série por Dispositivo
autorizacaoUsoSerieEmbarcadaController.id.value=ID autorizacaoUsoSerieEmbarcadaController.id.value=ID
autorizacaoUsoSerieEmbarcadaController.empresa.value=EMPRESA autorizacaoUsoSerieEmbarcadaController.empresa.value=EMPRESA