fixes bug#AL-2963

Melhorias Relatorio Vijar Detalhado
master
Gleison da Cruz 2023-07-24 10:34:59 -03:00
parent c020d4398d
commit aad6f2641c
9 changed files with 101 additions and 23 deletions

View File

@ -4,12 +4,12 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>br.com.rjconsultores</groupId> <groupId>br.com.rjconsultores</groupId>
<artifactId>ventaboletosadm</artifactId> <artifactId>ventaboletosadm</artifactId>
<version>1.10.5</version> <version>1.10.6</version>
<packaging>war</packaging> <packaging>war</packaging>
<properties> <properties>
<modelWeb.version>1.7.2</modelWeb.version> <modelWeb.version>1.7.3</modelWeb.version>
<flyway.version>1.6.1</flyway.version> <flyway.version>1.6.2</flyway.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties> </properties>

View File

@ -64,23 +64,44 @@ public class RelatorioPassageirosViajarDetalhado extends Relatorio {
String empresaId = (String) parametros.get("EMPRESA_ID"); String empresaId = (String) parametros.get("EMPRESA_ID");
String categorias = (String) parametros.get("LS_CATEGORIA"); String categorias = (String) parametros.get("LS_CATEGORIA");
Integer usuario = (Integer) parametros.get("USUARIO"); Integer usuario = (Integer) parametros.get("USUARIO");
String servico = (String) parametros.get("CORRIDA_ID");
sql.append(" SELECT ROWNUM AS NUMERO, "); sql.append(" SELECT ROWNUM AS NUMERO, ");
sql.append(" NOME, ");
sql.append(" RG, ");
sql.append(" LOCALIZADOR, ");
sql.append(" ENDERECO, ");
sql.append(" NUMTELEFONO, ");
sql.append(" AGENTE, ");
sql.append(" CONTROLE ");
sql.append(" FROM( ");
sql.append(" SELECT ");
sql.append(" B.NOMBPASAJERO AS NOME, "); sql.append(" B.NOMBPASAJERO AS NOME, ");
sql.append(" CASE B.DESCTIPODOC WHEN 'RG' THEN B.DESCNUMDOC END AS RG, "); sql.append(" DESCNUMDOC AS RG, ");
sql.append(" COALESCE(B.NUMFOLIOSISTEMA, B.NUMOPERACION) AS LOCALIZADOR, "); sql.append(" B.INFOPASAJERO AS LOCALIZADOR, ");
sql.append(" CD.DESCCALLE AS ENDERECO, "); sql.append(" B.DESCENDERECO AS ENDERECO, ");
sql.append(" C.NUMTELEFONO, "); sql.append(" B.DESCTELEFONO AS NUMTELEFONO, ");
sql.append(" U.CVEUSUARIO AS AGENTE, "); sql.append(" U.CVEUSUARIO AS AGENTE, ");
sql.append(" '''' AS CONTROLE "); sql.append(" ' ' AS CONTROLE ");
sql.append(" FROM BOLETO B INNER JOIN USUARIO U ON (B.USUARIO_ID = U.USUARIO_ID) "); sql.append(" FROM BOLETO B INNER JOIN USUARIO U ON (B.USUARIO_ID = U.USUARIO_ID) ");
sql.append(" LEFT JOIN CLIENTE C ON (B.CLIENTE_ID = C.CLIENTE_ID) "); sql.append(" WHERE B.INDSTATUSBOLETO = 'V' AND B.MOTIVOCANCELACION_ID IS NULL "+passagemAberta+" ");
sql.append(" LEFT JOIN CLIENTE_DIRECCION CD ON (C.CLIENTE_ID = CD.CLIENTE_ID) ");
sql.append("WHERE B.TIPOVENTA_ID = 15 ");
if (dataCadastroInicial != null && dataCadastroFinal != null) { if (dataCadastroInicial != null && dataCadastroFinal != null) {
sql.append("AND B.FECCREACION BETWEEN TO_DATE('" + formatSemHora.format(dataCadastroInicial) + " 00:00:00', " + formatToDate + ") " sql.append("AND B.FECCREACION BETWEEN TO_DATE('" + formatSemHora.format(dataCadastroInicial) + " 00:00:00', " + formatToDate + ") "
+ "AND TO_DATE('" + formatSemHora.format(dataCadastroFinal) + " 23:59:59', " + formatToDate + ") "); + "AND TO_DATE('" + formatSemHora.format(dataCadastroFinal) + " 23:59:59', " + formatToDate + ") ");
} }
if (empresaId != null && !empresaId.equals("") && !empresaId.equals("-1")) {
sql.append(" AND B.EMPRESACORRIDA_ID = "+empresaId+" ");
}
if (categorias != null && !categorias.equals("") && !categorias.equals("-1")) {
sql.append(" AND B.CATEGORIA_ID IN "+categorias+" ");
}
if (servico != null && !servico.equals("") && !servico.equals("-1")) {
sql.append(" AND B.CORRIDA_ID = "+servico+" ");
}
sql.append(" ORDER BY 1 ");
sql.append(") ");
return sql.toString(); return sql.toString();
} }

