fixes bug#22299
dev: GLEIMAR qua: Silvania git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@108350 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
73137d75bf
commit
756da5b697
|
@ -10,9 +10,11 @@ import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida;
|
||||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource;
|
import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource;
|
||||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
||||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioMensalDAERBean;
|
import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioMensalDAERBean;
|
||||||
|
@ -24,24 +26,22 @@ public class RelatorioMensalDAER extends Relatorio {
|
||||||
|
|
||||||
private List<RelatorioMensalDAERBean> lsDadosRelatorio;
|
private List<RelatorioMensalDAERBean> lsDadosRelatorio;
|
||||||
private static Logger log = Logger.getLogger(RelatorioMensalDAER.class);
|
private static Logger log = Logger.getLogger(RelatorioMensalDAER.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param parametros
|
* @param parametros
|
||||||
* @param conexao
|
* @param conexao
|
||||||
|
* @param listCategoria
|
||||||
*/
|
*/
|
||||||
public RelatorioMensalDAER(final Map<String, Object> parametros, final Connection conexao) throws Exception {
|
public RelatorioMensalDAER(final Map<String, Object> parametros, final Connection conexao, final List<Integer> listCategoria) throws Exception {
|
||||||
super(parametros, conexao);
|
super(parametros, conexao);
|
||||||
|
|
||||||
this.setCustomDataSource(new DataSource(this) {
|
this.setCustomDataSource(new DataSource(this) {
|
||||||
@Override
|
@Override
|
||||||
public void initDados() throws Exception {
|
public void initDados() throws Exception {
|
||||||
try {
|
try {
|
||||||
String agencia = parametros.get("AGENCIA") != null ? parametros.get("AGENCIA").toString() : null;
|
Integer agencia = parametros.get("AGENCIA") != null ? Integer.valueOf(parametros.get("AGENCIA").toString()) : null;
|
||||||
Empresa empresa = parametros.get("EMPRESA") != null ? (Empresa) (parametros.get("EMPRESA")) : null;
|
Empresa empresa = parametros.get("EMPRESA") != null ? (Empresa) (parametros.get("EMPRESA")) : null;
|
||||||
String tipoVenta = parametros.get("TIPOVENTA_ID").toString();
|
lsDadosRelatorio = preencheAgrupaRelatorioBean(preparaExecutaQuery(parametros, conexao, empresa, agencia, listCategoria));
|
||||||
|
|
||||||
// Executa query relatório e preenche objeto relatório
|
|
||||||
lsDadosRelatorio = preencheAgrupaRelatorioBean(preparaExecutaQuery(parametros, conexao, empresa, agencia, tipoVenta));
|
|
||||||
|
|
||||||
parametros.put("RELATORIOLIST", lsDadosRelatorio);
|
parametros.put("RELATORIOLIST", lsDadosRelatorio);
|
||||||
setLsDadosRelatorio(lsDadosRelatorio);
|
setLsDadosRelatorio(lsDadosRelatorio);
|
||||||
|
@ -59,9 +59,11 @@ public class RelatorioMensalDAER extends Relatorio {
|
||||||
* @return
|
* @return
|
||||||
* @throws SQLException
|
* @throws SQLException
|
||||||
*/
|
*/
|
||||||
private ResultSet preparaExecutaQuery(Map<String, Object> parametros, Connection conexao, Empresa empresa, String agencia, String tipoVenta) throws SQLException {
|
private ResultSet preparaExecutaQuery(Map<String, Object> parametros, Connection conexao, Empresa empresa, Integer agencia, List<Integer> idsCorrida) throws SQLException {
|
||||||
Boolean istipoVenta = (!tipoVenta.isEmpty());
|
Boolean istipoVenta = (idsCorrida.size() > 0);
|
||||||
String sql = getSql(istipoVenta);
|
StringBuilder sqlCat = new StringBuilder();
|
||||||
|
sqlCat = getIdsCategoria(listCategoria);
|
||||||
|
String sql = getSql(istipoVenta,sqlCat);
|
||||||
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
|
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
|
||||||
ResultSet rset = null;
|
ResultSet rset = null;
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
|
||||||
|
@ -76,11 +78,7 @@ public class RelatorioMensalDAER extends Relatorio {
|
||||||
stmt.setString("DATA_FINAL", sdf.format(dataFinal));
|
stmt.setString("DATA_FINAL", sdf.format(dataFinal));
|
||||||
}
|
}
|
||||||
stmt.setInt("EMPRESA", empresa.getEmpresaId());
|
stmt.setInt("EMPRESA", empresa.getEmpresaId());
|
||||||
stmt.setString("AGENCIA", agencia);
|
stmt.setInt("AGENCIA", agencia);
|
||||||
if(istipoVenta) {
|
|
||||||
stmt.setString("TIPOVENTA_ID", tipoVenta);
|
|
||||||
}
|
|
||||||
|
|
||||||
rset = stmt.executeQuery();
|
rset = stmt.executeQuery();
|
||||||
return rset;
|
return rset;
|
||||||
}
|
}
|
||||||
|
@ -98,7 +96,7 @@ public class RelatorioMensalDAER extends Relatorio {
|
||||||
|
|
||||||
protected List<RelatorioMensalDAERBean> preencheAgrupaRelatorioBean(ResultSet rset) throws SQLException {
|
protected List<RelatorioMensalDAERBean> preencheAgrupaRelatorioBean(ResultSet rset) throws SQLException {
|
||||||
lsDadosRelatorio = new ArrayList<RelatorioMensalDAERBean>();
|
lsDadosRelatorio = new ArrayList<RelatorioMensalDAERBean>();
|
||||||
Integer qtBilhetes=null;
|
Integer qtBilhetes = null;
|
||||||
while (rset.next()) {
|
while (rset.next()) {
|
||||||
RelatorioMensalDAERBean relatorioMensalDAER = new RelatorioMensalDAERBean(rset.getInt("corrida_id"));
|
RelatorioMensalDAERBean relatorioMensalDAER = new RelatorioMensalDAERBean(rset.getInt("corrida_id"));
|
||||||
qtBilhetes = rset.getInt("qtdbilhetes");
|
qtBilhetes = rset.getInt("qtdbilhetes");
|
||||||
|
@ -108,11 +106,11 @@ public class RelatorioMensalDAER extends Relatorio {
|
||||||
BigDecimal comissaoDAER = BigDecimal.valueOf(manifbilhetes * (11.0f / 100.0f));
|
BigDecimal comissaoDAER = BigDecimal.valueOf(manifbilhetes * (11.0f / 100.0f));
|
||||||
float comissao = comissaoDAER.floatValue();
|
float comissao = comissaoDAER.floatValue();
|
||||||
BigDecimal taxaFiscal = BigDecimal.valueOf(comissao * (3.0f / 100.0f));
|
BigDecimal taxaFiscal = BigDecimal.valueOf(comissao * (3.0f / 100.0f));
|
||||||
|
|
||||||
relatorioMensalDAER.setFecHorSalida(retornaHora(rset.getTimestamp("partida"),true));
|
relatorioMensalDAER.setFecHorSalida(retornaHora(rset.getTimestamp("partida"), true));
|
||||||
relatorioMensalDAER.setFecMinSalida(retornaHora(rset.getTimestamp("partida"),false));
|
relatorioMensalDAER.setFecMinSalida(retornaHora(rset.getTimestamp("partida"), false));
|
||||||
relatorioMensalDAER.setFecHorInicio(retornaHora(rset.getTimestamp("inicio"),true));
|
relatorioMensalDAER.setFecHorInicio(retornaHora(rset.getTimestamp("inicio"), true));
|
||||||
relatorioMensalDAER.setFecMinInicio(retornaHora(rset.getTimestamp("inicio"),false));
|
relatorioMensalDAER.setFecMinInicio(retornaHora(rset.getTimestamp("inicio"), false));
|
||||||
relatorioMensalDAER.setFecCorrida(rset.getDate("feccorrida"));
|
relatorioMensalDAER.setFecCorrida(rset.getDate("feccorrida"));
|
||||||
relatorioMensalDAER.setIndSentidoIda(sentido);
|
relatorioMensalDAER.setIndSentidoIda(sentido);
|
||||||
relatorioMensalDAER.setNumRuta(rset.getString("linha"));
|
relatorioMensalDAER.setNumRuta(rset.getString("linha"));
|
||||||
|
@ -127,7 +125,7 @@ public class RelatorioMensalDAER extends Relatorio {
|
||||||
relatorioMensalDAER.setComissaoPassagem(comissaoDAER);
|
relatorioMensalDAER.setComissaoPassagem(comissaoDAER);
|
||||||
relatorioMensalDAER.setTaxaFiscalizacao(taxaFiscal);
|
relatorioMensalDAER.setTaxaFiscalizacao(taxaFiscal);
|
||||||
relatorioMensalDAER.setTaxaManutencao(rset.getBigDecimal("embarque"));
|
relatorioMensalDAER.setTaxaManutencao(rset.getBigDecimal("embarque"));
|
||||||
|
|
||||||
lsDadosRelatorio.add(relatorioMensalDAER);
|
lsDadosRelatorio.add(relatorioMensalDAER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,7 +133,7 @@ public class RelatorioMensalDAER extends Relatorio {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String getSql(Boolean existeTpVenta) {
|
protected String getSql(Boolean existeTpCategoria, StringBuilder sqlCat) {
|
||||||
StringBuilder sql = new StringBuilder();
|
StringBuilder sql = new StringBuilder();
|
||||||
sql.append("SELECT ");
|
sql.append("SELECT ");
|
||||||
sql.append("( case when ct.numsecuencia = 1 then null ");
|
sql.append("( case when ct.numsecuencia = 1 then null ");
|
||||||
|
@ -156,18 +154,18 @@ public class RelatorioMensalDAER extends Relatorio {
|
||||||
sql.append(" ( SELECT COUNT(ce.corrida_id) FROM corrida ce WHERE ce.corrida_id = co.corrida_id AND ce.tiposervicio_id = 2 ");
|
sql.append(" ( SELECT COUNT(ce.corrida_id) FROM corrida ce WHERE ce.corrida_id = co.corrida_id AND ce.tiposervicio_id = 2 ");
|
||||||
sql.append(" AND ce.feccorrida BETWEEN TO_DATE(:DATA_INICIO, 'DD/MM/YYYY') AND TO_DATE(:DATA_FINAL, 'DD/MM/YYYY')) as extra, ");
|
sql.append(" AND ce.feccorrida BETWEEN TO_DATE(:DATA_INICIO, 'DD/MM/YYYY') AND TO_DATE(:DATA_FINAL, 'DD/MM/YYYY')) as extra, ");
|
||||||
sql.append(" ( SELECT COUNT(caja_id) FROM caja WHERE corrida_id = co.corrida_id AND ruta_id = co.ruta_id ");
|
sql.append(" ( SELECT COUNT(caja_id) FROM caja WHERE corrida_id = co.corrida_id AND ruta_id = co.ruta_id ");
|
||||||
if(existeTpVenta) {
|
if (existeTpCategoria) {
|
||||||
sql.append(" AND tipoventa_id in (:TIPOVENTA_ID) ");
|
sql.append(sqlCat);
|
||||||
}
|
}
|
||||||
sql.append(" AND feccorrida BETWEEN TO_DATE(:DATA_INICIO, 'DD/MM/YYYY') AND TO_DATE(:DATA_FINAL, 'DD/MM/YYYY')) AS qtdbilhetes, ");
|
sql.append(" AND feccorrida BETWEEN TO_DATE(:DATA_INICIO, 'DD/MM/YYYY') AND TO_DATE(:DATA_FINAL, 'DD/MM/YYYY')) AS qtdbilhetes, ");
|
||||||
sql.append(" ( SELECT SUM(caja.preciobase+caja.importeseguro)FROM caja WHERE corrida_id = co.corrida_id AND ruta_id = co.ruta_id ");
|
sql.append(" ( SELECT SUM(caja.preciobase+caja.importeseguro)FROM caja WHERE corrida_id = co.corrida_id AND ruta_id = co.ruta_id ");
|
||||||
if(existeTpVenta) {
|
if (existeTpCategoria) {
|
||||||
sql.append(" AND tipoventa_id in (:TIPOVENTA_ID) ");
|
sql.append(sqlCat);
|
||||||
}
|
}
|
||||||
sql.append(" AND feccorrida BETWEEN TO_DATE(:DATA_INICIO, 'DD/MM/YYYY') AND TO_DATE(:DATA_FINAL, 'DD/MM/YYYY')) AS manifbilhetes, ");
|
sql.append(" AND feccorrida BETWEEN TO_DATE(:DATA_INICIO, 'DD/MM/YYYY') AND TO_DATE(:DATA_FINAL, 'DD/MM/YYYY')) AS manifbilhetes, ");
|
||||||
sql.append(" ( SELECT SUM(caja.importetaxaembarque)FROM caja WHERE corrida_id = co.corrida_id AND ruta_id = co.ruta_id ");
|
sql.append(" ( SELECT SUM(caja.importetaxaembarque)FROM caja WHERE corrida_id = co.corrida_id AND ruta_id = co.ruta_id ");
|
||||||
if(existeTpVenta) {
|
if (existeTpCategoria) {
|
||||||
sql.append(" AND tipoventa_id in (:TIPOVENTA_ID) ");
|
sql.append(sqlCat);
|
||||||
}
|
}
|
||||||
sql.append(" AND feccorrida BETWEEN TO_DATE(:DATA_INICIO, 'DD/MM/YYYY') AND TO_DATE(:DATA_FINAL, 'DD/MM/YYYY')) AS embarque, ");
|
sql.append(" AND feccorrida BETWEEN TO_DATE(:DATA_INICIO, 'DD/MM/YYYY') AND TO_DATE(:DATA_FINAL, 'DD/MM/YYYY')) AS embarque, ");
|
||||||
sql.append(" ' ' as encomendas ");
|
sql.append(" ' ' as encomendas ");
|
||||||
|
@ -183,7 +181,7 @@ public class RelatorioMensalDAER extends Relatorio {
|
||||||
sql.append(" AND cs.descclase in ('CONVENCIONAL', 'EXECUTIVO', 'SEMI-DIRETO') ");
|
sql.append(" AND cs.descclase in ('CONVENCIONAL', 'EXECUTIVO', 'SEMI-DIRETO') ");
|
||||||
sql.append(" AND oc.descorgao like '%DAER%' ");
|
sql.append(" AND oc.descorgao like '%DAER%' ");
|
||||||
sql.append(" AND co.empresacorrida_id = :EMPRESA ");
|
sql.append(" AND co.empresacorrida_id = :EMPRESA ");
|
||||||
sql.append(" AND pv.puntoventa_Id = :AGENCIA ");
|
sql.append(" AND pv.puntoventa_Id = :AGENCIA ");
|
||||||
sql.append(" AND co.feccorrida BETWEEN TO_DATE(:DATA_INICIO, 'DD/MM/YYYY') AND TO_DATE(:DATA_FINAL, 'DD/MM/YYYY') ");
|
sql.append(" AND co.feccorrida BETWEEN TO_DATE(:DATA_INICIO, 'DD/MM/YYYY') AND TO_DATE(:DATA_FINAL, 'DD/MM/YYYY') ");
|
||||||
sql.append("ORDER BY ");
|
sql.append("ORDER BY ");
|
||||||
sql.append(" co.corrida_id, ");
|
sql.append(" co.corrida_id, ");
|
||||||
|
@ -194,9 +192,26 @@ public class RelatorioMensalDAER extends Relatorio {
|
||||||
return sql.toString();
|
return sql.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private StringBuilder getIdsCategoria(List<Integer> lsCategoria) {
|
||||||
|
Integer[] idsCategoria = new Integer[lsCategoria.size()];
|
||||||
|
StringBuilder ids = new StringBuilder();
|
||||||
|
int i = 0;
|
||||||
|
for (Integer ec : lsCategoria) {
|
||||||
|
idsCategoria[i] = ec;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lsCategoria.size() >0) {
|
||||||
|
ids.append(" AND caja.categoria_id in ( " + StringUtils.join(idsCategoria, ",") + ")");
|
||||||
|
} else {
|
||||||
|
ids.append("");
|
||||||
|
}
|
||||||
|
return ids;
|
||||||
|
}
|
||||||
|
|
||||||
public String retornaHora(Date horaCompleta, boolean ishora) {
|
public String retornaHora(Date horaCompleta, boolean ishora) {
|
||||||
String horaMin = null;
|
String horaMin = null;
|
||||||
if(horaCompleta == null) {
|
if (horaCompleta == null) {
|
||||||
return horaMin;
|
return horaMin;
|
||||||
} else if (ishora) {
|
} else if (ishora) {
|
||||||
SimpleDateFormat simpleTimeFormat = new SimpleDateFormat("HH");
|
SimpleDateFormat simpleTimeFormat = new SimpleDateFormat("HH");
|
||||||
|
@ -209,7 +224,7 @@ public class RelatorioMensalDAER extends Relatorio {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void processaParametros() throws Exception {
|
protected void processaParametros() throws Exception {
|
||||||
|
|
||||||
|
|
|
@ -24,16 +24,16 @@ import org.zkoss.zul.Radio;
|
||||||
import org.zkoss.zul.Row;
|
import org.zkoss.zul.Row;
|
||||||
import org.zkoss.zul.Textbox;
|
import org.zkoss.zul.Textbox;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Categoria;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.EmpresaEmailConfig;
|
import com.rjconsultores.ventaboletos.entidad.EmpresaEmailConfig;
|
||||||
import com.rjconsultores.ventaboletos.entidad.TipoVenta;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.UsuarioUbicacion;
|
import com.rjconsultores.ventaboletos.entidad.UsuarioUbicacion;
|
||||||
import com.rjconsultores.ventaboletos.enums.MimeType;
|
import com.rjconsultores.ventaboletos.enums.MimeType;
|
||||||
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioMensalDAER;
|
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioMensalDAER;
|
||||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
||||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.SaidaRelatorio;
|
import com.rjconsultores.ventaboletos.relatorios.utilitarios.SaidaRelatorio;
|
||||||
|
import com.rjconsultores.ventaboletos.service.CategoriaService;
|
||||||
import com.rjconsultores.ventaboletos.service.EmpresaEmailConfigService;
|
import com.rjconsultores.ventaboletos.service.EmpresaEmailConfigService;
|
||||||
import com.rjconsultores.ventaboletos.service.TipoVentaService;
|
|
||||||
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.SendMail;
|
import com.rjconsultores.ventaboletos.utilerias.SendMail;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
@ -52,7 +52,7 @@ public class RelatorioMensalDAERController extends MyGenericForwardComposer {
|
||||||
private DataSource dataSourceRead;
|
private DataSource dataSourceRead;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TipoVentaService tipoVentaService;
|
private CategoriaService tipoVentaService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private EmpresaEmailConfigService empresaEmailConfigService;
|
private EmpresaEmailConfigService empresaEmailConfigService;
|
||||||
|
@ -64,9 +64,9 @@ public class RelatorioMensalDAERController extends MyGenericForwardComposer {
|
||||||
private List<UsuarioUbicacion> lsAgencias;
|
private List<UsuarioUbicacion> lsAgencias;
|
||||||
private String agenciasUsuario;
|
private String agenciasUsuario;
|
||||||
private Boolean isPDF = true;
|
private Boolean isPDF = true;
|
||||||
private List<TipoVenta> lsTipoVenta;
|
private List<Categoria> lsTipoVenta;
|
||||||
private MyListbox selectedTipoVentaList;
|
private MyListbox selectedTipoVentaList;
|
||||||
private List<TipoVenta> listSelectedTipoVenta;
|
private List<Categoria> listSelectedTipoVenta;
|
||||||
private MyComboboxEstandar cmbTipoVenta;
|
private MyComboboxEstandar cmbTipoVenta;
|
||||||
private Radio rdTipoAnexoPDF;
|
private Radio rdTipoAnexoPDF;
|
||||||
private Radio rdTipoAnexoXLS;
|
private Radio rdTipoAnexoXLS;
|
||||||
|
@ -127,30 +127,23 @@ public class RelatorioMensalDAERController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
StringBuilder tipVenta = new StringBuilder();
|
StringBuilder tipVenta = new StringBuilder();
|
||||||
StringBuilder tipVentaIds = new StringBuilder();
|
StringBuilder tipVentaIds = new StringBuilder();
|
||||||
|
List<Integer> listCategoria = new ArrayList<Integer>();
|
||||||
String todos = "-1";
|
String todos = "-1";
|
||||||
|
|
||||||
if (!listSelectedTipoVenta.isEmpty()) {
|
if (!listSelectedTipoVenta.isEmpty()) {
|
||||||
for (TipoVenta venta : listSelectedTipoVenta) {
|
for (Categoria venta : listSelectedTipoVenta) {
|
||||||
tipVenta.append(venta.getDesctipoventa()).append(",");
|
tipVenta.append(venta.getDesccategoria()).append(",");
|
||||||
if (todos.equals(venta.getTipoventaId().toString())) {
|
if (todos.equals(venta.getCategoriaId().toString())) {
|
||||||
tipVentaIds = new StringBuilder();
|
tipVentaIds = new StringBuilder();
|
||||||
tipVentaIds.append("");
|
tipVentaIds.append("");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tipVentaIds.append(venta.getTipoventaId()).append(",");
|
listCategoria.add(venta.getCategoriaId());
|
||||||
}
|
}
|
||||||
|
|
||||||
// removendo ultima virgula
|
|
||||||
tipVentaIds = tipVentaIds.delete(tipVentaIds.length() -1, tipVentaIds.length());
|
|
||||||
tipVenta = tipVenta.delete(tipVenta.length() -1, tipVenta.length());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parametros.put("TIPOVENTA", tipVenta.append(";").toString());
|
Relatorio relatorio = new RelatorioMensalDAER(parametros, dataSourceRead.getConnection(), listCategoria);
|
||||||
parametros.put("TIPOVENTA_ID", tipVentaIds.toString());
|
|
||||||
|
|
||||||
// Instancia o relatório
|
|
||||||
Relatorio relatorio = new RelatorioMensalDAER(parametros, dataSourceRead.getConnection());
|
|
||||||
|
|
||||||
if (isEnviarEmail) {
|
if (isEnviarEmail) {
|
||||||
|
|
||||||
|
@ -191,14 +184,14 @@ public class RelatorioMensalDAERController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$btnRemoveTipoVenta(Event ev) throws InterruptedException {
|
public void onClick$btnRemoveTipoVenta(Event ev) throws InterruptedException {
|
||||||
TipoVenta tVenta = (TipoVenta) selectedTipoVentaList.getSelectedItem().getValue();
|
Categoria tVenta = (Categoria) selectedTipoVentaList.getSelectedItem().getValue();
|
||||||
listSelectedTipoVenta.remove(tVenta);
|
listSelectedTipoVenta.remove(tVenta);
|
||||||
selectedTipoVentaList.setData(listSelectedTipoVenta);
|
selectedTipoVentaList.setData(listSelectedTipoVenta);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$btnAddTipoVenta(Event ev) throws InterruptedException {
|
public void onClick$btnAddTipoVenta(Event ev) throws InterruptedException {
|
||||||
if (cmbTipoVenta.getSelectedItem() != null) {
|
if (cmbTipoVenta.getSelectedItem() != null) {
|
||||||
listSelectedTipoVenta.add((TipoVenta) cmbTipoVenta.getSelectedItem().getValue());
|
listSelectedTipoVenta.add((Categoria) cmbTipoVenta.getSelectedItem().getValue());
|
||||||
selectedTipoVentaList.setData(listSelectedTipoVenta);
|
selectedTipoVentaList.setData(listSelectedTipoVenta);
|
||||||
selectedTipoVentaList.setSelectedItem(null);
|
selectedTipoVentaList.setSelectedItem(null);
|
||||||
}
|
}
|
||||||
|
@ -269,8 +262,9 @@ public class RelatorioMensalDAERController extends MyGenericForwardComposer {
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
lsEmpresas = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
lsEmpresas = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
||||||
lsAgencias = UsuarioLogado.getUsuarioLogado().getUsuarioUbicacionActivoList();
|
lsAgencias = UsuarioLogado.getUsuarioLogado().getUsuarioUbicacionActivoList();
|
||||||
lsTipoVenta = tipoVentaService.obtenerTodos();
|
lsTipoVenta = tipoVentaService.buscarCategoriaOrgaoConcedente("DAER");
|
||||||
listSelectedTipoVenta = new ArrayList<TipoVenta>();
|
//lsTipoVenta = tipoVentaService.buscarCategoriaOrgaoConcedente("DAER");
|
||||||
|
listSelectedTipoVenta = new ArrayList<Categoria>();
|
||||||
StringBuilder agencias = new StringBuilder();
|
StringBuilder agencias = new StringBuilder();
|
||||||
|
|
||||||
for (int i =0; i< lsAgencias.size() ; i++) {
|
for (int i =0; i< lsAgencias.size() ; i++) {
|
||||||
|
@ -324,11 +318,11 @@ public class RelatorioMensalDAERController extends MyGenericForwardComposer {
|
||||||
this.selectedTipoVentaList = selectedTipoVentaList;
|
this.selectedTipoVentaList = selectedTipoVentaList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TipoVenta> getListSelectedTipoVenta() {
|
public List<Categoria> getListSelectedTipoVenta() {
|
||||||
return listSelectedTipoVenta;
|
return listSelectedTipoVenta;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setListSelectedTipoVenta(List<TipoVenta> listSelectedTipoVenta) {
|
public void setListSelectedTipoVenta(List<Categoria> listSelectedTipoVenta) {
|
||||||
this.listSelectedTipoVenta = listSelectedTipoVenta;
|
this.listSelectedTipoVenta = listSelectedTipoVenta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -348,11 +342,11 @@ public class RelatorioMensalDAERController extends MyGenericForwardComposer {
|
||||||
this.lsAgencias = lsAgencias;
|
this.lsAgencias = lsAgencias;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TipoVenta> getLsTipoVenta() {
|
public List<Categoria> getLsTipoVenta() {
|
||||||
return lsTipoVenta;
|
return lsTipoVenta;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLsCategorias(List<TipoVenta> lsTipoVenta) {
|
public void setLsCategorias(List<Categoria> lsTipoVenta) {
|
||||||
this.lsTipoVenta = lsTipoVenta;
|
this.lsTipoVenta = lsTipoVenta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue