Usuario representante do contrato feat bug#AL-4278
parent
16f7aa64f3
commit
c8a9d826c9
6
pom.xml
6
pom.xml
|
@ -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.99.0</version>
|
<version>1.100.0</version>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<modelWeb.version>1.74.0</modelWeb.version>
|
<modelWeb.version>1.75.0</modelWeb.version>
|
||||||
<flyway.version>1.57.0</flyway.version>
|
<flyway.version>1.58.0</flyway.version>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@ import org.zkoss.zul.api.Window;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Usuario;
|
import com.rjconsultores.ventaboletos.entidad.Usuario;
|
||||||
import com.rjconsultores.ventaboletos.service.ConstanteService;
|
import com.rjconsultores.ventaboletos.service.ConstanteService;
|
||||||
import com.rjconsultores.ventaboletos.service.FlywayUtilService;
|
import com.rjconsultores.ventaboletos.service.FlywayUtilService;
|
||||||
import com.rjconsultores.ventaboletos.service.UsuarioService;
|
|
||||||
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.menu.ItemMenuSistema;
|
import com.rjconsultores.ventaboletos.web.utilerias.menu.ItemMenuSistema;
|
||||||
|
@ -43,8 +42,6 @@ public class IndexController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@Autowired
|
@Autowired
|
||||||
private UsuarioService usuarioService;
|
|
||||||
@Autowired
|
|
||||||
private ConstanteService constanteService;
|
private ConstanteService constanteService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private FlywayUtilService flywayUtilService;
|
private FlywayUtilService flywayUtilService;
|
||||||
|
@ -67,6 +64,7 @@ public class IndexController extends MyGenericForwardComposer {
|
||||||
lblNombreAplicacion.setLabel(strNombre);
|
lblNombreAplicacion.setLabel(strNombre);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
|
@ -99,8 +97,6 @@ public class IndexController extends MyGenericForwardComposer {
|
||||||
openSearchMenu(event);
|
openSearchMenu(event);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
usuario = usuarioService.obtenerID(usuario.getUsuarioId());
|
|
||||||
|
|
||||||
toolBarUser.setVisible(Boolean.TRUE);
|
toolBarUser.setVisible(Boolean.TRUE);
|
||||||
toolBarUser.setLabel(usuario.getNombusuario());
|
toolBarUser.setLabel(usuario.getNombusuario());
|
||||||
|
|
|
@ -4,6 +4,8 @@ import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
@ -20,6 +22,7 @@ import com.rjconsultores.ventaboletos.entidad.ClienteCorporativo;
|
||||||
import com.rjconsultores.ventaboletos.entidad.ContratoCorporativo;
|
import com.rjconsultores.ventaboletos.entidad.ContratoCorporativo;
|
||||||
import com.rjconsultores.ventaboletos.service.ClienteCorporativoService;
|
import com.rjconsultores.ventaboletos.service.ClienteCorporativoService;
|
||||||
import com.rjconsultores.ventaboletos.service.GrupoContratoService;
|
import com.rjconsultores.ventaboletos.service.GrupoContratoService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxClienteCorporativo;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxClienteCorporativo;
|
||||||
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;
|
||||||
|
@ -31,6 +34,7 @@ import com.rjconsultores.ventaboletos.web.utilerias.render.RenderContrato;
|
||||||
@Scope("prototype")
|
@Scope("prototype")
|
||||||
public class BusquedaContratoController extends MyGenericForwardComposer {
|
public class BusquedaContratoController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
|
private static Logger log = LogManager.getLogger(BusquedaContratoController.class);
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@Autowired
|
@Autowired
|
||||||
private transient PagedListWrapper<ContratoCorporativo> plwpagingContrato;
|
private transient PagedListWrapper<ContratoCorporativo> plwpagingContrato;
|
||||||
|
@ -99,6 +103,10 @@ public class BusquedaContratoController extends MyGenericForwardComposer {
|
||||||
configCategoriaBusqueda.addFilterEqual("clienteCorporativoId", cliente.getClienteCorporativoId());
|
configCategoriaBusqueda.addFilterEqual("clienteCorporativoId", cliente.getClienteCorporativoId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(UsuarioLogado.isUsuarioAdmContrato()) {
|
||||||
|
configCategoriaBusqueda.addFilterEqual("usuarioRepId", UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
}
|
||||||
|
|
||||||
configCategoriaBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
configCategoriaBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
||||||
configCategoriaBusqueda.addSortAsc("numContrato");
|
configCategoriaBusqueda.addSortAsc("numContrato");
|
||||||
|
|
||||||
|
@ -110,6 +118,7 @@ public class BusquedaContratoController extends MyGenericForwardComposer {
|
||||||
Labels.getLabel("busquedaContratoController.window.title"),
|
Labels.getLabel("busquedaContratoController.window.title"),
|
||||||
Messagebox.OK, Messagebox.INFORMATION);
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
} catch (InterruptedException ex) {
|
} catch (InterruptedException ex) {
|
||||||
|
log.error(ex);
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
preencheComplemento();
|
preencheComplemento();
|
||||||
|
@ -138,7 +147,6 @@ public class BusquedaContratoController extends MyGenericForwardComposer {
|
||||||
if( StringUtils.isEmpty(obj.getNomeGrupoContrato()) ) {
|
if( StringUtils.isEmpty(obj.getNomeGrupoContrato()) ) {
|
||||||
obj.setNomeGrupoContrato( grupoService.obtenerID( obj.getGrupoContratoId()).getNomeGrupoContrato());
|
obj.setNomeGrupoContrato( grupoService.obtenerID( obj.getGrupoContratoId()).getNomeGrupoContrato());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
import com.rjconsultores.ventaboletos.service.ClienteCorporativoService;
|
import com.rjconsultores.ventaboletos.service.ClienteCorporativoService;
|
||||||
import com.rjconsultores.ventaboletos.service.ContratoService;
|
import com.rjconsultores.ventaboletos.service.ContratoService;
|
||||||
import com.rjconsultores.ventaboletos.service.GrupoContratoService;
|
import com.rjconsultores.ventaboletos.service.GrupoContratoService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxClienteCorporativo;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxClienteCorporativo;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxUsuario;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxUsuario;
|
||||||
|
@ -205,7 +206,13 @@ public class EditarContratoController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
private void preencheCombo() {
|
private void preencheCombo() {
|
||||||
cmbCliente.setSelectedCliente(contrato.getClienteCorporativoId());
|
cmbCliente.setSelectedCliente(contrato.getClienteCorporativoId());
|
||||||
cmbRepresentante.setSelectedUsuario(contrato.getUsuarioRepId());
|
|
||||||
|
if(UsuarioLogado.isUsuarioAdmContrato()) {
|
||||||
|
cmbRepresentante.setSelectedUsuario(UsuarioLogado.getUsuarioLogado());
|
||||||
|
cmbRepresentante.setDisabled(true);
|
||||||
|
}else {
|
||||||
|
cmbRepresentante.setSelectedUsuario(contrato.getUsuarioRepId());
|
||||||
|
}
|
||||||
|
|
||||||
if(contrato.getGrupoContratoId() != null ) {
|
if(contrato.getGrupoContratoId() != null ) {
|
||||||
GrupoContrato grupo = grupoService.obtenerID(contrato.getGrupoContratoId());
|
GrupoContrato grupo = grupoService.obtenerID(contrato.getGrupoContratoId());
|
||||||
|
|
|
@ -199,7 +199,7 @@ public class EditarExcepcionPeajeController extends MyGenericForwardComposer {
|
||||||
cmbParadaOrigem.setSelectedItem(ci);
|
cmbParadaOrigem.setSelectedItem(ci);
|
||||||
}
|
}
|
||||||
if(excepcionPeaje.getOrigem() != null ){
|
if(excepcionPeaje.getOrigem() != null ){
|
||||||
Comboitem ci = new Comboitem(excepcionPeaje.getOrigem().getCveparada().toString());
|
Comboitem ci = new Comboitem(excepcionPeaje.getOrigem().getCveparada());
|
||||||
ci.setAttribute("value", excepcionPeaje.getOrigem());
|
ci.setAttribute("value", excepcionPeaje.getOrigem());
|
||||||
ci.setValue(excepcionPeaje.getOrigem().getCveparada());
|
ci.setValue(excepcionPeaje.getOrigem().getCveparada());
|
||||||
ci.setParent(cmbParadaOrigemCve);
|
ci.setParent(cmbParadaOrigemCve);
|
||||||
|
@ -213,7 +213,7 @@ public class EditarExcepcionPeajeController extends MyGenericForwardComposer {
|
||||||
cmbParadaDestino.setSelectedItem(ci);
|
cmbParadaDestino.setSelectedItem(ci);
|
||||||
}
|
}
|
||||||
if(excepcionPeaje.getOrigem() != null ){
|
if(excepcionPeaje.getOrigem() != null ){
|
||||||
Comboitem ci = new Comboitem(excepcionPeaje.getDestino().getCveparada().toString());
|
Comboitem ci = new Comboitem(excepcionPeaje.getDestino().getCveparada());
|
||||||
ci.setAttribute("value", excepcionPeaje.getDestino());
|
ci.setAttribute("value", excepcionPeaje.getDestino());
|
||||||
ci.setValue(excepcionPeaje.getDestino().getCveparada());
|
ci.setValue(excepcionPeaje.getDestino().getCveparada());
|
||||||
ci.setParent(cmbParadaDestinoCve);
|
ci.setParent(cmbParadaDestinoCve);
|
||||||
|
|
|
@ -161,6 +161,7 @@ public class BusquedaUsuarioController extends MyGenericForwardComposer {
|
||||||
txtCveEmpleado.focus();
|
txtCveEmpleado.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
private void verUsuario(Usuario u) {
|
private void verUsuario(Usuario u) {
|
||||||
if (u == null) {
|
if (u == null) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -121,11 +121,18 @@ public class MyComboboxUsuario extends Combobox {
|
||||||
public void setSelectedUsuario(Integer usuarioRepId) {
|
public void setSelectedUsuario(Integer usuarioRepId) {
|
||||||
if(usuarioRepId != null ){
|
if(usuarioRepId != null ){
|
||||||
Usuario usuario = usuarioService.obtenerID(usuarioRepId);
|
Usuario usuario = usuarioService.obtenerID(usuarioRepId);
|
||||||
|
setSelectedUsuario(usuario);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSelectedUsuario(Usuario usuario) {
|
||||||
|
if(usuario != null ){
|
||||||
Comboitem ciUser = new Comboitem(usuario.toString());
|
Comboitem ciUser = new Comboitem(usuario.toString());
|
||||||
ciUser.setAttribute("value", usuario);
|
ciUser.setAttribute("value", usuario);
|
||||||
ciUser.setValue(usuario);
|
ciUser.setValue(usuario);
|
||||||
ciUser.setParent(this);
|
ciUser.setParent(this);
|
||||||
this.setSelectedItem(ciUser);
|
this.setSelectedItem(ciUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
/*
|
|
||||||
* To change this template, choose Tools | Templates
|
|
||||||
* and open the template in the editor.
|
|
||||||
*/
|
|
||||||
package com.rjconsultores.ventaboletos.web.utilerias;
|
package com.rjconsultores.ventaboletos.web.utilerias;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -17,6 +13,7 @@ import org.zkoss.zul.Window;
|
||||||
*
|
*
|
||||||
* @author gleimar
|
* @author gleimar
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("rawtypes")
|
||||||
public class MyGenericForwardComposer extends GenericForwardComposer {
|
public class MyGenericForwardComposer extends GenericForwardComposer {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
@ -71,6 +68,7 @@ public class MyGenericForwardComposer extends GenericForwardComposer {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
private void superArgs(Map args){
|
private void superArgs(Map args){
|
||||||
if(!super.arg.isEmpty()){
|
if(!super.arg.isEmpty()){
|
||||||
args.putAll(arg);
|
args.putAll(arg);
|
||||||
|
|
Loading…
Reference in New Issue