# 事项关联

原始文档链接：[事项关联](https://weapp.eteams.cn/build/techdoc/wdoc/index.html#/public/repository/b90d212e-0cab-40a6-9845-d9476f717caf/doc/958006624703741953)
目录分组：通用rpc接口以及通用方法

# 创建事项关联接口

### http接口：

> "/api/{module}/common/relevance/create.common","/api/{module}/{childmodule}/common/relevance/create.common","/api/{module}/{childmodule}/{thirdmodule}/common/relevance/create.common","/api/app/{module}/common/relevance/create.common","/api/app/{module}/{childmodule}/common/relevance/create.common","/api/app/{module}/{childmodule}/{thirdmodule}/common/relevance/create.common"

### 接口传参示例

```json
{
    "module": "workflow",
    "objectName": "hrx-水印版本2(2023-06-26 09:30:19)-曾令钛-2023-07-31",
    "objectId": "891391565906853899",
    "relevance": {
        "objectId": "891391565906853899",
        "objectModule": "workflow",
        "objectName": "hrx-水印版本2(2023-06-26 09:30:19)-曾令钛-2023-07-31",
        "objectModuleId": 0,
        "targetId": "777965211947219433",
        "targetName": "孙浩明二",
        "targetModule": "hr"
    }
}
```

### 接口参数：

| 字段名称 | 类型 | 说明 |
| --- | --- | --- |
| module | String | 模块名称 |
| objectId | String | 模块id |
| objectName | String | 关联名称 |
| relevance | SimpleRelevance | 关联内容 |

SimpleRelevance对象字段说明

| 字段名称 | 类型 | 说明 |
| --- | --- | --- |
| objectId | String | 模块id |
| objectModule | String | 模块名称 |
| objectName | String | 关联名称 |
| targetId | String | 被关联的id |
| targetModule | String | 被关联的模块 |
| targetName | String | 被关联的内容名称 |

### 接口返回格式示例

```json
{
    "status": "success",
    "msg": "成功",
    "data": {
        "relevance": {
            "id": "891573174225387521",
            "creator": "4257904481501370612",
            "tenantKey": "t2k74i3rjo",
            "deleteType": 0,
            "objectModule": "workflow",
            "objectId": "891391565906853899",
            "targetModule": "hr",
            "targetId": "777965211947219433",
            "targetName": "孙浩明二",
            "delete": false,
            "objectModuleId": "0",
            "employeeId": "4257904481501370612"
        }
    },
    "actionMsg": {
        "code": 0,
        "message": "成功"
    }
}
```

# 批量创建事项关联接口

> "/api/{module}/common/relevance/createByList.common","/api/{module}/{childmodule}/common/relevance/createByList.common","/api/{module}/{childmodule}/{thirdmodule}/common/relevance/createByList.common","/api/app/{module}/common/relevance/createByList.common","/api/app/{module}/{childmodule}/common/relevance/createByList.common","/api/app/{module}/{childmodule}/{thirdmodule}/common/relevance/createByList.common"

### 接口参数：

| 字段名称 | 类型 | 说明 |
| --- | --- | --- |
| module | String | 模块名称 |
| objectId | String | 模块id |
| objectName | String | 关联名称 |
| relevances | List | 关联内容 |

SimpleRelevance对象字段说明

| 字段名称 | 类型 | 说明 |
| --- | --- | --- |
| objectId | String | 模块id |
| objectModule | String | 模块名称 |
| objectName | String | 关联名称 |
| targetId | String | 被关联的id |
| targetModule | String | 被关联的模块 |
| targetName | String | 被关联的内容名称 |

### 接口返回格式示例

```json
{
    "status": "success",
    "msg": "成功",
    "actionMsg": {
        "code": 0,
        "message": "成功"
    }
}
```