View File

@ -20,16 +20,13 @@
<title> <title>
<band height="79" splitType="Stretch"> <band height="79" splitType="Stretch">
<textField pattern="" isBlankWhenNull="false"> <textField pattern="" isBlankWhenNull="false">
<reportElement uuid="96eded89-d7ca-4186-a91e-41fcd6baf278" mode="Transparent" x="0" y="0" width="457" height="41" forecolor="#000000" backcolor="#FFFFFF"/> <reportElement uuid="96eded89-d7ca-4186-a91e-41fcd6baf278" mode="Transparent" x="1" y="50" width="831" height="28" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none"> <textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="14" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <font fontName="SansSerif" size="14" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/> <paragraph lineSpacing="Single"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$P{NOME_RELATORIO}]]></textFieldExpression> <textFieldExpression><![CDATA[$P{NOME_RELATORIO}]]></textFieldExpression>
</textField> </textField>
<line>
<reportElement uuid="041f4c8d-2436-490c-b906-77c8780b5425" x="-1" y="58" width="832" height="1"/>
</line>
<line> <line>
<reportElement uuid="51d2aa74-94f4-440a-959f-2c9acc1902c7" positionType="Float" x="-1" y="78" width="832" height="1"/> <reportElement uuid="51d2aa74-94f4-440a-959f-2c9acc1902c7" positionType="Float" x="-1" y="78" width="832" height="1"/>
</line> </line>

View File

