文档

资产模型

更新时间:
一键部署

资产模型和空间模型开放API说明。

1 分页查询资产模型列表

资产管理应用提供资产基础数据查询服务,三方业务应用或数据中台通过调用此API服务,获取请求参数范围内的资产模型基础数据。

路径

/industry/assettype/base/infos/query

版本

1.0.0

请求参数

入参名称

数据类型

结构类型

是否必须

入参描述

子级参数类型

factoryIdentifier

字符串

工厂标识

parentAssetTypeIdentifier

字符串

父资产模型标识,查询指定父资产下的全部子级资产

assetTypeIdentifierList

JSON

数组

资产模型标识列表

字符串

parentTypeCode

字符串

父资产模型编码

status

整型

状态,1:启用,2:暂停,-1:删除

typeCodeList

JSON

数组

资产模型编码列表

字符串

searchKey

字符串

模糊搜索资产模型编码和名称

filterType

字符串

传入allocated则只查询已分配资源的列表

pageSize

整型

每页数量大小

pageNo

整型

当前页

totalRecord

整型

总记录数

source

字符串

来源

baseType

字符串

基础类别,其中设备:DEVICE,空间:SPACE

请求示例

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import com.aliyun.iotapigateway.Client;
import com.aliyun.iotapigateway.models.CommonParams;
import com.aliyun.iotapigateway.models.Config;
import com.aliyun.iotapigateway.models.IoTApiRequest;
import com.aliyun.tea.TeaResponse;
import com.aliyun.teautil.Common;
import com.aliyun.teautil.models.RuntimeOptions;

public class AssetTest {

    //AppKey由工业数据应用平台颁发, 第三方应用需要携带写入请求头
    private static final String APP_KEY = "***";
    //AppSecret 由工业数据应用平台颁发时与AppKey映射,用于数据签名
    private static final String APP_SECRET = "***";
    //服务域名/ip
    private static final String HOST = "host:port";
    //服务路径
    private static final String PATH = "/industry/assettype/base/infos/query";
    //服务版本,目前默认1.0.0
    private static final String VERSION = "1.0.0";
    private static final String HTTP_COL = "HTTP";
    private static final String HTTP_METHOD = "POST";

    public static void main(String[] args) throws Exception{
        Config config = new Config();
        config.appKey = APP_KEY;
        config.appSecret = APP_SECRET;
        config.domain = HOST;

        Client client = new Client(config);
        Map<String, Object> params = new HashMap<>();

        params.put("pageSize", 10);
        params.put("pageNo", 1);
        List<String> codes = new ArrayList<>();
        codes.add("testcode1");
        codes.add("testcode2");
        params.put("typeCodeList", JSON.parse(JSONObject.toJSONString(codes)));

        CommonParams req = new CommonParams();
        req.apiVer = VERSION;

        IoTApiRequest body = new IoTApiRequest();
        body.params = params;
        body.request = req;

        RuntimeOptions runtime = new RuntimeOptions();

        TeaResponse teaResponse = client.doRequest(PATH, HTTP_COL, HTTP_METHOD, null, body, runtime);
        //请求返回, 解析出对象 Common支持多种转换读取根据实际转换处理
        System.out.printf(Common.readAsString(teaResponse.body));
    }
}

响应参数

参数名称

数据类型

结构类型

参数描述

code

整型

code

data

JSON

结构体

data

-total

长整型

total

-dataList

JSON

数组

dataList

--parentTypeName

字符串

父资产模型名称

--parentTypeCode

字符串

父资产模型编码

--typeName

字符串

资产模型名称

--description

字符串

description

--id

长整型

主键id

--typeCode

字符串

资产模型编码

--baseType

字符串

基础类别,其中设备:DEVICE,空间:SPACE

--status

整型

状态,1:启用,2:暂停,-1:删除

--gmtModified

长整型

修改时间,毫秒时间戳

--gmtCreate

长整型

创建时间,毫秒时间戳

message

字符串

message

localizedMsg

字符串

localizedMsg

响应示例

