From d5d031cecc5366997ca9aa215874c27ff59b9b0b Mon Sep 17 00:00:00 2001 From: fy2qeq Date: Mon, 2 Dec 2019 00:54:41 +0100 Subject: [PATCH 1/6] Error in sequence to drop temporary table --- .../insee/arc/core/service/AbstractService.java | 2 +- .../service/thread/AbstractThreadService.java | 2 ++ .../service/thread/ThreadControleService.java | 2 +- .../service/thread/ThreadIdentifyService.java | 16 ++++++++-------- .../core/service/thread/ThreadLoadService.java | 2 +- .../service/thread/ThreadStructurizeService.java | 7 ++++++- 6 files changed, 19 insertions(+), 12 deletions(-) diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/AbstractService.java b/arc-core/src/main/java/fr/insee/arc/core/service/AbstractService.java index a3ba67b9d..072338b73 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/AbstractService.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/AbstractService.java @@ -327,7 +327,7 @@ public static String temporaryTableName2(String aCurrentPhase, String tableName, * @param tableName */ protected void addTableToBeCleandService(String tableId, String tableName) { - this.bddTable.addTable(tableId, this.executionEnv, tableName); + this.bddTable.addTemporaryTable(tableId, tableName); this.idTableToClean.add(tableId); } diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/thread/AbstractThreadService.java b/arc-core/src/main/java/fr/insee/arc/core/service/thread/AbstractThreadService.java index d9610ae98..b26a848b8 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/thread/AbstractThreadService.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/thread/AbstractThreadService.java @@ -213,6 +213,7 @@ private void tagPilotageFinal() throws SQLException { StringBuilder request = new StringBuilder(); request.append(this.marquageFinal(getTablePil(), this.getTablePilTempThread())); request.append(FormatSQL.dropTable(this.getTablePilTempThread())); + request.append("\n DISCARD SEQUENCES; DISCARD TEMP;"); UtilitaireDao.get("arc").executeBlock(this.connection, request); } @@ -456,6 +457,7 @@ public String marquageFinal(String tablePil, String tablePilTemp, String idSourc } query.append("\n \t AND a.etape = 1 ; "); query.append("\n set enable_hashjoin = on; "); + return query.toString(); } diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/thread/ThreadControleService.java b/arc-core/src/main/java/fr/insee/arc/core/service/thread/ThreadControleService.java index 62ae3f5f2..4a22fd4f5 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/thread/ThreadControleService.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/thread/ThreadControleService.java @@ -262,7 +262,7 @@ public void finControle() throws Exception { blocFin.append(FormatSQL.dropTable(tableOutOkTemp).toString()); blocFin.append(FormatSQL.dropTable(tableOutKoTemp).toString()); blocFin.append(FormatSQL.dropTable(this.bddTable.getQualifedName(BddTable.ID_TABLE_POOL_DATA)).toString()); - blocFin.append("\nDISCARD SEQUENCES; DISCARD TEMP;"); +// blocFin.append("\nDISCARD SEQUENCES; DISCARD TEMP;"); UtilitaireDao.get("arc").executeBlock(this.connection, blocFin); diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/thread/ThreadIdentifyService.java b/arc-core/src/main/java/fr/insee/arc/core/service/thread/ThreadIdentifyService.java index 2fa65bc8e..e0ef019a4 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/thread/ThreadIdentifyService.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/thread/ThreadIdentifyService.java @@ -73,13 +73,13 @@ public ThreadIdentifyService(int currentIndice, ApiIdentifyService aApi, Connect * * @throws SQLException */ - private void cleanBdd() throws SQLException { - // Nettoyage - StringBuilder blocFin = new StringBuilder(); - - blocFin.append("\nDISCARD SEQUENCES; DISCARD TEMP;"); - UtilitaireDao.get("arc").executeBlock(this.connection, blocFin); - } +// private void cleanBdd() throws SQLException { +// // Nettoyage +// StringBuilder blocFin = new StringBuilder(); +// +// blocFin.append("\nDISCARD SEQUENCES; DISCARD TEMP;"); +// UtilitaireDao.get("arc").executeBlock(this.connection, blocFin); +// } /** * Traitement métier lié à l'identification. @@ -215,7 +215,7 @@ public void process() throws Exception { @Override public void finalizePhase() throws SQLException { - cleanBdd(); +// cleanBdd(); } diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/thread/ThreadLoadService.java b/arc-core/src/main/java/fr/insee/arc/core/service/thread/ThreadLoadService.java index 4a104a58f..a58af4e8b 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/thread/ThreadLoadService.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/thread/ThreadLoadService.java @@ -137,7 +137,7 @@ public void finalizePhase() throws Exception { StringBuilder blocFin = new StringBuilder(); blocFin.append(FormatSQL.dropTable(this.tableTempA)); blocFin.append(FormatSQL.dropTable(this.tableTempAll)); - blocFin.append("\nDISCARD SEQUENCES; DISCARD TEMP;"); +// blocFin.append("\nDISCARD SEQUENCES; DISCARD TEMP;"); UtilitaireDao.get("arc").executeBlock(this.connection, blocFin); } diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/thread/ThreadStructurizeService.java b/arc-core/src/main/java/fr/insee/arc/core/service/thread/ThreadStructurizeService.java index a9685c8ad..8982f12d5 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/thread/ThreadStructurizeService.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/thread/ThreadStructurizeService.java @@ -27,6 +27,7 @@ import fr.insee.arc.core.model.rules.RuleStructurizeEntity; import fr.insee.arc.core.service.ApiNormageService; import fr.insee.arc.utils.dao.UtilitaireDao; +import fr.insee.arc.utils.format.Format; import fr.insee.arc.utils.structure.GenericBean; import fr.insee.arc.utils.utils.FormatSQL; import fr.insee.arc.utils.utils.LoggerDispatcher; @@ -191,6 +192,8 @@ private void joinXMLBlocks() throws Exception { } else { jointure = jointure.toLowerCase(); + if (Format.size(regle.get("id_regle"))>0) + { // ORDRE IMPORTANT // on supprime les rubriques inutilisées quand le service est invoqué en batch // (this.paramBatch!=null) @@ -213,7 +216,9 @@ private void joinXMLBlocks() throws Exception { jointure = appliquerRegleUnicite(regle, norme, validite, periodicite, jointure); jointure = appliquerRegleRelation(regle, norme, validite, periodicite, jointure); - + + } + // optimisation manu 9.6 // retravaille de la requete pour éliminer UNION ALL jointure = optimisation96(jointure); From 7b2e24614788d98ec96ddfa85014ff10b94d3b67 Mon Sep 17 00:00:00 2001 From: fy2qeq Date: Mon, 2 Dec 2019 01:00:21 +0100 Subject: [PATCH 2/6] mapmodel renamed back to mapping for compatibility purpose --- .../java/fr/insee/arc/batch/module/MapperBatch.java | 2 +- .../fr/insee/arc/core/factory/ApiServiceFactory.java | 2 +- .../fr/insee/arc/core/model/TypeTraitementPhase.java | 2 +- .../arc/core/service/ApiInitialisationService.java | 6 +++--- .../insee/arc/core/service/ApiReceptionService.java | 2 +- .../arc/core/service/mapping/RequeteMapping.java | 2 +- .../insee/arc/web/action/GererFamilleNormeAction.java | 11 +++++++---- .../fr/insee/arc/web/action/PilotagePRODAction.java | 4 ++-- .../fr/insee/arc/web/model/ViewVariableMetier.java | 2 +- .../main/java/fr/insee/arc/ws/dao/ClientDaoImpl.java | 8 ++++---- 10 files changed, 22 insertions(+), 19 deletions(-) diff --git a/arc-batch/src/main/java/fr/insee/arc/batch/module/MapperBatch.java b/arc-batch/src/main/java/fr/insee/arc/batch/module/MapperBatch.java index 910278a70..832c2773f 100644 --- a/arc-batch/src/main/java/fr/insee/arc/batch/module/MapperBatch.java +++ b/arc-batch/src/main/java/fr/insee/arc/batch/module/MapperBatch.java @@ -27,7 +27,7 @@ public static void main(String[] args) { @Override public void execute() { - this.report = ApiServiceFactory.getService(TypeTraitementPhase.MAPMODEL.toString(), (String) this.args[0], (String) this.args[1], + this.report = ApiServiceFactory.getService(TypeTraitementPhase.MAPPING.toString(), (String) this.args[0], (String) this.args[1], (String) this.args[2], (String) this.args[3], (String) this.args[4]).invokeApi(); } diff --git a/arc-core/src/main/java/fr/insee/arc/core/factory/ApiServiceFactory.java b/arc-core/src/main/java/fr/insee/arc/core/factory/ApiServiceFactory.java index 162ef9148..a39f7dede 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/factory/ApiServiceFactory.java +++ b/arc-core/src/main/java/fr/insee/arc/core/factory/ApiServiceFactory.java @@ -27,7 +27,7 @@ private ApiServiceFactory(Map aMap) { this.map.put(TypeTraitementPhase.STRUCTURIZE.toString(), ApiNormageServiceFactory.getInstance()); this.map.put(TypeTraitementPhase.CONTROL.toString(), ApiControleServiceFactory.getInstance()); this.map.put(TypeTraitementPhase.FILTER.toString(), ApiFiltrageServiceFactory.getInstance()); - this.map.put(TypeTraitementPhase.MAPMODEL.toString(), ApiMappingServiceFactory.getInstance()); + this.map.put(TypeTraitementPhase.MAPPING.toString(), ApiMappingServiceFactory.getInstance()); this.map.put(TypeTraitementPhase.DUMMY.toString(), ApiDummyServiceFactory.getInstance()); } diff --git a/arc-core/src/main/java/fr/insee/arc/core/model/TypeTraitementPhase.java b/arc-core/src/main/java/fr/insee/arc/core/model/TypeTraitementPhase.java index 47a7ed2d0..9b8b10ffa 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/model/TypeTraitementPhase.java +++ b/arc-core/src/main/java/fr/insee/arc/core/model/TypeTraitementPhase.java @@ -11,7 +11,7 @@ public enum TypeTraitementPhase { , STRUCTURIZE(4, 1000000)// , CONTROL(5, 1000000)// , FILTER(6, 1000000)// - , MAPMODEL(7, 1000000);// + , MAPPING(7, 1000000);// private TypeTraitementPhase(int anOrdre, int aNbLigneATraiter) { this.order = anOrdre; diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/ApiInitialisationService.java b/arc-core/src/main/java/fr/insee/arc/core/service/ApiInitialisationService.java index 72a80ff79..158adca89 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/ApiInitialisationService.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/ApiInitialisationService.java @@ -332,7 +332,7 @@ public void bddScript() { dbEnv(executionEnv) + TypeTraitementPhase.CONTROL + "_" + TraitementState.KO, dbEnv(executionEnv) + TypeTraitementPhase.FILTER + "_" + TraitementState.OK, dbEnv(executionEnv) + TypeTraitementPhase.FILTER + "_" + TraitementState.KO, - dbEnv(executionEnv) + TypeTraitementPhase.MAPMODEL + "_" + TraitementState.KO, + dbEnv(executionEnv) + TypeTraitementPhase.MAPPING + "_" + TraitementState.KO, dbEnv(executionEnv) + TypeTraitementPhase.LOAD + "_" + TraitementState.OK + TODO, dbEnv(executionEnv) + TypeTraitementPhase.STRUCTURIZE + "_" + TraitementState.OK + TODO, dbEnv(executionEnv) + TypeTraitementPhase.CONTROL + "_" + TraitementState.OK + TODO, @@ -731,7 +731,7 @@ public void cleanPilotagetable(Connection connexion, String executionEnv) throws .append(",isFichierToDelete AS ( ").append("SELECT id_source, container, date_client ") .append("FROM ").append(nomTablePilotage).append(" a ").append(", arc.ihm_norme b ") .append(", clientsParFamille c ") - .append("WHERE a.phase_traitement='" + TypeTraitementPhase.MAPMODEL + "' ") + .append("WHERE a.phase_traitement='" + TypeTraitementPhase.MAPPING + "' ") .append("AND a.etat_traitement='{" + TraitementState.OK + "}' ").append("AND a.client is not null ") .append("AND a.id_norme=b.id_norme ").append("AND a.periodicite=b.periodicite ") .append("AND b.id_famille=c.id_famille ") @@ -1166,7 +1166,7 @@ public void synchroniserEnvironmentByPilotage(Connection connexion, String execu String etat = ManipString.substringAfterLast(nomTable, "_").toUpperCase(); // TODO : add a flag to know if phase output tables are inherited tables or not - if (!nomTable.contains(TypeTraitementPhase.MAPMODEL.toString().toLowerCase())){ + if (!nomTable.contains(TypeTraitementPhase.MAPPING.toString().toLowerCase())){ // temporary table to store inherit table already checked diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/ApiReceptionService.java b/arc-core/src/main/java/fr/insee/arc/core/service/ApiReceptionService.java index f07f5697a..06c96c8d2 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/ApiReceptionService.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/ApiReceptionService.java @@ -323,7 +323,7 @@ public void registerFiles(Connection connexion, String anExecutionEnvironment, S requete.append("DELETE FROM "+nomTable+" a where exists (select 1 from a_rejouer b where a.id_source=b.id_source); "); requete.append("vacuum "+nomTable+"; "); - if (!nomTable.contains(TypeTraitementPhase.MAPMODEL.toString().toLowerCase()) + if (!nomTable.contains(TypeTraitementPhase.MAPPING.toString().toLowerCase()) && nomTable.endsWith("_" + TraitementState.OK.toString().toLowerCase())) { requete.append("DELETE FROM "+nomTable+"_todo a where exists (select 1 from a_rejouer b where a.id_source=b.id_source); "); requete.append("vacuum "+nomTable+"_todo; "); diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/mapping/RequeteMapping.java b/arc-core/src/main/java/fr/insee/arc/core/service/mapping/RequeteMapping.java index 8402c1997..106513f6b 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/mapping/RequeteMapping.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/mapping/RequeteMapping.java @@ -325,7 +325,7 @@ public String getRequete(String aNomFichier) { if (!this.isRequeteCalculee) { - StringBuilder requeteGlobale = new StringBuilder("DISCARD TEMP; SET ENABLE_HASHAGG=ON; SET ENABLE_BITMAPSCAN=OFF; \n"); + StringBuilder requeteGlobale = new StringBuilder("SET ENABLE_HASHAGG=ON; SET ENABLE_BITMAPSCAN=OFF; \n"); construireTablePrecedente(requeteGlobale); diff --git a/arc-web/src/main/java/fr/insee/arc/web/action/GererFamilleNormeAction.java b/arc-web/src/main/java/fr/insee/arc/web/action/GererFamilleNormeAction.java index 373af31a2..4856fc520 100644 --- a/arc-web/src/main/java/fr/insee/arc/web/action/GererFamilleNormeAction.java +++ b/arc-web/src/main/java/fr/insee/arc/web/action/GererFamilleNormeAction.java @@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; +import fr.insee.arc.core.model.TypeTraitementPhase; import fr.insee.arc.utils.dao.UtilitaireDao; import fr.insee.arc.utils.utils.FormatSQL; import fr.insee.arc.utils.utils.LoggerDispatcher; @@ -279,7 +280,7 @@ public static StringBuilder getRequeteListeVariableMetierTableMetier(List> mapContentAfterUpdate) { return estCeQueLesNomsDeVariablesSontNonNuls(message, mapContentAfterUpdate) - && estCeQueLesIdentifiantsSontExclus(message, mapContentAfterUpdate) + // && estCeQueLesIdentifiantsSontExclus(message, mapContentAfterUpdate) && estCeQueLeSchemaNeComportePasDeCycles(message, mapContentAfterUpdate); } @@ -797,7 +800,7 @@ public static final void executeRequeteMiseAjourTableMetier(StringBuilder messag } public final boolean isNomTableMetierValide(String nomTable) { - return nomTable.matches("(?i)^mapping_" + this.viewFamilleNorme.mapContentSelected().get("id_famille").get(0) + "_([a-z]|_)*[a-z]+_ok$"); + return nomTable.matches("(?i)^"+TypeTraitementPhase.MAPPING.toString().toLowerCase()+"_" + this.viewFamilleNorme.mapContentSelected().get("id_famille").get(0) + "_([a-z]|_)*[a-z]+_ok$"); } @Action(value = "/addTableMetier") diff --git a/arc-web/src/main/java/fr/insee/arc/web/action/PilotagePRODAction.java b/arc-web/src/main/java/fr/insee/arc/web/action/PilotagePRODAction.java index 0c465f28a..accf95236 100644 --- a/arc-web/src/main/java/fr/insee/arc/web/action/PilotagePRODAction.java +++ b/arc-web/src/main/java/fr/insee/arc/web/action/PilotagePRODAction.java @@ -476,8 +476,8 @@ public String startMappingPROD() { ApiInitialisationService.copyTablesToExecution(null, "arc.ihm", this.envExecution); // String repertoire=ServletActionContext.getServletContext().getRealPath("/"); - ApiServiceFactory.getService(TypeTraitementPhase.MAPMODEL.toString(), "arc.ihm", this.envExecution, this.repertoire, - String.valueOf(TypeTraitementPhase.MAPMODEL.getNbLinesToProcess()),new SimpleDateFormat("yyyyMMddHH").format(new Date())).invokeApi(); + ApiServiceFactory.getService(TypeTraitementPhase.MAPPING.toString(), "arc.ihm", this.envExecution, this.repertoire, + String.valueOf(TypeTraitementPhase.MAPPING.getNbLinesToProcess()),new SimpleDateFormat("yyyyMMddHH").format(new Date())).invokeApi(); return sessionSyncronize(); } diff --git a/arc-web/src/main/java/fr/insee/arc/web/model/ViewVariableMetier.java b/arc-web/src/main/java/fr/insee/arc/web/model/ViewVariableMetier.java index 7b39532e7..e5b522ab9 100644 --- a/arc-web/src/main/java/fr/insee/arc/web/model/ViewVariableMetier.java +++ b/arc-web/src/main/java/fr/insee/arc/web/model/ViewVariableMetier.java @@ -42,7 +42,7 @@ public static HashMap getInitialRenderingViewVariableMe returned.put("description_variable_metier", new ColumnRendering(true, "label.comment", "200px", "text", null, true)); returned.put("type_variable_metier", new ColumnRendering(true, "label.mapmodel.field.type", "100px", "select", "SELECT nom_type id, nom_type val FROM arc.ext_mod_type_autorise ORDER BY nom_type", true)); - returned.put("type_consolidation", new ColumnRendering(true, "label.mapmodel.field.aggregate", "200px", "text", null, true)); + returned.put("type_consolidation", new ColumnRendering(false, "label.mapmodel.field.aggregate", "200px", "text", null, true)); return returned; } diff --git a/arc-ws/src/main/java/fr/insee/arc/ws/dao/ClientDaoImpl.java b/arc-ws/src/main/java/fr/insee/arc/ws/dao/ClientDaoImpl.java index 60f2390d7..523286f15 100644 --- a/arc-ws/src/main/java/fr/insee/arc/ws/dao/ClientDaoImpl.java +++ b/arc-ws/src/main/java/fr/insee/arc/ws/dao/ClientDaoImpl.java @@ -85,7 +85,7 @@ public ArrayList> getIdSrcTableMetier(long timestamp, String c if (validiteInf != "") { request.append("AND validite>='" + validiteInf + "' "); } - request.append("AND validite<='" + validiteSup + "' AND T1.phase_traitement='" + TypeTraitementPhase.MAPMODEL + "' "); + request.append("AND validite<='" + validiteSup + "' AND T1.phase_traitement='" + TypeTraitementPhase.MAPPING + "' "); request.append("AND EXISTS (SELECT 1 FROM " + AbstractPhaseService.dbEnv(environnement) + "norme T2 WHERE T2.id_famille='" + idFamille + "' AND T1.id_norme=T2.id_norme) "); if (!reprise) { @@ -169,7 +169,7 @@ public ArrayList> getIdSrcTableMetier(long timestamp, JSONObje query.append("AND validite>='" + requeteJSON.getString(JsonKeys.VALINF.getKey()) + "' "); } - query.append("AND validite<='" + validiteSup + "' AND T1.phase_traitement='" + TypeTraitementPhase.MAPMODEL + "' "); + query.append("AND validite<='" + validiteSup + "' AND T1.phase_traitement='" + TypeTraitementPhase.MAPPING + "' "); query.append("AND EXISTS (SELECT 1 FROM " + env + "norme T2 WHERE T2.id_famille='" + idFamille + "' AND T1.id_norme=T2.id_norme) "); if (!reprise) { @@ -196,7 +196,7 @@ public ArrayList> getIdSrcTableMetier(long timestamp, JSONObje query.append("AND validite>='" + requeteJSON.getString(JsonKeys.VALINF.getKey()) + "' "); } - query.append("AND validite<='" + validiteSup + "' AND T1.phase_traitement='" + TypeTraitementPhase.MAPMODEL + "' "); + query.append("AND validite<='" + validiteSup + "' AND T1.phase_traitement='" + TypeTraitementPhase.MAPPING + "' "); query.append("AND EXISTS (SELECT 1 FROM " + env + "norme T2 WHERE T2.id_famille='" + idFamille + "' AND T1.id_norme=T2.id_norme) "); if (!reprise) { @@ -356,7 +356,7 @@ public void updatePilotage(long timestamp, String environnement, String tableSou // columnClient.append("AND T1.id_source IN (SELECT id_source FROM " + ApiService.dbEnv(environnement) + client + "_" + timestamp+ // "_id_source) "); columnClient.append("AND EXISTS (SELECT 1 FROM " + tableSource + " T2 where T1.id_source=T2.id_source) "); - columnClient.append("AND T1.phase_traitement='" + TypeTraitementPhase.MAPMODEL + "';"); + columnClient.append("AND T1.phase_traitement='" + TypeTraitementPhase.MAPPING + "';"); try { connection = UtilitaireDao.get("arc").getDriverConnexion(); From 5013e2a81c8e9cddc5704c0c7d078d1db4043c34 Mon Sep 17 00:00:00 2001 From: fy2qeq Date: Mon, 2 Dec 2019 01:02:21 +0100 Subject: [PATCH 3/6] bas1 was not built correctly --- arc-core/src/main/resources/BdD/script_table.sql | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arc-core/src/main/resources/BdD/script_table.sql b/arc-core/src/main/resources/BdD/script_table.sql index 5549782d9..7b4828bc3 100644 --- a/arc-core/src/main/resources/BdD/script_table.sql +++ b/arc-core/src/main/resources/BdD/script_table.sql @@ -39,6 +39,7 @@ EXCEPTION WHEN OTHERS then end; $$; update arc.ihm_paramettrage_ordre_phase set nom_phase='STRUCTURIZE', type_phase='STRUCTURIZE' where nom_phase='STRUCTURIZE_XML'; update arc.ihm_paramettrage_ordre_phase set phase_precedente='STRUCTURIZE' where phase_precedente='STRUCTURIZE_XML'; update arc.ihm_paramettrage_ordre_phase set nom_phase='MAPMODEL', type_phase='MAPMODEL' where nom_phase='FORMAT_TO_MODEL'; +update arc.ihm_paramettrage_ordre_phase set nom_phase='MAPPING', type_phase='MAPPING' where nom_phase='MAPMODEL'; CREATE TABLE IF NOT EXISTS arc.ext_etat ( @@ -71,6 +72,7 @@ exception when others then end; $$; +UPDATE arc.ext_etat_jeuderegle set id='arc.bas1', val='BAC A SABLE 1' where id='arc.bas'; CREATE TABLE IF NOT EXISTS arc.ext_etat_jeuderegle ( id text NOT NULL, val text, @@ -428,6 +430,10 @@ CREATE TABLE IF NOT EXISTS arc.ihm_mod_variable_metier ( ), CONSTRAINT fk_ihm_mod_variable_table_metier FOREIGN KEY (id_famille, nom_table_metier) REFERENCES arc.ihm_mod_table_metier (id_famille, nom_table_metier) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ); + +alter table arc.ihm_mod_variable_metier alter column type_consolidation set default '{exclus}'; + + CREATE TABLE IF NOT EXISTS arc.ihm_nmcl ( nom_table text NOT NULL, description text, From 73346cd62aacf0a0bcb99940e69a0cfc0c3c6973 Mon Sep 17 00:00:00 2001 From: fy2qeq Date: Mon, 2 Dec 2019 01:03:48 +0100 Subject: [PATCH 4/6] bug fix in environment pilotage. Pipeline tested --- .../src/main/java/fr/insee/arc/utils/format/Format.java | 5 +++++ .../java/fr/insee/arc/web/action/GererNormeAction.java | 8 ++++---- .../java/fr/insee/arc/web/action/PilotageBAS8Action.java | 7 ++++++- arc-web/src/main/webapp/js/component.js | 5 ++--- arc-web/src/main/webapp/jsp/gererNorme.jsp | 4 ++-- arc-web/src/main/webapp/jsp/tiles/header.jsp | 8 ++++---- 6 files changed, 23 insertions(+), 14 deletions(-) diff --git a/arc-utils/src/main/java/fr/insee/arc/utils/format/Format.java b/arc-utils/src/main/java/fr/insee/arc/utils/format/Format.java index ce0ff9a89..2560070dd 100644 --- a/arc-utils/src/main/java/fr/insee/arc/utils/format/Format.java +++ b/arc-utils/src/main/java/fr/insee/arc/utils/format/Format.java @@ -29,6 +29,11 @@ public static final String removeJSONForbiddenChars(String string) { return string.replaceAll("[\r\n\t]", " "); } + public static int size(ArrayList o) + { + return o==null?0:o.size(); + } + /** * * @param list diff --git a/arc-web/src/main/java/fr/insee/arc/web/action/GererNormeAction.java b/arc-web/src/main/java/fr/insee/arc/web/action/GererNormeAction.java index 1e90e2fbf..268d05298 100644 --- a/arc-web/src/main/java/fr/insee/arc/web/action/GererNormeAction.java +++ b/arc-web/src/main/java/fr/insee/arc/web/action/GererNormeAction.java @@ -956,8 +956,8 @@ public String preGenererRegleFiltrage() { UtilitaireDao.get("arc").executeRequest(null, new StringBuilder("INSERT INTO " + this.viewFiltrage.getTable())// .append(" " + Format.stringListe(this.viewFiltrage.getDatabaseColumnsLabel()))// - .append(" SELECT (SELECT max(id_regle) FROM " + this.viewFiltrage.getTable() - + ")+row_number() over () ,")// + .append(" SELECT coalesce((SELECT max(id_regle) FROM " + this.viewFiltrage.getTable() + + "),0)+row_number() over () ,")// .append(" '" + this.viewRulesSet.mapContentSelected().get(ConstanteBD.ID_NORME.getValue()).get(0) + "', ")// @@ -1066,8 +1066,8 @@ public String preGenererRegleMapping() { // List hard coded to be sure of the order in the select StringBuilder requete = new StringBuilder("INSERT INTO " + this.viewMapping.getTable()).append( " (id_regle, id_norme, validite_inf, validite_sup, version , periodicite, variable_sortie, expr_regle_col, commentaire) ") - .append(" SELECT (SELECT max(id_regle) FROM " + this.viewMapping.getTable() - + ")+row_number() over () ,") + .append(" SELECT coalesce((SELECT max(id_regle) FROM " + this.viewMapping.getTable() + + "),0)+row_number() over () ,") .append(" '" + this.viewRulesSet.mapContentSelected().get(ConstanteBD.ID_NORME.getValue()).get(0) + "', ") .append(" '" diff --git a/arc-web/src/main/java/fr/insee/arc/web/action/PilotageBAS8Action.java b/arc-web/src/main/java/fr/insee/arc/web/action/PilotageBAS8Action.java index a963f2e1f..cd217051d 100644 --- a/arc-web/src/main/java/fr/insee/arc/web/action/PilotageBAS8Action.java +++ b/arc-web/src/main/java/fr/insee/arc/web/action/PilotageBAS8Action.java @@ -169,9 +169,11 @@ public String sortRapportBAS8() { @Action(value = "/filesUploadBAS8") public String filesUploadBAS8() { - initialize(); LoggerHelper.debug(LOGGER, "* /* filesUploadBAS : " + this.viewEntrepotBAS8.getCustomValues() + " */ *"); + initializeArcActionWithProperties(); + recupererEnvironnementTravail(); + if (this.viewEntrepotBAS8.getCustomValues() != null && !this.viewEntrepotBAS8.getCustomValues().get(WRITING_REPO).equals("") && this.viewPilotageBAS8.getFileUploadFileName() != null) { @@ -202,6 +204,9 @@ public String filesUploadBAS8() { ApiServiceFactory.getService(TypeTraitementPhase.REGISTER.toString(), "arc.ihm", (String) getSession().get(SessionParameters.ENV), this.repertoire, String.valueOf(TypeTraitementPhase.REGISTER.getNbLinesToProcess())).invokeApi(); + + initialize(); + return generateDisplay(); } diff --git a/arc-web/src/main/webapp/js/component.js b/arc-web/src/main/webapp/js/component.js index 597653e1d..6c3d6d208 100644 --- a/arc-web/src/main/webapp/js/component.js +++ b/arc-web/src/main/webapp/js/component.js @@ -1,5 +1,4 @@ - -//Modules disponibles +//Modules disponibles //Render:Tree; //Render:Pilotage; //Render:AlertBox; @@ -756,7 +755,7 @@ function updateCells(e,t) var view=$(t).parents().filter('div[id]').attr('id'); // validation avec entrée - if (e.keyCode == 13) { + if (e.ctrlKey && e.keyCode == 13) { e.preventDefault(); $('[id="'+view+'.update"]').trigger('click'); } diff --git a/arc-web/src/main/webapp/jsp/gererNorme.jsp b/arc-web/src/main/webapp/jsp/gererNorme.jsp index cece71add..c62ae4563 100644 --- a/arc-web/src/main/webapp/jsp/gererNorme.jsp +++ b/arc-web/src/main/webapp/jsp/gererNorme.jsp @@ -65,7 +65,7 @@
-
@@ -152,7 +152,7 @@
-
+
diff --git a/arc-web/src/main/webapp/jsp/tiles/header.jsp b/arc-web/src/main/webapp/jsp/tiles/header.jsp index 160f6e2c7..545352497 100644 --- a/arc-web/src/main/webapp/jsp/tiles/header.jsp +++ b/arc-web/src/main/webapp/jsp/tiles/header.jsp @@ -38,7 +38,7 @@
+ + + scope="" doAction="importListNomenclatures" onclick="submitForm()" style="margin-left: 25px;" ajax="false" />
Date: Mon, 2 Dec 2019 07:56:59 +0100 Subject: [PATCH 6/6] Map to model changed to mapping in UI --- arc-web/src/main/resources/global.properties | 2 +- arc-web/src/main/resources/global_en.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arc-web/src/main/resources/global.properties b/arc-web/src/main/resources/global.properties index 77de5bd93..66aca7484 100644 --- a/arc-web/src/main/resources/global.properties +++ b/arc-web/src/main/resources/global.properties @@ -104,7 +104,7 @@ view.load=Load rules view.structurize=Structurize rules view.control=Control rules view.filter=Filter rules -view.mapping=Map to model rules +view.mapping=Mapping rules view.envManagement=Files status in the workflow view.envManagement.report=Workflow messages report diff --git a/arc-web/src/main/resources/global_en.properties b/arc-web/src/main/resources/global_en.properties index 6bfc23bc6..be03ae717 100644 --- a/arc-web/src/main/resources/global_en.properties +++ b/arc-web/src/main/resources/global_en.properties @@ -103,7 +103,7 @@ view.load=Load rules view.structurize=Structurize rules view.control=Control rules view.filter=Filter rules -view.mapping=Map to model rules +view.mapping=Mapping rules view.envManagement=Files status in the workflow view.envManagement.report=Workflow messages report