@ -19,12 +19,15 @@ import org.zkoss.util.resource.Labels;
import org.zkoss.zhtml.Messagebox; import org.zkoss.zhtml.Messagebox;
import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
import org.zkoss.zul.Button;
import org.zkoss.zul.Checkbox; import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Combobox; import org.zkoss.zul.Combobox;
import org.zkoss.zul.Datebox; import org.zkoss.zul.Datebox;
import org.zkoss.zul.Label;
import org.zkoss.zul.Paging; import org.zkoss.zul.Paging;
import org.zkoss.zul.Textbox; import org.zkoss.zul.Textbox;
import com.rjconsultores.ventaboletos.constantes.ConstantesFuncionSistema;
import com.rjconsultores.ventaboletos.entidad.Categoria; import com.rjconsultores.ventaboletos.entidad.Categoria;
import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioPassageirosViajar; import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioPassageirosViajar;
@ -32,9 +35,11 @@ import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioPassageirosViajar
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.service.CategoriaService; import com.rjconsultores.ventaboletos.service.CategoriaService;
import com.rjconsultores.ventaboletos.service.EmpresaService; import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.service.PerfilFuncionService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; 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.HibernateSearchObject;
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCategoriaSimple; import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCategoriaSimple;
@ -47,7 +52,9 @@ import com.trg.search.Filter;
@Controller("relatorioPassageirosViajarController") @Controller("relatorioPassageirosViajarController")
@Scope("prototype") @Scope("prototype")
public class RelatorioPassageirosViajarController extends MyGenericForwardComposer { public class RelatorioPassageirosViajarController extends MyGenericForwardComposer {
@Autowired
private PerfilFuncionService perfilFuncionService;
@Autowired @Autowired
private EmpresaService empresaService; private EmpresaService empresaService;
@Autowired @Autowired
@ -67,6 +74,9 @@ public class RelatorioPassageirosViajarController extends MyGenericForwardCompos
private Datebox datInicial; private Datebox datInicial;
private Datebox datFinal; private Datebox datFinal;
private Checkbox chkPassageiroAberto; private Checkbox chkPassageiroAberto;
private Button btnExecutarRelatorioDetalhado;
private MyTextbox txtCorridaId;
private org.zkoss.zul.Label lblCorridaId;
public Datebox getDatInicial() { public Datebox getDatInicial() {
return datInicial; return datInicial;
@ -261,7 +271,7 @@ public class RelatorioPassageirosViajarController extends MyGenericForwardCompos
parametros.put("DATA_INICIO", datInicial.getValue()); parametros.put("DATA_INICIO", datInicial.getValue());
parametros.put("DATA_FINAL", datFinal.getValue()); parametros.put("DATA_FINAL", datFinal.getValue());
String passagemAberta = " and (B.feccorrida is null and B.corrida_id is null) "; String passagemAberta = "";
if (!chkPassageiroAberto.isChecked()) { if (!chkPassageiroAberto.isChecked()) {
passagemAberta = " and (B.feccorrida is not null and B.corrida_id is not null) "; passagemAberta = " and (B.feccorrida is not null and B.corrida_id is not null) ";
} }
@ -269,9 +279,11 @@ public class RelatorioPassageirosViajarController extends MyGenericForwardCompos
Empresa e = (Empresa) cmbEmpresa.getSelectedItem().getValue(); Empresa e = (Empresa) cmbEmpresa.getSelectedItem().getValue();
parametros.put("EMPRESA_ID", e.getEmpresaId().toString()); parametros.put("EMPRESA_ID", e.getEmpresaId().toString());
parametros.put("NOME_RELATORIO", Labels.getLabel("relatorioCadastroClientesController.window.title")); parametros.put("NOME_RELATORIO", Labels.getLabel("relatorioPassageirosViajarControllerDetalhado.window.title"));
parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getUsuarioId().toString()); parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getUsuarioId().toString());
parametros.put("USUARIO_NOME", UsuarioLogado.getUsuarioLogado().getNombusuario()); parametros.put("USUARIO_NOME", UsuarioLogado.getUsuarioLogado().getNombusuario());
String strNumCategoria=""; String strNumCategoria="";
@ -290,6 +302,8 @@ public class RelatorioPassageirosViajarController extends MyGenericForwardCompos
parametros.put("LS_CATEGORIA", sbCategoria.toString()); parametros.put("LS_CATEGORIA", sbCategoria.toString());
parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getUsuarioId()); parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getUsuarioId());
parametros.put("CORRIDA_ID", txtCorridaId.getValue());
Relatorio relatorio = new RelatorioPassageirosViajarDetalhado(parametros, dataSourceRead.getConnection()); Relatorio relatorio = new RelatorioPassageirosViajarDetalhado(parametros, dataSourceRead.getConnection());
@ -309,7 +323,10 @@ public class RelatorioPassageirosViajarController extends MyGenericForwardCompos
categoriaList.setItemRenderer(new RenderCategoriaSimple()); categoriaList.setItemRenderer(new RenderCategoriaSimple());
categoriaSelList.setItemRenderer(new RenderCategoriaSimple()); categoriaSelList.setItemRenderer(new RenderCategoriaSimple());
boolean verDetalhado = possuiPermissaoRelatorioViajarDetalhado();
btnExecutarRelatorioDetalhado.setVisible(verDetalhado);
txtCorridaId.setVisible(verDetalhado);
lblCorridaId.setVisible(verDetalhado);
} }
public void onDoubleClick$categoriaList(Event ev) { public void onDoubleClick$categoriaList(Event ev) {
@ -322,4 +339,36 @@ public class RelatorioPassageirosViajarController extends MyGenericForwardCompos
Categoria categoriaSel = (Categoria) categoriaSelList.getSelected(); Categoria categoriaSel = (Categoria) categoriaSelList.getSelected();
categoriaSelList.removeItem(categoriaSel); categoriaSelList.removeItem(categoriaSel);
} }
public Button getbtnExecutarRelatorioDetalhado() {
return btnExecutarRelatorioDetalhado;
}
public void setbtnExecutarRelatorioDetalhado(Button btnExecutarRelatorioDetalhado) {
this.btnExecutarRelatorioDetalhado = btnExecutarRelatorioDetalhado;
}
public Label getlblCorridaId() {
return lblCorridaId;
}
public void setgetlblCorridaId(Label lblCorridaId) {
this.lblCorridaId = lblCorridaId;
}
public MyTextbox getTxtCorridaId() {
return txtCorridaId;
}
public void setTxtCorridaId(MyTextbox txtCorridaId) {
this.txtCorridaId = txtCorridaId;
}
private boolean possuiPermissaoRelatorioViajarDetalhado() {
return perfilFuncionService.usuarioPossuiPermissaoFuncionalidade(
UsuarioLogado.getUsuarioLogado().getUsuarioId(), ConstantesFuncionSistema.CLAVE_MENU_RELATORIOS_VIAJAR_DETALHADO);
}
} }

View File