{
    "code":200,
    "data":{
        "total":2,
        "dataList":[
            {
                "gmtModified":1628749529000,
                "typeName":"测试资产223",
                "id":2568,
                "gmtCreate":1628749529000,
                "typeCode":"ddd12",
                "baseType":"DEVICE",
                "status":1
            },
            {
                "gmtModified":1628479404000,
                "parentTypeName":"dytest0806资产模型",
                "parentTypeCode":"dytest0806",
                "typeName":"12",
                "description":"",
                "id":2551,
                "gmtCreate":1628479404000,
                "typeCode":"1212",
                "baseType":"DEVICE",
                "status":1
            }
        ]
    },
    "id":"f8ab43f0-acaa-4974-a813-b357d0179daa16415421634181"
}

2 分页查询资产设备列表

资产管理应用提供资产基础数据查询服务,三方业务应用或数据中台通过调用此API服务,获取请求参数范围内的资产基础数据。

路径

/industry/asset/base/infos/query

版本

3.0.0

请求参数

入参名称

数据类型

结构类型

是否必须

入参描述

子级参数类型

parentAssetIdentifier

字符串

父资产标识

pageSize

整型

每页数量大小

totalRecord

整型

总纪录数

pageNo

整型

当前页

factoryIdentifier

字符串

工厂标识

startTime

字符串

查询更新开始时间

endTime

字符串

查询更新结束时间

assetIdentifierList

JSON

数组

资产标识列表

字符串

locationIdentifier

字符串

位置标识

assetCodes

JSON

数组

资产编码列表

字符串

assetTypeIdentifierList

JSON

数组

资产类型ID列表

长整型

status

整型

资产状态

searchKey

字符串

模糊搜索资产设备名称和编码

identityId

字符串

用户id

请求示例

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import com.aliyun.iotapigateway.Client;
import com.aliyun.iotapigateway.models.CommonParams;
import com.aliyun.iotapigateway.models.Config;
import com.aliyun.iotapigateway.models.IoTApiRequest;
import com.aliyun.tea.TeaResponse;
import com.aliyun.teautil.Common;
import com.aliyun.teautil.models.RuntimeOptions;

public class AssetTest {

    //AppKey由工业数据应用平台颁发, 第三方应用需要携带写入请求头
    private static final String APP_KEY = "***";
    //AppSecret 由工业数据应用平台颁发时与AppKey映射,用于数据签名
    private static final String APP_SECRET = "***";
    //服务域名/ip
    private static final String HOST = "host:port";
    //服务路径
    private static final String PATH = "/industry/asset/base/infos/query";
    //服务版本,目前默认1.0.0
    private static final String VERSION = "3.0.0";
    private static final String HTTP_COL = "HTTP";
    private static final String HTTP_METHOD = "POST";

    public static void main(String[] args) throws Exception{
        Config config = new Config();
        config.appKey = APP_KEY;
        config.appSecret = APP_SECRET;
        config.domain = HOST;

        Client client = new Client(config);
        Map<String, Object> params = new HashMap<>();

        params.put("pageSize", 10);
        params.put("pageNo", 1);
        List<String> codes = new ArrayList<>();
        codes.add("testday0001_001");
        params.put("assetCodes", JSON.parse(JSONObject.toJSONString(codes)));

        CommonParams req = new CommonParams();
        req.apiVer = VERSION;

        IoTApiRequest body = new IoTApiRequest();
        body.params = params;
        body.request = req;

        RuntimeOptions runtime = new RuntimeOptions();

        TeaResponse teaResponse = client.doRequest(PATH, HTTP_COL, HTTP_METHOD, null, body, runtime);
        //请求返回, 解析出对象 Common支持多种转换读取根据实际转换处理
        System.out.printf(Common.readAsString(teaResponse.body));
    }
}

响应参数

参数名称

数据类型

结构类型

参数描述

code

整型

code

data

JSON

结构体

data

-total

长整型

total

-dataList

JSON

数组

dataList

--assetBaseTypeCode

字符串

资产基础类型

--factoryCode

字符串

地点编码

--gmtModified

长整型

更新时间,毫秒时间戳

--assetTypeId

