|
@@ -33,7 +33,7 @@ class ParserFile
|
33
|
33
|
{
|
34
|
34
|
}
|
35
|
35
|
|
36
|
|
- public function index($rutaDiariaDownloader, $fechaInicioParser, $datosPerfil)
|
|
36
|
+ public function index($rutaDiariaDownloader, $fechaInicioParser, $datosPerfil, $idUltimaImportacion)
|
37
|
37
|
{
|
38
|
38
|
$this->rutaDiaria = $rutaDiariaDownloader . "/format";
|
39
|
39
|
$this->fechaInicioParser = $fechaInicioParser;
|
|
@@ -46,6 +46,8 @@ class ParserFile
|
46
|
46
|
$resultEntries = array();
|
47
|
47
|
$contador = 0;
|
48
|
48
|
|
|
49
|
+ $stats = array();
|
|
50
|
+
|
49
|
51
|
foreach ($files as $file) {
|
50
|
52
|
$filename = basename($file);
|
51
|
53
|
$contador++;
|
|
@@ -70,7 +72,7 @@ class ParserFile
|
70
|
72
|
if (!$existLicitacionActualizada) {
|
71
|
73
|
//$arrayDeletedEntries = $xml->children('at', true);
|
72
|
74
|
|
73
|
|
- $resultEntries[$filename]['general'][$aux] = $this->nodoEntry($row, $xml->entry[$clave], $datosPerfil->id);
|
|
75
|
+ $resultEntries[$filename]['general'][$aux] = $this->nodoEntry($row, $xml->entry[$clave], $datosPerfil->id, $idUltimaImportacion);
|
74
|
76
|
|
75
|
77
|
$contractFolder = $this->nodoContractFolderStatus($row, $xml->entry[$clave]);
|
76
|
78
|
|
|
@@ -113,7 +115,7 @@ class ParserFile
|
113
|
115
|
unset($xml);
|
114
|
116
|
unset($array);
|
115
|
117
|
unset($tablasTruncate);
|
116
|
|
- $this->CI->parserdatabaselimpio->index($fechaInicioParser, $filename);
|
|
118
|
+ $stats[$filename] = $this->CI->parserdatabaselimpio->index($fechaInicioParser, $filename);
|
117
|
119
|
|
118
|
120
|
gc_mem_caches();
|
119
|
121
|
gc_collect_cycles();
|
|
@@ -177,7 +179,7 @@ class ParserFile
|
177
|
179
|
return $result;
|
178
|
180
|
}
|
179
|
181
|
|
180
|
|
- private function nodoEntry($xml, $xmlPrimitivo, $tipoPerfil)
|
|
182
|
+ private function nodoEntry($xml, $xmlPrimitivo, $tipoPerfil, $idUltimaImportacion)
|
181
|
183
|
{
|
182
|
184
|
$resultEntries = array();
|
183
|
185
|
$id_licitacion = (string) substr($xml['id'], strrpos($xml['id'], '/') + 1);
|
|
@@ -190,6 +192,7 @@ class ParserFile
|
190
|
192
|
$resultEntries['updated'] = (string) $xml['updated'];
|
191
|
193
|
$resultEntries['tipo_perfil_licitacion'] = $tipoPerfil;
|
192
|
194
|
$resultEntries['fecha_creacion_log'] = $this->fechaInicioParser;
|
|
195
|
+ $resultEntries['id_importacion'] = $idUltimaImportacion;
|
193
|
196
|
return $resultEntries;
|
194
|
197
|
}
|
195
|
198
|
|
|
@@ -423,8 +426,8 @@ class ParserFile
|
423
|
426
|
$resultEntries[$i]['startDate'] = $this->existNodo($tenderResult[$i], 'StartDate', 'string');
|
424
|
427
|
$resultEntries[$i]['smeawardedIndicator'] = $this->existNodo($tenderResult[$i], 'SMEAwardedIndicator', 'string');
|
425
|
428
|
//AwardedTenderedProject
|
426
|
|
- $resultEntries[$i]['contract_id'] = $this->existNodo($tenderResult[$i]->Contract, 'ID', 'string');
|
427
|
|
- $resultEntries[$i]['contract_issueDate'] = $this->existNodo($tenderResult[$i]->Contract, 'IssueDate', 'string');
|
|
429
|
+ $resultEntries[$i]['contract_id'] = $this->existNodo($tenderResult[$i]['Contract'], 'ID', 'string');
|
|
430
|
+ $resultEntries[$i]['contract_issueDate'] = $this->existNodo($tenderResult[$i]['Contract'], 'IssueDate', 'string');
|
428
|
431
|
|
429
|
432
|
if (array_key_exists("WinningParty", $tenderResult[$i])) {
|
430
|
433
|
$winningParty = $tenderResult[$i]['WinningParty'];
|