From 01f974b9aefd1454702d75d3a5c1f7fc2ccd2972 Mon Sep 17 00:00:00 2001 From: "fabio.fbarreto" Date: Mon, 26 Feb 2024 19:30:14 -0300 Subject: [PATCH] =?UTF-8?q?Corre=C3=A7ao=20de=20cadastro=20de=20subserie?= =?UTF-8?q?=20AIDF=20fixes=20bug=20#AL-3865?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 9 +++++--- Dockerfile_base | 11 ++++++--- conf/inicial | 10 ++++++-- pom.xml | 2 +- .../gr/EditarAidfController.java | 23 ++++++++++++++----- 5 files changed, 40 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8d0c07019..d228d484f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,13 @@ FROM fabiomagoo/wildflybase:22.0.1.final -USER jboss +USER root # Define as variáveis de ambiente a partir do arquivo .env -ENV $(cat /tmp/adm/.env | grep -v '#' | xargs) +# ENV $(cat //home/rjconsultores/dist/.env | grep -v '#' | xargs) -ADD target/*.war /opt/jboss/wildfly/standalone/deployments/ +#ADD target/*.war /opt/jboss/wildfly/standalone/deployments/ + +RUN chown -R jboss:jboss /opt/jboss +RUN chown -R jboss:jboss /home/rjconsultores/dist EXPOSE 8080 9990 8787 \ No newline at end of file diff --git a/Dockerfile_base b/Dockerfile_base index 7e6191a58..cc4b84a94 100644 --- a/Dockerfile_base +++ b/Dockerfile_base @@ -1,18 +1,23 @@ FROM jboss/wildfly:22.0.1.Final -USER jboss +USER root #set do diretorio de trabalho -WORKDIR /tmp/adm +WORKDIR /home/rjconsultores/dist + +RUN mkdir -p /opt/jboss/wildfly/standalone/data/content/c7/242cb44f0b5fe54b156bffd848347dfa943728/ # adicionando usuario adm RUN /opt/jboss/wildfly/bin/add-user.sh -u admin -p rjmaster09 --silent #copy do driver -ADD target/ventaboletosadm/WEB-INF/lib/ojdbc8.jar /opt/jboss/wildfly/standalone/deployments/ojdbc8-21.7.0.0.jar +ADD ./conf/content /opt/jboss/wildfly/standalone/data/content/c7/242cb44f0b5fe54b156bffd848347dfa943728/ ADD ./conf/inicial /opt/jboss/wildfly/standalone/configuration/standalone.xml EXPOSE 8080 9990 8787 +RUN chmod 744 -R /opt/jboss +RUN chown -R jboss:jboss /home/rjconsultores/dist + CMD /opt/jboss/wildfly/bin/standalone.sh ${DEBUG_ENV} -b 0.0.0.0 -bmanagement 0.0.0.0 -c standalone.xml \ No newline at end of file diff --git a/conf/inicial b/conf/inicial index 464d11dce..99fbd26a8 100644 --- a/conf/inicial +++ b/conf/inicial @@ -209,7 +209,8 @@ - + + @@ -526,7 +527,7 @@ - + @@ -585,4 +586,9 @@ + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 30bae4e82..018e05a63 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 br.com.rjconsultores ventaboletosadm - 1.53.4 + 1.53.5 war diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/gr/EditarAidfController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/gr/EditarAidfController.java index 12f07a637..26195a3fb 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/gr/EditarAidfController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/gr/EditarAidfController.java @@ -169,7 +169,6 @@ public class EditarAidfController extends MyGenericForwardComposer { if (aidf.getAidfId() == null) { btnApagar.setVisible(Boolean.FALSE); }else{ - isEstoqueSimplificado = false; if (temPermissao("ADM.AIDF.EDITARJACRIADA")) { btnSalvar.setDisabled(Boolean.TRUE); } else { @@ -326,14 +325,14 @@ public class EditarAidfController extends MyGenericForwardComposer { if (aidf.getAidfId() == null) { aidfService.suscribir(aidf); aidfList.addItemNovo(aidf); + + if(isEstoqueSimplificado) { + gravarDetAbastoAutomatico(); + } } else { aidfService.actualizacion(aidf); aidfList.updateItem(aidf); } - - if(isEstoqueSimplificado && aidf.getTipoValidaVenta().equals("M")) { - gravarDetAbastoAutomatico(); - } Messagebox.show( Labels.getLabel("editarMensajeController.MSG.suscribirOK"), @@ -406,6 +405,18 @@ public class EditarAidfController extends MyGenericForwardComposer { } } } + + private String obterSerieSubserieFormatada() { + String serieInformada = aidf.getSerie(); + String subSerieInformada = aidf.getSubserie(); + + return serieInformada + .trim() + .concat( + subSerieInformada == null || subSerieInformada.isEmpty() + ? "" + : "-".concat(subSerieInformada.trim())); + } private AbastoBoleto gravarAbastoAutomatico() { Date now = Calendar.getInstance().getTime(); @@ -437,7 +448,7 @@ public class EditarAidfController extends MyGenericForwardComposer { detAbastoBoleto.setAbastoBoleto(abastoBoleto); detAbastoBoleto.setAidf(aidf); detAbastoBoleto.setNummovimiento(nummovimiento); - detAbastoBoleto.setNumseriepreimpresa(aidf.getSerie()); + detAbastoBoleto.setNumseriepreimpresa(obterSerieSubserieFormatada()); detAbastoBoleto.setNumfolioinicial(aidf.getForminicial()); detAbastoBoleto.setNumfoliofinal(aidf.getFormfinal()); detAbastoBoleto.setStatusfirma(Boolean.TRUE);