master
Lucas 2024-08-19 13:00:30 -03:00
parent 0de22201d5
commit 5d3fa630c3
9 changed files with 280 additions and 8 deletions

View File

@ -4,12 +4,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.rjconsultores</groupId>
<artifactId>ventaboletosadm</artifactId>
<version>1.126.2</version>
<version>1.126.4</version>
<packaging>war</packaging>
<properties>
<modelWeb.version>1.96.0</modelWeb.version>
<flyway.version>1.84.0</flyway.version>
<modelWeb.version>1.96.2</modelWeb.version>
<flyway.version>1.85.0</flyway.version>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

View File

@ -89,6 +89,7 @@ import com.rjconsultores.ventaboletos.entidad.EmpresaAsistenciaDeViajeConfig;
import com.rjconsultores.ventaboletos.entidad.EmpresaCertificadoConfig;
import com.rjconsultores.ventaboletos.entidad.EmpresaCieloLinkConfig;
import com.rjconsultores.ventaboletos.entidad.EmpresaComprovantePassagemConfig;
import com.rjconsultores.ventaboletos.entidad.EmpresaConfigLayout;
import com.rjconsultores.ventaboletos.entidad.EmpresaContaBancaria;
import com.rjconsultores.ventaboletos.entidad.EmpresaCrediBancoConfig;
import com.rjconsultores.ventaboletos.entidad.EmpresaEmail;
@ -110,6 +111,7 @@ import com.rjconsultores.ventaboletos.entidad.InstiFinanceira;
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
import com.rjconsultores.ventaboletos.entidad.Parada;
import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra;
import com.rjconsultores.ventaboletos.entidad.TipoVenta;
import com.rjconsultores.ventaboletos.enums.EnumTipoCertificado;
import com.rjconsultores.ventaboletos.enums.EnumTipoIntegracao;
import com.rjconsultores.ventaboletos.enums.TipoCstGratuidade;
@ -124,6 +126,7 @@ import com.rjconsultores.ventaboletos.service.EmpresaAsistenciaDeViajeConfigServ
import com.rjconsultores.ventaboletos.service.EmpresaCertificadoConfigService;
import com.rjconsultores.ventaboletos.service.EmpresaCieloLinkService;
import com.rjconsultores.ventaboletos.service.EmpresaComprovantePassagemConfigService;
import com.rjconsultores.ventaboletos.service.EmpresaConfigLayoutService;
import com.rjconsultores.ventaboletos.service.EmpresaCrediBancoConfigService;
import com.rjconsultores.ventaboletos.service.EmpresaEmailConfigService;
import com.rjconsultores.ventaboletos.service.EmpresaEmailEComerceService;
@ -143,6 +146,7 @@ import com.rjconsultores.ventaboletos.service.ImpresionLayoutConfigService;
import com.rjconsultores.ventaboletos.service.InstiFinanceiraService;
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
import com.rjconsultores.ventaboletos.service.TipoEventoExtraService;
import com.rjconsultores.ventaboletos.service.TipoVentaService;
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
import com.rjconsultores.ventaboletos.utilerias.CustomEnum;
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
@ -163,6 +167,7 @@ import com.rjconsultores.ventaboletos.web.utilerias.render.RenderComEmpCategoria
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderComEmpFormapago;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderComEmpTipoEventoExtra;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderEmpresaContaBancaria;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderEmpresaEmpresaConfigLayout;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderEmpresaImposto;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderEmpresaInscricaoEstadual;
@ -229,6 +234,9 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
private EmpresaPMArtespConfigService empresaPMArtespConfigService;
@Autowired
private OrgaoConcedenteService orgaoConcedenteService;
@Autowired
private TipoVentaService tipoVentaService;
private List<TipoVenta> lsTiposVenta;
private Empresa empresa;
private EmpresaEmail empresaEmail;
@ -630,6 +638,15 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
private ImpresionLayoutConfigService impresionLayoutConfigService;
private Combobox cmbConfigLayoutTiposVenda;
private MyComboboxImpresionLayoutConfig cmbImpresionLayoutConfig;
private MyListbox empresaLayoutConfigList;
private Checkbox chkindLayoutEmailConfig;
private List<EmpresaConfigLayout> lsEmpresaConfigLayout;
@Autowired
private EmpresaConfigLayoutService empresaConfigLayoutService;
private static final String EMAIL_PATTERN = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
+ "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
@ -651,6 +668,7 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
lsCidades = new ArrayList<Ciudad>();
lsBanco = instFinanceiraService.obtenerTodos();
lsTiposVenta = tipoVentaService.obtenerTodos();
if (empresa != null && empresa.getEmpresaId() != null) {
empresaEmail = empresaEmailService.buscarPorEmpresa(empresa);
@ -664,6 +682,7 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
empresaAsistenciaDeViajeConfig = empresaAsistenciaDeViajeConfigService.buscarByEmpresa(empresa.getEmpresaId());
empresaComprovantePassagemConfig = empresaComprovantePassagemConfigService.buscarByEmpresa(empresa.getEmpresaId());
empresaPMArtespConfig = empresaPMArtespConfigService.buscarPorEmpresa(empresa);
lsEmpresaConfigLayout = empresaConfigLayoutService.buscarByEmpresa(empresa.getEmpresaId());
}
if (empresa != null && empresa.getEmpresaId() != null) {
@ -970,6 +989,7 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
txtNumInscricaoMunicipal.setDisabled(true);
ckIsento.setChecked(true);
empresaLayoutConfigList.setItemRenderer(new RenderEmpresaEmpresaConfigLayout());
if (empresa.getEmpresaId() != null) {
empresa = empresaService.obtenerID(empresa.getEmpresaId());
@ -983,6 +1003,8 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
//retirar caracteres cnpj - mantis: 16363
retirarCaracteresEspeciaisCNPJ();
empresaLayoutConfigList.setData(lsEmpresaConfigLayout);
}
txtNome.focus();
@ -1554,6 +1576,8 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
adicionaInformacoesAsistenciaDeViaje();
adicionaInformacoesComprovantePassagem();
salvarEmpresaConfigLayout();
//INTEGRACAO TIPO DE PASSAGEM PM ARTESP
salvarEmpresaPMArtespConfig();
@ -1635,6 +1659,25 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
}
}
private void salvarEmpresaConfigLayout() {
for (EmpresaConfigLayout empresaEmpresaConfigLayoutInTheList : lsEmpresaConfigLayout) {
if (empresaEmpresaConfigLayoutInTheList != null
&& empresaEmpresaConfigLayoutInTheList.getEmpresaconfiglayoutId() != null) {
if (empresaEmpresaConfigLayoutInTheList.getActivo()) {
empresaConfigLayoutService.actualizacion(empresaEmpresaConfigLayoutInTheList);
} else {
empresaConfigLayoutService.borrar(empresaEmpresaConfigLayoutInTheList);
}
} else {
empresaConfigLayoutService.suscribir(empresaEmpresaConfigLayoutInTheList);
}
}
}
private Date buscarHora(Date horaEmbarque) {
if (horaEmbarque != null) {
GregorianCalendar gHoraSalida = new GregorianCalendar();
@ -2954,6 +2997,84 @@ public void onClick$btnTestEmailFlexBus(Event ev) throws InterruptedException {
return true;
}
public void onClick$btnAdicionarConfigLayout(Event ev) throws InterruptedException {
if (cmbConfigLayoutTiposVenda.getSelectedItem() == null || cmbImpresionLayoutConfig.getSelectedItem() == null) {
return;
}
TipoVenta tipoVenta = (TipoVenta) cmbConfigLayoutTiposVenda.getSelectedItem().getValue();
ImpresionLayoutConfig impresionLayoutConfig = (ImpresionLayoutConfig) cmbImpresionLayoutConfig.getSelectedItem()
.getValue();
EmpresaConfigLayout empresaConfigLayoutToAdd = new EmpresaConfigLayout();
empresaConfigLayoutToAdd.setActivo(Boolean.TRUE);
empresaConfigLayoutToAdd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
empresaConfigLayoutToAdd.setFecmodif(Calendar.getInstance().getTime());
empresaConfigLayoutToAdd.setEmpresa(empresa);
empresaConfigLayoutToAdd.setTipoVenta(tipoVenta);
empresaConfigLayoutToAdd.setImpresionlayoutconfigId(impresionLayoutConfig);
empresaConfigLayoutToAdd.setIndEmail(chkindLayoutEmailConfig.isChecked());
boolean achou = Boolean.FALSE;
for (EmpresaConfigLayout empresaEmpresaConfigLayoutInTheList : lsEmpresaConfigLayout) {
if (empresaEmpresaConfigLayoutInTheList != null && empresaEmpresaConfigLayoutInTheList.getActivo()
&& empresaConfigLayoutToAdd.getTipoVenta()
.equals(empresaEmpresaConfigLayoutInTheList.getTipoVenta())
&& empresaConfigLayoutToAdd.getImpresionlayoutconfigId()
.equals(empresaEmpresaConfigLayoutInTheList.getImpresionlayoutconfigId())
&& empresaConfigLayoutToAdd.getIndEmail()
.equals(empresaEmpresaConfigLayoutInTheList.getIndEmail())) {
achou = Boolean.TRUE;
}
}
if (!achou) {
lsEmpresaConfigLayout.add(empresaConfigLayoutToAdd);
List<EmpresaConfigLayout> tempList = new ArrayList<EmpresaConfigLayout>();
if (lsEmpresaContaBancaria != null) {
for (EmpresaConfigLayout empresaConfigLayout : lsEmpresaConfigLayout) {
if (empresaConfigLayout.getActivo()) {
tempList.add(empresaConfigLayout);
}
}
}
empresaLayoutConfigList.setData(tempList);
} else {
Messagebox.show(Labels.getLabel("editarEmpresaController.MSG.jaExisteConfigLayoutComAsMesmasInfoCadastradas"),
Labels.getLabel("editarEmpresaController.tabConfiguracaoLayout.value"), Messagebox.OK,
Messagebox.EXCLAMATION);
}
}
public void onClick$btnRemoverConfigLayout(Event ev) {
EmpresaConfigLayout empresaToRemove = (EmpresaConfigLayout) empresaLayoutConfigList.getSelected();
if (empresaToRemove != null) {
lsEmpresaConfigLayout.remove(empresaToRemove);
empresaToRemove.setFecmodif(Calendar.getInstance().getTime());
empresaToRemove.setActivo(Boolean.FALSE);
empresaToRemove.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
lsEmpresaConfigLayout.add(empresaToRemove);
empresaLayoutConfigList.updateItem(empresaToRemove);
empresaLayoutConfigList.removeItem(empresaToRemove);
} else {
try {
Messagebox.show(Labels.getLabel("editarEmpresaController.MSG.selecioneUmItemConfigLayout"),
Labels.getLabel("editarEmpresaController.tabConfiguracaoLayout.value"), Messagebox.OK,
Messagebox.EXCLAMATION);
} catch (InterruptedException e) {
EditarEmpresaController.log.error("editarEmpresaController: " + e);
}
}
}
private void retirarCaracteresEspeciaisCNPJ() {
if(empresa != null && empresa.getCnpj() != null && empresa.getCnpj().contains("-")
|| empresa.getCnpj().contains(".") || empresa.getCnpj().contains("/")) {
@ -3666,4 +3787,28 @@ public void onClick$btnTestEmailFlexBus(Event ev) throws InterruptedException {
this.lsTipoIntegracao = lsTipoIntegracao;
}
public List<TipoVenta> getLsTiposVenta() {
return lsTiposVenta;
}
public void setLsTiposVenta(List<TipoVenta> lsTiposVenta) {
this.lsTiposVenta = lsTiposVenta;
}
public List<EmpresaConfigLayout> getLsEmpresaConfigLayout() {
return lsEmpresaConfigLayout;
}
public void setLsEmpresaConfigLayout(List<EmpresaConfigLayout> lsEmpresaConfigLayout) {
this.lsEmpresaConfigLayout = lsEmpresaConfigLayout;
}
public MyListbox getEmpresaLayoutConfigList() {
return empresaLayoutConfigList;
}
public void setEmpresaLayoutConfigList(MyListbox empresaLayoutConfigList) {
this.empresaLayoutConfigList = empresaLayoutConfigList;
}
}

View File

@ -0,0 +1,41 @@
package com.rjconsultores.ventaboletos.web.utilerias.render;
import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import com.rjconsultores.ventaboletos.entidad.EmpresaConfigLayout;
public class RenderEmpresaEmpresaConfigLayout implements ListitemRenderer {
@Override
public void render(Listitem listItem, Object selected) throws Exception {
Listcell lc = new Listcell();
if (selected != null) {
EmpresaConfigLayout empresaConfigLayout = (EmpresaConfigLayout) selected;
lc = new Listcell(empresaConfigLayout.getTipoVenta() != null ? empresaConfigLayout.getTipoVenta().getDesctipoventa(): "");
lc.setParent(listItem);
lc = new Listcell(
empresaConfigLayout.getImpresionlayoutconfigId() != null
? empresaConfigLayout.getImpresionlayoutconfigId().getDescricao() + " - "
+ empresaConfigLayout.getImpresionlayoutconfigId().getLinguagem().name()
: "");
lc.setParent(listItem);
lc = new Listcell();
boolean indEmail = empresaConfigLayout.getIndEmail() != null ? empresaConfigLayout.getIndEmail() : false;
Checkbox chk = new Checkbox();
chk.setDisabled(Boolean.TRUE);
chk.setChecked(indEmail);
lc.appendChild(chk);
lc.setParent(listItem);
listItem.setAttribute("data", empresaConfigLayout);
}
}
}

View File

@ -483,6 +483,7 @@
<value>com.rjconsultores.ventaboletos.entidad.DescontoContrato</value>
<value>com.rjconsultores.ventaboletos.entidad.ConfComprovantePassagem</value>
<value>com.rjconsultores.ventaboletos.entidad.Voucher</value>
<value>com.rjconsultores.ventaboletos.entidad.EmpresaConfigLayout</value>
</list>
</property>

View File

@ -10354,3 +10354,11 @@ winMovimentacionBilhetesPuntoVenta.numSerie.label = Series
winMovimentacionBilhetesPuntoVenta.origem.label = Origin
winMovimentacionBilhetesPuntoVenta.puntoventa.label = Ag.
winMovimentacionBilhetesPuntoVenta.tipoMovimentacion.label = Nature
editarEmpresaController.tabConfiguracaoLayout.value = Layout Configuration
editarEmpresaController.cmbConfigLayoutTiposVenda = Type Sale
editarEmpresaController.cmbImpresionLayoutConfig = Layout
editarEmpresaController.lblLayoutEmail = Email Layout
editarEmpresaController.MSG.jaExisteConfigLayoutComAsMesmasInfoCadastradas = There is already a layout configuration with the same information registered
editarEmpresaController.MSG.selecioneUmItemConfigLayout = Select the layout configuration to be removed

View File

@ -10378,3 +10378,11 @@ winMovimentacionBilhetesPuntoVenta.numSerie.label = Série
winMovimentacionBilhetesPuntoVenta.origem.label = Origen
winMovimentacionBilhetesPuntoVenta.puntoventa.label = Ag.
winMovimentacionBilhetesPuntoVenta.tipoMovimentacion.label = Naturaleza
editarEmpresaController.tabConfiguracaoLayout.value = Configuración de Layout
editarEmpresaController.cmbConfigLayoutTiposVenda = Tipo de venta
editarEmpresaController.cmbImpresionLayoutConfig = Layout
editarEmpresaController.lblLayoutEmail = Layout de correo electrónico
editarEmpresaController.MSG.jaExisteConfigLayoutComAsMesmasInfoCadastradas = Ya existe una configuración de Layout con la misma información registrada.
editarEmpresaController.MSG.selecioneUmItemConfigLayout = Seleccione la configuración de Layout para eliminar

View File

@ -10347,3 +10347,11 @@ winMovimentacionBilhetesPuntoVenta.numSerie.label = Série
winMovimentacionBilhetesPuntoVenta.origem.label = Origine
winMovimentacionBilhetesPuntoVenta.puntoventa.label = Ag.
winMovimentacionBilhetesPuntoVenta.tipoMovimentacion.label = Nature
editarEmpresaController.tabConfiguracaoLayout.value = Configuration de la mise en page
editarEmpresaController.cmbConfigLayoutTiposVenda = Type de vente
editarEmpresaController.cmbImpresionLayoutConfig = Mise en page
editarEmpresaController.lblLayoutEmail = Disposition des e-mails
editarEmpresaController.MSG.jaExisteConfigLayoutComAsMesmasInfoCadastradas = Il existe déjà une configuration de mise en page avec les mêmes informations enregistrées
editarEmpresaController.MSG.selecioneUmItemConfigLayout = Sélectionnez le paramètre de mise en page à supprimer

View File

@ -10340,3 +10340,10 @@ winMovimentacionBilhetesPuntoVenta.numSerie.label = Série
winMovimentacionBilhetesPuntoVenta.origem.label = Origem
winMovimentacionBilhetesPuntoVenta.puntoventa.label = Ag.
winMovimentacionBilhetesPuntoVenta.tipoMovimentacion.label = Natureza
editarEmpresaController.tabConfiguracaoLayout.value = Configuração Layout
editarEmpresaController.cmbConfigLayoutTiposVenda = Tipo Venda
editarEmpresaController.cmbImpresionLayoutConfig = Layout
editarEmpresaController.lblLayoutEmail = Layout para e-mail
editarEmpresaController.MSG.jaExisteConfigLayoutComAsMesmasInfoCadastradas = Já existe uma configuração de layout com as mesmas informações cadastrada
editarEmpresaController.MSG.selecioneUmItemConfigLayout = Selecione a configuração de layout a ser removida

View File

@ -55,6 +55,7 @@
<tab label="${c:l('editarEmpresaController.lblCrediBanco.value')}" id="tabCrediBanco" />
<tab label="${c:l('editarEmpresaController.lblAsistenciaDeViaje.value')}" id="tabAssistenteViagem" />
<tab label="${c:l('editarEmpresaController.tabComprovantePassagem.value')}" id="tabComprovantePassagem" />
<tab label="${c:l('editarEmpresaController.tabConfiguracaoLayout.value')}" />
</tabs>
<tabpanels style="overflow: auto">
@ -3095,6 +3096,59 @@
</tabbox>
</tabpanel>
<!-- Configuracao Layout -->
<tabpanel>
<grid fixedLayout="true">
<columns>
<column width="30%" />
<column width="70%" />
</columns>
<rows>
<row>
<label
value="${c:l('editarEmpresaController.cmbConfigLayoutTiposVenda')}" />
<combobox id="cmbConfigLayoutTiposVenda"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
width="98%" mold="rounded" buttonVisible="true"
model="@{winEditarEmpresa$composer.lsTiposVenta}" />
</row>
<row>
<label value="${c:l('editarEmpresaController.cmbImpresionLayoutConfig')}" />
<combobox id="cmbImpresionLayoutConfig"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxImpresionLayoutConfig" mold="rounded" buttonVisible="true" width="100%" />
</row>
<row>
<label value="${c:l('editarEmpresaController.lblLayoutEmail')}" />
<checkbox id="chkindLayoutEmailConfig"/>
</row>
<row>
<label />
<hbox>
<button
id="btnAdicionarConfigLayout" height="20"
image="/gui/img/add.png" width="35px"
tooltiptext="${c:l('tooltiptext.btnAgregar')}" />
<button id="btnRemoverConfigLayout"
height="20" image="/gui/img/remove.png" width="35px"
tooltiptext="${c:l('tooltiptext.btnEliminar')}" />
</hbox>
</row>
</rows>
</grid>
<listbox id="empresaLayoutConfigList"
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
vflex="true" multiple="false">
<listhead sizable="true">
<listheader image="/gui/img/create_doc.gif"
label="${c:l('editarEmpresaController.cmbConfigLayoutTiposVenda')}" sort="auto(tipoVenta.desctipoventa)" />
<listheader image="/gui/img/create_doc.gif"
label="${c:l('editarEmpresaController.cmbImpresionLayoutConfig')} sort="auto(impresionlayoutconfigId.descricao)" />
<listheader image="/gui/img/create_doc.gif"
label="${c:l('editarEmpresaController.lblLayoutEmail')}" sort="auto(indEmail)" />
</listhead>
</listbox>
</tabpanel>
</tabpanels>
</tabbox>
</window>