|
@@ -57,15 +57,16 @@ class ParserFile
|
57
|
57
|
foreach ($tablasTruncate['datos'] as $row) {
|
58
|
58
|
$this->CI->Parser_model->truncateTables($row->tabla_sucia);
|
59
|
59
|
}
|
|
60
|
+ $arrayDeletedEntries = array();
|
|
61
|
+ $arrayDeletedEntries = $array['deleted-entry'];
|
60
|
62
|
|
61
|
63
|
foreach ($array['entry'] as $clave => $row) {
|
62
|
64
|
|
63
|
65
|
$existLicitacionActualizada = $this->getDatosLicitacion($row);
|
64
|
66
|
|
65
|
67
|
if (!$existLicitacionActualizada) {
|
66
|
|
- //$arrayDeletedEntries = $xml->children('at', true);
|
67
|
68
|
|
68
|
|
- $resultEntries[$filename]['general'][$aux] = $this->nodoEntry($row, $xml->entry[$clave], $datosPerfil->id, $idUltimaImportacion);
|
|
69
|
+ $resultEntries[$filename]['general'][$aux] = $this->nodoEntry($row, $xml->entry[$clave], $datosPerfil->id, $idUltimaImportacion, $arrayDeletedEntries);
|
69
|
70
|
|
70
|
71
|
$contractFolder = $this->nodoContractFolderStatus($row, $xml->entry[$clave]);
|
71
|
72
|
|
|
@@ -172,7 +173,7 @@ class ParserFile
|
172
|
173
|
return $result;
|
173
|
174
|
}
|
174
|
175
|
|
175
|
|
- private function nodoEntry($xml, $xmlPrimitivo, $tipoPerfil, $idUltimaImportacion)
|
|
176
|
+ private function nodoEntry($xml, $xmlPrimitivo, $tipoPerfil, $idUltimaImportacion, $deletedEntry)
|
176
|
177
|
{
|
177
|
178
|
$resultEntries = array();
|
178
|
179
|
$id_licitacion = (string) substr($xml['id'], strrpos($xml['id'], '/') + 1);
|
|
@@ -186,6 +187,26 @@ class ParserFile
|
186
|
187
|
$resultEntries['tipo_perfil_licitacion'] = $tipoPerfil;
|
187
|
188
|
$resultEntries['fecha_creacion_log'] = $this->fechaInicioParser;
|
188
|
189
|
$resultEntries['id_importacion'] = $idUltimaImportacion;
|
|
190
|
+
|
|
191
|
+ $resultEntries['estadoLicitacion'] = "VIGENTE";
|
|
192
|
+ if ($deletedEntry) {
|
|
193
|
+ foreach ($deletedEntry as $row) {
|
|
194
|
+ $idBorrado = (string) substr($row['@attributes']["ref"], strrpos($row['@attributes']["ref"], '/') + 1);
|
|
195
|
+ if ($id_licitacion == $idBorrado) {
|
|
196
|
+ $anyo1 = date_create($row['@attributes']['when']);
|
|
197
|
+ $anyo2 = date_create($resultEntries['updated']);
|
|
198
|
+ $diferencia = $anyo2->diff($anyo1);
|
|
199
|
+ $diferenciaFormat = $diferencia->y;
|
|
200
|
+ if ($diferenciaFormat > 5) {
|
|
201
|
+ $resultEntries['estadoLicitacion'] = "ARCHIVADA";
|
|
202
|
+ } else {
|
|
203
|
+ $resultEntries['estadoLicitacion'] = "ANULADA";
|
|
204
|
+ }
|
|
205
|
+ }
|
|
206
|
+ }
|
|
207
|
+
|
|
208
|
+ }
|
|
209
|
+
|
189
|
210
|
return $resultEntries;
|
190
|
211
|
}
|
191
|
212
|
|