HC小区接口文档

API接口文档:查询业主信息

查询业主
修改业主
添加业主
删除业主

1. 接口名称

查询业主信息

2. 接口描述

该接口用于第三方系统(如招商系统)查询小区业主的基本信息,支持分页查询、条件筛选(如业主姓名、手机号、身份证号等),并返回业主列表及统计信息。

3. 接口路径

GET http://{ip}:{port}/app/owner.queryOwners

4. 请求方法

GET

5. 请求头

参数名称 必填 类型 描述
Authorization 是 String 用户认证Token(Base Token)
app-id 是 String 应用ID(由系统dev账户分配)
transaction-id 是 String 请求流水号(格式:1000000000+YYYYMMDDhhmmss+6位序列)
sign 是 String 签名
req-time 是 String 请求时间(格式:YYYYMMDDhhmmss)

6. 请求参数

6.1 查询参数(Query Parameters)
参数名称 必填 类型 长度限制 描述
page 是 int 11 当前页码(从1开始)
row 是 int 11 每页记录数
communityId 是 String 30 小区ID
name 否 String 64 业主姓名(模糊匹配)
link 否 String 11 业主手机号(精确匹配)
idCard 否 String 30 业主身份证号(精确匹配,无权限时返回脱敏数据)
ownerTypeCd 否 String 12 业主类型:1001(业主)、2002(家庭成员,需传ownerId)
ownerId 否 String 30 业主ID(查询家庭成员时必填)
memberId 否 String 30 业主主键ID
roomName 否 String - 房屋名称(格式:楼栋-单元-房屋,如 1-2-101)

7. 返回值

7.1 响应格式
{
  "code": 0,
  "msg": "成功",
  "owners": [
    {
      "communityId": "2022121921870161",
      "name": "张三",
      "link": "189****8888",
      "idCard": "110**********1234",
      "address": "1栋2单元101室",
      "sex": "1",
      "ownerTypeCd": "1001",
      "remark": "",
      "memberId": "772023012589770046",
      "ownerPhoto": "base64编码的人脸图片"
    }
  ],
  "page": 1,
  "records": 1,
  "rows": 10,
  "total": 1
}
7.2 响应字段说明
字段名称 类型 描述
code int 返回码:0成功,其他失败
msg String 返回信息
owners Array 业主列表
└─communityId String 小区ID
└─name String 业主姓名
└─link String 手机号(无权限时返回脱敏格式)
└─idCard String 身份证号(无权限时返回脱敏格式)
└─address String 房屋地址
└─sex String 性别:1(男)、0(女)
└─ownerTypeCd String 业主类型
└─remark String 备注
└─memberId String 业主主键ID
└─ownerPhoto String 业主人脸照片(Base64编码,用于门禁同步)
page int 当前页码
records int 当前页记录数
rows int 每页记录数
total int 总记录数

8. 示例请求

请求URL

http://127.0.0.1:8000/app/owner.queryOwners?ownerTypeCd=1001&page=1&row=10&communityId=2022121921870161

请求头

Authorization: Bearer xxxxxx
app-id: micro-community
transaction-id: 100000000020231201142359000001
sign: xxxxxx
req-time: 20231201142359

9. 示例响应

{
  "owners": [
    {
      "address": "1栋2单元101室",
      "idCard": "110**********1234",
      "link": "189****8888",
      "memberId": "772023012589770046",
      "name": "张三",
      "ownerId": "772023012589770046",
      "ownerTypeCd": "1001",
      "remark": "",
      "sex": "1",
      "ownerPhoto": "xxxxxx"
    }
  ],
  "page": 1,
  "records": 1,
  "rows": 10,
  "total": 1
}

10. 注意事项

  1. 权限控制:
    • 若无权限访问敏感字段(如身份证、手机号),接口会自动返回脱敏数据。
  2. 房屋查询:
    • 若通过roomName查询,需严格遵循楼栋-单元-房屋格式(如 1-2-101)。
  3. 分页逻辑:
    • 参数page和row必须为有效整数,否则返回参数错误。

11. 业务逻辑说明

  • 调用IOwnerInnerServiceSMO查询业主数据,并关联房屋、权限、人脸照片等信息。
  • 对敏感字段(身份证、手机号)进行动态脱敏处理。
  • 支持通过房屋名称反向查询roomId以关联业主。