# 中台工具字典接口使用对接方案 测试环境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" } ] } ] } ] } ] } ``` #### 查询 项目(project)建筑(building)、楼层(floor)下的信息点 ``` GET: dict/funcid?&groupId=WD&classCode=building ``` 请求参数 | 参数名 | 说明 | | | --------- | --------------------------------------- | ---- | | classCode | 类型编码 | 必选 | | groupId | 集团id | 可选 | | schemeId | 集团方案id | 可选 | | projectId | 项目id | 可选 | | appId | 应用id,传入appId时必须同时传入projectId | 可选 | | | | | 请求参数说明 ``` 1.传入projectId是必须同时传入groupId 2.传入projectId时对应项目必须已配置集团方案,schemeId可以不传,否则报错"当前项目未配置集团方案" 3.传入appId时必须同时传入projectId ``` 返回参数 ``` { "result": "success", "count": 159, "data": funcid[] // 信息点列表 } ``` ### 查询系统的结构树 需要先查询出来专业 再查询每个专业下的系统 #### 查询所有专业 ``` POST: dict/major/query ``` 请求参数 ``` { "criteria": { } } ``` 应答内容 ``` { "result":"success", "data":[ { "id":1, "code":"SE", "name":"强电专业", "aliasCode":"SE", "aliasName":"强电专业", "type":"common", "groupId":"0" }, { "id":2, "code":"WE", "name":"弱电专业", "aliasCode":"WE", "aliasName":"弱电专业", "type":"common", "groupId":"0" } ], "count":2 } ``` #### 查询专业下的系统 ``` /dict/class/query ``` 请求参数 ``` { "criteria": { "majorCode":{"$in":["SE"]} } } ``` 应答内容 ``` { "result": "success", "data": [ { "code": "SEBPBA", "name": "UPS", "aliasCode": "SEBPBA", "aliasName": "UPS", "parentCode": "equipment", "majorCode": "SE", "systemCode": "SEBP" }, { "code": "SEBPBP", "name": "备用电源", "aliasCode": "SEBPBP", "aliasName": "EPS", "parentCode": "equipment", "majorCode": "SE", "systemCode": "SEBP" } ], "count": 2 } ``` 说明: ``` majorCode 是指专业编码 systemCode 系统编码 ``` ### 设备类型树结构 #### 需要先获取专业再根据专业获取系统,然后根据系统获取系统下的设备 获取专业以及系统见上面,下面是直接获取系统下的设备类型 ``` /dict/class/query ``` 请求参数 ``` { "criteria": { "systemCode":{"$in":["ACAT"]} } } ``` 应答内容 ``` { "result": "success", "data": [ { "code": "ACATAA", "name": "吊顶风机", "aliasCode": "ACATAA", "aliasName": "吊顶风机", "parentCode": "equipment", "majorCode": "AC", "systemCode": "ACAT" }, { "code": "ACATAH", "name": "空调机组", "aliasCode": "ACATAH", "aliasName": "空调机组", "parentCode": "equipment", "majorCode": "AC", "systemCode": "ACAT" } ], "count": 2 } ``` #### 获取部件类型树结构 需要先获取到所有的部件然后根据部件对应找到设备类型,拼接组成部件树结构 ``` /dict/class/query ``` 请求参数 ``` { "criteria": { "parentCode": { "$in": [ "component" ] } } } ``` 应答内容 ``` { "result": "success", "data": [ { "code": "SETDHSIP", "name": "综合保护装置", "aliasCode": "SETDHSIP", "aliasName": "综合保护装置", "parentCode": "component", "majorCode": "SE", "systemCode": "SETD", "equipmentCode": "SETDHS" }, { "code": "SETDLSDW", "name": "低压配电抽屉", "aliasCode": "SETDLSDW", "aliasName": "低压配电抽屉", "parentCode": "component", "majorCode": "SE", "systemCode": "SETD", "equipmentCode": "SETDLS" } ], "count": 2 } ``` #### 根据部件的 equipmentCode 查询设备类型 然后拼接成部件树结构 ``` /dict/class/query ``` 请求参数 ``` { "criteria": { "code":{"$in":["SETDHS"]} } } ``` ## 注意事项 1.某一个类型显示子分类功能新版字典还没有实现 2.空间类型无法获取 3.编码问题 例如 系统是两位编码 加上专业是四位编码 code 是为了适配别名? ``` { "code": "SEBPBP", "name": "备用电源", "aliasCode": "SEBPBP", "aliasName": "EPS", "parentCode": "equipment", "majorCode": "SE", "systemCode": "SEBP" } ``` 4. 创建子分类? 5. 获取到系统树结构,怎么样知道系统哪些类型中的信息点处于待审核、审核中状态 ![问题](./img/wenti001.png) 6.怎么使用信息点扩展分类 ![问题](./img/wenti002.png) 7.修改类型的别名称以及所属的父类 系统和设备都需要 ![问题](./img/wenti003.png) 8.添加系统类型或设备类型 复制信息点操作 ![问题](./img/wenti004.png) ## 调换角度,直接使用新版数据字典数库的角度,评定新版数据字典需要实现的接口