简要描述:

  • 查询单条路线具体信息

接口版本:

版本号 制定人 制定日期 修订日期
1.0.0 lenny 2022-09-22 2020-09-22

请求URL:

请求方式:

  • POST

    请求头:

参数名 是否必须 类型 说明
Content-Type string 请求类型: application/json

请求参数:

参数名 是否必须 类型 说明
FTokenID string 令牌ID
FAction string 方法名 (QueryRoutePlanByFGUID )
FGUID string 路线唯一标识

返回示例:

正确时返回:

{
    "Result": 200,
    "Message": "check token success",
    "FObject": {
    "Result": 200,
    "Message": "check token success",
    "FObject": {
        "Table": [
            {
                "FGUID": "e286fe13-2034-45eb-9da2-d929e8a2558a",
                "FName": "8789746",
                "FCode": "20200830145345",
                "FStartFence": "5b81e7f0-1e4c-4e4e-a4ba-32a7138caf03",
                "FStartFenceName": "海谷出围栏测试",
                "FStartFormType": 1,
                "FStartTypeName": "测试",
                "FStartPath": "[{\"lat\":22.67071837531768,\"lng\":113.91099242249336},{\"lat\":22.66875631707885,\"lng\":113.90927486128945},{\"lat\":22.66580899152102,\"lng\":113.91246440413853},{\"lat\":22.666602014375645,\"lng\":113.91647473726114},{\"lat\":22.669011541033097,\"lng\":113.91715372235394},{\"lat\":22.671964991193125,\"lng\":113.91618420544815},{\"lat\":22.671898164421865,\"lng\":113.91389170362235}]",
                "FStartRadius": 0.0,
                "FStartCenterLon": 113.91365407695481,
                "FStartCenterLat": 22.668931600149243,
                "FEndFence": "38978700-bdc9-4857-bb0b-9826b59e83e4",
                "FEndFenceName": "测试围栏2",
                "FEndFormType": 1,
                "FEndTypeName": "测试",
                "FEndPath": "[{\"lat\":24.70994521713008,\"lng\":113.57509278388251},{\"lat\":24.70994521713008,\"lng\":113.57657521611749},{\"lat\":24.711750782978523,\"lng\":113.57657521611749},{\"lat\":24.711750782978523,\"lng\":113.57509278388251}]",
                "FEndRadius": 0.0,
                "FEndCenterLon": 113.575834,
                "FEndCenterLat": 24.710848,
                "FRoadPoints": "[{\"lat\":22.66885928808014,\"lng\":113.91363220848557},{\"lat\":22.668999470705682,\"lng\":113.91294237794823},{\"lat\":22.669019771511334,\"lng\":113.91277192775806},{\"lat\":22.669609614401278,\"lng\":113.91290200213997},...,{\"lat\":24.70851446100423,\"lng\":113.57876801084377}]",
                "FRemark": ""
            }
        ],
        "Table1": [
            {
                "FRouteGUID": "e286fe13-2034-45eb-9da2-d929e8a2558a",
                "FPassFenceGUID": "added96f-c1d2-4965-b425-06e83e72acfc",
                "FName": "测试围栏1",
                "FFormType": 1,
                "FTypeName": "测试",
                "FPath": "[{\"lat\":22.84764017,\"lng\":114.1301658},{\"lat\":22.84764024,\"lng\":114.13065303},{\"lat\":22.84899473,\"lng\":114.13065304},{\"lat\":22.84899466,\"lng\":114.13016582}]",
                "FRadius": 0.0,
                "FCenterLon": 114.13065303,
                "FCenterLat": 22.84831749,
                "FIndex": 1
            },
            {
                "FRouteGUID": "e286fe13-2034-45eb-9da2-d929e8a2558a",
                "FPassFenceGUID": "fe09bedb-aae1-43b6-90fb-d2b64e1f4796",
                "FName": "test002",
                "FFormType": 1,
                "FTypeName": "测试",
                "FPath": "[{\"lat\":24.316466141381518,\"lng\":113.30286794457346},{\"lat\":24.316466141381518,\"lng\":113.30311424787654},{\"lat\":24.31782038639906,\"lng\":113.30311424787654},{\"lat\":24.31782038639906,\"lng\":113.30286794457346}]",
                "FRadius": 0.0,
                "FCenterLon": 113.302991096225,
                "FCenterLat": 24.3171432638601,
                "FIndex": 2
            }
        ]
    }
}
    }
}

错误时返回:

//表示传入的公司的唯一标识为空,应该是数据格式不对
{
    "Result": 102,
    "Message": "FParam is null",
    "FObject": []
}
//表示token过期异常报错
{
    "Result": 104,
    "Message": "token error or timeout",
    "FObject": []
}
//表示有异常报错
{
    "Result": 105,
    "Message": "fail",
    "FObject": null
}

返回参数Table说明:

参数名 类型 说明
FAgentGUID String 公司唯一标识
FGUID String 路线唯一标识
FName String 路线名称
FCode String 路线名称
FStartFence String 开始围栏唯一标识
FStartFenceName String 开始围栏名称
FStartFormType int 开始围栏类型 1:多边形 2:圆形
FStartTypeName String 开始围栏类型名称
FStartPath String 开始围栏点集合,Json字符串
FStartRadius double 开始围栏半径
FStartCenterLon String 开始围栏中心点经度
FStartCenterLat String 开始围栏中心点纬度
FEndFence String 结束围栏唯一标识
FEndFenceName String 结束围栏名称
FEndFormType int 结束围栏类型 1:多边形 2:圆形
FEndTypeName String 结束围栏类型名称
FEndPath String 结束围栏点集合,Json字符串
FEndRadius double 结束围栏半径
FEndCenterLon String 结束围栏中心点经度
FEndCenterLat String 结束围栏中心点纬度
FRoadPoints String 路线所有点集合,Json字符串
FRemark String 路线描述

返回参数Table1说明 : 所有途经围栏,如果为null,表示该路线无途经围栏

参数名 类型 说明
FRouteGUID String 所属路线唯一标识
FPassFenceGUID String 途径围栏唯一标识
FName String 途径围栏名称
FFormType int 围栏类型 1:多边形 2:圆形
FTypeName String 围栏类型名称
FPath String 围栏点集合,Json字符串
FRadius double 开始围栏半径
FCenterLon String 开始围栏中心点经度
FCenterLat String 开始围栏中心点纬度
FIndex int 途径围栏序号

备注:

  • 更多返回错误代码如下:
  • 102:请求参数错误
  • 104:token过期异常报错
  • 105:表示有异常报错

请求示例:

Java:

String result = "";
//请求路径
String url = "http://cloud.assetscontrols.com:8092/OpenApi/Admin";  
//请求参数 ,json格式参数,建议用对象传入
String body = "{"FAction":"QueryRoutePlanByFGUID","FGUID":"e286fe13-2034-45eb-9da2-d929e8a2558a",  \"FTokenID\": \"ec51d691-d9a7-4f74-95a8-1856be2ae741\"}";
URL realUrl = new URL(url);
// 设置通用请求的属性
URLConnection conn = realUrl.openConnection(); 
conn.setRequestProperty("accept", "*/*");
conn.setRequestProperty("connection", "keep-Alive");
conn.setRequestProperty("Content-Type", "application/json");
conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
conn.setRequestProperty("method", "post");
// 发送POST请求必须设置如下两行
conn.setDoOutput(true);
conn.setDoInput(true);
PrintWriter pw = new PrintWriter(conn.getOutputStream());
// 发送请求参数
pw.print(body);
// flush输出流的缓冲  
pw.flush();   
// 定义BufferedReader输入流来读取URL的响应
BufferedReader bufReader = new BufferedReader(new InputStreamReader(conn.getInputStream()));  
// 定义BufferedReader输入流来读取URL的响应
String line;
while ((line = bufReader.readLine()) != null) {
     result += line;        
 }
//返回的是json字符串
return result;

C#:

//请求路径
string url = "http://cloud.assetscontrols.com:8092/OpenApi/Admin";  
//请求参数 ,json格式参数,建议用对象传入
string body = "{"FAction":"QueryRoutePlanByFGUID","FGUID":"e286fe13-2034-45eb-9da2-d929e8a2558a",  \"FTokenID\": \"ec51d691-d9a7-4f74-95a8-1856be2ae741\"}"; 
Encoding encoding = Encoding.UTF8;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
 //请求方式 post / get
request.Method = "post"; 
request.Accept = "*/*";    
request.ContentType = "application/json";
request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";
byte[] buffer = encoding.GetBytes(body);
request.ContentLength = buffer.Length;
request.GetRequestStream().Write(buffer, 0, buffer.Length);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
using (StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8))
{
    //返回的是json字符串
    return reader.ReadToEnd();
}

Python:

url = 'http://cloud.assetscontrols.com:8092/OpenApi/Admin'
      data = {
        'FAction': 'QueryDepartureListByFAgentGUID',
        'FTokenID': 'ec51d691-d9a7-4f74-95a8-1856be2ae741',
        'FGUID': 'e286fe13-2034-45eb-9da2-d929e8a2558a' 
       }
      data = parse.urlencode(data).encode('utf-8')
      headers = {
       'User-Agent': r'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) '
                     r'Chrome/45.0.2454.85 Safari/537.36 115Browser/6.0.3',
       'Connection': 'keep-alive'
       }
      req = request.Request(url, headers=headers, data=data)  
      page = request.urlopen(req).read()
      page = page.decode('utf-8')
      # json_array = json.loads(page)
      return page;
文档更新时间: 2024-12-20 16:46   作者:刘家帅