USED DROM XML update - move light commercial types to special
This commit is contained in:
parent
8662db0e5a
commit
a2b2fbb599
@ -202,10 +202,18 @@ class DromXMLGenerator
|
||||
{
|
||||
$this->total++;
|
||||
|
||||
$type = $entry['PROPERTIES']['VEHICLE_SUBTYPE']['VALUE'];
|
||||
//print $type."\n";
|
||||
$type = $entry['PROPERTIES']['VEHICLE_TYPE']['VALUE'];
|
||||
$subtype = $entry['PROPERTIES']['VEHICLE_SUBTYPE']['VALUE'];
|
||||
//print $type." ".$subtype."\n";
|
||||
|
||||
if($type === "Легковой автомобиль")
|
||||
if($type === "Лёгкий коммерческий")
|
||||
{
|
||||
$this->found_special++;
|
||||
$this->buildOffer(true, [ 'group' => 'truck', 'id' => 27 ], $entry);
|
||||
}
|
||||
else
|
||||
{
|
||||
if($subtype === "Легковой автомобиль")
|
||||
{
|
||||
$this->found_cars++;
|
||||
$this->buildOffer(false, [ 'group' => 'car' ], $entry);
|
||||
@ -286,7 +294,7 @@ class DromXMLGenerator
|
||||
{
|
||||
$this->found_special++;
|
||||
|
||||
$frame = $this->getFrameType(mb_strtoupper($type), mb_strtoupper($entry['PROPERTIES']['MODEL']['RELATED']['NAME']));
|
||||
$frame = $this->getFrameType(mb_strtoupper($subtype), mb_strtoupper($entry['PROPERTIES']['MODEL']['RELATED']['NAME']));
|
||||
|
||||
if(!is_null($frame))
|
||||
{
|
||||
@ -295,12 +303,13 @@ class DromXMLGenerator
|
||||
else
|
||||
{
|
||||
$this->invalid_special++;
|
||||
print $this->invalid_special." НЕ УДАЛОСЬ ОПРЕДЕЛИТЬ ТИП: ".mb_strtoupper($type)." \t\t[ ".$entry['CODE']." ][ ".$entry['PROPERTIES']['BRAND']['RELATED']['NAME']." ][ ".$entry['PROPERTIES']['MODEL']['RELATED']['NAME']." ]\n";
|
||||
print $this->invalid_special." НЕ УДАЛОСЬ ОПРЕДЕЛИТЬ ТИП: ".mb_strtoupper($subtype)." \t\t[ ".$entry['CODE']." ][ ".$entry['PROPERTIES']['BRAND']['RELATED']['NAME']." ][ ".$entry['PROPERTIES']['MODEL']['RELATED']['NAME']." ]\n";
|
||||
|
||||
//$this->not_found_special++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function buildOffer($special = false, $frame, $entry)
|
||||
{
|
||||
@ -321,9 +330,6 @@ class DromXMLGenerator
|
||||
$payload["Haul"] = $entry['PROPERTIES']['MILEAGE']['VALUE'];
|
||||
}
|
||||
|
||||
print_r($entry['PROPERTIES']['AFTER_ACCIDENT']);
|
||||
print "\n";
|
||||
|
||||
if(!empty($entry['PROPERTIES']['AFTER_ACCIDENT']['VALUE']))
|
||||
{
|
||||
$payload[ $special ? "idDamagedType" : "DamagedType" ] = $entry['PROPERTIES']['AFTER_ACCIDENT']['VALUE_XML_ID'] == "YES" ? 1 : 0;
|
||||
@ -359,12 +365,19 @@ class DromXMLGenerator
|
||||
$payload['idWheelFormulaType'] = $idWheelFormulaType;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(stripos($item_name, "КАБИНЕТ") !== false || stripos($item_name, "ФУРГОН") !== false || stripos($item_name, "БОРТОВОЙ") !== false || stripos($item_name, "СОБОЛЬ") !== false)
|
||||
{
|
||||
$payload['idWheelFormulaType'] = $this->getDictionaryRecordId($this->dictionaries[ $frame['group'] ]['wheels'], "4X2");
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->invalid_special++;
|
||||
print $this->invalid_special." НЕТ КОЛЕСНОЙ ФОРМУЛЫ: ".$entry['CODE']." - ".$item_name." [".$wheel_type_matches[0]."]\n";
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(in_array($frame['group'], [ "bus", "truck", "truck_tractor", "mobile_crane", "loader", "municipal", "atv", "motorhome" ]))
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user