'Adição de reintegração e padronizado hibernate fix bug#AL-2540' (!143) from AL-2540 into master

Reviewed-on: http://18.235.188.113:3000/adm/VentaBoletosAdm/pulls/143
Reviewed-by: Lucas Taiã <lucas@rjconsultores.com.br>
master 1.4.5
fabio 2023-05-11 14:19:34 +00:00
commit 6dc033f627
4 changed files with 50 additions and 11 deletions

10
pom.xml
View File

@ -4,14 +4,14 @@
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.rjconsultores</groupId>
<artifactId>ventaboletosadm</artifactId>
<version>1.4.4</version>
<version>1.4.5</version>
<packaging>war</packaging>
<properties>
<modelWeb.version>1.3.1</modelWeb.version>
<modelWeb.version>1.3.2</modelWeb.version>
<flyway.version>1.3.1</flyway.version>
<project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
<project.reporting.outputEncoding>ISO-8859-1</project.reporting.outputEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<distributionManagement>
@ -39,7 +39,7 @@
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>ISO-8859-1</encoding>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>

View File

@ -7,11 +7,19 @@ import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.service.SapService;
import com.rjconsultores.ventaboletos.vo.integracao.FechamentoCntCorrenteVO;
import com.rjconsultores.ventaboletos.web.gui.controladores.job.IntegracaoSapJob;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderFechamentoCntcorrente;
import org.apache.log4j.Logger;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.Trigger;
import org.quartz.TriggerUtils;
import org.quartz.impl.StdSchedulerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
@ -31,6 +39,7 @@ import org.zkoss.zul.Messagebox;
public class RelatorioSapController extends MyGenericForwardComposer {
private static final long serialVersionUID = -6110350409404675022L;
private static Logger log = Logger.getLogger(RelatorioSapController.class);
private MyListbox boletoFechamentoList;
@ -143,19 +152,45 @@ public class RelatorioSapController extends MyGenericForwardComposer {
Messagebox.show(Labels.getLabel("Registros não integrados"),
Labels.getLabel("relatorioSap.window.title"), Messagebox.OK, Messagebox.ERROR);
return;
}else if( integrados < qtdEnviar ) {
Messagebox.show("Alguns registros não foram integrados, favor filtrar novamente para verificar",
Labels.getLabel("relatorioSap.window.title"), Messagebox.OK, Messagebox.ERROR);
return;
}else if( integrados == qtdEnviar ) {
Messagebox.show("Todos registros foram integrados com sucesso",
Labels.getLabel("relatorioSap.window.title"), Messagebox.OK, Messagebox.ERROR);
return;
}
} catch (Exception e) {
Messagebox.show( e.getMessage(),
Labels.getLabel("relatorioSap.window.title"), Messagebox.OK, Messagebox.ERROR);
}
}
public void onClick$btnReintegrar(Event ev) throws Exception {
try {
Scheduler sched = new StdSchedulerFactory().getScheduler();
JobDetail jobDetail = new JobDetail("IntegracaoSap", null, IntegracaoSapJob.class);
log.info("Execução manual de integraçao com SAP ");
Trigger trigger = TriggerUtils.makeImmediateTrigger("integracaoSapTrigger", 1, 1000);
trigger.setName("integracaoSapTrigger");
JobDetail job = sched.getJobDetail(jobDetail.getName(), jobDetail.getGroup());
log.info("Job=" + jobDetail.getName() + "." + jobDetail.getGroup());
if (job != null) {
log.info("Job ya existia");
boolean deleted = sched.deleteJob(job.getName(), Scheduler.DEFAULT_GROUP);
log.info("Deleted=" + deleted);
}
sched.scheduleJob(jobDetail, trigger);
sched.start();
Messagebox.show("Rotina de integração automática iniciada",
Labels.getLabel("relatorioSap.window.title"), Messagebox.OK, Messagebox.INFORMATION);
} catch (SchedulerException ex) {
log.error(ex);
} catch (RuntimeException e) {
Messagebox.show( e.getMessage(),
Labels.getLabel("relatorioSap.window.title"), Messagebox.OK, Messagebox.ERROR);

View File

@ -1027,6 +1027,7 @@ relatorioSapController.lbAte.label = até
relatorioSapController.reenviarGerados.label = Buscar já enviados?
relatorioSapController.btnPesquisar.label = Pequisar
relatorioSapController.btnGerarRemessa.label = Enviar Integração
relatorioSapController.btnReintegrar.label = Reintegração
relatorioSapController.lbEmpresa.value = Empresa
relatorioSapController.lbPtoVenda.value = Agência
relatorioSapController.lbDataFecha.value = Dt. Fechamento

View File

@ -80,6 +80,9 @@
<button id="btnExecutarRemessa"
image="/gui/img/enginer.png"
label="${c:l('relatorioSapController.btnGerarRemessa.label')}" />
<button id="btnReintegrar"
image="/gui/img/enginer.png"
label="${c:l('relatorioSapController.btnReintegrar.label')}" />
<button id="btnImportarRetorno" visible="false"
image="/gui/img/enginer.png"
label="${c:l('relatorioSapController.btnImportarRetornoRemessa.label')}" />