长整型

资产模型ID

--assetTypeName

字符串

资产模型名称

--latitude

字符串

纬度

--parentAssetName

字符串

父资产名称

--description

字符串

描述

--organizationId

字符串

业务实体ID

--assetFile

字符串

附件url

--id

长整型

资产ID

--longitude

字符串

经度

--parentAssetCode

字符串

父资产编码

--idStr

字符串

资产ID,以id为前缀的字符串

--address

字符串

地址

--assetCode

字符串

资产编码

--organizationName

字符串

业务实体名称

--factoryId

字符串

地点ID

--factoryName

字符串

地点名称

--assetLevel

整型

级别

--assetSerialNu mber

字符串

资产序列号

--hasSubAsset

布尔

是否有子资产

--assetIdStr

字符串

资产ID

--parentAssetId Str

字符串

父资产id

--assetName

字符串

资产名称

--location

字符串

位置

--assetTypeCode

字符串

资产类型编码

--parentAssetId

长整型

父资产ID

--locationCode

字符串

位置编码

--status

整型

资产状态

--multiDescription

字符串

多语言描述

message

字符串

message

localizedMsg

字符串

localizedMsg

响应示例

{
    "code":200,
    "data":{
        "total":1,
        "dataList":[
            {
                "assetBaseTypeCode":"DEVICE",
                "factoryCode":"address0913",
                "parentAssetCode":"assert0914",
                "idStr":"id44736",
                "gmtModified":1637222686000,
                "assetCode":"testday0001_001",
                "assetTypeId":2941,
                "organizationName":"zxl全量实体test",
                "factoryId":"198",
                "assetTypeName":"testday0001",
                "parentAssetName":"zxl设备资产0914",
                "factoryName":"重庆",
                "assetLevel":2,
                "multiDescription":"{\"zh\":\"test\"}",
                "organizationId":"129",
                "assetIdStr":"id44736",
                "parentAssetIdStr":"id38767",
                "assetName":"testday0001",
                "assetTypeCode":"testday0001",
                "id":44736,
                "parentAssetId":38767,
                "status":1
            }
        ]
    },
    "id":"a23c023d-eec8-47c2-9d54-61b06437357216415441340531"
}

3 分页查询资产设备关联的业务属性列表

资产管理应用提供资产模型数据查询服务,数据中台等三方应用通过调用此API服务,获取请求参数范围内的资产的业务属性列表。

路径

/industry/asset/biz/attributes/query

版本

3.0.2

请求参数

入参名称

数据类型

结构类型

是否必须

入参描述

子级参数类型

assetIdentifierList

JSON

数组

资产标识数组,查询多个资产的基础数据

字符串

assetCodes

JSON

数组

资产编码数组

字符串

startTime

字符串

最近更新时间范围开始时间,格式为yyyy-MM-dd HH:mm:ss

endTime

字符串

最近更新时间范围结束时间,格式为yyyy-MM-dd HH:mm:ss

pageNo

整型

当前页码

pageSize

整型

每页数量

totalRecord

整型

总记录数

请求示例

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import com.aliyun.iotapigateway.Client;
import com.aliyun.iotapigateway.models.CommonParams;
import com.aliyun.iotapigateway.models.Config;
import com.aliyun.iotapigateway.models.IoTApiRequest;
import com.aliyun.tea.TeaResponse;
import com.aliyun.teautil.Common;
import com.aliyun.teautil.models.RuntimeOptions;

public class AssetBizAttributeTest {

    //AppKey由工业数据应用平台颁发, 第三方应用需要携带写入请求头
    private static final String APP_KEY = "***";
    //AppSecret 由工业数据应用平台颁发时与AppKey映射,用于数据签名
    private static final String APP_SECRET = "***";
    //服务域名/ip
    private static final String HOST = "host:port";
    //服务路径
    private static final String PATH = "/industry/asset/biz/attributes/query";
    //服务版本,目前默认1.0.0
    private static final String VERSION = "3.0.2";
    private static final String HTTP_COL = "HTTP";
    private static final String HTTP_METHOD = "POST";

