描述

获取单据实例,返回数据包含字段值和权限,url可带上查询参数containsAuthority=true,也可不带(不带默认containsAuthority=true)。
搭搭云单据权限精确到字段级,此接口是为了便于UI显示和权限控制,减少网络开销,一次调用就可获取单据实例的字段值和权限。

请求

名称 是否必需 类型 描述
idOrName String 单据模板 Id/名称/实体名称。
instanceId String 单据实例Id。
keyOption String 返回的字段以什么为键名。
键名:
- Entity 以实体属性名为键名;
- Caption 以[组名-]控件名为键名;
- Id 以字段的Id为键名;
- FieldName 以字段的FieldName为键名,默认。
fields String 返回字段;多个字段用英文半角逗号分割(例如:Id,Name;字段值与 keyOption有关)。默认值为空,返回所有字段。

响应

  • 返回单据实例对象,单据实例对象是包含若干属性值对(key-value,也称「键值对」),返回参数:
名称 类型 描述
Id String 实例Id。
IsValid Boolean 是否已提交:
- false 未提交(草稿);
- true 已提交。
IsBlock Boolean 是否流程携带的实例。
DataEnable Boolean 是否已生效。
CreatorName String 创建时,创建者名称。
ModifyByName String 修改者名称。
CreatorPosition String 创建时,创建者部门岗位名称。
$Field Object 字段 Id/名称/实体名称(由请求的keyOption决定)。
$Field.Value Object 字段值。类型由模板的字段类型决定。
$Field.R Boolean 字段查看权限。
$Field.U Boolean 字段修改权限。
$Field.C Boolean 字段的创建权限(子表控件才有)。
$Field.D Boolean 字段的删除权限(子表控件才有)。
$Field.SubFieldsRoleAction Object 子表控件里各个字段的权限(子表控件才有)。
$Field.SubFieldsRoleAction.$SubField Object 子表控件里的字段 Id/名称/实体名称(由请求的keyOption决定)。。
$Field.SubFieldsRoleAction.$SubField.R Boolean 子表控件里的字段的查看权限。
$Field.SubFieldsRoleAction.$SubField.U Boolean 子表控件里的字段的修改权限。
RoleAction Object 整单权限,当前用户对此单据实例的权限。
RoleAction.R Boolean 查看权限。
RoleAction.U Boolean 修改权限。
RoleAction.D Boolean 删除权限。
RoleAction.Export Boolean 导出权限。
  1. 以上IdIsValidIsBlockDataEnableCreatorNameModifyByNameCreatorPositionRoleAction是固定字段,每个单据实例都有;
  2. $Field$SubField等表示动态字段,字段的数量由所设计的单据模板决定,数据结构参照下文返回示例。

示例

以员工信息表为例,以下返回示例为了便于用户查看,省略了部分属性或值:

1. 以Entity作为键名(key)(推荐):

请求示例

GET  /v1/form/templates/Employee/instances/a1e38673-ae69-4536-acac-a27dc46da856?keyOption=Entity&containsAuthority=false  HTTP/1.1
Host: api.dadayun.cn
Date: Wed, 05 Sep 2018 09:30:18 GMT

正常返回示例

HTTP/1.1 200 OK
Date: Wed, 05 Sep 2018 09:30:18 GMT
Content-Type: application/json; charset=utf-8

