## 一 、分配相关接口  

#### 1. 获取组织结构树

> 注： 请求地址 为  中台地址

##### URL: /web/common/companyCtl/getOrgs

##### REQUEST

| 参数名 | 必须 | 说明 |
| ------ | ---- | ---- |
|        |      |      |

##### RESPONSE

```json
{
    "status": 0,
    "msg": "操作成功",
    "data": {
        "orgJson": [
            {
                "title": "公司宝",   
                "code": "root10",
                "expand": true,
                "orgpath": "root10",
                "children": [
                    {
                        "title": "销售一组",
                        "code": "ic",
                        "expand": true,
                        "orgpath": "root10/ic",
                        "children": [
                            {
                                "title": "销售一一",
                                "code": "2",
                                "expand": true,
                                "orgpath": "root10/ic/2",
                                "children": [],
                                "nodeKey": 2,
                                "isPosition": true, // 是否是岗位
                                "seq": 0,
                                "titlepath": "公司宝/销售一组/销售一一",
                                "level": 3,
                                "roles": [
                                    4,
                                    5
                                ],
                                "isMain": true,
                                "orgtag": "ic"
                            }
                        ],
                        "nodeKey": 1,
                        "isPosition": true,
                        "seq": 0,
                        "titlepath": "公司宝/销售一组",
                        "level": 2,
                        "roles": [
                            4,
                            5
                        ]
                    },
                    {
                        "title": "交付组",
                        "code": "dlivergroup",
                        "expand": true,
                        "orgpath": "root10/dlivergroup",
                        "children": [
                            {
                                "isPosition": true,
                                "isMain": false, // 是否是负责人
                                "orgtag": "",
                                "roles": [
                                    5
                                ],
                                "seq": 0,
                                "code": "dgroupmembers",
                                "title": "交付员",
                                "nodeKey": 4,
                                "orgpath": "root10/dlivergroup/dgroupmembers",
                                "titlepath": "公司宝/交付组/交付员",
                                "level": 3,
                                "expand": true
                            }
                        ],
                        "nodeKey": 3,
                        "isPosition": false,
                        "seq": 0,
                        "titlepath": "公司宝/交付组",
                        "level": 2
                    },
                    {
                        "isPosition": false,
                        "isMain": false,
                        "orgtag": "",
                        "roles": [],
                        "seq": 0,
                        "code": "bizgroup01",
                        "title": "业务组",
                        "nodeKey": 5,
                        "orgpath": "root10/bizgroup01",
                        "titlepath": "公司宝/业务组",
                        "level": 2,
                        "expand": true,
                        "children": [
                            {
                                "isPosition": true,
                                "isMain": false,
                                "orgtag": "",
                                "roles": [
                                    19
                                ],
                                "seq": 0,
                                "code": "g1members",
                                "title": "业务员",
                                "nodeKey": 6,
                                "orgpath": "root10/bizgroup01/g1members",
                                "titlepath": "公司宝/业务组/业务员",
                                "level": 3,
                                "expand": true,
                                "children": []
                            }
                        ]
                    }
                ],
                "nodeKey": 0,
                "titlepath": "公司宝",
                "level": 1
            }
        ]
    },
    "bizmsg": "empty",
    "requestId": "38c2877f63ac49bf8c04dfed24b623a2"
}
```

#### 2. 查询组织结构下的人员

> 注： 请求地址 为  中台地址

##### URL:  /web/auth/userCtl/findAndCountAll

##### REQUEST

```js
{
    "search": {
        "opath": "code码" // 传组织结构下的code码
    },
    "pageInfo": {
        "pageSize": 10,
        "pageNo": 1 // ( -1 的话 查询全部不分页 )
    }
}
```

##### RESPONSE

```json
{
    "status": 0,
    "msg": "操作成功",
    "data": {
        "results": {
            "count": 2,
            "rows": [
                {
                    "mobile": "111",
                    "id": 75,
                    "userName": "test",
                    "nickName": "test_sxy",
                    "sex": null,
                    "mail": "111@qq.com",
                    "headUrl": "",
                    "center_id": "5b2ace4a-c32a-438b-bd1e-d32083322a3f",
                    "isEnabled": true,
                    "opath": "root10/ic/2/test",
                    "ptags": "ic",
                    "skilltags": "公司注册,云上园区注册",
                    "regiontags": "",
                    "openid": null,
                    "unid": null,
                    "isDelivery": true,
                    "isSalesman": true,
                    "isAllArea": true,
                    "created_at": "2020-08-18T02:22:05.000Z",
                    "updated_at": "2020-08-18T02:22:05.000Z",
                    "deleted_at": null,
                    "version": 1,
                    "app_id": 1,
                    "company_id": 10
                }
            ]
        }
    },
    "bizmsg": "empty",
    "requestId": "cac2a1a4037b4308ab8787bedf01f405"
}
```

#### 3. 分配

##### URL:   /web/bizchance/deliverybillCtl/distributionPerson

> 注： 请求地址 为  子系统地址

##### REQUEST

| 参数名   | 必须 | 说明                                                    |
| -------- | ---- | ------------------------------------------------------- |
| numbers  | Y    | 数组    交付单编号 或者 需求单编号                      |
| userId   | Y    | 所分配人的id                                            |
| opCode   | Y    | 所分配人的opath                                         |
| nickName | N    | 所分配人的 昵称                                         |
| type     | Y    | BIZ (分配需求时 )          \|   DELIVERY (分配交付单时) |
| phone    | N    | 手机号                                                  |

##### RESPONSE

```json
{
		"status": 0, // 0为请求成功
    "msg": "SUCCESS",
    "data":"SUCCESS",
    "bizmsg": "empty",
    "requestId": "8800bea986ff4b2ca77824275a4684a8"
}
```

