From e1182bcb817d48c5640d9935762fef5693673786 Mon Sep 17 00:00:00 2001 From: Sofian pujo <sofian.pujo@veremes.com> Date: Mon, 12 Nov 2018 14:26:32 +0100 Subject: [PATCH] =?UTF-8?q?Modification=20des=20param=C3=A8tres=20de=20lan?= =?UTF-8?q?cement=20du=20contr=C3=B4le?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ws/ExtractionExtraction.class.sql.inc | 2 ++ .../ws/Extraction_depots.class.inc | 2 +- .../web_service/ws/Extractions.class.inc | 24 ++++++++++++++++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/module_extraction/web_service/ws/ExtractionExtraction.class.sql.inc b/src/module_extraction/web_service/ws/ExtractionExtraction.class.sql.inc index 5e4c86d7..de8f6493 100755 --- a/src/module_extraction/web_service/ws/ExtractionExtraction.class.sql.inc +++ b/src/module_extraction/web_service/ws/ExtractionExtraction.class.sql.inc @@ -17,4 +17,6 @@ $aSql['getRtLayerWithCtId'] = 'SELECT distinct layer_id, layer, category, mutual $aSql['getRtLayer'] = 'SELECT distinct layer_id, layer, category, mutualized, statistique FROM [schema_extraction].rt_layer INNER JOIN s_extraction.commune ON rt_layer.ct_id = commune.ct_id'; $aSql['getUserGroups'] = 'SELECT name FROM [schema_framework]."group",[schema_framework].user_group WHERE "group".group_id = user_group.group_id AND user_group.user_id = [user_id]'; + +$aSql['getDepositFile'] = 'SELECT wk_params FROM [schema_gtf]."order" WHERE "order".order_id = [bo_id];' ?> \ No newline at end of file diff --git a/src/module_extraction/web_service/ws/Extraction_depots.class.inc b/src/module_extraction/web_service/ws/Extraction_depots.class.inc index 8cebd171..8d96ea82 100755 --- a/src/module_extraction/web_service/ws/Extraction_depots.class.inc +++ b/src/module_extraction/web_service/ws/Extraction_depots.class.inc @@ -395,7 +395,7 @@ class Extraction_depots extends ExtractionExtraction $sExtension = '*.' . end(explode(".", $this->aValues["control_file_name"])); if (in_array($sExtension, explode("|", $this->aProperties['sig'])) or in_array($sExtension, explode("|", $this->aProperties['dao']))) { $this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']); - $this->oBO->insertOrder('EM0160AYYTK48', 'sourceDir=' . end(explode("/", $sDirPath)) . '/' . $this->aValues["control_file_name"] . '|sourceMotif='.$sExtension); + $this->oBO->insertOrder('EM0160AYYTK48', 'sourceDir=' . end(explode("/", $sDirPath)) . '/' . $this->aValues["input_deposit_name"] . '|sourceMotif=' . $sExtension . '|schema=' . $sSchemaContrainte . '|format=ACAD'); } else { //Si l'extension n'est pas bonne $error_message .= $this->aValues["control_file_name"] . " format is not authaurized (". $sExtension . ")"; diff --git a/src/module_extraction/web_service/ws/Extractions.class.inc b/src/module_extraction/web_service/ws/Extractions.class.inc index 86ec09e6..c3cbe333 100755 --- a/src/module_extraction/web_service/ws/Extractions.class.inc +++ b/src/module_extraction/web_service/ws/Extractions.class.inc @@ -244,6 +244,13 @@ class Extractions extends ExtractionExtraction //Si l'extension est autorisée if (in_array($sExtension, explode("|", $this->aProperties['sig'])) || in_array($sExtension, explode("|", $this->aProperties['dao']))) { + $sSchemaContrainte = ""; + if (in_array($sExtension, explode("|", $this->aProperties['sig']))) { + $sSchemaContrainte = $this->aProperties["schema_sig"]; + } elseif (in_array($sExtension, explode("|", $this->aProperties['dao']))) + { + $sSchemaContrainte = $this->aProperties["schema_dao"]; + } // Méthode de transition. if (!empty($this->aValues['tr_status_method'])) { eval('$this->' . $this->aValues['tr_status_method'] . '();'); @@ -260,7 +267,7 @@ class Extractions extends ExtractionExtraction fwrite($fp, $this->aValues["input_deposit_file"]); fclose($fp); //Demande GTF - $this->oBO->insertOrder('EM0160AYYTK48', 'sourceDir=' . end(explode("/", $sDirPath)) . '/' . $this->aValues["control_file_name"] . '|sourceMotif=' . $sExtension); + $this->oBO->insertOrder('EM0160AYYTK48', 'sourceDir=' . end(explode("/", $sDirPath)) . '/' . $this->aValues["input_deposit_name"] . '|sourceMotif=' . $sExtension . '|schema=' . $sSchemaContrainte . '|format=ACAD'); } else { //Si l'extension n'est pas bonne $error_message .= $this->aValues["input_deposit_name"] . " format is not authaurized (" . $sExtension . ")"; @@ -567,6 +574,21 @@ class Extractions extends ExtractionExtraction // Check si la table existe si oui change l'état $this->oBO->wabSetStatus($this->aProperties["schema_extraction"], "extraction", "bo_id", $this->aValues["bo_id"], "Fichier accepté"); + + $sSql = $aSql['getDepositFile']; + $aSQLParams = array( + 'schema_gtf' => array('value' => $this->aProperties['schema_gtf'], 'type' => 'schema_name'), + 'bo_id' => array('value' => $this->aValues['bo_id'], 'type' => 'integer'), + ); + + $oPDOresult = $this->oConnection->oBd->executeWithParams($sSql, $aSQLParams); + if (!$this->oConnection->oBd->enErreur()) { + $aResult = $this->oConnection->oBd->getResultTableAssoc($oPDOresult); + foreach ($aResult as $sWkParams) { + $sParams[] = $sWkParams['wk_params']; + } + } + //$this->oBO->sendmail(id_du_mail_pour_dire_que_le_fichier_est_accepté); $this->trReception(); -- GitLab