    public static void main(String[] args) throws Exception{
        Config config = new Config();
        config.appKey = APP_KEY;
        config.appSecret = APP_SECRET;
        config.domain = HOST;

        Client client = new Client(config);
        Map<String, Object> params = new HashMap<>();

        params.put("pageSize", 10);
        params.put("pageNo", 1);
        List<String> codes = new ArrayList<>();
        codes.add("testday0001_001");
        params.put("assetCodes", JSON.parse(JSONObject.toJSONString(codes)));

        CommonParams req = new CommonParams();
        req.apiVer = VERSION;

        IoTApiRequest body = new IoTApiRequest();
        body.params = params;
        body.request = req;

        RuntimeOptions runtime = new RuntimeOptions();

        TeaResponse teaResponse = client.doRequest(PATH, HTTP_COL, HTTP_METHOD, null, body, runtime);
        //请求返回, 解析出对象 Common支持多种转换读取根据实际转换处理
        System.out.printf(Common.readAsString(teaResponse.body));
    }
}

响应参数

参数名称

数据类型

结构类型

参数描述

code

整型

code

data

JSON

结构体

data

-total

长整型

total

-dataList

JSON

数组

dataList

--assetIdStr

字符串

资产id

--instanceDTOList

JSON

数组

instanceDTOList

---idStr

字符串

主键id

---assetCode

字符串

资产编码

---assetTypeId

长整型

资产模型id

---attributeGroupIdentifier

字符串

属性组标识

---assetIdStr

字符串

资产id

---assetId

长整型

资产Id

---assetTypeCode

字符串

资产类型编码

---id

长整型

主键id

---attributeDTO

JSON

结构体

属性信息

----gmtModified

长整型

更新时间戳,毫秒

----attributeValue

字符串

属性值

----defaultValue

字符串

默认值

----editable

整型

是否可编辑

----attributeOrder

整型

属性排序

----description

字符串

描述

----title

字符串

标题

----templateId

长整型

模板ID

----precisionFormat

字符串

精度格式

----tips

字符串

提示

----required

整型

是否必填

----visable

整型

是否可见

----templateName

字符串

模板名称

----attributeType

整型

属性类型:单行文本:1,数字:2,时间:3,单选组:4,附件:5,多行文本:6,日期:7,下拉表:8,复选框:8,主数据:9 监控点类型:数据类型:布尔:10,整数(64位):11,小数(64位):12,枚举(30字节):13,文本(255字节):1,时间:3

----attributeIdentifier

字符串

attributeIdentifier

----customOption

字符串

自定义选项

----relationMasterData

字符串

关联主数据

----multiSelected

整型

是否多选,默认0,不多选

----id

长整型

属性id

----supportThousandsFormal

整型

0代表不支持千分位,1代表支持千分位显示

---attributeGroupName

字符串

资产属性组名称

message

字符串

message

localizedMsg

字符串

localizedMsg

响应示例

{
    "code":200,
    "data":{
        "total":1,
        "dataList":[
            {
                "assetIdStr":"id44736",
                "instanceDTOList":[
                    {
                        "assetCode":"testday0001_001",
                        "assetId":44736,
                        "attributeDTO":{
                            "gmtModified":1636100833000,
                            "defaultValue":"",
                            "editable":1,
                            "attributeOrder":1,
                            "title":"ID",
                            "templateId":847,
                            "precisionFormat":"0",
                            "tips":"",
                            "required":0,
                            "visable":1,
                            "attributeType":1,
                            "attributeIdentifier":"0d49ec81499a4dc7af4fd3f0deace240",
                            "id":761,
                            "supportThousandsFormal":0
                        }
                    },
                    {
                        "assetCode":"testday0001_001",
                        "assetId":44736,
                        "attributeDTO":{
                            "gmtModified":1636100833000,
                            "defaultValue":"",
                            "editable":1,
                            "attributeOrder":2,
                            "title":"Name",
                            "templateId":847,
                            "precisionFormat":"0",
                            "tips":"",
                            "required":0,
                            "visable":1,
                            "attributeType":1,
                            "attributeIdentifier":"96e55c1dfa014674b9e4c84e6e3c55b9",
                            "id":762,
                            "supportThousandsFormal":0
                        }
                    }
                ]
            }
        ]
    },
    "id":"3cbe5943-2b80-48ba-8754-5d31e3e1f18b16417819846731"
}