{
    "Id": "a1e38673-ae69-4536-acac-a27dc46da856",
    "IsBlock": false,
    "IsValid": true,
    "DataEnable": true,
    "CreatorName": "系统管理员",
    "ModifyByName": "系统管理员",
    "CreatorPosition": "系统管理员",
    "Title": {
        "Value": "在职_系统管理员",
        "R": true,
        "U": true
    },
    "Status": {
        "Value": "在职",
        "R": true,
        "U": true
    },
    "EmployeeNumber": {
        "Value": "NO.1",
        "R": true,
        "U": true
    },
    "Name": {
        "Value": "系统管理员",
        "R": true,
        "U": true
    },
    "Portrai": {
        "Value": [
            {
                "Id": "form/.../myPortrai.jpg",
                "FileName": "myPortrai.jpg",
                "FileLength": 148931,
                "Original": "https://jz-file.oss-cn-hangzhou.aliyuncs.com/form/.../myPortrai.jpg",
                "Thumbnail": "https://jz-file.oss-cn-hangzhou.aliyuncs.com/form/.../myPortrai.jpg@!p50",
                "Bmiddle": "https://jz-file.oss-cn-hangzhou.aliyuncs.com/form/.../myPortrai.jpg@!p200"
            }
        ],
        "R": true,
        "U": true
    },
    "Gender": {
        "Value": "男",
        "R": true,
        "U": true
    },
    "Creator": {
        "Value": "a1e38673-ae69-4536-acac-a27dc46da856",
        "R": true,
        "U": true
    },
    "CreatorPositionId": {
        "Value": "00000000-0000-0000-0000-000000000000",
        "R": true,
        "U": true
    },
    "CreateTime": {
        "Value": "2018-05-25T02:04:24.567Z",
        "R": true,
        "U": true
    },
    "ModifyBy": {
        "Value": "a1e38673-ae69-4536-acac-a27dc46da856",
        "R": true,
        "U": true
    },
    "ModifyTime": {
        "Value": "2018-09-06T07:26:56.077Z",
        "R": true,
        "U": true
    },
    "Educations": {
        "Value": [
            {
                "Id": "c2aa83df-c1c3-40c5-b409-0718ef8edefb",
                "StartDate": "200809",
                "EndDate": "201206",
                "EduServices": "XX大学",
                "Major": "软件技术",
                "Certificate": "",
                "OrderIndex": 0
            }
        ],
        "C": true,
        "D": true,
        "R": true,
        "U": true,
        "SubFieldsRoleAction": {
            "StartDate": {
                "R": true,
                "U": true
            },
            "EndDate": {
                "R": true,
                "U": true
            },
            "EduServices": {
                "R": true,
                "U": true
            },
            "Major": {
                "R": true,
                "U": true
            },
            "Certificate": {
                "R": true,
                "U": true
            }
        }
    },
    "RoleAction": {
        "R": true,
        "U": true,
        "D": true,
        "Export": true
    }
}

2. 以Caption作为键名(key):

请求示例

GET /v1/form/templates/%E5%91%98%E5%B7%A5%E4%BF%A1%E6%81%AF%E8%A1%A8/instances/a1e38673-ae69-4536-acac-a27dc46da856?keyOption=Caption&containsAuthority=false  HTTP/1.1
Host: api.dadayun.cn
Date: Wed, 05 Sep 2018 09:30:18 GMT

正常返回示例

HTTP/1.1 200 OK
Date: Wed, 05 Sep 2018 09:30:18 GMT
Content-Type: application/json; charset=utf-8

{
    "Id": "a1e38673-ae69-4536-acac-a27dc46da856",
    "IsBlock": false,
    "IsValid": true,
    "DataEnable": true,
    "CreatorName": "系统管理员",
    "ModifyByName": "系统管理员",
    "CreatorPosition": "系统管理员",
    "标题": {
        "Value": "在职_系统管理员",
        "R": true,
        "U": true
    },
    "在职状态": {
        "Value": "在职",
        "R": true,
        "U": true
    },
    "基本信息-员工编号": {
        "Value": "NO.1",
        "R": true,
        "U": true
    },
    "基本信息-姓名": {
        "Value": "系统管理员",
        "R": true,
        "U": true
    },
    "基本信息-照片": {
        "Value": [
            {
                "Id": "form/.../myPortrai.jpg",
                "FileName": "myPortrai.jpg",
                "FileLength": 148931,
                "Original": "https://jz-file.oss-cn-hangzhou.aliyuncs.com/form/.../myPortrai.jpg",
                "Thumbnail": "https://jz-file.oss-cn-hangzhou.aliyuncs.com/form/.../myPortrai.jpg@!p50",
                "Bmiddle": "https://jz-file.oss-cn-hangzhou.aliyuncs.com/form/.../myPortrai.jpg@!p200"
            }
        ],
        "R": true,
        "U": true
    },
    "基本信息-性别": {
        "Value": "男",
        "R": true,
        "U": true
    },
    "创建人": {
        "Value": "a1e38673-ae69-4536-acac-a27dc46da856",
        "R": true,
        "U": true
    },
    "创建人岗位": {
        "Value": "00000000-0000-0000-0000-000000000000",
        "R": true,
        "U": true
    },
    "创建时间": {
        "Value": "2018-05-25T02:04:24.567Z",
        "R": true,
        "U": true
    },
    "修改人": {
        "Value": "a1e38673-ae69-4536-acac-a27dc46da856",
        "R": true,
        "U": true
    },
    "修改时间": {
        "Value": "2018-09-06T07:26:56.077Z",
        "R": true,
        "U": true
    },
    "教育背景-教育背景": {
        "Value": [
            {
                "Id": "c2aa83df-c1c3-40c5-b409-0718ef8edefb",
                "教育背景-自(年月)": "200809",
                "教育背景-至(年月)": "201206",
                "教育背景-教育机构": "XX大学",
                "教育背景-专业": "软件技术",
                "教育背景-证书名称及编号": "",
                "OrderIndex": 0
            }
        ],
        "C": true,
        "D": true,
        "R": true,
        "U": true,
        "SubFieldsRoleAction": {
            "教育背景-自(年月)": {
                "R": true,
                "U": true
            },
            "教育背景-至(年月)": {
                "R": true,
                "U": true
            },
            "教育背景-教育机构": {
                "R": true,
                "U": true
            },
            "教育背景-专业": {
                "R": true,
                "U": true
            },
            "教育背景-证书名称及编号": {
                "R": true,
                "U": true
            }
        }
    },
    "RoleAction": {
        "R": true,
        "U": true,
        "D": true,
        "Export": true
    }
}

