|
@@ -11,6 +11,7 @@ class Parser extends CI_Controller
|
11
|
11
|
|
12
|
12
|
protected $rutaMensual = FCPATH . "DOWNLOADS/MONTH/";
|
13
|
13
|
protected $enlaceAtom = "";
|
|
14
|
+ protected $fechaCreacionLog = "";
|
14
|
15
|
|
15
|
16
|
public function __construct()
|
16
|
17
|
{
|
|
@@ -31,10 +32,17 @@ class Parser extends CI_Controller
|
31
|
32
|
|
32
|
33
|
$this->Parser_model->inicioParser();
|
33
|
34
|
|
|
35
|
+ $tablasTruncate = $this->Parser_model->getMapaTablas();
|
|
36
|
+
|
|
37
|
+ foreach ($tablasTruncate['datos'] as $row) {
|
|
38
|
+ $this->Parser_model->truncateTables($row->tabla_sucia);
|
|
39
|
+ }
|
|
40
|
+
|
34
|
41
|
$resultSetPerfiles = $this->Parser_model->getUrlArchivos();
|
35
|
42
|
|
36
|
43
|
foreach ($resultSetPerfiles['datos'] as $row) {
|
37
|
44
|
$fechaCarpeta = date("Y-m-d_H-i-s");
|
|
45
|
+ $this->fechaCreacionLog = $fechaCarpeta;
|
38
|
46
|
$rutaPerfil = $this->rutaDiaria . "/" . $row->prefijos_tablas;
|
39
|
47
|
|
40
|
48
|
$this->newFolder($rutaPerfil);
|
|
@@ -57,6 +65,8 @@ class Parser extends CI_Controller
|
57
|
65
|
|
58
|
66
|
$this->Parser_model->stopParser();
|
59
|
67
|
|
|
68
|
+ $this->tablasCalculadas($this->fechaCreacionLog);
|
|
69
|
+
|
60
|
70
|
/*$resultSetPerfiles = $this->Parser_model->getUrlArchivos();
|
61
|
71
|
foreach ($resultSetPerfiles['datos'] as $row) {
|
62
|
72
|
$this->parserfile->index($this->rutaDiaria . "PER_PCSP_EX/2022-02-10_09-02-17", date("Y-m-n"), $row);
|
|
@@ -176,4 +186,16 @@ class Parser extends CI_Controller
|
176
|
186
|
return $result;
|
177
|
187
|
}
|
178
|
188
|
|
|
189
|
+ private function tablasCalculadas($fechaInicioParser)
|
|
190
|
+ {
|
|
191
|
+ $this->Parser_model->truncateTables("import_licitaciones_temp");
|
|
192
|
+
|
|
193
|
+ $this->Parser_model->truncateTables("vista_datos_licitacion");
|
|
194
|
+
|
|
195
|
+ $licitaciones = $this->Xlsexport_model->getLicitaciones("HAVING LI.fecha_creacion_log = '" . $fechaInicioParser . "'");
|
|
196
|
+
|
|
197
|
+ insertBucleDuplicateOnKey($licitaciones['datos'], "vista_datos_licitacion", "");
|
|
198
|
+
|
|
199
|
+ }
|
|
200
|
+
|
179
|
201
|
}
|