|
@@ -6,7 +6,7 @@ class ParserDatabaseBruto
|
6
|
6
|
protected $idLicitacion = 0;
|
7
|
7
|
protected $fechaInicioParser = "";
|
8
|
8
|
protected $CI;
|
9
|
|
- protected $nombreLog = "setLicitacion__";
|
|
9
|
+ protected $nombreLog = "";
|
10
|
10
|
|
11
|
11
|
public function __construct()
|
12
|
12
|
{
|
|
@@ -17,7 +17,7 @@ class ParserDatabaseBruto
|
17
|
17
|
public function setDatosParser($arrayDatosSucios, $fecha, $datosPerfil)
|
18
|
18
|
{
|
19
|
19
|
$this->fechaInicioParser = $fecha;
|
20
|
|
- $this->nombreLog .= $datosPerfil->prefijos_tablas . "__" . $this->fechaInicioParser;
|
|
20
|
+ $this->nombreLog = "setLicitacion__" . $datosPerfil->prefijos_tablas . "__" . $this->fechaInicioParser;
|
21
|
21
|
|
22
|
22
|
if (!empty($arrayDatosSucios)) {
|
23
|
23
|
|
|
@@ -30,9 +30,9 @@ class ParserDatabaseBruto
|
30
|
30
|
if ($idLicitacion['result']) {
|
31
|
31
|
$this->idLicitacion = $idLicitacion['id'];
|
32
|
32
|
|
33
|
|
- $this->setDatosSingular($row, "contractInfo", "BRUTO_contract_folder", $this->idLicitacion, "ContractInfo");
|
|
33
|
+ $this->setDatosSingular($row, "contractInfo", "BRUTO_contract_folder", $this->idLicitacion, "ContractInfo", "id_ajena_licitacion");
|
34
|
34
|
|
35
|
|
- $this->setDatosSingular($row, "tenderingProcess", "BRUTO_tendering_process", $this->idLicitacion, "TenderingProcess");
|
|
35
|
+ $this->setDatosSingular($row, "tenderingProcess", "BRUTO_tendering_process", $this->idLicitacion, "TenderingProcess", "id_ajena_licitacion");
|
36
|
36
|
|
37
|
37
|
$this->setProcurementProject($row['procurementProject']);
|
38
|
38
|
|
|
@@ -46,15 +46,15 @@ class ParserDatabaseBruto
|
46
|
46
|
|
47
|
47
|
$this->setValidNoticeInfo($row['validNoticeInfo']);
|
48
|
48
|
|
49
|
|
- $this->setDatosMultiples($row, "tenderingResult", "BRUTO_tender_result", $this->idLicitacion, "TenderResult");
|
|
49
|
+ $this->setDatosMultiples($row, "tenderingResult", "BRUTO_tender_result", $this->idLicitacion, "TenderResult", "id_ajena_licitacion");
|
50
|
50
|
|
51
|
|
- $this->setDatosMultiples($row, "legalDocs", "BRUTO_legal_documents", $this->idLicitacion, "LegalDocs");
|
|
51
|
+ $this->setDatosMultiples($row, "legalDocs", "BRUTO_legal_documents", $this->idLicitacion, "LegalDocs", 'id_ajena_licitacion');
|
52
|
52
|
|
53
|
|
- $this->setDatosMultiples($row, "technicalDocs", "BRUTO_technical_documents", $this->idLicitacion, "TechnicalDocs");
|
|
53
|
+ $this->setDatosMultiples($row, "technicalDocs", "BRUTO_technical_documents", $this->idLicitacion, "TechnicalDocs", "id_ajena_licitacion");
|
54
|
54
|
|
55
|
|
- $this->setDatosMultiples($row, "generalDocs", "BRUTO_general_documents", $this->idLicitacion, "GeneralDocs");
|
|
55
|
+ $this->setDatosMultiples($row, "generalDocs", "BRUTO_general_documents", $this->idLicitacion, "GeneralDocs", "id_ajena_licitacion");
|
56
|
56
|
|
57
|
|
- $this->setDatosMultiples($row, "additionalDocs", "BRUTO_additional_documents", $this->idLicitacion, "AdditionalDocs");
|
|
57
|
+ $this->setDatosMultiples($row, "additionalDocs", "BRUTO_additional_documents", $this->idLicitacion, "AdditionalDocs", "id_ajena_licitacion");
|
58
|
58
|
}
|
59
|
59
|
}
|
60
|
60
|
}
|
|
@@ -82,25 +82,25 @@ class ParserDatabaseBruto
|
82
|
82
|
|
83
|
83
|
private function setLocatedContractingParty($contractInfo): void
|
84
|
84
|
{
|
85
|
|
- $locatedContractingPartyId = $this->setDatosSingular($contractInfo, "locatedContractingParty", "BRUTO_located_contracting_party", $this->idLicitacion, "locatedContractingParty");
|
|
85
|
+ $locatedContractingPartyId = $this->setDatosSingular($contractInfo, "locatedContractingParty", "BRUTO_located_contracting_party", $this->idLicitacion, "locatedContractingParty", "id_ajena_licitacion");
|
86
|
86
|
|
87
|
|
- $this->setDatosMultiples($contractInfo, "activity", "BRUTO_located_contracting_party_activity", $locatedContractingPartyId, "locatedContractingParty_Activity");
|
|
87
|
+ $this->setDatosMultiples($contractInfo, "activity", "BRUTO_located_contracting_party_activity", $locatedContractingPartyId, "locatedContractingParty_Activity", "id_ajena_lcp");
|
88
|
88
|
|
89
|
89
|
}
|
90
|
90
|
|
91
|
91
|
private function setParty($partyInfo): void
|
92
|
92
|
{
|
93
|
|
- $partyId = $this->setDatosSingular($partyInfo, "party", "BRUTO_party", $this->idLicitacion, "PartyInfo");
|
|
93
|
+ $partyId = $this->setDatosSingular($partyInfo, "party", "BRUTO_party", $this->idLicitacion, "PartyInfo", "id_ajena_licitacion");
|
94
|
94
|
|
95
|
|
- $this->setDatosMultiples($partyInfo, "partyIdentification", "BRUTO_party_party_idenfitication", $partyId, "PartyInfo_PartyIdentification");
|
|
95
|
+ $this->setDatosMultiples($partyInfo, "partyIdentification", "BRUTO_party_party_idenfitication", $partyId, "PartyInfo_PartyIdentification", "id_ajena_party");
|
96
|
96
|
|
97
|
97
|
}
|
98
|
98
|
|
99
|
99
|
private function setProcurementProject($procurementInfo): void
|
100
|
100
|
{
|
101
|
|
- $procurementProjectId = $this->setDatosSingular($procurementInfo, "budget", "BRUTO_procurement_project", $this->idLicitacion, "ProcurementProject");
|
|
101
|
+ $procurementProjectId = $this->setDatosSingular($procurementInfo, "budget", "BRUTO_procurement_project", $this->idLicitacion, "ProcurementProject", "id_ajena_licitacion");
|
102
|
102
|
|
103
|
|
- $this->setDatosMultiples($procurementInfo, "itemClass", "BRUTO_procurement_project_itemClass", $procurementProjectId, "ProcurementProject_ItemClass");
|
|
103
|
+ $this->setDatosMultiples($procurementInfo, "itemClass", "BRUTO_procurement_project_itemClass", $procurementProjectId, "ProcurementProject_ItemClass", "id_ajena_pp");
|
104
|
104
|
}
|
105
|
105
|
|
106
|
106
|
private function setProcurementProjectLot($procurementLotInfo): void
|
|
@@ -112,13 +112,13 @@ class ParserDatabaseBruto
|
112
|
112
|
foreach ($procurementLotInfo as $row) {
|
113
|
113
|
$setInsert = array();
|
114
|
114
|
$setInsert[$aux] = $row;
|
115
|
|
- $setInsert[$aux]['id_ajena'] = $this->idLicitacion;
|
|
115
|
+ $setInsert[$aux]['id_ajena_licitacion'] = $this->idLicitacion;
|
116
|
116
|
unset($setInsert[$aux]['itemClassification']);
|
117
|
117
|
|
118
|
118
|
if (!empty($setInsert)) {
|
119
|
119
|
$resultInsert = insertBucle($setInsert, "BRUTO_procurement_project_lot", $this->nombreLog);
|
120
|
120
|
if (array_key_exists('itemClassification', $row)) {
|
121
|
|
- $this->setDatosMultiples($row, "itemClassification", "BRUTO_procurement_project_lot_item", $resultInsert, "ProcurementLotItem");
|
|
121
|
+ $this->setDatosMultiples($row, "itemClassification", "BRUTO_procurement_project_lot_item", $resultInsert, "ProcurementLotItem", "id_ajena_ppl");
|
122
|
122
|
}
|
123
|
123
|
}
|
124
|
124
|
$aux++;
|
|
@@ -145,19 +145,19 @@ class ParserDatabaseBruto
|
145
|
145
|
|
146
|
146
|
$setInsert = array();
|
147
|
147
|
$setInsert['tenderingTerms'][0] = $tenderingTermsInfo[0];
|
148
|
|
- $setInsert['tenderingTerms'][0]['id_ajena'] = $this->idLicitacion;
|
|
148
|
+ $setInsert['tenderingTerms'][0]['id_ajena_licitacion'] = $this->idLicitacion;
|
149
|
149
|
|
150
|
150
|
if (!empty($setInsert)) {
|
151
|
151
|
$resultInsert = insertBucle($setInsert['tenderingTerms'], "BRUTO_tendering_terms", $this->nombreLog);
|
152
|
152
|
|
153
|
153
|
if ($resultInsert > 0) {
|
154
|
|
- $this->setDatosMultiples($tenderingTermsInfo, 1, "BRUTO_tendering_terms_awarding_terms", $resultInsert, "TenderingTermsAwardingTerms");
|
|
154
|
+ $this->setDatosMultiples($tenderingTermsInfo, 1, "BRUTO_tendering_terms_awarding_terms", $resultInsert, "TenderingTermsAwardingTerms", "id_ajena_tt");
|
155
|
155
|
|
156
|
|
- $this->setDatosMultiples($tenderingTermsInfo, 2, "BRUTO_tendering_terms_qualification_request", $resultInsert, "TenderingTermsQualificationRequest");
|
|
156
|
+ $this->setDatosMultiples($tenderingTermsInfo, 2, "BRUTO_tendering_terms_qualification_request", $resultInsert, "TenderingTermsQualificationRequest", "id_ajena_tt");
|
157
|
157
|
|
158
|
|
- $this->setDatosMultiples($tenderingTermsInfo, 3, "BRUTO_tendering_terms_financial_evaluation", $resultInsert, "TenderingTermsFinancialEvaluation");
|
|
158
|
+ $this->setDatosMultiples($tenderingTermsInfo, 3, "BRUTO_tendering_terms_financial_evaluation", $resultInsert, "TenderingTermsFinancialEvaluation", "id_ajena_ttfe");
|
159
|
159
|
|
160
|
|
- $this->setDatosMultiples($tenderingTermsInfo, 4, "BRUTO_tendering_terms_specific_terms", $resultInsert, "TenderingTermsSpecificRequirement");
|
|
160
|
+ $this->setDatosMultiples($tenderingTermsInfo, 4, "BRUTO_tendering_terms_specific_terms", $resultInsert, "TenderingTermsSpecificRequirement", "id_ajena_tt");
|
161
|
161
|
}
|
162
|
162
|
}
|
163
|
163
|
|
|
@@ -183,7 +183,7 @@ class ParserDatabaseBruto
|
183
|
183
|
foreach ($validNoticeInfo as $row) {
|
184
|
184
|
$setInsert = array();
|
185
|
185
|
$setInsert[$aux] = $row;
|
186
|
|
- $setInsert[$aux]['id_ajena'] = $this->idLicitacion;
|
|
186
|
+ $setInsert[$aux]['id_ajena_licitacion'] = $this->idLicitacion;
|
187
|
187
|
|
188
|
188
|
unset($setInsert[$aux]['documento']);
|
189
|
189
|
unset($setInsert[$aux]['fechas']);
|
|
@@ -192,9 +192,9 @@ class ParserDatabaseBruto
|
192
|
192
|
$resultInsert = insertBucle($setInsert, "BRUTO_valid_notice_info", $this->nombreLog);
|
193
|
193
|
|
194
|
194
|
if ($resultInsert > 0) {
|
195
|
|
- $this->setDatosMultiples($row, "documento", "BRUTO_valid_notice_info_documento", $resultInsert, "validNoticeInfoFechas");
|
|
195
|
+ $this->setDatosMultiples($row, "documento", "BRUTO_valid_notice_info_documento", $resultInsert, "validNoticeInfoFechas", "id_ajena_vni");
|
196
|
196
|
|
197
|
|
- $this->setDatosMultiples($row, "fechas", "BRUTO_valid_notice_info_fecha", $resultInsert, "validNoticeInfoDocumento");
|
|
197
|
+ $this->setDatosMultiples($row, "fechas", "BRUTO_valid_notice_info_fecha", $resultInsert, "validNoticeInfoDocumento", "id_ajena_vni");
|
198
|
198
|
}
|
199
|
199
|
}
|
200
|
200
|
$aux++;
|
|
@@ -212,7 +212,7 @@ class ParserDatabaseBruto
|
212
|
212
|
}
|
213
|
213
|
}
|
214
|
214
|
|
215
|
|
- private function setDatosSingular($arrayDatos, $arrayKey, $tabla, $idAjena = 0, $nodoLog): int
|
|
215
|
+ private function setDatosSingular($arrayDatos, $arrayKey, $tabla, $idAjena = 0, $nodoLog, $txtIdAjena): int
|
216
|
216
|
{
|
217
|
217
|
$insertedId = 0;
|
218
|
218
|
if (!empty($arrayDatos) && array_key_exists($arrayKey, $arrayDatos)) {
|
|
@@ -221,7 +221,7 @@ class ParserDatabaseBruto
|
221
|
221
|
$arrayInsertar[0] = $arrayDatos[$arrayKey];
|
222
|
222
|
|
223
|
223
|
if ($idAjena > 0) {
|
224
|
|
- $arrayInsertar[0]['id_ajena'] = $idAjena;
|
|
224
|
+ $arrayInsertar[0][$txtIdAjena] = $idAjena;
|
225
|
225
|
}
|
226
|
226
|
|
227
|
227
|
$insertedId = insertBucle($arrayInsertar, $tabla, $this->nombreLog);
|
|
@@ -238,7 +238,7 @@ class ParserDatabaseBruto
|
238
|
238
|
return $insertedId;
|
239
|
239
|
}
|
240
|
240
|
|
241
|
|
- private function setDatosMultiples($arrayDatos, $arrayKey, $tabla, $idAjena = 0, $nodoLog): void
|
|
241
|
+ private function setDatosMultiples($arrayDatos, $arrayKey, $tabla, $idAjena = 0, $nodoLog, $txtIdAjena): void
|
242
|
242
|
{
|
243
|
243
|
$setInsert = array();
|
244
|
244
|
$resultInsert = 0;
|
|
@@ -250,7 +250,7 @@ class ParserDatabaseBruto
|
250
|
250
|
$setInsert[$aux] = $row;
|
251
|
251
|
|
252
|
252
|
if ($idAjena > 0) {
|
253
|
|
- $setInsert[$aux]['id_ajena'] = $idAjena;
|
|
253
|
+ $setInsert[$aux][$txtIdAjena] = $idAjena;
|
254
|
254
|
}
|
255
|
255
|
|
256
|
256
|
$aux++;
|