def get_worker_id(shh, projectId, worker):
"""
Get the logged in users dispatcher id
:param shh: The ArcREST security handler helper
:param projectId: The projectId to use
:param worker: The name of the worker to get the id of
:return: The OBJECTID of the specified dispatcher
"""
logger = logging.getLogger()
logger.debug("Getting dispatcher id for: {}...".format(worker))
worker_fl = workforcehelpers.get_workers_feature_layer(shh, projectId)
workers = worker_fl.query(where="userId='{}'".format(worker))
if workers.features:
return workers.features[0].asDictionary["attributes"]["OBJECTID"]
else:
logger.critical("{} is not a worker".format(worker))
return None
check_completion_location.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录