4 分页查询资产设备关联的技术属性列表

资产管理应用提供资产模型数据查询服务,数据中台等三方应用通过调用此API服务,获取请求参数范围内的资产的技术属性列表。

路径

/industry/asset/iot/attributes/query

版本

3.0.1

请求参数

入参名称

数据类型

结构类型

是否必须

入参描述

子级参数类型

assetIdentifierList

JSON

数组

资产标识数组,查询多个资产的基础数据

字符串

assetCodeList

JSON

数组

资产编码数组

字符串

startTime

字符串

最近更新时间范围开始时间,格式为yyyy-MM-dd HH:mm:ss

endTime

字符串

最近更新时间范围结束时间,格式为yyyy-MM-dd HH:mm:ss

pageNo

整型

当前页码

pageSize

整型

每页数量

totalRecord

整型

总记录数

searchKey

字符串

模糊搜索属性编码和名称

请求示例

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import com.aliyun.iotapigateway.Client;
import com.aliyun.iotapigateway.models.CommonParams;
import com.aliyun.iotapigateway.models.Config;
import com.aliyun.iotapigateway.models.IoTApiRequest;
import com.aliyun.tea.TeaResponse;
import com.aliyun.teautil.Common;
import com.aliyun.teautil.models.RuntimeOptions;

public class AssetIotAttributeTest {

    //AppKey由工业数据应用平台颁发, 第三方应用需要携带写入请求头
    private static final String APP_KEY = "***";
    //AppSecret 由工业数据应用平台颁发时与AppKey映射,用于数据签名
    private static final String APP_SECRET = "***";
    //服务域名/ip
    private static final String HOST = "host:port";
    //服务路径
    private static final String PATH = "/industry/asset/iot/attributes/query";
    //服务版本,目前默认1.0.0
    private static final String VERSION = "3.0.1";
    private static final String HTTP_COL = "HTTP";
    private static final String HTTP_METHOD = "POST";

    public static void main(String[] args) throws Exception{
        Config config = new Config();
        config.appKey = APP_KEY;
        config.appSecret = APP_SECRET;
        config.domain = HOST;

        Client client = new Client(config);
        Map<String, Object> params = new HashMap<>();

        params.put("pageSize", 10);
        params.put("pageNo", 1);
        List<String> codes = new ArrayList<>();
        codes.add("44736");
        //params.put("assetCodeList", JSON.parse(JSONObject.toJSONString(codes)));
        params.put("assetIdentifierList", JSON.parse(JSONObject.toJSONString(codes)));

        CommonParams req = new CommonParams();
        req.apiVer = VERSION;

        IoTApiRequest body = new IoTApiRequest();
        body.params = params;
        body.request = req;

        RuntimeOptions runtime = new RuntimeOptions();

        TeaResponse teaResponse = client.doRequest(PATH, HTTP_COL, HTTP_METHOD, null, body, runtime);
        //请求返回, 解析出对象 Common支持多种转换读取根据实际转换处理
        System.out.printf(Common.readAsString(teaResponse.body));
    }
}

响应参数

参数名称

数据类型

结构类型

参数描述

code

整型

code

data

JSON

结构体

data

-total

长整型

数据数量

-dataList

JSON

数组

dataList

--assetIdStr

字符串

资产ID

--instanceDTOList

JSON

数组

技术属性列表

--idStr

字符串

技术属性id

--attributeRelationType

整型

属性关系类型,1:属性组, 2:属性

--assetCode

字符串

资产编码

--assetTypeId

长整型

资产类型ID

--maxValue

字符串

最大值

--measureUnit

字符串

单位

--attributeGroupName

字符串

属性组名称

--writable

整型

是否可写

--attributeId

长整型

属性ID

--attributeTemplateId

长整型

属性模板id

--minValue

