Merge
bug #6071 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@45426 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
5ca5ee8b21
commit
ba70a45508
|
@ -30,9 +30,12 @@ import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus;
|
|||
import com.rjconsultores.ventaboletos.entidad.EsquemaAsiento;
|
||||
import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida;
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
import com.rjconsultores.ventaboletos.entidad.PerfilFuncion;
|
||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||
import com.rjconsultores.ventaboletos.entidad.RutaSecuencia;
|
||||
import com.rjconsultores.ventaboletos.entidad.Tramo;
|
||||
import com.rjconsultores.ventaboletos.entidad.Usuario;
|
||||
import com.rjconsultores.ventaboletos.entidad.UsuarioPerfil;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
import com.rjconsultores.ventaboletos.service.DiagramaAutobusService;
|
||||
import com.rjconsultores.ventaboletos.service.EsquemaAsientoService;
|
||||
|
@ -40,6 +43,8 @@ import com.rjconsultores.ventaboletos.service.EsquemaCorridaService;
|
|||
import com.rjconsultores.ventaboletos.service.ParadaService;
|
||||
import com.rjconsultores.ventaboletos.service.RutaSecuenciaService;
|
||||
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;
|
||||
|
||||
|
@ -65,6 +70,8 @@ public class EditarCorridaAsientoController extends MyGenericForwardComposer {
|
|||
private RutaService rutaService;
|
||||
@Autowired
|
||||
private RutaSecuenciaService rutaSecuenciaService;
|
||||
@Autowired
|
||||
private UsuarioService usuarioService;
|
||||
private EsquemaCorrida esquemaCorrida;
|
||||
private List<Parada> lsOrigen;
|
||||
private List<Parada> lsDestino;
|
||||
|
@ -241,8 +248,30 @@ public class EditarCorridaAsientoController extends MyGenericForwardComposer {
|
|||
cmbDestino.setDisabled(true);
|
||||
txtMotivo.setDisabled(true);
|
||||
}
|
||||
|
||||
if (!temPermissao("ADM.VTA.SERVICIO.OCUPAR")){
|
||||
btnCeder.setDisabled(Boolean.TRUE);
|
||||
}
|
||||
|
||||
if (!temPermissao("ADM.VTA.SERVICIO.LIBERAR")){
|
||||
btnLiberar.setDisabled(Boolean.TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
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 void colorirAsientos() throws InterruptedException {
|
||||
lsAsientos = esquemaAsientoService.obtenerPorCorrida(esquemaCorrida);
|
||||
|
||||
|
|
Loading…
Reference in New Issue