@ -7831,6 +7831,7 @@ relatorioLinhaOperacionalController.lblEspecie.value = Espécie
#Relatorio Pasajeiros Viajar #Relatorio Pasajeiros Viajar
relatorioPassageirosViajarController.window.title = Passageiros a viajar relatorioPassageirosViajarController.window.title = Passageiros a viajar
relatorioPassageirosViajarControllerDetalhado.window.title = LISTA DE PASSAGEIROS relatorioPassageirosViajarControllerDetalhado.window.title = LISTA DE PASSAGEIROS
relatorioPassageirosViajarController.lbServico.value = Nº Serviço
relatorioPassageirosViajarController.lbDataIni.value = Data Inicial relatorioPassageirosViajarController.lbDataIni.value = Data Inicial
relatorioPassageirosViajarController.lbDataFin.value = Data Final relatorioPassageirosViajarController.lbDataFin.value = Data Final
relatorioPassageirosViajarController.lbEmpresa.value = Empresa relatorioPassageirosViajarController.lbEmpresa.value = Empresa

View File

@ -7328,6 +7328,8 @@ relatorioLinhaOperacionalController.lblEspecie.value = Espécie
#Relatorio Pasajeiros Viajar #Relatorio Pasajeiros Viajar
relatorioPassageirosViajarController.window.title = Pasajeros a viajar relatorioPassageirosViajarController.window.title = Pasajeros a viajar
relatorioPassageirosViajarControllerDetalhado.window.title = LISTA DE PASSAGEIROS
relatorioPassageirosViajarController.lbServico.value = Nº Serviço
relatorioPassageirosViajarController.lbDataIni.value = Fecha inicial relatorioPassageirosViajarController.lbDataIni.value = Fecha inicial
relatorioPassageirosViajarController.lbDataFin.value = Fecha final relatorioPassageirosViajarController.lbDataFin.value = Fecha final
relatorioPassageirosViajarController.lbEmpresa.value = Empresa relatorioPassageirosViajarController.lbEmpresa.value = Empresa

View File

@ -7854,6 +7854,8 @@ relatorioLinhaOperacionalController.lblEspecie.value = Espécie
#Relatorio Pasajeiros Viajar #Relatorio Pasajeiros Viajar
relatorioPassageirosViajarController.window.title = Passageiros a viajar relatorioPassageirosViajarController.window.title = Passageiros a viajar
relatorioPassageirosViajarControllerDetalhado.window.title = LISTA DE PASSAGEIROS
relatorioPassageirosViajarController.lbServico.value = Nº Serviço
relatorioPassageirosViajarController.lbDataIni.value = Data Inicial relatorioPassageirosViajarController.lbDataIni.value = Data Inicial
relatorioPassageirosViajarController.lbDataFin.value = Data Final relatorioPassageirosViajarController.lbDataFin.value = Data Final
relatorioPassageirosViajarController.lbEmpresa.value = Empresa relatorioPassageirosViajarController.lbEmpresa.value = Empresa

View File

@ -7,7 +7,7 @@
<zk xmlns="http://www.zkoss.org/2005/zul"> <zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winFiltroRelatorioPassageirosViajar" <window id="winFiltroRelatorioPassageirosViajar"
apply="${relatorioPassageirosViajarController}" apply="${relatorioPassageirosViajarController}"
contentStyle="overflow:auto" height="238px" width="550px" contentStyle="overflow:auto" height="260px" width="550px"
border="normal"> border="normal">
<grid fixedLayout="true"> <grid fixedLayout="true">
<columns> <columns>
@ -93,6 +93,13 @@
</borderlayout> </borderlayout>
</cell> </cell>
</row> </row>
<row>
<label id="lblCorridaId"
value="${c:l('relatorioPassageirosViajarController.lbServico.value')}" />
<textbox id="txtCorridaId" width="95%"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
maxlength="7" />
</row>
</rows> </rows>
</grid> </grid>
<toolbar> <toolbar>
@ -100,7 +107,6 @@
label="${c:l('relatorio.lb.btnExecutarRelatorio')}" /> label="${c:l('relatorio.lb.btnExecutarRelatorio')}" />
<button id="btnExecutarRelatorioDetalhado" image="/gui/img/find.png" <button id="btnExecutarRelatorioDetalhado" image="/gui/img/find.png"
label="${c:l('relatorio.lb.btnExecutarRelatorioDetalhado')}" /> label="${c:l('relatorio.lb.btnExecutarRelatorioDetalhado')}" />
</toolbar> </toolbar>
</window> </window>
</zk> </zk>