字符串

最小值

--attributeRelationId

长整型

属性关联id

--enumValue

字符串

枚举值

--attributeGroupIdentifier

字符串

属性组标识

--assetIdStr

字符串

资产ID,字符串前缀

--attributeType

整型

属性类型

--assetId

长整型

资产ID

--attributeIdentifier

字符串

属性标识

--attributeName

字符串

属性名称

--assetTypeCode

字符串

资产类型名称

--id

长整型

技术属性实例id

--multiAttributeDesc

字符串

多语言属性描述

--multiAttributeGroupDesc

字符串

多语言属性组描述

--bitNumber

整型

位序

--attributeClass

字符串

技术属性分类

--attributeCode

字符串

属性编码

message

字符串

message

localizedMsg

字符串

localizedMsg

响应示例

{
    "code":200,
    "data":{
        "total":4,
        "dataList":[
            {
                "assetIdStr":"id44736",
                "instanceDTOList":[
                    {
                        "idStr":"testday0001_001_D1641650",
                        "attributeRelationType":2,
                        "assetCode":"testday0001_001",
                        "assetTypeId":2941,
                        "attributeGroupName":"zxl技术属性090701",
                        "writable":0,
                        "attributeCode":"name",
                        "attributeTemplateId":831,
                        "attributeRelationId":1641650,
                        "attributeGroupIdentifier":"b3858f07cb4da6e7cce184cd871081",
                        "assetIdStr":"id44736",
                        "attributeType":1,
                        "assetId":44736,
                        "attributeIdentifier":"testday0001_001_D1641650",
                        "attributeName":"Name",
                        "id":29239125
                    },
                    {
                        "idStr":"testday0001_001_D1641651",
                        "attributeRelationType":2,
                        "assetCode":"testday0001_001",
                        "assetTypeId":2941,
                        "maxValue":"1000",
                        "attributeGroupName":"zxl技术属性090701",
                        "writable":0,
                        "attributeCode":"id",
                        "attributeTemplateId":831,
                        "minValue":"1",
                        "attributeRelationId":1641651,
                        "attributeGroupIdentifier":"b3858f07cb4da6e7cce184cd871081",
                        "assetIdStr":"id44736",
                        "attributeType":11,
                        "assetId":44736,
                        "attributeIdentifier":"testday0001_001_D1641651",
                        "attributeName":"ID",
                        "id":29239124
                    },
                    {
                        "idStr":"testday0001_001_D1669492",
                        "attributeRelationType":2,
                        "assetCode":"testday0001_001",
                        "assetTypeId":2941,
                        "attributeGroupName":"d",
                        "writable":0,
                        "attributeCode":"name",
                        "attributeTemplateId":831,
                        "attributeRelationId":1669492,
                        "attributeGroupIdentifier":"77e0910d750195b448797616e091ad",
                        "assetIdStr":"id44736",
                        "attributeType":1,
                        "assetId":44736,
                        "attributeIdentifier":"testday0001_001_D1669492",
                        "attributeName":"Name",
                        "id":29239123
                    },
                    {
                        "idStr":"testday0001_001_D1669493",
                        "attributeRelationType":2,
                        "assetCode":"testday0001_001",
                        "assetTypeId":2941,
                        "maxValue":"1000",
                        "attributeGroupName":"d",
                        "writable":0,
                        "attributeCode":"id",
                        "attributeTemplateId":831,
                        "minValue":"1",
                        "attributeRelationId":1669493,
                        "attributeGroupIdentifier":"77e0910d750195b448797616e091ad",
                        "assetIdStr":"id44736",
                        "attributeType":11,
                        "assetId":44736,
                        "attributeIdentifier":"testday0001_001_D1669493",
                        "attributeName":"ID",
                        "id":29239122
                    }
                ]
            }
        ]
    },
    "id":"c7fb49b9-2d8b-4fa3-96a7-51fb7f1c5a4b16417954642621"
}

5 分页查询空间资产列表

分页查询空间资产列表。

路径

/industry/asset/outer/functionlocation/list

版本

1.0.0

请求参数

入参名称