3. 以Id作为键名(key):

请求示例

GET  /v1/form/templates/4bc85381-2209-4f36-a073-b1a7795bcd00/instances/a1e38673-ae69-4536-acac-a27dc46da856?keyOption=FieldName&containsAuthority=false  HTTP/1.1
Host: api.dadayun.cn
Date: Wed, 05 Sep 2018 09:30:18 GMT

正常返回示例

HTTP/1.1 200 OK
Date: Wed, 05 Sep 2018 09:30:18 GMT
Content-Type: application/json; charset=utf-8

{
    "Id": "a1e38673-ae69-4536-acac-a27dc46da856",
    "IsBlock": false,
    "IsValid": true,
    "DataEnable": true,
    "CreatorName": "系统管理员",
    "ModifyByName": "系统管理员",
    "CreatorPosition": "系统管理员",
    "a92299dd-f270-4a91-9252-a46de335056e": {
        "Value": "在职_系统管理员",
        "R": true,
        "U": true
    },
    "dc22db37-5ddb-412d-81db-d71c272a9740": {
        "Value": "在职",
        "R": true,
        "U": true
    },
    "836a4b6f-133b-4204-ae82-ac26713a2b98": {
        "Value": "NO.1",
        "R": true,
        "U": true
    },
    "83035ce3-a6de-4296-b3db-a73cb5de3725": {
        "Value": "系统管理员",
        "R": true,
        "U": true
    },
    "5d54877e-1646-4744-867c-a57b5b9365c2": {
        "Value": [
            {
                "Id": "form/.../myPortrai.jpg",
                "FileName": "myPortrai.jpg",
                "FileLength": 148931,
                "Original": "https://jz-file.oss-cn-hangzhou.aliyuncs.com/form/.../myPortrai.jpg",
                "Thumbnail": "https://jz-file.oss-cn-hangzhou.aliyuncs.com/form/.../myPortrai.jpg@!p50",
                "Bmiddle": "https://jz-file.oss-cn-hangzhou.aliyuncs.com/form/.../myPortrai.jpg@!p200"
            }
        ],
        "R": true,
        "U": true
    },
    "7a3a45f5-8551-46f6-9bc1-4742929f9921": {
        "Value": "男",
        "R": true,
        "U": true
    },
    "8500f40c-f940-4fe1-9320-da4e0ff81204": {
        "Value": "a1e38673-ae69-4536-acac-a27dc46da856",
        "R": true,
        "U": true
    },
    "fc747c65-7460-4f5d-9203-8d79c7ba19fd": {
        "Value": "00000000-0000-0000-0000-000000000000",
        "R": true,
        "U": true
    },
    "87fb1c30-9299-4380-8d24-5aa78e393ff2": {
        "Value": "2018-05-25T02:04:24.567Z",
        "R": true,
        "U": true
    },
    "a1364f13-6be7-4378-a0f8-8a464ac1d771": {
        "Value": "a1e38673-ae69-4536-acac-a27dc46da856",
        "R": true,
        "U": true
    },
    "7a372af9-a78c-4e44-8493-42acfad1bce0": {
        "Value": "2018-09-06T07:26:56.077Z",
        "R": true,
        "U": true
    },
    "d0d35fcf-23a9-43fd-bc63-71e82f4dfe79": {
        "Value": [
            {
                "Id": "c2aa83df-c1c3-40c5-b409-0718ef8edefb",
                "7a7a89a0-b73d-42e5-8df3-1c11a60af05e": "200809",
                "6b8bcb9b-dafb-4720-a5a9-87ac95501434": "201206",
                "ccff267b-0bdf-40bb-9f77-52ff95223190": "XX大学",
                "7358d99b-82f7-44b9-970b-47b60807582f": "软件技术",
                "224f6a06-9c15-4d03-a41b-2f1e425907c4": "",
                "OrderIndex": 0
            }
        ],
        "C": true,
        "D": true,
        "R": true,
        "U": true,
        "SubFieldsRoleAction": {
            "7a7a89a0-b73d-42e5-8df3-1c11a60af05e": {
                "R": true,
                "U": true
            },
            "6b8bcb9b-dafb-4720-a5a9-87ac95501434": {
                "R": true,
                "U": true
            },
            "ccff267b-0bdf-40bb-9f77-52ff95223190": {
                "R": true,
                "U": true
            },
            "7358d99b-82f7-44b9-970b-47b60807582f": {
                "R": true,
                "U": true
            },
            "224f6a06-9c15-4d03-a41b-2f1e425907c4": {
                "R": true,
                "U": true
            }
        }
    },
    "RoleAction": {
        "R": true,
        "U": true,
        "D": true,
        "Export": true
    }
}

