# 中台工具字典接口使用对接方案
测试环境IP以及端口号
```
172.16.44.212:8081/paas
```


## 集团管理

#### 查询所有集团列表 
```
POST: /usercenter/groupCompany/query
```

请求参数
```
{}
```

应答内容

```
{
    "result": "success",
    "data": [
        {
            "code": "SN",             集团id
            "name": "苏宁集团"         集团名称
        },
        {
            "code": "WD",
            "name": "万达集团"
        },
        {
            "code": "WK",
            "name": "万科集团"
        }
    ],
    "count": 3
}
```

#### 添加集团

```
POST: /usercenter/groupCompany/save
```
请求参数
```
{
    "code":"546455",      集团id
    "name":"12123213"     集团名称
}
```

应答内容

```
{
    "result":"success"
}
```

#### 编辑集团信息 注意编辑集团和创建使用的同一个接口

```
POST: /usercenter/groupCompany/save
```
请求参数
```
{
    "code":"546455",      集团id
    "name":"12123213"     集团名称
}
```

应答内容

```
{
    "result":"success"
}
```

##### 中台工具中只修改集团名称，前端控制ID不可以修改，确保集团id入参是要修改集团ID否则会创建新的集团


#### 集团字典搜索 功能前端自行筛选

创建集团后，自动创建集团字典（字典默认为平台字典全部内容）；并创建默认方案（默认为集团字典全部内容）

创建集团后调用创建方案接口 ，然后调用方案订阅接口订阅所有类型，以及每个类型下的信息点

#### 创建集团下默认方案

```
dict/scheme/create
```

请求参数

```
{
    "groupId":"142563",             集团id
    "note":null,                    备注
    "name":"默认方案"                方案名称
}
```

应答内容

```
{
    "result":"success",
    "id":5
}
```


方案中订阅类型  需要把平台级字典的所有类型查询出来  然后组合成数组调用方案订阅接口   
方案种类型订阅信息点，需要把平台级的每个类型的信息点查出来，然后一个一个类型的信息点通过接口执行订阅

## 项目管理

#### 根据集团查询项目

```
POST: usercenter/project/query
```

请求参数

```
{
    "criteria":{
        "groupCompanyCode":"WK"   集团id
    }
}
```

应答内容

```
{
    "result":"success",
    "data":[
        {
            "id":"Pj1106479820",
            "name":"北京万科国际大厦",
            "groupCompany":{
                "code":"WK",
                "name":"万科集团"
            }
        }
    ],
    "count":1
}
```

#### 添加项目

```
POST: usercenter/project/save
```

请求参数

```
{
    "id":"Pj3264971164",      项目id
    "name":"测试项目",         项目名称
    "groupCompany":{          
        "code":"WK"           集团id
    }
}
```

应答内容

```
{
    "result":"success"
}
```
#### 集团方案列表

```
POST: /dict/scheme/query
```

请求参数

```
{
    "criteria":{
        "groupId":"WD"  集团id
    }
}
```

应答内容

```
{
    "result":"success",
    "data":[
        {
            "id":3,                         方案id
            "name":"商业综合体",             方案名称
            "groupId":"WD"                  集团id
        },
        {
            "id":4,
            "name":"酒店管理方案",
            "note":"wanda03156",
            "groupId":"WD"
        }
    ],
    "count":2
}
```
#### 项目设置集团方案

```
dict/scheme/project/set
```

请求参数

```
{
    "criteria":{
        "projectId":[    项目id列表
            "Pj1101050029"
        ]
    }
}
```

应答内容

```
{
    "result":"success"
}
```

#### 编辑项目

```
POST: usercenter/project/save
```

请求参数

```
{
    "id":"Pj1101050029",            项目id
    "name":"东坝万达广场1",           项目名称
    "groupCompany":{                集团对象
        "code":"WD",                集团id
        "name":"万达集团"            集团名称
    }
}
```

应答内容

```
{
    "result":"success"
}
```

## 集团字典

### 集团字典管理

#### 获取集团下类型树结构

```
 Get: dict/class?&groupId=WD&subFlag=false     //groupId: 集团id   subFlag： 是否显示所有子分类
```

应答内容

```
{
    "result":"success",
    "data":[
        {
            "code":"project",
            "name":"项目",
            "aliasCode":"project",
            "aliasName":"项目"
        },
        {
            "code":"building",
            "name":"建筑",
            "aliasCode":"building",
            "aliasName":"建筑"
        },
        {
            "code":"floor",
            "name":"楼层",
            "aliasCode":"floor",
            "aliasName":"楼层"
        },
        {
            "code":"space",
            "name":"空间",
            "aliasCode":"space",
            "aliasName":"空间"
        },
        {
            "code":"system",
            "name":"系统",
            "aliasCode":"system",
            "aliasName":"系统",
            "children":[
                {
                    "code":"system-AC",
                    "name":"空调专业",
                    "aliasCode":"system-AC",
                    "aliasName":"空调专业",
                    "children":[
                        {
                            "code":"ACAT",
                            "name":"空调末端系统",
                            "aliasCode":"ACAT",
                            "aliasName":"空调末端系统",
                            "parentCode":"system",
                            "majorCode":"AC"
                        },
                        {
                            "code":"ACAD",
                            "name":"空调人防系统",
                            "aliasCode":"ACAD",
                            "aliasName":"空调人防系统",
                            "parentCode":"system",
                            "majorCode":"AC"
                        }
                    ]
                },
                {
                    "code":"system-FF",
                    "name":"消防专业",
                    "aliasCode":"system-FF",
                    "aliasName":"消防专业",
                    "children":[
                        {
                            "code":"FFSC",
                            "name":"防排烟系统",
                            "aliasCode":"FFSC",
                            "aliasName":"防排烟系统",
                            "parentCode":"system",
                            "majorCode":"FF"
                        }
                    ]
                }
            ]
        },
        {
            "code":"equipment",
            "name":"设备",
            "aliasCode":"equipment",
            "aliasName":"设备",
            "children":[
                {
                    "code":"equipment-AC",
                    "name":"空调专业",
                    "aliasCode":"equipment-AC",
                    "aliasName":"空调专业",
                    "children":[
                        {
                            "code":"equipment-ACAT",
                            "name":"空调末端系统",
                            "aliasCode":"equipment-ACAT",
                            "aliasName":"空调末端系统",
                            "children":[
                                {
                                    "code":"ACATAH",
                                    "name":"空调机组",
                                    "aliasCode":"ACATAH",
                                    "aliasName":"空调机组",
                                    "parentCode":"equipment",
                                    "majorCode":"AC",
                                    "systemCode":"ACAT"
                                }
                            ]
                        },
                        {
                            "code":"equipment-ACCH",
                            "name":"中央供热系统",
                            "aliasCode":"equipment-ACCH",
                            "aliasName":"中央供热系统",
                            "children":[
                                {
                                    "code":"ACCHWT",
                                    "name":"供热水箱",
                                    "aliasCode":"ACCHWT",
                                    "aliasName":"供热水箱",
                                    "parentCode":"equipment",
                                    "majorCode":"AC",
                                    "systemCode":"ACCH"
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}
```









## 注意事项
1.某一个类型显示子分类功能新版字典还没有实现


































 


