|
@@ -6,6 +6,7 @@ class ParserDatabaseBruto
|
6
|
6
|
protected $idLicitacion = 0;
|
7
|
7
|
protected $fechaInicioParser = "";
|
8
|
8
|
protected $CI;
|
|
9
|
+ protected $nombreLog = "setLicitacion__";
|
9
|
10
|
|
10
|
11
|
public function __construct()
|
11
|
12
|
{
|
|
@@ -13,13 +14,15 @@ class ParserDatabaseBruto
|
13
|
14
|
$this->CI->load->model("Parser_model");
|
14
|
15
|
}
|
15
|
16
|
|
16
|
|
- public function setDatosParser($arrayDatosSucios, $fecha)
|
|
17
|
+ public function setDatosParser($arrayDatosSucios, $fecha, $datosPerfil)
|
17
|
18
|
{
|
18
|
19
|
$this->fechaInicioParser = $fecha;
|
|
20
|
+ $this->nombreLog .= $datosPerfil->prefijos_tablas . "__" . $this->fechaInicioParser;
|
|
21
|
+
|
19
|
22
|
if (!empty($arrayDatosSucios)) {
|
20
|
23
|
|
21
|
24
|
foreach ($arrayDatosSucios as $nombreArchivo => $datosArchivo) {
|
22
|
|
- guardar_log("setLicitacion_" . $this->fechaInicioParser, "ARCHIVO ---" . $nombreArchivo, false);
|
|
25
|
+ guardar_log($this->nombreLog, "ARCHIVO ---" . $nombreArchivo, false);
|
23
|
26
|
|
24
|
27
|
foreach ($datosArchivo as $row) {
|
25
|
28
|
$idLicitacion = $this->setInicioLicitacion($row['general']);
|
|
@@ -68,10 +71,10 @@ class ParserDatabaseBruto
|
68
|
71
|
|
69
|
72
|
if ($insertLicitacion) {
|
70
|
73
|
$result = array("result" => true, "id" => $insertLicitacion);
|
71
|
|
- guardar_log("setLicitacion_" . $this->fechaInicioParser, "Licitacion ID " . $datosInicioLicitacion['id_licitacion'] . " - BBDD Licitación ID " . $insertLicitacion, "false");
|
|
74
|
+ guardar_log($this->nombreLog, "Licitacion ID " . $datosInicioLicitacion['id_licitacion'] . " - BBDD Licitación ID " . $insertLicitacion, "false");
|
72
|
75
|
} else {
|
73
|
76
|
$result = array("result" => true, "id" => 0);
|
74
|
|
- guardar_log("setLicitacion_" . $this->fechaInicioParser, "Licitacion ID " . $datosInicioLicitacion['id_licitacion'], "false", 2);
|
|
77
|
+ guardar_log($this->nombreLog, "Licitacion ID " . $datosInicioLicitacion['id_licitacion'], "false", 2);
|
75
|
78
|
}
|
76
|
79
|
|
77
|
80
|
return $result;
|
|
@@ -113,7 +116,7 @@ class ParserDatabaseBruto
|
113
|
116
|
unset($setInsert[$aux]['itemClassification']);
|
114
|
117
|
|
115
|
118
|
if (!empty($setInsert)) {
|
116
|
|
- $resultInsert = insertBucle($setInsert, "BRUTO_procurement_project_lot", "setLicitacion_" . $this->fechaInicioParser);
|
|
119
|
+ $resultInsert = insertBucle($setInsert, "BRUTO_procurement_project_lot", $this->nombreLog);
|
117
|
120
|
if (array_key_exists('itemClassification', $row)) {
|
118
|
121
|
$this->setDatosMultiples($row, "itemClassification", "BRUTO_procurement_project_lot_item", $resultInsert, "ProcurementLotItem");
|
119
|
122
|
}
|
|
@@ -123,13 +126,13 @@ class ParserDatabaseBruto
|
123
|
126
|
|
124
|
127
|
if ($resultInsert) {
|
125
|
128
|
$result = array("result" => true);
|
126
|
|
- guardar_log("setLicitacion_" . $this->fechaInicioParser, "ProcurementLot Finalizada Inserción", "false");
|
|
129
|
+ guardar_log($this->nombreLog, "ProcurementLot Finalizada Inserción", "false");
|
127
|
130
|
} else {
|
128
|
131
|
$result = array("result" => true, "id" => 0);
|
129
|
|
- guardar_log("setLicitacion_" . $this->fechaInicioParser, "ProcurementLot Fallida", "false", 2);
|
|
132
|
+ guardar_log($this->nombreLog, "ProcurementLot Fallida", "false", 2);
|
130
|
133
|
}
|
131
|
134
|
} else {
|
132
|
|
- guardar_log("setLicitacion_" . $this->fechaInicioParser, "ProcurementLot vacio", "false");
|
|
135
|
+ guardar_log($this->nombreLog, "ProcurementLot vacio", "false");
|
133
|
136
|
}
|
134
|
137
|
}
|
135
|
138
|
|
|
@@ -145,7 +148,7 @@ class ParserDatabaseBruto
|
145
|
148
|
$setInsert['tenderingTerms'][0]['id_ajena'] = $this->idLicitacion;
|
146
|
149
|
|
147
|
150
|
if (!empty($setInsert)) {
|
148
|
|
- $resultInsert = insertBucle($setInsert['tenderingTerms'], "BRUTO_tendering_terms", "setLicitacion_" . $this->fechaInicioParser);
|
|
151
|
+ $resultInsert = insertBucle($setInsert['tenderingTerms'], "BRUTO_tendering_terms", $this->nombreLog);
|
149
|
152
|
|
150
|
153
|
if ($resultInsert > 0) {
|
151
|
154
|
$this->setDatosMultiples($tenderingTermsInfo, 1, "BRUTO_tendering_terms_awarding_terms", $resultInsert, "TenderingTermsAwardingTerms");
|
|
@@ -160,13 +163,13 @@ class ParserDatabaseBruto
|
160
|
163
|
|
161
|
164
|
if ($resultInsert) {
|
162
|
165
|
$result = array("result" => true);
|
163
|
|
- guardar_log("setLicitacion_" . $this->fechaInicioParser, "TenderingTerms Finalizada Inserción", "false");
|
|
166
|
+ guardar_log($this->nombreLog, "TenderingTerms Finalizada Inserción", "false");
|
164
|
167
|
} else {
|
165
|
168
|
$result = array("result" => true, "id" => 0);
|
166
|
|
- guardar_log("setLicitacion_" . $this->fechaInicioParser, "TenderingTerms Fallida", "false", 2);
|
|
169
|
+ guardar_log($this->nombreLog, "TenderingTerms Fallida", "false", 2);
|
167
|
170
|
}
|
168
|
171
|
} else {
|
169
|
|
- guardar_log("setLicitacion_" . $this->fechaInicioParser, "TenderingTerms vacio", "false");
|
|
172
|
+ guardar_log($this->nombreLog, "TenderingTerms vacio", "false");
|
170
|
173
|
}
|
171
|
174
|
}
|
172
|
175
|
|
|
@@ -186,7 +189,7 @@ class ParserDatabaseBruto
|
186
|
189
|
unset($setInsert[$aux]['fechas']);
|
187
|
190
|
|
188
|
191
|
if (!empty($setInsert)) {
|
189
|
|
- $resultInsert = insertBucle($setInsert, "BRUTO_valid_notice_info", "setLicitacion_" . $this->fechaInicioParser);
|
|
192
|
+ $resultInsert = insertBucle($setInsert, "BRUTO_valid_notice_info", $this->nombreLog);
|
190
|
193
|
|
191
|
194
|
if ($resultInsert > 0) {
|
192
|
195
|
$this->setDatosMultiples($row, "documento", "BRUTO_valid_notice_info_documento", $resultInsert, "validNoticeInfoFechas");
|
|
@@ -199,13 +202,13 @@ class ParserDatabaseBruto
|
199
|
202
|
|
200
|
203
|
if ($resultInsert) {
|
201
|
204
|
$result = array("result" => true);
|
202
|
|
- guardar_log("setLicitacion_" . $this->fechaInicioParser, "validNoticeInfo Finalizada Inserción", "false");
|
|
205
|
+ guardar_log($this->nombreLog, "validNoticeInfo Finalizada Inserción", "false");
|
203
|
206
|
} else {
|
204
|
207
|
$result = array("result" => true, "id" => 0);
|
205
|
|
- guardar_log("setLicitacion_" . $this->fechaInicioParser, "validNoticeInfo Fallida", "false", 2);
|
|
208
|
+ guardar_log($this->nombreLog, "validNoticeInfo Fallida", "false", 2);
|
206
|
209
|
}
|
207
|
210
|
} else {
|
208
|
|
- guardar_log("setLicitacion_" . $this->fechaInicioParser, "validNoticeInfo vacio", "false");
|
|
211
|
+ guardar_log($this->nombreLog, "validNoticeInfo vacio", "false");
|
209
|
212
|
}
|
210
|
213
|
}
|
211
|
214
|
|
|
@@ -221,15 +224,15 @@ class ParserDatabaseBruto
|
221
|
224
|
$arrayInsertar[0]['id_ajena'] = $idAjena;
|
222
|
225
|
}
|
223
|
226
|
|
224
|
|
- $insertedId = insertBucle($arrayInsertar, $tabla, "setLicitacion_" . $this->fechaInicioParser);
|
|
227
|
+ $insertedId = insertBucle($arrayInsertar, $tabla, $this->nombreLog);
|
225
|
228
|
|
226
|
229
|
if ($insertedId == 0) {
|
227
|
|
- guardar_log("setLicitacion_" . $this->fechaInicioParser, $nodoLog . " Fallido", "false");
|
|
230
|
+ guardar_log($this->nombreLog, $nodoLog . " Fallido", "false");
|
228
|
231
|
} else {
|
229
|
|
- guardar_log("setLicitacion_" . $this->fechaInicioParser, $nodoLog . " Finalizada Inserción", "false");
|
|
232
|
+ guardar_log($this->nombreLog, $nodoLog . " Finalizada Inserción", "false");
|
230
|
233
|
}
|
231
|
234
|
} else {
|
232
|
|
- guardar_log("setLicitacion_" . $this->fechaInicioParser, $nodoLog . " vacio", "false");
|
|
235
|
+ guardar_log($this->nombreLog, $nodoLog . " vacio", "false");
|
233
|
236
|
}
|
234
|
237
|
|
235
|
238
|
return $insertedId;
|
|
@@ -254,21 +257,21 @@ class ParserDatabaseBruto
|
254
|
257
|
}
|
255
|
258
|
|
256
|
259
|
if (!empty($setInsert)) {
|
257
|
|
- $resultInsert = insertBucle($setInsert, $tabla, "setLicitacion_" . $this->fechaInicioParser);
|
|
260
|
+ $resultInsert = insertBucle($setInsert, $tabla, $this->nombreLog);
|
258
|
261
|
}
|
259
|
262
|
|
260
|
263
|
if ($resultInsert) {
|
261
|
264
|
$result = array("result" => true);
|
262
|
|
- guardar_log("setLicitacion_" . $this->fechaInicioParser, $nodoLog . " Finalizada Inserción", "false");
|
|
265
|
+ guardar_log($this->nombreLog, $nodoLog . " Finalizada Inserción", "false");
|
263
|
266
|
} else {
|
264
|
267
|
$result = array("result" => true, "id" => 0);
|
265
|
|
- guardar_log("setLicitacion_" . $this->fechaInicioParser, $nodoLog . " Fallida", "false", 2);
|
|
268
|
+ guardar_log($this->nombreLog, $nodoLog . " Fallida", "false", 2);
|
266
|
269
|
}
|
267
|
270
|
} else {
|
268
|
|
- guardar_log("setLicitacion_" . $this->fechaInicioParser, $nodoLog . " vacio", "false");
|
|
271
|
+ guardar_log($this->nombreLog, $nodoLog . " vacio", "false");
|
269
|
272
|
}
|
270
|
273
|
} else {
|
271
|
|
- guardar_log("setLicitacion_" . $this->fechaInicioParser, $nodoLog . " vacio", "false");
|
|
274
|
+ guardar_log($this->nombreLog, $nodoLog . " vacio", "false");
|
272
|
275
|
}
|
273
|
276
|
}
|
274
|
277
|
|