1

Drivers and vehicle Filter

(13/03/2019 08:40:00 отредактировано samir.agile)

Тема: Drivers and vehicle Filter

Hello

How can we get only available drivers and available vehicle whicle creating journey(route/round)?

while getting a list of drivers and vehicles it should satisfy below criteria::

1. Drivers should be available (That is they should not be assigned to any other journeys at the same time)

2. Selected vehicle should be available to make the journey on that particular date and time (That is the Vehicle should not be assigned to any other
    journeys at the same time)


How can we filter while getting data from APIs?

currently, we are using https://sdk.wialon.com/wiki/en/sidebar/ … arch_items for getting all drivers and all vehicles(units).

2

Drivers and vehicle Filter

(13/03/2019 10:56:36 отредактировано muev)

Re: Drivers and vehicle Filter

samir.agile пишет:

Hello

How can we get only available drivers and available vehicle whicle creating journey(route/round)?

while getting a list of drivers and vehicles it should satisfy below criteria::

1. Drivers should be available (That is they should not be assigned to any other journeys at the same time)

2. Selected vehicle should be available to make the journey on that particular date and time (That is the Vehicle should not be assigned to any other
    journeys at the same time)


How can we filter while getting data from APIs?

currently, we are using https://sdk.wialon.com/wiki/en/sidebar/ … arch_items for getting all drivers and all vehicles(units).


Good afternoon!

Filtering avaliable drivers and units you can make only on your side. To get drivers information you can use request core/search_items  with parameters below:

{"spec":{
                "itemsType": "avl_resource",    
                "propName": "drivers",    
                "propValueMask": "*",    
                "sortType": "drivers",
                "propType": "propitemname",
                "or_logic": 0    
                 },
                 "force": 0,            
                 "flags": 256,            
                     "from":0,            
                 "to":0
}

And get drivers id from "drvrs" array where "bu" field is empty. ( https://sdk.wialon.com/wiki/en/sidebar/ … ce#drivers

Also, to get assigned vehicles on journes you need to make search in "avl_route" itemType with flags=1204 for route schedules (https://sdk.wialon.com/wiki/en/sidebar/ … #schedules) and delete them in result from request of searching all vehicles.

You can use core/batch request to make all these requests in one.

3

Drivers and vehicle Filter

Re: Drivers and vehicle Filter

muev пишет:
samir.agile пишет:

Hello

How can we get only available drivers and available vehicle whicle creating journey(route/round)?

while getting a list of drivers and vehicles it should satisfy below criteria::

1. Drivers should be available (That is they should not be assigned to any other journeys at the same time)

2. Selected vehicle should be available to make the journey on that particular date and time (That is the Vehicle should not be assigned to any other
    journeys at the same time)


How can we filter while getting data from APIs?

currently, we are using https://sdk.wialon.com/wiki/en/sidebar/ … arch_items for getting all drivers and all vehicles(units).


Good afternoon!

Filtering avaliable drivers and units you can make only on your side. To get drivers information you can use request core/search_items  with parameters below:

{"spec":{
                "itemsType": "avl_resource",    
                "propName": "drivers",    
                "propValueMask": "*",    
                "sortType": "drivers",
                "propType": "propitemname",
                "or_logic": 0    
                 },
                 "force": 0,            
                 "flags": 256,            
                     "from":0,            
                 "to":0
}

And get drivers id from "drvrs" array where "bu" field is empty. ( https://sdk.wialon.com/wiki/en/sidebar/ … ce#drivers

Also, to get assigned vehicles on journes you need to make search in "avl_route" itemType with flags=1204 for route schedules (https://sdk.wialon.com/wiki/en/sidebar/ … #schedules) and delete them in result from request of searching all vehicles.

You can use core/batch request to make all these requests in one.


We are not getting for vehicles. Can you please explain in more details.
from which field of route_schedules we need to check and delete from get all units(vehicles).
because these are so many fields on "rs"(schedule) and which filed we need to get and delete that item from get all units.

4

Drivers and vehicle Filter

Re: Drivers and vehicle Filter

In the field "cfg" you can see the field "units" which contains items IDs of assigned units on this schedule. So you need to exclude them from search request result.

5

Drivers and vehicle Filter

Re: Drivers and vehicle Filter

muev пишет:

In the field "cfg" you can see the field "units" which contains items IDs of assigned units on this schedule. So you need to exclude them from search request result.


Hello Team,
As per our previous discussion on this topic.

We are fetching available drivers and vehicles and it works perfectly.
Now question is while create Journey we are using below APIs

1- create route :- https://sdk.wialon.com/wiki/en/sidebar/ … eate_route
2- update checkpoints :- https://sdk.wialon.com/wiki/en/sidebar/ … heckpoints
3- create schedule :- https://sdk.wialon.com/wiki/en/sidebar/ … e_schedule
4- create round :- https://sdk.wialon.com/wiki/en/sidebar/ … date_round

So, once we are used one driver it's "bu" field should be updated with unit.
So how to update bu field in driver's list ?
which apis we need to use for that ?