数据类型

结构类型

是否必须

入参描述

子级参数类型

name

字符串

功能位置名称

code

字符串

功能位置编码

assetTypeId

长整型

资产类型id

assetTypeCode

字符串

资产类型编码

status

整型

状态

functionType

字符串

功能位置类型

level

整型

功能位置级别

rootLocationCode

字符串

根功能位置编码

locationSystemCode

字符串

空间系统编码

locationSystemId

长整型

空间系统id

parentFunctionLocationId

长整型

父空间位置id

parentFunctionLocationCode

字符串

父空间位置编码

searchKey

字符串

搜索关键字,搜索名称和编码

idList

JSON

数组

功能位置id集合

长整型

codes

JSON

数组

功能位置编码集合

字符串

pageSize

整型

页大小

pageNo

整型

页码

factoryId

字符串

地点id

organizationId

字符串

业务实体id

forbidQueryTree

布尔

是否禁止查询父子树

请求示例

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import com.aliyun.iotapigateway.Client;
import com.aliyun.iotapigateway.models.CommonParams;
import com.aliyun.iotapigateway.models.Config;
import com.aliyun.iotapigateway.models.IoTApiRequest;
import com.aliyun.tea.TeaResponse;
import com.aliyun.teautil.Common;
import com.aliyun.teautil.models.RuntimeOptions;

/**
 * @author dongxun.cwj
 * @since 2021/12/16
 */
public class AssetFuncTest {

    //AppKey由工业数据应用平台颁发, 第三方应用需要携带写入请求头
    private static final String APP_KEY = "***";
    //AppSecret 由工业数据应用平台颁发时与AppKey映射,用于数据签名
    private static final String APP_SECRET = "******";
    //服务域名/ip
    private static final String HOST = "host:port";
    //服务路径
    private static final String PATH = "/industry/asset/outer/functionlocation/list";
    //服务版本,目前默认1.0.0
    private static final String VERSION = "1.0.0";
    private static final String HTTP_COL = "HTTP";
    private static final String HTTP_METHOD = "POST";

    public static void main(String[] args) throws Exception{
        Config config = new Config();
        config.appKey = APP_KEY;
        config.appSecret = APP_SECRET;
        config.domain = HOST;

        Client client = new Client(config);
        Map<String, Object> params = new HashMap<>();
        params.put("pageNo", 1);
        params.put("pageSize", 10);
        params.put("forbidQueryTree", true);
        params.put("factoryId", "152");
        params.put("code", "testfl");

        CommonParams req = new CommonParams();
        req.apiVer = VERSION;

        IoTApiRequest body = new IoTApiRequest();
        body.params = params;
        body.request = req;

        RuntimeOptions runtime = new RuntimeOptions();

        TeaResponse teaResponse = client.doRequest(PATH, HTTP_COL, HTTP_METHOD, null, body, runtime);
        //请求返回, 解析出对象 Common支持多种转换读取根据实际转换处理
        System.out.printf(Common.readAsString(teaResponse.body));
    }
}

响应参数

参数名称

数据类型

结构类型

参数描述

code

整型

code

data

JSON

结构体

data

-total

长整型

总记录数

-dataList

JSON

数组

dataList

--gmtModified

长整型

gmtModified

--code

字符串

空间资产编码

--assetTypeId

长整型

设备类型id

--subFunctionLocationList

JSON

数组

子空间资产列表

---gmtModified

长整型

gmtModified

---code

字符串

code

---assetTypeId

长整型

assetTypeId

---parentFunctionLocationCode

字符串

parentFunctionLocationCode

---level

整型

level

---factoryId

字符串

factoryId

---description

字符串

description

---pic

字符串

pic

---gmtCreate

长整型

gmtCreate

---rootLocationCode

字符串

rootLocationCode

---organizationId

字符串

organizationId

---locationSystemCode

字符串

locationSystemCode

---fullCode

字符串

fullCode

---name

字符串

name

---locationSystemId

长整型

locationSystemId

---assetTypeCode

字符串

assetTypeCode

---functionType

字符串

functionType

---id

长整型

id