请求示例

GET  /v1/form/templates/:idOrName/instances/:instanceId?keyOption=FieldName&containsAuthority=true  HTTP/1.1
Host: api.dadayun.cn
Date: Wed, 05 Sep 2018 09:30:18 GMT

正常返回示例

HTTP/1.1 200 OK
Date: Wed, 05 Sep 2018 09:30:18 GMT
Content-Type: application/json; charset=utf-8

{
    "Id": "a1e38673-ae69-4536-acac-a27dc46da856",
    "IsBlock": false,
    "IsValid": true,
    "DataEnable": true,
    "CreatorName": "系统管理员",
    "ModifyByName": "系统管理员",
    "CreatorPosition": "系统管理员",
    "Title": {
        "Value": "在职_系统管理员",
        "R": true,
        "U": true
    },
    "status": {
        "Value": "在职",
        "R": true,
        "U": true
    },
    "employeenumber": {
        "Value": "NO.1",
        "R": true,
        "U": true
    },
    "name": {
        "Value": "系统管理员",
        "R": true,
        "U": true
    },
    "Field1": {
        "Value": [
            {
                "Id": "form/.../myPortrai.jpg",
                "FileName": "myPortrai.jpg",
                "FileLength": 148931,
                "Original": "https://jz-file.oss-cn-hangzhou.aliyuncs.com/form/.../myPortrai.jpg",
                "Thumbnail": "https://jz-file.oss-cn-hangzhou.aliyuncs.com/form/.../myPortrai.jpg@!p50",
                "Bmiddle": "https://jz-file.oss-cn-hangzhou.aliyuncs.com/form/.../myPortrai.jpg@!p200"
            }
        ],
        "R": true,
        "U": true
    },
    "Field4": {
        "Value": "男",
        "R": true,
        "U": true
    },
    "Creator": {
        "Value": "a1e38673-ae69-4536-acac-a27dc46da856",
        "R": true,
        "U": true
    },
    "CreatorPositionId": {
        "Value": "00000000-0000-0000-0000-000000000000",
        "R": true,
        "U": true
    },
    "CreateTime": {
        "Value": "2018-05-25T02:04:24.567Z",
        "R": true,
        "U": true
    },
    "ModifyBy": {
        "Value": "a1e38673-ae69-4536-acac-a27dc46da856",
        "R": true,
        "U": true
    },
    "ModifyTime": {
        "Value": "2018-09-06T07:26:56.077Z",
        "R": true,
        "U": true
    },
    "28b053ec-ad1a-4fb5-8421-11d4a94a913b": {
        "Value": [
            {
                "Id": "c2aa83df-c1c3-40c5-b409-0718ef8edefb",
                "Field31": "200809",
                "Field32": "201206",
                "Field33": "XX大学",
                "Field34": "软件技术",
                "Field35": "",
                "OrderIndex": 0
            }
        ],
        "C": true,
        "D": true,
        "R": true,
        "U": true,
        "SubFieldsRoleAction": {
            "Field31": {
                "R": true,
                "U": true
            },
            "Field32": {
                "R": true,
                "U": true
            },
            "Field33": {
                "R": true,
                "U": true
            },
            "Field34": {
                "R": true,
                "U": true
            },
            "Field35": {
                "R": true,
                "U": true
            }
        }
    },
    "RoleAction": {
        "R": true,
        "U": true,
        "D": true,
        "Export": true
    }
}

results matching ""

    No results matching ""