fixes bug#23046
qua: dev: Ajustado o filtro do relatório de grupo de linha git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@108343 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
a308ee8a38
commit
09327529ea
|
@ -48,7 +48,7 @@ public class RelatorioIndiceIRK extends Relatorio {
|
||||||
try {
|
try {
|
||||||
Integer rutaId = parametros.get("RUTA_ID") != null ? Integer.valueOf(parametros.get("RUTA_ID").toString()) : null;
|
Integer rutaId = parametros.get("RUTA_ID") != null ? Integer.valueOf(parametros.get("RUTA_ID").toString()) : null;
|
||||||
Empresa empresa = parametros.get("EMPRESA") != null ? (Empresa) (parametros.get("EMPRESA")) : null;
|
Empresa empresa = parametros.get("EMPRESA") != null ? (Empresa) (parametros.get("EMPRESA")) : null;
|
||||||
Integer grupoRutaId = parametros.get("GRUPORUTA_ID") != null ? Integer.valueOf(parametros.get("GRUPORUTA_ID").toString()) : null;
|
String grupoRutaId = parametros.get("GRUPORUTA_ID") != null ? parametros.get("GRUPORUTA_ID").toString() : null;
|
||||||
String rutaIds = parametros.get("LINHA_FILTRO") != null ? (parametros.get("LINHA_FILTRO").toString()) : null;
|
String rutaIds = parametros.get("LINHA_FILTRO") != null ? (parametros.get("LINHA_FILTRO").toString()) : null;
|
||||||
String corridasIds = parametros.get("SERVICO_FILTRO") != null ? (parametros.get("SERVICO_FILTRO").toString()) : null;
|
String corridasIds = parametros.get("SERVICO_FILTRO") != null ? (parametros.get("SERVICO_FILTRO").toString()) : null;
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ public class RelatorioIndiceIRK extends Relatorio {
|
||||||
* @return
|
* @return
|
||||||
* @throws SQLException
|
* @throws SQLException
|
||||||
*/
|
*/
|
||||||
private ResultSet preparaExecutaQuery(final Map<String, Object> parametros, final Connection conexao, Integer rutaId, Empresa empresa, Integer grupoRutaId,String rutaIds, String corridasIds) throws SQLException {
|
private ResultSet preparaExecutaQuery(final Map<String, Object> parametros, final Connection conexao, Integer rutaId, Empresa empresa, String grupoRutaId,String rutaIds, String corridasIds) throws SQLException {
|
||||||
String sql = getSql(rutaId, grupoRutaId, rutaIds, corridasIds);
|
String sql = getSql(rutaId, grupoRutaId, rutaIds, corridasIds);
|
||||||
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
|
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
|
||||||
ResultSet rset = null;
|
ResultSet rset = null;
|
||||||
|
@ -114,7 +114,7 @@ public class RelatorioIndiceIRK extends Relatorio {
|
||||||
public void processaParametros() throws Exception {
|
public void processaParametros() throws Exception {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getSql(Integer rutaId, Integer grupoRutaId, String rutaIds, String corridasIds) {
|
private String getSql(Integer rutaId, String grupoRutaId, String rutaIds, String corridasIds) {
|
||||||
String TODOS = "TODOS";
|
String TODOS = "TODOS";
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
@ -191,7 +191,7 @@ public class RelatorioIndiceIRK extends Relatorio {
|
||||||
sb.append(" and cj.feccorrida BETWEEN TO_DATE(:DATA_INICIO, 'DD/MM/YY hh24:mi:ss') AND TO_DATE(:DATA_FINAL, 'DD/MM/YY hh24:mi:ss') ");
|
sb.append(" and cj.feccorrida BETWEEN TO_DATE(:DATA_INICIO, 'DD/MM/YY hh24:mi:ss') AND TO_DATE(:DATA_FINAL, 'DD/MM/YY hh24:mi:ss') ");
|
||||||
sb.append(rutaIds == null ||TODOS.equals(rutaIds) ? "" : " AND r.ruta_id IN ( " + rutaIds + " ) ");
|
sb.append(rutaIds == null ||TODOS.equals(rutaIds) ? "" : " AND r.ruta_id IN ( " + rutaIds + " ) ");
|
||||||
sb.append(corridasIds == null || TODOS.equals(corridasIds) ? "" : " AND cj.corrida_id IN ( " + corridasIds + " ) ");
|
sb.append(corridasIds == null || TODOS.equals(corridasIds) ? "" : " AND cj.corrida_id IN ( " + corridasIds + " ) ");
|
||||||
sb.append(grupoRutaId == null ? "" : " AND R.GRUPORUTA_ID IN ( " + grupoRutaId + " ) ");
|
sb.append(grupoRutaId == null || TODOS.equals(grupoRutaId) ? "" : " AND R.GRUPORUTA_ID IN ( " + grupoRutaId + " ) ");
|
||||||
sb.append(" GROUP BY cj.caja_id,");
|
sb.append(" GROUP BY cj.caja_id,");
|
||||||
sb.append(" cj.corrida_id,");
|
sb.append(" cj.corrida_id,");
|
||||||
sb.append(" r.ruta_id,");
|
sb.append(" r.ruta_id,");
|
||||||
|
|
|
@ -112,6 +112,7 @@ public class RelatorioIndiceIRKController extends MyGenericForwardComposer {
|
||||||
if (cmbGrupoRuta.getSelectedItem() != null) {
|
if (cmbGrupoRuta.getSelectedItem() != null) {
|
||||||
grupoRuta = (GrupoRuta) cmbGrupoRuta.getSelectedItem().getValue();
|
grupoRuta = (GrupoRuta) cmbGrupoRuta.getSelectedItem().getValue();
|
||||||
}
|
}
|
||||||
|
parametros.put("GRUPORUTA_ID", grupoRuta != null ? grupoRuta.getGrupoRutaId() : "TODOS");
|
||||||
parametros.put("DESCGRUPO", grupoRuta != null ? grupoRuta.getDescGrupo() : "TODOS");
|
parametros.put("DESCGRUPO", grupoRuta != null ? grupoRuta.getDescGrupo() : "TODOS");
|
||||||
// Filtro Linha
|
// Filtro Linha
|
||||||
lsNumLinha = new ArrayList(Arrays.asList(linhaListSelList.getData()));
|
lsNumLinha = new ArrayList(Arrays.asList(linhaListSelList.getData()));
|
||||||
|
|
Loading…
Reference in New Issue