---parentFunctionLocationId

长整型

parentFunctionLocationId

---status

整型

status

--parentFunctionLocationCode

字符串

父空间资产编码

--level

整型

空间资产级别

--factoryId

字符串

地点id

--description

字符串

空间资产描述

--pic

字符串

pic

--gmtCreate

长整型

gmtCreate

--rootLocationCode

字符串

跟空间资产编码

--organizationId

字符串

业务实体id

--parentFunctionLocationList

JSON

数组

父空间资产列表

---gmtModified

长整型

gmtModified

---code

字符串

code

---assetTypeId

长整型

assetTypeId

---parentFunctionLocationCode

字符串

parentFunctionLocationCode

---level

整型

level

---factoryId

字符串

factoryId

---description

字符串

description

---pic

字符串

pic

---gmtCreate

长整型

gmtCreate

---rootLocationCode

字符串

rootLocationCode

---organizationId

字符串

organizationId

---locationSystemCode

字符串

locationSystemCode

---fullCode

字符串

fullCode

---name

字符串

name

---locationSystemId

长整型

locationSystemId

---assetTypeCode

字符串

assetTypeCode

---functionType

字符串

functionType

---id

长整型

id

---parentFunctionLocationId

长整型

parentFunctionLocationId

---status

整型

status

--locationSystemCode

字符串

空间系统编码

--fullCode

字符串

fullCode

--name

字符串

空间资产名称

--locationSystemId

长整型

空间系统id

--assetTypeCode

字符串

资产类型编码

--functionType

字符串

空间资产类型

--id

长整型

空间资产id

--parentFunctionLocationId

长整型

父空间资产id

--status

整型

状态

message

字符串

message

localizedMsg

字符串

localizedMsg

响应示例

{
    "code":200,
    "data":{
        "total":1,
        "dataList":[
            {
                "gmtModified":1621933872000,
                "code":"test3",
                "assetTypeId":1621933872000,
                "parentFunctionLocationCode":"test1",
                "level":1,
                "factoryId":"132",
                "description":"",
                "pic":"",
                "gmtCreate":1621933872000,
                "rootLocationCode":"test1",
                "organizationId":"87",
                "locationSystemCode":"编码",
                "fullCode":"test1,test2",
                "name":"test3",
                "locationSystemId":1621933872000,
                "assetTypeCode":"test",
                "functionType":"操作",
                "id":1621933872000,
                "parentFunctionLocationId":1621933872000,
                "status":1,
                "parentFunctionLocationList":[
                    {
                        "gmtModified":1621933872000,
                        "code":"test3",
                        "assetTypeId":1621933872000,
                        "parentFunctionLocationCode":"test1",
                        "level":1,
                        "factoryId":"132",
                        "description":"",
                        "pic":"",
                        "gmtCreate":1621933872000,
                        "rootLocationCode":"test1",
                        "organizationId":"87",
                        "locationSystemCode":"编码",
                        "fullCode":"test1,test2",
                        "name":"test3",
                        "locationSystemId":1621933872000,
                        "assetTypeCode":"test",
                        "functionType":"操作",
                        "id":1621933872000,
                        "parentFunctionLocationId":1621933872000,
                        "status":1
                    }
                ],
                "subFunctionLocationList":[
                    {
                        "gmtModified":1621933872000,
                        "code":"test3",
                        "assetTypeId":1621933872000,
                        "parentFunctionLocationCode":"test1",
                        "level":1,
                        "factoryId":"132",
                        "description":"",
                        "pic":"",
                        "gmtCreate":1621933872000,
                        "rootLocationCode":"test1",
                        "organizationId":"87",
                        "locationSystemCode":"编码",
                        "fullCode":"test1,test2",
                        "name":"test3",
                        "locationSystemId":1621933872000,
                        "assetTypeCode":"test",
                        "functionType":"操作",
                        "id":1621933872000,
                        "parentFunctionLocationId":1621933872000,
                        "status":1
                    }
                ]
            }
        ]
    },
    "message":"success",
    "localizedMsg":""
}

  • 本页导读 (0)
文档反馈