Added St. Stefan Stainz to rimo import
This commit is contained in:
@@ -239,7 +239,7 @@
|
||||
<th>Partner</th>
|
||||
<th>Attribute</th>
|
||||
<th>Erstellt<br />Bearbeitet</th>
|
||||
<?php if($me->is(["Admin","netowner"]) && $campaign->fulfillment == "rimo"): ?>
|
||||
<?php if($me->is(["Admin","netowner"])): ?>
|
||||
<th></th>
|
||||
<?php endif; ?>
|
||||
<th></th>
|
||||
@@ -295,7 +295,7 @@
|
||||
<span id="update-<?=$preorder->id?>"><?=date('d.m.Y H:i', $preorder->edit)?></span>
|
||||
</td>
|
||||
|
||||
<?php if($me->is(["Admin", "netowner"]) && $campaign->fulfillment == "rimo"): ?>
|
||||
<?php if($me->is(["Admin", "netowner"])): ?>
|
||||
<td><?php if($preorder->adb_wohneinheit_id && is_object($preorder->adb_wohneinheit->rimo_workorder)):?><i class="fas fa-r" title="Rimo Workorder erstellt"></i><?php endif; ?></td>
|
||||
<?php endif; ?>
|
||||
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
|
||||
|
||||
@@ -210,6 +210,9 @@
|
||||
</tr><tr>
|
||||
<th>Gemeinde</th>
|
||||
<td><?=$preorder->adb_hausnummer->strasse->gemeinde->name?></td>
|
||||
</tr><tr>
|
||||
<th>Anzahl Wohneinheiten</th>
|
||||
<td><?=(is_array($preorder->adb_hausnummer->wohneinheiten) && count($preorder->adb_hausnummer->wohneinheiten)) ? count($preorder->adb_hausnummer->wohneinheiten) : "0"?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace ADBRimoImport\ADBAddressHelper\Network;
|
||||
|
||||
/*
|
||||
* Netzgebiet
|
||||
* St. Stefan ob Stainz
|
||||
*/
|
||||
class Network_C03070 {
|
||||
|
||||
public function checkAddress($data) {
|
||||
/*
|
||||
* array keys are a reference to their original variables and can be manipulated directly
|
||||
*
|
||||
*/
|
||||
|
||||
// dererence input array keys into copies - makes variables available in scope
|
||||
foreach(["strasse_name", "hausnummer_name", "addresszusatz", "gem_kz", "gem_name", "ort_name", "plz_name"] as $var) {
|
||||
$$var = $data[$var];
|
||||
}
|
||||
|
||||
if($strasse_name == "Radlpass Straße") $strasse_name = "Radlpaßstraße";
|
||||
if($strasse_name == "Sankt Stefan Ob Stainz") $strasse_name = "St. Stefan Ob Stainz";
|
||||
if($strasse_name == "Schilcherlandsiedlung") $strasse_name = "Schilcherland Siedlung";
|
||||
if($strasse_name == "Reichenfeldweg") return false;
|
||||
|
||||
if($strasse_name == "Lemsitz GNR") {
|
||||
$strasse_name = "Lemsitz";
|
||||
$hausnummer_name = "GNR $hausnummer_name";
|
||||
}
|
||||
|
||||
if($strasse_name == "Rossegg" && $gem_kz == "60348") {
|
||||
$gem_kz = "60350";
|
||||
}
|
||||
|
||||
if(strtolower($strasse_name) == "st. stefan ob stainz" && $ort_name == "Deutschlandsberg") {
|
||||
//echo "Changing ort_name to 'Sankt Stefan ob Stainz'\n";
|
||||
$ort_name = "Sankt Stefan ob Stainz";
|
||||
}
|
||||
|
||||
|
||||
// put new values back into original pointer
|
||||
foreach(["strasse_name", "hausnummer_name", "addresszusatz", "gem_kz", "gem_name", "ort_name", "plz_name"] as $var) {
|
||||
$data[$var] = $$var;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -98,10 +98,10 @@ foreach($clustersResponse->item as $cluster) {
|
||||
}
|
||||
|
||||
|
||||
/*if($cluster_rimo_id != "SDISalesCluster_200193309697_1700559530") {
|
||||
// kalwang
|
||||
if($cluster_rimo_id != "SDISalesCluster_40295863041_1679040094") {
|
||||
// st. stefan ob stainz
|
||||
continue;
|
||||
}*/
|
||||
}
|
||||
|
||||
$AddressHelper = new ADBAddressHelper\AddressHelper(["log" => $log, "db" => $adb, "netzgebiet" => $adb_netzgebiet]);
|
||||
|
||||
@@ -170,14 +170,14 @@ foreach($clustersResponse->item as $cluster) {
|
||||
$home_rimo_id = $home->id;
|
||||
$home_name = $home->name;
|
||||
|
||||
echo "$home_rimo_id\n";
|
||||
//echo "$home_rimo_id\n";
|
||||
|
||||
if(array_key_exists($home_rimo_id, $existing_units)) {
|
||||
$unit = $existing_units[$home_rimo_id];
|
||||
} else {
|
||||
// find free home without rimo_id
|
||||
$unit = \ADBWohneinheitModel::getFirst(["hausnummer_id" => $hausnummer->id, "extref" => null]);
|
||||
echo "-- Using free unit\n";
|
||||
//echo "-- Using free unit\n";
|
||||
}
|
||||
|
||||
if(!$unit) {
|
||||
@@ -289,12 +289,12 @@ foreach($clustersResponse->item as $cluster) {
|
||||
$req_url = $epGetService."?".$qs;
|
||||
$req_ctx = stream_context_create($ctxOptsGet);
|
||||
|
||||
echo $req_url."\n";
|
||||
//echo $req_url."\n";
|
||||
$responseText = file_get_contents($req_url, false, $req_ctx);
|
||||
|
||||
if($responseText === false) {
|
||||
echo "Error fetching Service for Home $home_rimo_id\n";
|
||||
exit;
|
||||
//echo "Error fetching Service for Home $home_rimo_id\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
$serviceResponse = json_decode($responseText);
|
||||
@@ -307,7 +307,7 @@ foreach($clustersResponse->item as $cluster) {
|
||||
$fixedDN = $service->portA->fixEndDN;
|
||||
|
||||
if($fixedDN) {
|
||||
echo "fixedDn found: $fixedDN\n";
|
||||
//echo "fixedDn found: $fixedDN\n";
|
||||
$dn = getServiceDnValues($fixedDN);
|
||||
if(array_key_exists("Shelf", $dn) && array_key_exists("PatchPanel", $dn) && array_key_exists("Port", $dn)) {
|
||||
$cluster = null;
|
||||
@@ -350,12 +350,12 @@ foreach($clustersResponse->item as $cluster) {
|
||||
$req_url = $epGetWorkorders."?".$qs;
|
||||
$req_ctx = stream_context_create($ctxOptsGet);
|
||||
|
||||
echo $req_url."\n";
|
||||
//echo $req_url."\n";
|
||||
$responseText = file_get_contents($req_url, false, $req_ctx);
|
||||
|
||||
if($responseText === false) {
|
||||
echo "Error fetching Workorders for building $rimo_building_id\n";
|
||||
exit;
|
||||
//echo "Error fetching Workorders for building $rimo_building_id\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
$workordersResponse = json_decode($responseText);
|
||||
@@ -372,7 +372,7 @@ foreach($clustersResponse->item as $cluster) {
|
||||
$wo = \RimoWorkorderModel::getFirst(["rimo_id" => $rimo_workorder_id]);
|
||||
|
||||
if($wo && $workorder_status != $wo->rimo_status) {
|
||||
echo "Updating Workorder $rimo_workorder_id ($workorder_home_id)\n";
|
||||
//echo "Updating Workorder $rimo_workorder_id ($workorder_home_id)\n";
|
||||
$wo->rimo_status = $workorder_status;
|
||||
$wo->save();
|
||||
}
|
||||
@@ -381,11 +381,11 @@ foreach($clustersResponse->item as $cluster) {
|
||||
$wo_home = \ADBWohneinheitModel::getFirst(["extref" => $workorder_home_id]);
|
||||
|
||||
if(!$wo_home) {
|
||||
echo "Home zu Workorder $rimo_workorder_id ($workorder_home_id) nicht gefunden\n";
|
||||
//echo "Home zu Workorder $rimo_workorder_id ($workorder_home_id) nicht gefunden\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
echo "Creating Workorder $rimo_workorder_id ($workorder_home_id)\n";
|
||||
//echo "Creating Workorder $rimo_workorder_id ($workorder_home_id)\n";
|
||||
$wo = \RimoWorkorderModel::create([
|
||||
"adb_wohneinheit_id" => $wo_home->id,
|
||||
"rimo_id" => $rimo_workorder_id,
|
||||
|
||||
@@ -1,356 +0,0 @@
|
||||
https://rimo-saas.com/CRM2RIMO/prod/getBuildings?apiKey=323D33323DC0F8D96BB3C403324D1B7B2F7294FEF981ACF2059BE2B3ACB80EA389D079918FFBAD831861C1850F4046AB&clusterId=SDISalesCluster_126657212929_1678961358
|
||||
===================================
|
||||
strasse: Bierbaum | hausnummer: 62 | zusatz: | gemkz: 60670 | gem_name: Premstätten | ort_name: Bierbaum | plz_name: 8141
|
||||
found hausnummer from rimo_id SDIBuilding_689339860481_1617191662
|
||||
stdClass Object
|
||||
(
|
||||
[id] => SDIHome_63149132801_1664900169
|
||||
[name] => 25011048.01
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] =>
|
||||
[className] =>
|
||||
[executionState] => stdClass Object
|
||||
(
|
||||
[name] => 3
|
||||
[userLabel] => Plan released
|
||||
)
|
||||
|
||||
[operationalState] => stdClass Object
|
||||
(
|
||||
[name] => 10
|
||||
[userLabel] => Planned
|
||||
)
|
||||
|
||||
[subAddress] =>
|
||||
[ftus] => stdClass Object
|
||||
(
|
||||
[item] => Array
|
||||
(
|
||||
[0] => stdClass Object
|
||||
(
|
||||
[id] => SDMMaterial_63149135105_0
|
||||
[name] => G241.01
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] =>
|
||||
[className] =>
|
||||
[oaidObject] => stdClass Object
|
||||
(
|
||||
[id] => SDIOAIDObject_277465606401_1698935360
|
||||
[name] => KWD7M4L0
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] => 1698935360
|
||||
[className] => SDIOAIDObject
|
||||
[terminiationUnit] =>
|
||||
[linkObjects] => stdClass Object
|
||||
(
|
||||
[id] =>
|
||||
[name] =>
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] =>
|
||||
[className] =>
|
||||
[item] => Array
|
||||
(
|
||||
[0] => stdClass Object
|
||||
(
|
||||
[id] =>
|
||||
[name] => KWD7M4L0.001
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] =>
|
||||
[className] =>
|
||||
[terminiationUnit] => stdClass Object
|
||||
(
|
||||
[id] => SDMPort_63149135617_1698935360
|
||||
[name] => 1
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] =>
|
||||
[className] =>
|
||||
[oaidObject] =>
|
||||
)
|
||||
|
||||
[linkObjects] =>
|
||||
[oaidObject] =>
|
||||
[portZ] => stdClass Object
|
||||
(
|
||||
[id] =>
|
||||
[name] => 1
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] =>
|
||||
[className] =>
|
||||
[functionalState] => stdClass Object
|
||||
(
|
||||
[name] => 1
|
||||
[userLabel] => Good
|
||||
)
|
||||
|
||||
[masterItem] => stdClass Object
|
||||
(
|
||||
[id] =>
|
||||
[name] => SC/APC
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] =>
|
||||
[className] =>
|
||||
)
|
||||
|
||||
[fixEndDN] => root{SDMRoot}:Locations{SDILocationRoot}:Austria{SDICountry}:ST{SDIState}:GU{SDIPoliticalDistrict}:60670{SDIMunicipality}:63206{SDICadastralMunicipality}:1168927{SDIBuilding}:25011048.01{SDIHome}:G241.01{TerminationDevice}:1{Port}
|
||||
[home] =>
|
||||
[parent] =>
|
||||
)
|
||||
|
||||
[services] => stdClass Object
|
||||
(
|
||||
[item] => Array
|
||||
(
|
||||
[0] => stdClass Object
|
||||
(
|
||||
[id] => SDIService_63157655297_1664900174
|
||||
[name] => 108SL1
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] => 1664900174
|
||||
[className] => SDIService
|
||||
[operationalState] => stdClass Object
|
||||
(
|
||||
[name] => 10
|
||||
[userLabel] => Planned
|
||||
)
|
||||
|
||||
[masterItem] => stdClass Object
|
||||
(
|
||||
[id] => SDMServiceMasterItem_1025929847553_0
|
||||
[name] => FTTx Service (red)
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] => 1664892065
|
||||
[className] => SDMServiceMasterItem
|
||||
)
|
||||
|
||||
[active] =>
|
||||
[state] => stdClass Object
|
||||
(
|
||||
[name] => 1
|
||||
[userLabel] => undefined
|
||||
)
|
||||
|
||||
[customerId] =>
|
||||
[customerState] =>
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[1] => stdClass Object
|
||||
(
|
||||
[id] =>
|
||||
[name] => KWD7M4L0.002
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] =>
|
||||
[className] =>
|
||||
[terminiationUnit] => stdClass Object
|
||||
(
|
||||
[id] => SDMPort_63149136641_1698935360
|
||||
[name] => 2
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] =>
|
||||
[className] =>
|
||||
[oaidObject] =>
|
||||
)
|
||||
|
||||
[linkObjects] =>
|
||||
[oaidObject] =>
|
||||
[portZ] => stdClass Object
|
||||
(
|
||||
[id] =>
|
||||
[name] => 2
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] =>
|
||||
[className] =>
|
||||
[functionalState] => stdClass Object
|
||||
(
|
||||
[name] => 1
|
||||
[userLabel] => Good
|
||||
)
|
||||
|
||||
[masterItem] => stdClass Object
|
||||
(
|
||||
[id] =>
|
||||
[name] => SC/APC
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] =>
|
||||
[className] =>
|
||||
)
|
||||
|
||||
[fixEndDN] => root{SDMRoot}:Locations{SDILocationRoot}:Austria{SDICountry}:ST{SDIState}:GU{SDIPoliticalDistrict}:60670{SDIMunicipality}:63206{SDICadastralMunicipality}:1168927{SDIBuilding}:25011048.01{SDIHome}:G241.01{TerminationDevice}:2{Port}
|
||||
[home] =>
|
||||
[parent] =>
|
||||
)
|
||||
|
||||
[services] => stdClass Object
|
||||
(
|
||||
[item] => Array
|
||||
(
|
||||
[0] => stdClass Object
|
||||
(
|
||||
[id] => SDIService_63157653249_1664900174
|
||||
[name] => 108SL2
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] => 1664900174
|
||||
[className] => SDIService
|
||||
[operationalState] => stdClass Object
|
||||
(
|
||||
[name] => 10
|
||||
[userLabel] => Planned
|
||||
)
|
||||
|
||||
[masterItem] => stdClass Object
|
||||
(
|
||||
[id] => SDMServiceMasterItem_1025929848833_0
|
||||
[name] => FTTx Service (blue)
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] => 1664892070
|
||||
[className] => SDMServiceMasterItem
|
||||
)
|
||||
|
||||
[active] =>
|
||||
[state] => stdClass Object
|
||||
(
|
||||
[name] => 1
|
||||
[userLabel] => undefined
|
||||
)
|
||||
|
||||
[customerId] =>
|
||||
[customerState] =>
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[2] => stdClass Object
|
||||
(
|
||||
[id] =>
|
||||
[name] => KWD7M4L0.003
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] =>
|
||||
[className] =>
|
||||
[terminiationUnit] => stdClass Object
|
||||
(
|
||||
[id] => SDMPort_63149136897_1698935360
|
||||
[name] => 3
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] =>
|
||||
[className] =>
|
||||
[oaidObject] =>
|
||||
)
|
||||
|
||||
[linkObjects] =>
|
||||
[oaidObject] =>
|
||||
[portZ] => stdClass Object
|
||||
(
|
||||
[id] =>
|
||||
[name] => 3
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] =>
|
||||
[className] =>
|
||||
[functionalState] => stdClass Object
|
||||
(
|
||||
[name] => 1
|
||||
[userLabel] => Good
|
||||
)
|
||||
|
||||
[masterItem] => stdClass Object
|
||||
(
|
||||
[id] =>
|
||||
[name] => SC/APC
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] =>
|
||||
[className] =>
|
||||
)
|
||||
|
||||
[fixEndDN] => root{SDMRoot}:Locations{SDILocationRoot}:Austria{SDICountry}:ST{SDIState}:GU{SDIPoliticalDistrict}:60670{SDIMunicipality}:63206{SDICadastralMunicipality}:1168927{SDIBuilding}:25011048.01{SDIHome}:G241.01{TerminationDevice}:3{Port}
|
||||
[home] =>
|
||||
[parent] =>
|
||||
)
|
||||
|
||||
[services] => stdClass Object
|
||||
(
|
||||
[item] => Array
|
||||
(
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[3] => stdClass Object
|
||||
(
|
||||
[id] =>
|
||||
[name] => KWD7M4L0.004
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] =>
|
||||
[className] =>
|
||||
[terminiationUnit] => stdClass Object
|
||||
(
|
||||
[id] => SDMPort_63149157889_1698935360
|
||||
[name] => 4
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] =>
|
||||
[className] =>
|
||||
[oaidObject] =>
|
||||
)
|
||||
|
||||
[linkObjects] =>
|
||||
[oaidObject] =>
|
||||
[portZ] => stdClass Object
|
||||
(
|
||||
[id] =>
|
||||
[name] => 4
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] =>
|
||||
[className] =>
|
||||
[functionalState] => stdClass Object
|
||||
(
|
||||
[name] => 1
|
||||
[userLabel] => Good
|
||||
)
|
||||
|
||||
[masterItem] => stdClass Object
|
||||
(
|
||||
[id] =>
|
||||
[name] => SC/APC
|
||||
[userLabel] =>
|
||||
[lastHistoryEntry] =>
|
||||
[className] =>
|
||||
)
|
||||
|
||||
[fixEndDN] => root{SDMRoot}:Locations{SDILocationRoot}:Austria{SDICountry}:ST{SDIState}:GU{SDIPoliticalDistrict}:60670{SDIMunicipality}:63206{SDICadastralMunicipality}:1168927{SDIBuilding}:25011048.01{SDIHome}:G241.01{TerminationDevice}:4{Port}
|
||||
[home] =>
|
||||
[parent] =>
|
||||
)
|
||||
|
||||
[services] => stdClass Object
|
||||
(
|
||||
[item] => Array
|
||||
(
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
@@ -21,8 +21,9 @@ $campaign_prem_nord = 5;
|
||||
$campaign_prem_sued = 6;
|
||||
$campaign_gross_st_florian = 7;
|
||||
$campaign_kalwang = 41;
|
||||
$cmapaign_st_stefan_stainz = 36;
|
||||
|
||||
$selected_campaign = $campaign_kalwang;
|
||||
$selected_campaign = $cmapaign_st_stefan_stainz;
|
||||
|
||||
if(!$selected_campaign) {
|
||||
echo "Keine Kampagne ausgewählt.\n";
|
||||
|
||||
@@ -21,8 +21,9 @@ $campaign_prem_nord = 5;
|
||||
$campaign_prem_sued = 6;
|
||||
$campaign_gross_st_florian = 7;
|
||||
$campaign_kalwang = 41;
|
||||
$cmapaign_st_stefan_stainz = 36;
|
||||
|
||||
$selected_campaign = $campaign_kalwang;
|
||||
$selected_campaign = $cmapaign_st_stefan_stainz;
|
||||
|
||||
if(!$selected_campaign) {
|
||||
echo "Keine Kampagne ausgewählt.\n";
|
||||
@@ -60,8 +61,9 @@ foreach(PreorderModel::search(['preordercampaign_id' => $selected_campaign, 'adb
|
||||
}
|
||||
|
||||
|
||||
if($unit_count > 1 && $unit_count <= 4) {
|
||||
// assume its single-dwelling with erroneously high door count
|
||||
if($unit_count > 1) {
|
||||
// legacy comment: assume its single-dwelling with erroneously high door count
|
||||
// current comment: Just use any unit
|
||||
$unit_candidates = [];
|
||||
|
||||
foreach($wohneinheiten as $unit) {
|
||||
@@ -71,14 +73,13 @@ foreach(PreorderModel::search(['preordercampaign_id' => $selected_campaign, 'adb
|
||||
}
|
||||
}
|
||||
|
||||
/*if(!count($unit_candidates)) {
|
||||
// no candidates with door number -> use any
|
||||
|
||||
if(!count($unit_candidates)) {
|
||||
foreach($wohneinheiten as $unit) {
|
||||
if(!$unit->zusatz) continue;
|
||||
if(preg_match('/Top\s+\d+/i',$unit->zusatz)) {
|
||||
$unit_candidates[$unit->zusatz] = $unit;
|
||||
}
|
||||
$unit_candidates[] = $unit;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
if(count($unit_candidates)) {
|
||||
ksort($unit_candidates, SORT_NUMERIC);
|
||||
|
||||
Reference in New Issue
Block a user