fixes bug#20989
qua:juliane dev:valdir Foi criado uma função sistema 'USUARIO RELATORIO GRATUIDADE AGER > MENU RELATORIO > ESTATISTICO > RELATORIO GRATUIDADE AGER' para definir que o usuario tenha acesso somente ao órgao concedenet AGER/MT Na descrição da espec, pede 3 tipos de passagens, porém na propria espec tem um print pedindo somente o tipo Normal. Conversei com o Régis, e foi definido para considerar somente o tipo de passagem Normal. git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@105011 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
9a254ac5d2
commit
170b745e7d
|
@ -22,13 +22,18 @@ import org.zkoss.zul.Textbox;
|
|||
import com.rjconsultores.ventaboletos.entidad.Categoria;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||
import com.rjconsultores.ventaboletos.entidad.PerfilFuncion;
|
||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||
import com.rjconsultores.ventaboletos.entidad.Usuario;
|
||||
import com.rjconsultores.ventaboletos.entidad.UsuarioPerfil;
|
||||
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioGratuidadeAGER;
|
||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
||||
import com.rjconsultores.ventaboletos.service.CategoriaService;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
||||
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
|
||||
import com.rjconsultores.ventaboletos.service.RutaService;
|
||||
import com.rjconsultores.ventaboletos.service.UsuarioService;
|
||||
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;
|
||||
|
@ -46,6 +51,8 @@ public class RelatorioGratuidadeAGERController extends MyGenericForwardComposer
|
|||
@Autowired
|
||||
private EmpresaService empresaService;
|
||||
@Autowired
|
||||
private UsuarioService usuarioService;
|
||||
@Autowired
|
||||
private RutaService rutaService;
|
||||
@Autowired
|
||||
private OrgaoConcedenteService orgaoConcedenteService;
|
||||
|
@ -117,7 +124,18 @@ public class RelatorioGratuidadeAGERController extends MyGenericForwardComposer
|
|||
private void executarPesquisaLinha() {
|
||||
|
||||
String palavraPesquisaRuta = txtPalavraPesquisaLinha.getText();
|
||||
|
||||
if (temPermissao("USUARIO.RELATORIO.AGER")){
|
||||
if(cmbOrgaoConcedente.getSelectedItem() == null) {
|
||||
return;
|
||||
}
|
||||
OrgaoConcedente orgaoConcedente = (OrgaoConcedente) cmbOrgaoConcedente.getSelectedItem().getValue();
|
||||
linhaList.setData(rutaService.buscaRuta(palavraPesquisaRuta, orgaoConcedente));
|
||||
}else {
|
||||
linhaList.setData(rutaService.buscaRuta(palavraPesquisaRuta));
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (linhaList.getData().length == 0) {
|
||||
try {
|
||||
|
@ -234,14 +252,38 @@ public class RelatorioGratuidadeAGERController extends MyGenericForwardComposer
|
|||
public void doAfterCompose(Component comp) throws Exception {
|
||||
super.doAfterCompose(comp);
|
||||
lsEmpresas = empresaService.obtenerTodos();
|
||||
|
||||
if (temPermissao("USUARIO.RELATORIO.AGER")){
|
||||
lsOrgaosConcedentes = orgaoConcedenteService.buscar("AGER/MT");
|
||||
cmbOrgaoConcedente.setText(lsOrgaosConcedentes.isEmpty() ? "": lsOrgaosConcedentes.get(0).getDescOrgao());
|
||||
|
||||
lsCategorias = categoriaService.buscar("NORMAL");
|
||||
cmbTipoGratuidade.setText(lsCategorias.isEmpty() ? "": lsCategorias.get(0).getDesccategoria());
|
||||
|
||||
}else {
|
||||
lsOrgaosConcedentes = orgaoConcedenteService.obtenerTodos();
|
||||
lsCategorias = categoriaService.obtenerTodos();
|
||||
listSelectedTipoGratuidade = new ArrayList<Categoria>();
|
||||
}
|
||||
|
||||
listSelectedTipoGratuidade = new ArrayList<Categoria>();
|
||||
linhaList.setItemRenderer(new RenderRelatorioLinhaHorario());
|
||||
linhaListSelList.setItemRenderer(new RenderRelatorioLinhaHorario());
|
||||
}
|
||||
|
||||
private boolean temPermissao(String permissao){
|
||||
Usuario usuario = usuarioService.obtenerID(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
|
||||
for (UsuarioPerfil up : usuario.getUsuarioPerfilList()){
|
||||
List<PerfilFuncion> listPerfilFuncion = up.getPerfil().getPerfilFuncionList();
|
||||
for (PerfilFuncion pf : listPerfilFuncion) {
|
||||
if (pf.getFuncionSistema().getDescruta().equals(permissao)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<Categoria> getLsCategorias() {
|
||||
return lsCategorias;
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<combobox id="cmbOrgaoConcedente" width="100%"
|
||||
maxlength="60" mold="rounded" buttonVisible="true"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
model="@{winFiltroRelatorioGratuidadeAGER$composer.lsOrgaosConcedentes}" />
|
||||
model="@{winFiltroRelatorioGratuidadeAGER$composer.lsOrgaosConcedentes}" constraint="no empty"/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
|
|
Loading…
Reference in New Issue