mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-22 19:56:29 +01:00
status maintenance
This commit is contained in:
parent
a577f60e91
commit
31ecc83c1e
2 changed files with 19 additions and 15 deletions
|
@ -479,7 +479,7 @@ elsif($q->param('request') eq "bikes_available"){
|
|||
}
|
||||
|
||||
#bikes_all with service_state calculater
|
||||
#cronjob for maintanance update runs at ~ 7:00
|
||||
#cronjob for maintenance update runs at ~ 7:00
|
||||
elsif($q->param('request') eq "bikes_all"){
|
||||
if($varenv{syshost} eq "shareeapp-primary"){
|
||||
($aowner,my $return_merchant) = $apif->fetch_merchant($q,\%varenv,$coo,$q->param('merchant_id'));
|
||||
|
@ -578,32 +578,32 @@ elsif($q->param('request') eq "bikes_all"){
|
|||
#print "$bikes_allraw->{$bid}->{service_state_blue}|$bikes_allraw->{$bid}->{service_state_green}" if($bid eq "5");
|
||||
#$bikes_all->{$oprefix . $bid}->{service_state} = "$bikes_allraw->{$bid}->{service_state_blue}";
|
||||
$bikes_all->{$oprefix . $bid}->{service_state} = "2";
|
||||
$bikes_all->{$oprefix . $bid}->{state} = "maintanance";
|
||||
#if($bikes_allraw->{$bid}->{txt10} && $bikes_allraw->{$bid}->{txt10} !~ /defect|maintanance|requested|occupied/)
|
||||
$bikes_all->{$oprefix . $bid}->{state} = "maintenance";
|
||||
#if($bikes_allraw->{$bid}->{txt10} && $bikes_allraw->{$bid}->{txt10} !~ /defect|maintenance|requested|occupied/)
|
||||
if($bikes_allraw->{$bid}->{int10} && ($bikes_allraw->{$bid}->{int10} == 1 || $bikes_allraw->{$bid}->{int10} == 6)){
|
||||
$service_state_debug .= "$bid: service_state 2\n";
|
||||
#$bw->log("maintanance service_state bike: $bid:",$bikes_all->{$oprefix . $bid}->{service_state},"");
|
||||
#4 = "maintanance"
|
||||
#$bw->log("maintenance service_state bike: $bid:",$bikes_all->{$oprefix . $bid}->{service_state},"");
|
||||
#4 = "maintenance"
|
||||
$apif->bikestate_update($authraw,$bikes_allraw->{$bid}->{c_id},"4");
|
||||
}
|
||||
}
|
||||
elsif($bikes_allraw->{$bid}->{service_state_green} >= 1){
|
||||
#$bikes_all->{$oprefix . $bid}->{service_state} = "$bikes_allraw->{$bid}->{service_state_green}";
|
||||
$bikes_all->{$oprefix . $bid}->{service_state} = "3";
|
||||
$bikes_all->{$oprefix . $bid}->{state} = "maintanance";
|
||||
#if($bikes_allraw->{$bid}->{txt10} && $bikes_allraw->{$bid}->{txt10} !~ /defect|maintanance|requested|occupied/){
|
||||
$bikes_all->{$oprefix . $bid}->{state} = "maintenance";
|
||||
#if($bikes_allraw->{$bid}->{txt10} && $bikes_allraw->{$bid}->{txt10} !~ /defect|maintenance|requested|occupied/){
|
||||
if($bikes_allraw->{$bid}->{int10} && ($bikes_allraw->{$bid}->{int10} == 1 || $bikes_allraw->{$bid}->{int10} == 6)){
|
||||
|
||||
$service_state_debug .= "$bid: service_state 3\n";
|
||||
#$bw->log("maintanance service_state bike: $bid:",$bikes_all->{$oprefix . $bid}->{service_state},"");
|
||||
#4 = "maintanance"
|
||||
#$bw->log("maintenance service_state bike: $bid:",$bikes_all->{$oprefix . $bid}->{service_state},"");
|
||||
#4 = "maintenance"
|
||||
$apif->bikestate_update($authraw,$bikes_allraw->{$bid}->{c_id},"4");
|
||||
}
|
||||
}elsif($bikes_allraw->{$bid}->{service_state_exist} == 1){
|
||||
#if($bikes_allraw->{$bid}->{txt10} && $bikes_allraw->{$bid}->{txt10} =~ /maintanance/)
|
||||
#if($bikes_allraw->{$bid}->{txt10} && $bikes_allraw->{$bid}->{txt10} =~ /maintenance/)
|
||||
if($bikes_allraw->{$bid}->{int10} && $bikes_allraw->{$bid}->{int10} == 4){
|
||||
$service_state_debug .= "$bid: 0\n";
|
||||
#$bw->log("maintanance TO available service_state bike: $bid:",$bikes_all->{$oprefix . $bid}->{service_state},"");
|
||||
#$bw->log("maintenance TO available service_state bike: $bid:",$bikes_all->{$oprefix . $bid}->{service_state},"");
|
||||
#1 = "available"
|
||||
$apif->bikestate_update($authraw,$bikes_allraw->{$bid}->{c_id},"1");
|
||||
}
|
||||
|
@ -780,7 +780,7 @@ elsif($q->param('request') eq "service_done"){
|
|||
}
|
||||
|
||||
#UPDATE bike content state
|
||||
if($q->param('work_id') eq "state" && looks_like_number($bike_id) && $q->param('work_val') =~ /available|maintanance|defect/){
|
||||
if($q->param('work_id') eq "state" && looks_like_number($bike_id) && $q->param('work_val') =~ /available|maintenance|defect/){
|
||||
#once again to get node_record template
|
||||
($xresponse->{$article}, $responseraw, $node_template, $crecord) = $apif->service_select($q,$authraw,"","1");
|
||||
while (my ($key, $value) = each %{ $dbt->{copri_conf}->{bike_state} }) {
|
||||
|
|
|
@ -128,8 +128,8 @@ sub sig_available {
|
|||
$response_out->{$station}->{state} = "defect";
|
||||
if(uc($resp->{site}->{status}) =~ /ACTIVE|PRIVATE/i){
|
||||
$response_out->{$station}->{state} = "available";
|
||||
}elsif(uc($resp->{site}->{status}) eq "MAINTANANCE"){
|
||||
$response_out->{$station}->{state} = "maintanance";
|
||||
}elsif(uc($resp->{site}->{status}) eq "MAINTENANCE"){
|
||||
$response_out->{$station}->{state} = "maintenance";
|
||||
}
|
||||
|
||||
$response_out->{$station}->{operator_data} = {
|
||||
|
@ -203,7 +203,11 @@ sub sig_available {
|
|||
$response_out->{$bike}->{state} = "available";
|
||||
}
|
||||
|
||||
$response_out->{$bike}->{bike_type}->{engine}->{manufacturer} = "dummy";
|
||||
if($resp->{status} && $resp->{status} eq "MAINTENANCE"){
|
||||
$response_out->{$bike}->{state} = "maintenance";
|
||||
}
|
||||
|
||||
$response_out->{$bike}->{bike_type}->{engine}->{manufacturer} = "sigo";
|
||||
my $max_bars = 5;
|
||||
my $current_bars = 0;
|
||||
$response_out->{$bike}->{bike_type}->{battery}->{charge_max_bars} = "$max_bars";
|
||||
|
|
Loading…
Add table
Reference in a new issue