1 业务组织

1.1 业务组织或行政组织新增/修改

业务和行政组织的新增和修改共用同一个接口。

1.1.1 原接口

URL: /v1/iot/main/org/update

Method: POST

HTTP头部:见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《Part II 前端(含H5、小程序、APP)请求Token 约定》

body: JSON格式约定

字段 字段类型 是否必填 说明
id Int 业务或行政组强织的主键id;注意:此值 非空代表修改,为空代表新增。
org_name String 单条记录新增必填;批量新增list不为空时可以不用传些值。
parentid Int 父机构ID, 父机构ID为空,代表顶级节点;当前节点为非顶级节点不可为空。仅超管帐号可创建顶级业务/行政组织。
org_type Int 机构类型: 1:行政组织,2:业务组织
sub_type Int 当org_type=1为行政组织,sub_type取值为: 1: 内部行政组织, 2: 内部临时组织, 3:应用帐号组织,4:职能帐号组织, 5: 外部帐号组织,6: 公共通讯录组织; 当org_type=2为业务组织sub_type取值为: 1: 项目类型, 2:非项目类型
list Array [ {"org_name":"XXX"}, {"org_name":"XXX" }, .... ] , list集合不为空时, parentid 必传, 表示将list 集合中的对象批量保存,并作为主键ID=parentid 的节点的子节点;

1.1.2 新接口

说明: 新接口较原接口新增一个字段 rel_business_org_ids :新增或修改业务组织时,可以关联当前租户下多个行政组织。 普通员工仅可新增或修改非须级业务组织。不可对顶级业务和顶级行政进行关联和对关联关系进行修改。

URL: /v1/iot/main/org/update

Method: POST

body: JSON格式约定

字段 字段类型 是否必填 说明
id Int 业务或行政组强织的主键id;注意:此值 非空代表修改,为空代表新增。
org_name String 单条记录新增必填;批量新增list不为空时可以不用传些值。
parentid Int 父机构ID, 父机构ID为空,代表顶级节点;当前节点为非顶级节点不可为空。
org_type Int 机构类型: 1:行政组织,2:业务组织
sub_type Int 当org_type=1为行政组织,sub_type取值为: 1: 内部行政组织, 2: 内部临时组织, 3:应用帐号组织,4:职能帐号组织, 5: 外部帐号组织,6: 公共通讯录组织; 当org_type=2为业务组织sub_type取值为: 1: 项目类型, 2:非项目类型
list Array [ {"org_name":"XXX"}, {"org_name":"XXX" }, .... ] , list集合不为空时, parentid 必传, 表示将list 集合中的对象批量保存,并作为主键ID=parentid 的节点的子节点;
rel_business_org_ids Array 行政组织ID集合,新增修改单条业务组织时,可以关联多个行政组织。此值非空时,如:[]或者有元素,不支持批量保存,即list字段将忽略。当候改业务组织时,如是行政组织ID集合为一个空集合,代表解除原有所的与行政组织的关联,注意是空集合[],不是null。

返回:

{

  "code":"200",
  "message":"success",
   "result": Org对象, //   仅单条保存有值
   "results":Org对象集合 // 仅批量新增保存有值

}

1.2 业务组织角色

1.2.1 原接口

URL: /v1/iot/main/orgrolerel/query/page

POST

请求BODY:

字段 字段类型 是否必填 说明
create_org_id Int 全局切换业务组织ID
org_id Int 当前业务组织
pageNo Int 页码:默认1
pageSize int 记录尺寸:默认20

返回:

{"code":"200","message":"成功","result":[
{"role_id":258169,"role_name":"体验角色","org_rel_num":1,"update_time":1650436691000,}],"pageNo":1,"pageSize":10,"total":1,"totalPage":1}

返回关键字段说明:

org_rel_num: 该角色关联业务组织数量;

1.2.2 新接口

更新说明:

返回结果: 新增menu_rel_num: 该角色关联权限(菜单应用)的数量;

URL: https://biz-admin-sit.smartmideazy.com/v1/iot/main/orgrolerel/query/page

HTTP头部:见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《Part II 前端(含H5、小程序、APP)请求Token 约定》

POST:

请求BODY:

字段 字段类型 是否必填 说明
create_org_id Int 全局切换业务组织ID
org_id Int 当前业务组织
pageNo Int 页码:默认1
pageSize int 记录尺寸:默认20

返回:

{"code":"200","message":"成功","result":[
{"role_id":258169,"role_name":"体验角色","org_rel_num":1,"update_time":1650436691000, "menu_rel_num":3}],"pageNo":1,"pageSize":10,"total":1,"totalPage":1}

返回关键字段说明:

org_rel_num: 该角色关联业务组织数量;

menu_rel: 该角色关联权限(菜单应用)的数量;

1.3 切换全局业务组织获取菜单权限树

说明:相对原接口入参和出参均不变。仅逻辑做了调整理,实现权限向下继承 。 注:新的社区平台中此接口未调用,此接口是多租户权限控制的基础。本次改造须加上,按照业务组织层级实现动态权限控制。

原接口见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《3.20 由业务组织获取相应的菜单》;适用于用户登录后点击切换左上角业务组织时,菜单权限树动态显示。

URL: https://biz-admin-sit.smartmideazy.com/v1/iot/main/org/loginmenus

HTTP头部:见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《Part II 前端(含H5、小程序、APP)请求Token 约定》

POST:

请求BODY:

字段 字段类型 是否必填 说明
adminId Int 用户ID

请求示例

  {
    "adminId":01010
  }

1.3.A 当前登录用户的全量菜单应用权限树范围

说明:适用场景:用户创建角色与菜单应用的关联时(一个角色对应多个菜单应用),用户能够选取的菜单应用权限树的范围。

先前的逻辑:调用接口 https://biz-admin-sit.smartmideazy.com/v1/iot/main/orgmenu/rel/trees/15264,依据业务组织的菜单应用权限的范围来选取。

https://biz-admin-sit.smartmideazy.com/v1/iot/main/orgmenu/trees/118556

新的逻辑:普通员工: 采用当前操作用户所有角色关联的的全量菜单应用来确定菜单应用权限范围。

​ 超管: 依据顶级业务组织的菜单应用权限的范围来选取。

URL: https://biz-admin-sit.smartmideazy.com/v1/iot/main/org/loginmenus/range

HTTP头部:见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《Part II 前端(含H5、小程序、APP)请求Token 约定》

POST:

请求BODY:

字段 字段类型 是否必填 说明
adminId Int 用户ID

请求示例

  {
    "adminId":01010
  }

1.4 当前员工所关联的业务组织树

说明:与主数据http://arch.smartmideazy.com/apidoc/main-entry/API.html 《3.13 获取登录用户的机构树集合, 左上角的全局切换业务组织机构的树集合》接口( URL: /v1/iot/main/org/trees/logined/{admin_id})不同。此接口是由员工与业务组织的关联,确定一个选取业务组织的范围。结果返回多棵树。

main/org/update

业场景:员工关联业务组织;角色授权给员工。

URL: /v1/iot/main/org/trees/orgrel

POST:

HTTP头部:见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《Part II 前端(含H5、小程序、APP)请求Token 约定》

返回结果(社区平台一致的响应的结果)

{
  "code": "200",
  "message": "成功",
  "version": null,
  "returnExceptionData": false,
  "trees": [
    {
      "tree": [
        {

          "id": 15264,
          "org_code": "100000001",
          "org_name": "美的置业-业务",
          "parent_code": null,
          "parentid": null,
          "full_org_name": "美的置业-业务",
          "org_type": 2,
          "sub_type": 2,
          "parent_name": null,
          "children": [
            {
              "
              "id": 15274,
              "org_code": "100000001100000000",
              "org_name": "美的新海岸446",
              "parent_code": "100000001",
              "parent_name": '美的置业-业务',
              "org_type": 2,
              "sub_type": 2
              }...
              ]
           }
        ]
      }

1.5 新增项目-保存项目额外信息

URL: /v1/iot/main/spacelocation/add

POST

HTTP头部:见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《Part II 前端(含H5、小程序、APP)请求Token 约定》

请求BODY:

{

"province": "广东省",

"city": "佛山市",

"id": 258043,

"district": "顺德区",

"lon": "",

"lat": "",

"detail": "广东省佛山市顺德区北滘镇瑞璟花园瑞璟新村",

"area": 100,

"space_id": 258043,

"contact_tels_json": [

​ {

​ "area_no": "",

​ "tel": ""

​ }

],

"ico": "",

"community_introduce":"项目介绍balabala", //项目介绍

"community_area":"10000", //项目面积

"community_area_unit":1, //面积单位 枚举值:1:平方米;2:亩;3:公顷

"community_delivery_status":"1", //项目交付状态。枚举值:0:未交付;1:已交付

"community_delivery_date":"2022-07-07", //项目交楼日期,格式:yyyy-MM-dd

"community_phone":"13418777026" //项目联系人

}

返回:

结构和以前一致
多返回字段:
 "community_introduce":"项目介绍balabala",    //项目介绍

  "community_area":"10000",  //项目面积

  "community_area_unit":1,  //面积单位 枚举值:1:平方米;2:亩;3:公顷

  "community_delivery_status":"1",  //项目交付状态。枚举值:0:未交付;1:已交付

  "community_delivery_date":"2022-07-07",  //项目交楼日期,格式:yyyy-MM-dd

  "community_phone":"13418777026"  //项目联系人

1.5 编辑项目-编辑项目额外信息

URL: /v1/iot/main/spacelocation/edit

HTTP头部:见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《Part II 前端(含H5、小程序、APP)请求Token 约定》

POST:

请求BODY:

{

"msgId": "43d6337c-34be-49b6-0bf0-638dfc7c4476",

"id": 258044,

"province": "广东省",

"city": "佛山市",

"district": "顺德区",

"detail": "广东省佛山市顺德区北滘镇瑞璟花园瑞璟新村",

"lon": 0,

"lat": 0,

"space_id": 258043,

"ico": "",

"contact_tels": "[{\"area_no\":\"\",\"tel\":\"\"}]",

"shift_times": null,

"contact_tels_json": [

​ {

​ "area_no": "",

​ "tel": ""

​ }

],

"shift_times_json": null,

"birthday_reminder_set": null,

"community_introduce":"项目介绍balabala", //项目介绍

"community_area":"10000", //项目面积

"community_area_unit":1, //面积单位 枚举值:1:平方米;2:亩;3:公顷

"community_delivery_status":"1", //项目交付状态。枚举值:0:未交付;1:已交付

"community_delivery_date":"2022-07-07", //项目交楼日期,格式:yyyy-MM-dd

"community_phone":"13418777026" //项目联系人

}

返回:

结构和以前一致
多返回字段:
 "community_introduce":"项目介绍balabala",    //项目介绍

  "community_area":"10000",  //项目面积

  "community_area_unit":1,  //面积单位 枚举值:1:平方米;2:亩;3:公顷

  "community_delivery_status":"1",  //项目交付状态。枚举值:0:未交付;1:已交付

  "community_delivery_date":"2022-07-07",  //项目交楼日期,格式:yyyy-MM-dd

  "community_phone":"13418777026"  //项目联系人

1.6 项目列表分页查询

URL: /v1/iot/main/space/list

HTTP头部:见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《Part II 前端(含H5、小程序、APP)请求Token 约定》

POST

请求BODY:

{

"pageNo": 1,

"pageSize": 10,

"space_type": "COMMUNITY",

"top_org_id": 21897,

"hasRelated": "",

"status": 1,

"space_id": "",

"searchCondition": "测试",

"beginDeliveryDate":"2022-07-01", //交楼日期开始时间

"endDeliveryDate":"2022-07-09" //交楼日期结束时间

}

返回:

{
    "code": "200",
    "message": "成功",
    "version": "1.1",
    "returnExceptionData": false,
    "result": [
        {
            "create_by": null,
            "update_by": null,
            "create_by_id": null,
            "update_by_id": null,
            "create_time": 1650373425000,
            "update_time": 1657186969000,
            "id": 258043,
            "parentid": null,
            "space_id": null,
            "parent_space_id": null,
            "community_id": null,
            "space_name": "测试项目001",
            "full_space_name": "测试项目001",
            "parent_code": null,
            "space_code": "100008078",
            "space_type": "COMMUNITY",
            "space_sort": "COMMUNITY",
            "org_code": "100000150100000000100000015",
            "business_type": 1,
            "src": 1,
            "org_id": 162007,
            "top_org_id": 21897,
            "top_org_code": "100000150",
            "status": 1,
            "area": 10000.0,
            "fee_area": null,
            "is_public_floor": null,
            "business_code": null,
            "logic_deleted": 1,
            "lease_status": null,
            "owner_names": null,
            "searchCondition": null,
            "top_org_name": null,
            "hasRelated": 1,
            "province": null,
            "city": null,
            "district": null,
            "detail": null,
            "lon": null,
            "lat": null,
            "children": null,
            "parent_name": null,
            "org_ids": null,
            "pageNo": 0,
            "pageSize": 0,
            "list": null,
            "org_id_name": {
                "org_id": 162007,
                "org_name": "zhy业务组织01",
                "full_org_name": "sit顶级业务组织234/珠三角区域/zhy业务组织01"
            },
            "orgName": null,
            "authOrg": null,
            "orderby": null,
            "directChildrenNums": 0,
            "directZoneNums": 0,
            "directPhysicalSpaceNums": 0,
            "is_super": null,
            "orgCode": null,
            "oldRelOrgId": null,
            "selected": false,
            "beginDeliveryDate": null,
            "endDeliveryDate": null,
            "community_delivery_date": "2022-07-08",
            "community_delivery_status": 1,
            "community_introduce": null,
            "community_area_unit": null,
            "community_phone": null,
            "_only_sub": true
        }
    ],
    "communitys": null,
    "pageNo": 1,
    "pageSize": 10,
    "total": 1,
    "totalPage": 1
}

返回关键字段说明:

"community_delivery_date": "2022-07-08", //交楼日期 格式yyyy-MM-dd "community_delivery_status": 1, //项目交付状态 枚举值:0:未交付;1:已交付

1.7 项目详情查询

URL: /v1/iot/main/space/detail/community/{id}

HTTP头部:见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《Part II 前端(含H5、小程序、APP)请求Token 约定》

POST

请求BODY:

{

}

返回:

{
    "code": "200",
    "message": "成功",
    "version": null,
    "returnExceptionData": false,
    "result": {
        "space": {
            "create_by": null,
            "update_by": null,
            "create_by_id": null,
            "update_by_id": null,
            "create_time": 1650373425000,
            "update_time": 1657186969000,
            "id": 258043,
            "parentid": null,
            "space_id": null,
            "parent_space_id": null,
            "community_id": null,
            "space_name": "测试项目001",
            "full_space_name": "测试项目001",
            "parent_code": null,
            "space_code": "100008078",
            "space_type": "COMMUNITY",
            "space_sort": "COMMUNITY",
            "org_code": "100000150100000000100000015",
            "business_type": 1,
            "src": 1,
            "org_id": 162007,
            "top_org_id": 21897,
            "top_org_code": "100000150",
            "status": 1,
            "area": 10000.0,
            "fee_area": null,
            "is_public_floor": null,
            "business_code": null,
            "logic_deleted": 1,
            "lease_status": null,
            "owner_names": null,
            "searchCondition": null,
            "top_org_name": null,
            "hasRelated": null,
            "province": null,
            "city": null,
            "district": null,
            "detail": null,
            "lon": null,
            "lat": null,
            "children": null,
            "parent_name": null,
            "org_ids": null,
            "pageNo": 0,
            "pageSize": 0,
            "list": null,
            "org_id_name": {
                "org_id": 162007,
                "org_name": "zhy业务组织01",
                "full_org_name": "sit顶级业务组织234/珠三角区域/zhy业务组织01"
            },
            "orgName": null,
            "authOrg": null,
            "orderby": null,
            "directChildrenNums": 0,
            "directZoneNums": 0,
            "directPhysicalSpaceNums": 0,
            "is_super": null,
            "orgCode": null,
            "oldRelOrgId": null,
            "selected": false,
            "beginDeliveryDate": null,
            "endDeliveryDate": null,
            "community_delivery_date": null,
            "community_delivery_status": null,
            "community_introduce": null,
            "community_area_unit": null,
            "community_phone": null,
            "_only_sub": true
        },
        "location": {
            "id": 258044,
            "province": "广东省",
            "city": "佛山市",
            "district": "顺德区",
            "detail": "广东省佛山市顺德区北滘镇瑞璟花园瑞璟新村",
            "lon": 0.0,
            "lat": 0.0,
            "space_id": 258043,
            "ico": "",
            "contact_tels": "[{\"area_no\":\"\",\"tel\":\"\"}]",
            "shift_times": null,
            "community_delivery_date": "2022-07-08",
            "community_delivery_status": 1,
            "community_introduce": "项目介绍balabala-修改",
            "community_area": 20000,
            "community_area_unit": 1,
            "community_phone": "13418777099",
            "contact_tels_json": [
                {
                    "area_no": "",
                    "tel": ""
                }
            ],
            "shift_times_json": null,
            "birthday_reminder_set": null
        },
        "buildingNum": 1,
        "parkNum": 0,
        "houseNum": 1
    },
    "data": null
}

2 员工帐号

2.1 员工帐号新增/修改

更新说明: 密码字段在新增的时修会初始化一个随机密码,由平台发短信给新帐号所对应的手机号。

​ 修改时不对密码字段进行处理; 密码和员工状态字段已屏蔽;新增一个业务组织ID集合:businessOrgIds。

保存或修改时必选。保存时:业务组织ID集合来源于一棵业务组织树,支持多选;

URL: https://biz-admin-sit.smartmideazy.com/v1/iot/main/admin/update

HTTP头部:见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《Part II 前端(含H5、小程序、APP)请求Token 约定》

method: POST

{
    "msgId": "b79067e5-b043-947f-6b03-0af1f545c686",
    "org_id": 27628,
    "org_code": "100000149100000005",
    "nickname": "test101",
    "name": "test1",
    "job_number": "test101",
    "staff_no": "",
    "position": "",
    "email": "1@qq.com",
    "mobile": "13112345678",
    "identity": "440661200001012247",
    "status": 1,
    "type": "1",
    "src": "1",
    "is_effective": "",
    "position_level": "",
    "face_ico": "",
    "authOrgId": 21897,
    "businessOrgIds": [
        15264,
        15341,
        15354
    ]
}

请求BODY:

字段 字段类型 是否必填 说明
org_id Int 行政组织ID(未来会弃用,暂留字段)
org_code Long 行政组织编号
identity String 身份证
mobile String 手机暗号
email String 邮箱
nickname String 昵称
job_number String 工号
position String 职务
businessOrgIds JSONArray 业务组织ID集合。 smart_cmty_org表. 如: [1001,1009,2309]

2.2 员工信息详情(加载)

https://biz-admin-sit.smartmideazy.com/v1/iot/main/admin/detail

Method: POST

HTTP头部:见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《Part II 前端(含H5、小程序、APP)请求Token 约定》

返回员工的基本信息及关联的业务组织。关联的业务组织以树型显示,已关联的节点处于选中状态。

BODY:

{
    "code": "200",
    "message": "成功",
    "version": null,
    "returnExceptionData": false,
    "result": {
        "create_by": "system_insert",
        "update_by": null,
        "create_by_id": null,
        "update_by_id": null,
        "create_time": 1659665829000,
        "update_time": 1659665829000,
        "id": 302390,
        "user_id": null,
        "org_id": 27628,
        "org_name": null,
        "mobile": "13112345678",
        "org_code": "100000149100000005",
        "src": 1,
        "nickname": "test101",
        "per_signature": null,
        "ico": null,
        "job_number": "test101",
        "pwd": "$2a$10$KWQXKU6W/OYFVerQqG5F9.dLSIvwgyUSrFqLxmsAIsNmVknwxnCcm",
        "name": "test1",
        "sex": null,
        "email": "1@qq.com",
        "identity": "440661200001012247",
        "type": 1,
        "status": 1,
        "last_login_time": null,
        "pwd_modify_time": null,
        "lock_time": null,
        "login_fail_times": null,
        "birthday": null,
        "last_login": null,
        "staff_no": "",
        "position": "",
        "is_supper": 1,
        "face_ico": "",
        "is_effective": 1,
        "delivery_address": null,
        "position_level": 0,
        "random_bg": 0,
        "roleNames": null,
        "groupNames": null,
        "ids": null,
        "userIds": null,
        "relationId": null,
        "relationIds": null,
        "groupId": null,
        "adminOrgCodes": null,
        "adminIds": null,
        "pageNo": null,
        "pageSize": null,
        "client_id": null,
        "client_secret": null,
        "orgName": "美的置业2",
        "fullOrgName": "sit顶级行政组织456/美的置业2",
        "org_type": null,
        "rel_org_id": null,
        "authOrgId": null,
        "communityId": null,
        "oldFlag": null,
        "communitys": null,
        "grant_type": null,
        "refresh_token": null,
        "full_org_name": null,
        "searchCondition": null,
        "topOrgCode": null,
        "topOrgId": null,
        "msgId": null,
        "beginDate": null,
        "endDate": null,
        "keyword": null,
        "businessOrgIds": [
            15264,
            15341,
            15354
        ],
        "businessOrgs": [
            {
                "id": 15264,
                "org_code": "100000001",
                "org_name": "美的置业-业务"
            },
            {
                "id": 15341,
                "org_code": "100000007",
                "org_name": "徐宇星测试01"
            },
            {
                "id": 15354,
                "org_code": "100000008",
                "org_name": "测试项目"
            }
        ],
        "upperOrgAdmin": false
    },
    "data": null
}

2.3 重置密码

https://biz-admin-sit.smartmideazy.com/v1/iot/main/admin/reset/pwd

超管可以重置所有人的密码;租户管理员可以重置集团下所有人的密码;普通员工仅可重置自己的密码

HTTP头部:见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《Part II 前端(含H5、小程序、APP)请求Token 约定》

请求BODY:

字段 字段类型 是否必填 说明
id Int 员工员的主键 ID
pwd String 新密码。 见 http://arch.smartmideazy.com/docs/account/account-doc.html 《5.2.3 密码规范》。 须由明文统一加密传输,见《5.2 密码明文加密》

返回:

{"code":"200", "message":"success"}

2.4 员工列表

业务组织下查询员工的场景。

注: 老的接口用searchCondition 新的用key_word。

原接口URL: https://biz-admin-sit.smartmideazy.com/v1/iot/main/admin/query/page

新接口: https://biz-admin-sit.smartmideazy.com/v1/iot/main/new/admin/query/page/v3

POST:

HTTP头部:见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《Part II 前端(含H5、小程序、APP)请求Token 约定》

请求BODY:

字段 字段类型 是否必填 说明
key_word String 关键词。可以是员工姓名、帐号、手机号
org_code String 业务组织code。左模糊查询。
pageNo Int 缺省值:1
pageSize Int 缺省值:20
is_effective Int 不传默认所有。1:启用, 2:禁用

返回:

{
    "code": "200",
    "data": {
        "result": [
            {
                "create_by": null,
                "update_by": null,
                "create_by_id": null,
                "update_by_id": null,
                "create_time": 1660637905000,
                "update_time": null,
                "id": 312450,
                "user_id": null,
                "org_id": 279029,
                "org_name": "谢田顶级导入测试(行政)",
                "mobile": "13112345678",
                "org_code": "100000362",
                "src": null,
                "nickname": null,
                "per_signature": null,
                "ico": null,
                "job_number": "xie1",
                "pwd": null,
                "name": "xie1",
                "sex": null,
                "email": "5@qq.com",
                "identity": null,
                "type": null,
                "status": null,
                "last_login_time": null,
                "pwd_modify_time": null,
                "lock_time": null,
                "login_fail_times": null,
                "birthday": null,
                "last_login": null,
                "staff_no": null,
                "position": "",
                "is_supper": null,
                "face_ico": null,
                "is_effective": 1,
                "delivery_address": null,
                "position_level": 0,
                "random_bg": 0,
                "roleNames": null,
                "groupNames": null,
                "ids": null,
                "userIds": null,
                "relationId": null,
                "relationIds": null,
                "groupId": null,
                "adminOrgCodes": null,
                "adminIds": null,
                "pageNo": null,
                "pageSize": null,
                "client_id": null,
                "client_secret": null,
                "orgName": null,
                "fullOrgName": null,
                "org_type": null,
                "rel_org_id": null,
                "authOrgId": null,
                "communityId": null,
                "oldFlag": null,
                "communitys": null,
                "grant_type": null,
                "refresh_token": null,
                "full_org_name": "谢田顶级导入测试(行政)",
                "searchCondition": null,
                "topOrgCode": null,
                "topOrgId": null,
                "msgId": null,
                "beginDate": null,
                "endDate": null,
                "keyword": null,
                "businessCode": null,
                "roleCode": null,
                "roleIds": null,
                "businessOrgIds": null,
                "businessOrgs": [
                    {
                        "id": 296032,
                        "org_code": "100000363",
                        "org_name": "谢田顶级导入测试(业务)"
                    }
                ],
                "upperOrgAdmin": false
            },
            {
                "create_by": null,
                "update_by": null,
                "create_by_id": null,
                "update_by_id": null,
                "create_time": 1660637348000,
                "update_time": null,
                "id": 311123,
                "user_id": null,
                "org_id": 279029,
                "org_name": "谢田顶级导入测试(行政)",
                "mobile": "13612341234",
                "org_code": "100000362",
                "src": null,
                "nickname": null,
                "per_signature": null,
                "ico": null,
                "job_number": "ces220",
                "pwd": null,
                "name": "新建管理员测试",
                "sex": null,
                "email": "ces@midea.com",
                "identity": null,
                "type": null,
                "status": null,
                "last_login_time": null,
                "pwd_modify_time": null,
                "lock_time": null,
                "login_fail_times": null,
                "birthday": null,
                "last_login": null,
                "staff_no": null,
                "position": "",
                "is_supper": null,
                "face_ico": null,
                "is_effective": 1,
                "delivery_address": null,
                "position_level": 0,
                "random_bg": 0,
                "roleNames": null,
                "groupNames": null,
                "ids": null,
                "userIds": null,
                "relationId": null,
                "relationIds": null,
                "groupId": null,
                "adminOrgCodes": null,
                "adminIds": null,
                "pageNo": null,
                "pageSize": null,
                "client_id": null,
                "client_secret": null,
                "orgName": null,
                "fullOrgName": null,
                "org_type": null,
                "rel_org_id": null,
                "authOrgId": null,
                "communityId": null,
                "oldFlag": null,
                "communitys": null,
                "grant_type": null,
                "refresh_token": null,
                "full_org_name": "谢田顶级导入测试(行政)",
                "searchCondition": null,
                "topOrgCode": null,
                "topOrgId": null,
                "msgId": null,
                "beginDate": null,
                "endDate": null,
                "keyword": null,
                "businessCode": null,
                "roleCode": null,
                "roleIds": null,
                "businessOrgIds": null,
                "businessOrgs": [
                    {
                        "id": 296032,
                        "org_code": "100000363",
                        "org_name": "谢田顶级导入测试(业务)"
                    }
                ],
                "upperOrgAdmin": false
            }
        ],
        "pageNo": 1,
        "pageSize": 10,
        "total": 2,
        "totalPage": 1
    },
    "message": "成功"
}

2.5 新增管理员场景查询员工

说明: 选取一个员工作为租户的管理员,分页。入参与出参不变,仅改变逻辑。

URL: https://biz-admin-sit.smartmideazy.com/v1/iot/main/orgroleadmin/unrel/admins

Method: POST

BODY:

{"org_id":118556,"create_org_id":118556,"pageNo":1,"pageSize":10}

2.6 查询业务组织下管理员列表

https://biz-admin-sit.smartmideazy.com/v1/iot/main/orgroleadmin/rel/systemadmins

BODY:

{"org_id":15341,"create_org_id":15341,"pageSize":10,"pageNo":1}

2.7 分页查询员工列表 -- 微服务调用

a.支持根据项目id 或 业务组织id 或业务组织code分页查询业务组织下的员工的场景。

b.支持顶级组织id 或者 顶级组织code下根据手机号或者姓名或者工号在该租户查全局搜索

c.支持根据员工id查询指定的员工

接口: https://biz-admin-sit.smartmideazy.com/v1/iot/main/inner/admin/page/v3

POST:

请求BODY:

字段 字段类型 是否必填 说明
org_id Long 业务组织id,根据业务组织id查询业务组织code,右模糊查询。
org_code String 业务组织code。右模糊查询。
communityId Long 项目id,根据项目id获取业务组织code查询
topOrgId Long 顶级业务组织id
topOrgCode String 顶级业务组织code
keyword String 关键词。可以是员工姓名、帐号、手机号。建议根据关键字查询时带上顶级组织信息,避免跨租户查询数据
id Long 员工id
pageNo Int 缺省值:1
pageSize Int 缺省值:20

返回:

{

  "code": "200",

  "data": {

​    "result": [

​      {

​        "create_by": **null**,

​        "update_by": "system_insert",

​        "create_by_id": **null**,

​        "update_by_id": **null**,

​        "create_time": **null**,

​        "update_time": 1660024484000,

​        "id": 302390,

​        "org_id": 27628,

​        "org_name": "美的置业2",

​        "mobile": "13112345678",

​        "org_code": "100000149100000005",

​        "src": 1,

​        "nickname": "test101",   

​        "ico": **null**,

​        "job_number": "test101",

​        "pwd": "$2a$10$KWQXKU6W/OYFVerQqG5F9.dLSIvwgyUSrFqLxmsAIsNmVknwxnCcm",

​        "name": "test1",

​        "sex": **null**,

​        "email": "1@qq.com",

​        "identity": "440661200001012247",

​        "type": 1,

​        "status": 1,

​        "staff_no": "",

​        "position": "",

​        "is_supper": 1,

​        "face_ico": **null**,

​        "is_effective": 1,

​        "delivery_address": **null**,

​        "position_level": 0,

​        "random_bg": 0

​      }

​    ],

​    "pageNo": 1,

​    "pageSize": 10,

​    "total": 1,

​    "totalPage": 1

  },

  "message": "成功"

}

2.8 根据角色查询员工列表 -- 微服务调用

* 支持根据员工表和员工与角色表关联关系表的创建时间和更新时间有更新来查询员工
* 支持根据项目id查询
* 支持根据员工id单个查询
* 支持根据员工id集合过滤
* 支持根据角色id集合过滤
* 支持根据场景角色中的businessCode过滤
* 支持根据场景角色中的roleCode过滤

接口: https://biz-admin-sit.smartmideazy.com/v1/iot/main/inner/admin/page/v3/byRole

POST:

请求BODY:

字段 字段类型 是否必填 说明
org_id Long 业务组织id,根据业务组织id查询业务组织code,右模糊查询。
org_code String 业务组织code。右模糊查询。
communityId Long 项目id,根据项目id获取业务组织code查询
beginDate Date 开始时间
endDate Date 结束时间
id Long 员工id
ids List 员工id集合
roleIds List 角色id集合
businessCode String 角色场景:业务编码
roleCode String 角色场景:角色编码
pageNo Int 缺省值:1
pageSize Int 缺省值:20

返回:

{

  "code": "200",

  "data": {

​    "result": [

​      {

​        "create_by": **null**,

​        "update_by": "system_insert",

​        "create_by_id": **null**,

​        "update_by_id": **null**,

​        "create_time": **null**,

​        "update_time": 1660024484000,

​        "id": 302390,

​        "org_id": 27628,

​        "org_name": "美的置业2",

​        "mobile": "13112345678",

​        "org_code": "100000149100000005",

​        "src": 1,

​        "nickname": "test101",   

​        "ico": **null**,

​        "job_number": "test101",

​        "pwd": "$2a$10$KWQXKU6W/OYFVerQqG5F9.dLSIvwgyUSrFqLxmsAIsNmVknwxnCcm",

​        "name": "test1",

​        "sex": **null**,

​        "email": "1@qq.com",

​        "identity": "440661200001012247",

​        "type": 1,

​        "status": 1,

​        "staff_no": "",

​        "position": "",

​        "is_supper": 1,

​        "face_ico": **null**,

​        "is_effective": 1,

​        "delivery_address": **null**,

​        "position_level": 0,

​        "random_bg": 0

​      }

​    ],

​    "pageNo": 1,

​    "pageSize": 10,

​    "total": 1,

​    "totalPage": 1

  },

  "message": "成功"

}

3 角色

3.1 角色列表

说明: 新的角色列表不再与业务组织关联,全集团游离。当角色授予给员工时,不支持删除。

可以根据角色名称来过滤。

原接口URL: https://biz-admin-sit.smartmideazy.com/v1/iot/main/orgrolemenu/query/page

新接口URL: https://biz-admin-sit.smartmideazy.com/v1/iot/main/global/roles/query/page

HTTP头部:见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《Part II 前端(含H5、小程序、APP)请求Token 约定》

POST

分页:

请求示例:

{"pageNo":1,"pageSize":10,"role_name":"ABC"}

3.2 由小区ID查询授予特定角色的员工

描述 仅适用于睿住平台,需要指定业务编码。 仅适用于睿住平台,睿智云平台角色分为:普通角色和内置角色,平台内置角色指的是由平台统一设置,有固定的角色编码,由平台超管维护,不对外开放新增、修改、删除、查询操作。 需要指定业务编码。

请求信息

HTTP协议:HTTP,HTTPS

uri: /v1/iot/main/platform/community/admins

方法:POST

请求参数:

名称 类型 必填 描述
communityId Long 小区ID
roleCode String 平台内置角色编码,当前有:PROJECT_ENGINE_SUPERVISOR:项目主管; BUSINESS_MANAGER:业务线主管;QUALITY_CHECK_EXECUTOR:品检执行人; personPassage, authorization
businessCode String 业务编码:quality: 品质管理模板 , equipment:设备设施管理

请求Body描述(非Form表单数据)

{"communityId": 89197, "roleCode": "BUSINESS_MANAGER", "businessCode": "quality"}

测试样例 :

http://localhost:20070/v1/iot/main/platform/community/admins

{"communityId": 89197, "roleCode": "BUSINESS_MANAGER", "businessCode": "quality"}

返回 :

{
  "code": "200",
  "data": {
    "result": [
      {

        "id": 88293,
        "org_id": 88290,
        "mobile": "13926003690",
        "org_code": "100000344",
        "nickname": "客户000010",

        "job_number": "pz0001",

        "name": "品质测试1",
        "sex": null,
        "email": "pz0001@126.com",
        "identity": null,
        "type": 1,
        "status": 1,
        "staff_no": "pz0001",
        "position": null,
        "is_supper": 1,
        "is_effective": 1,
        "orgName": null

      }
    ]
  },
  "message": "成功"
}

返回一组管理员对象集合。 管理员实体见 iot-main-domain:com.mideazy.smart.iot.domain.Admin

3.3 由业务组织ID查询授予特定角色的员工

描述 仅适用于睿住平台,需要指定业务编码。 仅适用于睿住平台,睿智云平台角色分为:普通角色和内置角色,平台内置角色指的是由平台统一设置,有固定的角色编码,由平台超管维护,不对外开放新增、修改、删除、查询操作。 需要指定业务编码。

请求信息

HTTP协议:HTTP,HTTPS

uri: /v1/iot/main/platform/org/admins

方法:POST

请求参数:

名称 类型 必填 描述
orgId Long 业务组织ID
roleCode String 平台内置角色编码,当前提供的平台内置角色有:PROJECT_ENGINE_SUPERVISOR:项目主管; BUSINESS_MANAGER:业务线主管;QUALITY_CHECK_EXECUTOR:品检执行人
businessCode String 业务编码:quality: 品质管理模板 , equipment:设备设施管理

请求Body描述(非Form表单数据)

{"orgId":  89196, "roleCode": "BUSINESS_MANAGER", "businessCode": "quality"}

测试样例 :

http://localhost:20070/v1/iot/main/platform/org/admins

{"orgId": 89196, "roleCode": "BUSINESS_MANAGER", "businessCode": "quality"}

返回 :

{
  "code": "200",
  "data": {
    "result": [
      {

        "id": 88293,
        "org_id": 88290,
        "mobile": "13926003690",
        "org_code": "100000344",
        "nickname": "客户000010",

        "job_number": "pz0001",

        "name": "品质测试1",
        "sex": null,
        "email": "pz0001@126.com",
        "identity": null,
        "type": 1,
        "status": 1,
        "staff_no": "pz0001",
        "position": null,
        "is_supper": 1,
        "is_effective": 1,
        "orgName": null

      }
    ]
  },
  "message": "成功"
}

返回一组管理员对象集合。 管理员实体见 iot-main-domain:com.mideazy.smart.iot.domain.Admin

3.4 由员工ID和项目ID查询员工已授予的相关业务的平台内置角色

描述 仅适用于睿住平台, 需要指定业务编码。

请求信息

HTTP协议:HTTP,HTTPS

uri: /v1/iot/main/platform/org/admin/roles

方法:POST

请求参数:

名称 类型 必填 描述
adminId Long 员工ID
communityId Long 小区ID
businessCode String 业务编码,quality: 品质管理 , equipment:设备设施管理 , work order: 工单

请求Body描述(非Form表单数据)

{"communityId":19,"adminId": 9091, "businessCode":"quality" }

返回示例 :

{ "code":"200", "message": "success", "data":{"result": ["PROJECT_ENGINE_SUPERVISOR", "BUSINESS_MANAGER" ]} }

3.5 查询平台特定内置角色

描述 仅适用于睿住平台, 需要指定业务编码。返回全局切换业务组织下平台内置角色集合

请求信息

HTTP协议:HTTP,HTTPS

uri: /v1/iot/main/platform/org/role/list

方法:POST

请求参数:

名称 类型 必填 描述
businessCode String 业务编码,quality: 品质管理 , equipment:设备设施管理 , work order: 工单
org_id Long 后台PC端可以不用传,但管家APP必传。

请求示例 :

http://localhost:18089/v1/iot/main/platform/org/role/list

{"businessCode": "workorder"}

返回示例 :

{
  "code": "200",
  "data": [
    {
      "role_id": 117212,
      "role_name": "管家"
    }
  ],
  "message": "成功"
}

3.6 由角色ID集合查询所有的员工

描述 仅适用于睿住平台,返回授予角色的员工集合。

请求信息

HTTP协议:HTTP,HTTPS

uri: /v1/iot/main/platform/get/admins/by/roleIds

方法:PUT

Body 属性

名称 类型 必填 描述
roleIds Arraty 角色ID集合,如 :[109,120], 必须是平台内置角色
businessCode String 业务编码,quality: 品质管理 , equipment:设备设施管理 , work order: 工单。 避免查询业务范围过大。
pageable Boolean 默认为true, 支持分页。false: 全量返回 ,不分页。

返回示例 :

请求示例 :

http://localhost:18089/v1/iot/main/platform/get/admins/by/roleIds

{"businessCode": "workorder", "roleIds": [27824, 117212] }

返回 :

{
  "code": "200",
  "data": {
    "result": [
      {
        "id": 117209,
        "mobile": "13102422681",
        "job_number": "workorder2",
        "name": "工单测试2"
      },
      {
        "id": 117208,
        "mobile": "13102422680",
        "job_number": "workorder1",
        "name": "工单测试人员1"
      }
    ],
    "pageNo": 1,
    "pageSize": 20,
    "total": 2,
    "totalPage": 1
  },
  "message": "成功"
}

3.6A 由角色ID集合查询员工(不考虑业置角色)

描述 仅适用于睿住平台,返回授予角色的员工集合。

请求信息

HTTP协议:HTTP,HTTPS

uri: /v1/iot/main/platform/get/admins/pure/by/roleIds

方法:PUT

Body 属性

名称 类型 必填 描述
roleIds Arraty 角色ID集合,如 :[109,120], 必须是平台内置角色
pageable Boolean 默认为true, 支持分页。false: 全量返回 ,不分页。

返回示例 :

请求示例 :

uri: /v1/iot/main/platform/get/admins/pure/by/roleIds

{ "roleIds": [27824, 117212] }

返回 :

{
  "code": "200",
  "data": {
    "result": [
      {
        "id": 117209,
        "mobile": "13102422681",
        "job_number": "workorder2",
        "name": "工单测试2"
      },
      {
        "id": 117208,
        "mobile": "13102422680",
        "job_number": "workorder1",
        "name": "工单测试人员1"
      }
    ],
    "pageNo": 1,
    "pageSize": 20,
    "total": 2,
    "totalPage": 1
  },
  "message": "成功"
}

3.7 由角色ID集合查询所有的员工

描述 仅适用于睿住平台,返回授予角色的员工集合。 需要按角色列出人员且人员图像需要返回。

请求信息

HTTP协议:HTTP,HTTPS

uri: /v1/iot/main/platform/get/admins/by/roleIds/v2

方法:POST

Body 属性

名称 类型 必填 描述
roleIds Arraty 角色ID集合,如 :[109,120], 必须是平台内置角色
businessCode String 业务编码,quality: 品质管理 , equipment:设备设施管理 , work order: 工单。 避免查询业务范围过大。

返回示例 :

请求示例 :

http://localhost:18089/v1/iot/main/platform/get/admins/by/roleIds/v2

{"businessCode": "workorder", "roleIds": [27824, 117212] }

返回 :

{
  "code": "200",
  "data": {
    "result": [
      {
        "role_name": "管家",
        "role_id": 117212,
        "admins": [
          {
            "id": 117208,
            "mobile": "13102422680",
            "job_number": "workorder1",
            "name": "工单测试人员1",
            "ico": null
          },
          {
            "id": 117209,
            "mobile": "13102422681",
            "job_number": "workorder2",
            "name": "工单测试2",
            "ico": "https://iot-xlink-xfile.oss-cn-hangzhou-internal.aliyuncs.com/customer/2022-01-06/1166981641448421249.jpg"
          }
        ]
      }
    ]
  },
  "message": "成功"
}

3.8 由员工ID集合查询平台内置角色

请求信息

HTTP协议:HTTP,HTTPS

uri: /v1/iot/main/platform/get/roles/by/adminId

方法:PUT

路径参数

名称 类型 必填 描述
adminId Long 员工的ID
businessCode String 业务编码,quality: 品质管理 , equipment:设备设施管理 , work order: 工单。 避免查询业务范围过大。

返回示例 :

 {
    "code":"200",
    "message":"success",
    "data":{
       "result": [
            {"role_id":11,  "role_name":""}, 
               ...
             {"role_id":11,  "role_name":""}

       ]


    }



 }

3.9 由角色ID集合查询所有的员工

范围:员工端及PC管理端

描述 返回指定业务的平台内置角色及人员列表。一次性以角色-人员列表的格式返回 。平台需要从用户

请求信息

HTTP协议:HTTP,HTTPS

uri: /v1/iot/main/platform/get/admins/by/roleIds/v3

方法:POST

Body 属性

名称 类型 必填 描述
businessCode String 业务编码,quality: 品质管理 , equipment:设备设施管理 , work order: 工单。 避免查询业务范围过大。
roleCode String 平台内置角色编码,当前提供的平台内置角色有:PROJECT_ENGINE_SUPERVISOR:项目主管; BUSINESS_MANAGER:业务线主管;QUALITY_CHECK_EXECUTOR:品检执行人

返回示例 :

请求示例 :

http://localhost:18089/v1/iot/main/platform/get/admins/by/roleIds/v3

{"businessCode": "workorder" }

返回 :

{
  "code": "200",
  "data": {
    "result": [
      {
        "role_name": "管家",
        "role_id": 117212,
        "admins": [
          {
            "id": 117208,
            "mobile": "13102422680",
            "job_number": "workorder1",
            "name": "工单测试人员1",
            "ico": null
          },
          {
            "id": 117209,
            "mobile": "13102422681",
            "job_number": "workorder2",
            "name": "工单测试2",
            "ico": "https://iot-xlink-xfile.oss-cn-hangzhou-internal.aliyuncs.com/customer/2022-01-06/1166981641448421249.jpg"
          }
        ]
      }
    ]
  },
  "message": "成功"
}

3.10 角色场景

3.10.1 读取角色场景配置

获取平台全局角色场景:H5页面拿到数据后作为场景色的配置表单项。

URL: https://biz-admin-sit.smartmideazy.com/v1/iot/main/platformrole/scene/roles

HTTP头部:见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《Part II 前端(含H5、小程序、APP)请求Token 约定》

GET:

返回:

{ "code":"200",  "message":"success", "data":   {
   "result": [
      {
          "roles": [
              {
                  "role_name": "项目工程主管",
                  "role_id": 3,
                  "role_code": "PROJECT_ENGINE_SUPERVISOR",
                   "refers": [

                        {"refer_role_id":XX, "refer_role_name":XX },
                        ... 

                   ]
              }
          ],
          "business_description": "设备设施",
          "business_code": "equipment"
      },
      {
          "roles": [
              {
                  "role_name": "客户服务部客服前台",
                  "role_id": 5,
                  "role_code": "RECEPTION_SUPERVISOR"
              },
              {
                  "role_name": "报事报修接单员",
                  "role_id": 6,
                  "role_code": "CASE_MAINTAIN_RECEPTION"
              },
              {
                  "role_name": "维保修大队负责人",
                  "role_id": 7,
                  "role_code": "CASE_MAINTAIN_CHARGER",
                   "refers": [

                        {"refer_role_id":XX, "refer_role_name":XX },
                        ... 

                   ]
              },
              {
                  "role_name": "维保修大队维修技工",
                  "role_id": 8,
                  "role_code": "CASE_MAINTAIN_SKILLER",
                   "refers": [

                        {"refer_role_id":XX, "refer_role_name":XX },
                        ... 

                   ]
              }
          ],
          "business_description": "工单",
          "business_code": "workorder"
      },
      {
          "roles": [
              {
                  "role_name": "项目工程主管",
                  "role_id": 1,
                  "role_code": "PROJECT_ENGINE_SUPERVISOR",
                   "refers": [

                        {"refer_role_id":XX, "refer_role_name":XX },
                        ... 

                   ]
              },
              {
                  "role_name": "业务线经理",
                  "role_id": 2,
                  "role_code": "BUSINESS_MANAGER",
                   "refers": [

                        {"refer_role_id":XX, "refer_role_name":XX },
                        ... 

                   ]
              },
              {
                  "role_name": "品检执行人",
                  "role_id": 4,
                  "role_code": "QUALITY_CHECK_EXECUTOR",
                   "refers": [

                        {"refer_role_id":XX, "refer_role_name":XX },
                        ... 

                   ]
              }
          ],
          "business_description": "品质管理",
          "business_code": "quality"
      }
]

}

}

3.10.2 更新角色场景配置

更新平台全局角色场景:

URL: https://biz-admin-sit.smartmideazy.com/v1/iot/main/platformrole/scene/roles/update

HTTP头部:见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《Part II 前端(含H5、小程序、APP)请求Token 约定》

PUT:

入参格式如下:

{  
   "result": [
      {
          "business_description": "设备设施",
           "business_code": "equipment",
          "roles": [
              {
                  "role_name": "项目工程主管",
                  "role_id": 3,
                  "role_code": "PROJECT_ENGINE_SUPERVISOR"
              }
          ]

      },
      {
          "roles": [
              {
                  "role_name": "客户服务部客服前台",
                  "role_id": 5,
                  "role_code": "RECEPTION_SUPERVISOR"
              },
              {
                  "role_name": "报事报修接单员",
                  "role_id": 6,
                  "role_code": "CASE_MAINTAIN_RECEPTION"
              },
              {
                  "role_name": "维保修大队负责人",
                  "role_id": 7,
                  "role_code": "CASE_MAINTAIN_CHARGER",
                   "refers": [

                        {"refer_role_id":1, "refer_role_name":XX },
                        ... 

                   ]
              },
              {
                  "role_name": "维保修大队维修技工",
                  "role_id": 8,
                  "role_code": "CASE_MAINTAIN_SKILLER",
                   "refers": [

                        {"refer_role_id":1, "refer_role_name":XX },
                        ... 

                   ]
              }
          ],
          "business_description": "工单",
          "business_code": "workorder"
      },
      {
          "roles": [
              {
                  "role_name": "项目工程主管",
                  "role_id": 1,
                  "role_code": "PROJECT_ENGINE_SUPERVISOR",
                   "refers": [

                        {"refer_role_id":XX, "refer_role_name":XX },
                        ... 

                   ]
              },
              {
                  "role_name": "业务线经理",
                  "role_id": 2,
                  "role_code": "BUSINESS_MANAGER",
                   "refers": [

                        {"refer_role_id":XX, "refer_role_name":XX },
                        ... 

                   ]
              },
              {
                  "role_name": "品检执行人",
                  "role_id": 4,
                  "role_code": "QUALITY_CHECK_EXECUTOR",
                   "refers": [

                        {"refer_role_id":XX, "refer_role_name":XX },
                        ... 

                   ]
              }
          ],
          "business_description": "品质管理",
          "business_code": "quality"
      }
]



}

BODY:

字段 字段类型 是否必填 说明
business_code String 平台角色编号
business_description String 平台角色描述
role_code String 角色编号
role_name String 角色名称
refer_role_id String 主数据-角色id
refer_role_name String 主数据-角色名称

3.11 角色新增/修改

使用新的接口。

原URL: https://biz-admin-sit.smartmideazy.com/v1/iot/main/orgrolerel/add

新URL: https://biz-admin-sit.smartmideazy.com/v1/iot/main/orgrolerel/add/v3

HTTP头部:见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《Part II 前端(含H5、小程序、APP)请求Token 约定》

method: POST

BODY:

旧的入参:

{"msgId":"fcdd617b-8a2c-6124-5b9c-f7defb958044","name":"Gogo","list":[21897],"create_org_id":21897}

新的入参:

{"name":"角色名称", "menu_ids":[123,456]}

BODY字段说明

字段 字段类型 是否必填 说明
role_id Int 角色表的主键字段,非空是代表修改角色时;为空代表新增角色
name String 必填。长度1-32 , 可以是中英文和数字;同一租户下名称唯一。
menu_ids String 菜单应用ID集合,不可为空。

3.12 将一个角色批量授权给员工

说明:批量为员工授予一个角色,建立员工、业务组织、角色的关联。 员工组织取员工所属的业务组织集合。

URL: https://biz-admin-sit.smartmideazy.com/v1/iot/main/orgroleadmin/orgrole2admins/rel/v3

HTTP头部:见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《Part II 前端(含H5、小程序、APP)请求Token 约定》

BODY

{
   "admin_ids":[1,2,3], "role_id":XX 

}

BODY字段说明

字段 字段类型 是否必填 说明
admin_ids List 员工ID集合
role_id Int 角色ID

返回:

{
  "code":"200", "message":"success"
}

3.13 为一个员工批量授予多个角色

说明:批量为一个员工授予多个角色,建立员工、业务组织、角色的关联。

URL: https://biz-admin-sit.smartmideazy.com/v1/iot/main/orgroleadmin/orgroles2admin/rel/v3

HTTP头部:见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《Part II 前端(含H5、小程序、APP)请求Token 约定》

BODY

原协议:

{
   "admin_id":123, "org_role_ids":[{"org_ids":[11,12,13], "role_id":22}, ... ]

}

更新成:

BODY字段说明

字段 字段类型 是否必填 说明
admin_id Int 员工ID
org_role_ids JSONArray 业务组织集合与角色ID集合

org_role_ids对象参数说明

字段 字段类型 是否必填 说明
org_ids Array(int) 业务组织ID集合
role_id Int 角色ID

返回:

{
  "code":"200", "message":"success"
}

3.14 加载员工与业务组织、角色的关联关系详情

URL: https://biz-admin-sit.smartmideazy.com/v1/iot/main/orgroleadmin/rel/detail/{admin_id}

HTTP头部:见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《Part II 前端(含H5、小程序、APP)请求Token 约定》

Method: GET

路径参数 : admin_id : 员工ID

返回:

{

   "code":"200", "message":"success",

   "data": {

      "result": {

          "admin_id": 123,
          "org_role_ids":[{"org_ids":[11,12,13], "role_id":22}, ... ]

      }


   }


}

3.15 删除角色

当前色绑定员工不可删除。 删除角色的同时删除角色下的功能应用。

URL: /iot/main/orgrolerel/remove

Method: POST

BODY

{"role_id":123 }

3.16 查普通角色关联的员工分页

当前色绑定员工不可删除。 删除角色的同时删除角色下的功能应用。

URL: /iot/main/new/admins/byrole/page

Method: POST

BODY

{"role_id":123, "pageNo":112, "pageSize":20 , "key_word":"" }

key_word可以是员工的手机号、帐号、姓名,可进行全模糊查询。

3.17 查询当前业务组织下普通角色未关联的员工分页

URL: /iot/main/new/notrel/admins/byrole/page

Method: POST

BODY

{"role_id":123, "pageNo":112, "pageSize":20 , "key_word":"" }

key_word可以是员工的手机号、帐号、姓名,可进行全模糊查询。

3.18 将一个角色与多个员工进行解绑

URL: /iot/main/new/orgroles2admin/unbind

Method: PUT

BODY

{"role_id":123, "admin_ids":[1,30,289] }

3.19 当前顶级业务组织下全量角色列表(不分页)

适用场景: 选取角色列表。

URL: /v1/iot/main/global/roles/all

Method: POST

返回:

{
  "code":"200", "message":"success",
  "data":
  {
     "result":[ {"role_id", 11, "role_name": "AA"}, ... ]

  }


}

3.20 查询整棵业务组织树

适用场景: 员工通讯录

URL: /iot/main/org/global/tree

Method: POST

HTTP头部:见 http://arch.smartmideazy.com/apidoc/main-entry/API.html 《Part II 前端(含H5、小程序、APP)请求Token 约定》

返回:

{
  "code":"200", "message":"success",
  "data":
  {
     "result":[ {"id", 11, "org_name": "AA"}, ... ]

  }


}

4 menu

4.1 删除菜单应用

说明:如果菜单有子项,不可删除。仅叶子节点可以删除。

URL: /v1/iot/main/supper/menu/del/{menu_id}

method : DELETE

返回:

{
    "code": "200",
    "message": "成功"
}

5 接口调用顺序

5.1 新增员工绑定多个角色接口顺序

原型

URL: /v1/iot/main/orgroleadmin/orgroles2admin/rel/v3

(1) 选角色调用:《3.19 当前顶级业务组织下全量角色列表(不分页)》

URL: /iot/main/role/global/roles/all

(2) 选业务组织树调用:《1.4 当前员工所关联的业务组织树》URL: /v1/iot/main/org/trees/orgrel

(3) 提交按钮调用: 《3.13 为一个员工批量授予多个角色》

5.2 加载员工与角色的关系(用于修改)

接口见:《3.14 加载员工与业务组织、角色的关联关系详情》

=======

6 管家app通讯录

6.1 获取当前人员行政组织路径

说明:获取当前人员行政组织路径

URL: /v1/iot/main/org/business/path/full

Header: tokenInfo method : POST body:

{
    "bizOrgCode":"100000150100000000100000000"
}

返回:

{
    "code": "200",
    "message": "成功",
    "version": null,
    "returnExceptionData": false,
    "result": [
        {
            "create_by": null,
            "update_by": null,
            "create_by_id": null,
            "update_by_id": null,
            "create_time": 1609276770000,
            "update_time": 1610675117000,
            "id": 21897,
            "org_code": "100000150",
            "org_name": "sit顶级业务组织234",
            "parent_code": null,
            "parentid": null,
            "full_org_name": "sit顶级业务组织234",
            "org_type": 2,
            "sub_type": 2,
            "org_id": null,
            "src": 1,
            "parent_org_id": null,
            "logic_deleted": 1,
            "tenant_id": 0,
            "defaul_experience": null,
            "parent_name": null,
            "children": null,
            "list": null,
            "pageNo": null,
            "pageSize": null,
            "status": 1,
            "selected": false,
            "space_id": null,
            "hasPropertyRelations": false,
            "orderby": null,
            "is_super": null,
            "beRelByThisApp": false,
            "beRelByOtherApp": false,
            "cannotBeUnbind": false,
            "community_id": null,
            "community_name": null,
            "community_code": null,
            "authOrgId": null,
            "communityStatus": null,
            "bizOrgId": null,
            "rel_business_org_ids": null,
            "_only_sub": false
        },
        {
            "create_by": null,
            "update_by": null,
            "create_by_id": null,
            "update_by_id": null,
            "create_time": 1660738824000,
            "update_time": 1660738824000,
            "id": 21908,
            "org_code": "100000150100000000",
            "org_name": "珠三角区域",
            "parent_code": null,
            "parentid": 21897,
            "full_org_name": "sit顶级业务组织234/珠三角区域",
            "org_type": 2,
            "sub_type": 2,
            "org_id": null,
            "src": 1,
            "parent_org_id": null,
            "logic_deleted": 1,
            "tenant_id": null,
            "defaul_experience": null,
            "parent_name": null,
            "children": null,
            "list": null,
            "pageNo": null,
            "pageSize": null,
            "status": 1,
            "selected": false,
            "space_id": null,
            "hasPropertyRelations": false,
            "orderby": null,
            "is_super": null,
            "beRelByThisApp": false,
            "beRelByOtherApp": false,
            "cannotBeUnbind": false,
            "community_id": null,
            "community_name": null,
            "community_code": null,
            "authOrgId": null,
            "communityStatus": null,
            "bizOrgId": null,
            "rel_business_org_ids": null,
            "_only_sub": false
        },
        {
            "create_by": null,
            "update_by": null,
            "create_by_id": null,
            "update_by_id": null,
            "create_time": 1609331154000,
            "update_time": 1660738824000,
            "id": 21909,
            "org_code": "100000150100000000100000000",
            "org_name": "领贤公馆业务",
            "parent_code": null,
            "parentid": 21908,
            "full_org_name": "sit顶级业务组织234/珠三角区域/领贤公馆业务",
            "org_type": 2,
            "sub_type": 1,
            "org_id": null,
            "src": 1,
            "parent_org_id": null,
            "logic_deleted": 1,
            "tenant_id": 0,
            "defaul_experience": null,
            "parent_name": null,
            "children": null,
            "list": null,
            "pageNo": null,
            "pageSize": null,
            "status": 1,
            "selected": false,
            "space_id": null,
            "hasPropertyRelations": false,
            "orderby": null,
            "is_super": null,
            "beRelByThisApp": false,
            "beRelByOtherApp": false,
            "cannotBeUnbind": false,
            "community_id": null,
            "community_name": null,
            "community_code": null,
            "authOrgId": null,
            "communityStatus": null,
            "bizOrgId": null,
            "rel_business_org_ids": null,
            "_only_sub": false
        }
    ],
    "data": null
}

6.2 获取当前业务组织下的人员和子组织树

说明:获取当前业务组织下的人员和子组织树

URL: /v1/iot/main/org/business/child/{org_id}

Header: tokenInfo method : POST

返回:

{
    "code": "200",
    "message": "成功",
    "version": null,
    "returnExceptionData": false,
    "result": {
        "org_list": [
            {
                "create_by": null,
                "update_by": null,
                "create_by_id": null,
                "update_by_id": null,
                "create_time": 1660738824000,
                "update_time": 1660738824000,
                "id": 21908,
                "org_code": "100000150100000000",
                "org_name": "珠三角区域",
                "parent_code": null,
                "parentid": 21897,
                "full_org_name": "sit顶级业务组织234/珠三角区域",
                "org_type": 2,
                "sub_type": 2,
                "org_id": null,
                "src": 1,
                "parent_org_id": null,
                "logic_deleted": 1,
                "tenant_id": null,
                "defaul_experience": null,
                "parent_name": null,
                "children": null,
                "list": null,
                "pageNo": null,
                "pageSize": null,
                "status": 1,
                "selected": false,
                "space_id": null,
                "hasPropertyRelations": false,
                "orderby": null,
                "is_super": null,
                "beRelByThisApp": false,
                "beRelByOtherApp": false,
                "cannotBeUnbind": false,
                "community_id": null,
                "community_name": null,
                "community_code": null,
                "authOrgId": null,
                "communityStatus": null,
                "bizOrgId": null,
                "rel_business_org_ids": null,
                "_only_sub": false
            },
            {
                "create_by": null,
                "update_by": null,
                "create_by_id": null,
                "update_by_id": null,
                "create_time": 1609405232000,
                "update_time": 1650356444000,
                "id": 22371,
                "org_code": "100000150100000001",
                "org_name": "万锦熙岸",
                "parent_code": null,
                "parentid": 21897,
                "full_org_name": "sit顶级业务组织234/万锦熙岸",
                "org_type": 2,
                "sub_type": 1,
                "org_id": null,
                "src": 1,
                "parent_org_id": null,
                "logic_deleted": 1,
                "tenant_id": 0,
                "defaul_experience": null,
                "parent_name": null,
                "children": null,
                "list": null,
                "pageNo": null,
                "pageSize": null,
                "status": 1,
                "selected": false,
                "space_id": null,
                "hasPropertyRelations": false,
                "orderby": null,
                "is_super": null,
                "beRelByThisApp": false,
                "beRelByOtherApp": false,
                "cannotBeUnbind": false,
                "community_id": null,
                "community_name": null,
                "community_code": null,
                "authOrgId": null,
                "communityStatus": null,
                "bizOrgId": null,
                "rel_business_org_ids": null,
                "_only_sub": false
            }
        ],
        "admin_list": [
            {
                "create_by": "路人甲44",
                "update_by": null,
                "create_by_id": null,
                "update_by_id": null,
                "create_time": 1660737117000,
                "update_time": 1660737290000,
                "id": 333670,
                "user_id": null,
                "org_id": 223535,
                "org_name": "3",
                "mobile": "15815944560",
                "org_code": "100000149100010037",
                "src": 1,
                "nickname": "111",
                "per_signature": null,
                "ico": null,
                "job_number": "ces817",
                "pwd": "$2a$10$mMz6ZzMNy6x/6QSIdEDkuO7CI2NAjW3wYpVo5YapxHk4JzzdRxma.",
                "name": "123111",
                "sex": null,
                "email": "23165165189@qq.com",
                "identity": "420322199202300011",
                "type": 1,
                "status": 1,
                "last_login_time": null,
                "pwd_modify_time": null,
                "lock_time": null,
                "login_fail_times": null,
                "birthday": null,
                "last_login": null,
                "staff_no": "",
                "position": "",
                "is_supper": 1,
                "face_ico": "",
                "is_effective": 1,
                "delivery_address": null,
                "position_level": 0,
                "random_bg": 0,
                "roleNames": null,
                "groupNames": null,
                "ids": null,
                "userIds": null,
                "relationId": null,
                "relationIds": null,
                "groupId": null,
                "adminOrgCodes": null,
                "adminIds": null,
                "pageNo": null,
                "pageSize": null,
                "client_id": null,
                "client_secret": null,
                "orgName": null,
                "fullOrgName": null,
                "org_type": null,
                "rel_org_id": null,
                "authOrgId": null,
                "communityId": null,
                "oldFlag": null,
                "communitys": null,
                "grant_type": null,
                "refresh_token": null,
                "full_org_name": null,
                "searchCondition": null,
                "topOrgCode": null,
                "topOrgId": null,
                "msgId": null,
                "beginDate": null,
                "endDate": null,
                "keyword": null,
                "businessCode": null,
                "roleCode": null,
                "roleIds": null,
                "upperOrgAdmin": false
            }
        ]
    },
    "data": null
}

6.3 获取人员列表

说明:根据组织code(org_code)或者人员电话/姓名(key_word)获取人员列表。查询当前组织下的人员只传org_code,根据姓名电话查询人员只传key_word。 两个参数必须有一个

URL: /v1/iot/main/new/admin/all/query/page

Header: tokenInfo method : POST

入参: { "pageSize": 10, "pageNo": 1, "key_word": "测试" }

返回:

{
    "code": "200",
    "data": {
        "result": [
            {
                "create_by": "system_insert",
                "update_by": null,
                "create_by_id": null,
                "update_by_id": null,
                "create_time": 1660530415000,
                "update_time": 1660530415000,
                "id": 306119,
                "user_id": null,
                "org_id": 15267,
                "org_name": "美的置业-市场部-采购分部",
                "mobile": "13450834336",
                "org_code": "100000000100000000100000000",
                "src": 1,
                "nickname": "testf",
                "per_signature": null,
                "ico": null,
                "job_number": "testf",
                "pwd": "$2a$10$UfoReWvKKwv6lk2GnTgtKe70ouDJTKUn6JLO7e4e7KkhbQd2Qlzf2",
                "name": "测试",
                "sex": null,
                "email": "2@qq.com",
                "identity": "440681202201012243",
                "type": 1,
                "status": 1,
                "last_login_time": null,
                "pwd_modify_time": null,
                "lock_time": null,
                "login_fail_times": null,
                "birthday": null,
                "last_login": null,
                "staff_no": "",
                "position": "abc",
                "is_supper": 1,
                "face_ico": "",
                "is_effective": 1,
                "delivery_address": null,
                "position_level": 0,
                "random_bg": 0,
                "roleNames": null,
                "groupNames": null,
                "ids": null,
                "userIds": null,
                "relationId": null,
                "relationIds": null,
                "groupId": null,
                "adminOrgCodes": null,
                "adminIds": null,
                "pageNo": null,
                "pageSize": null,
                "client_id": null,
                "client_secret": null,
                "orgName": null,
                "fullOrgName": null,
                "org_type": null,
                "rel_org_id": null,
                "authOrgId": null,
                "communityId": null,
                "oldFlag": null,
                "communitys": null,
                "grant_type": null,
                "refresh_token": null,
                "full_org_name": null,
                "searchCondition": null,
                "topOrgCode": null,
                "topOrgId": null,
                "msgId": null,
                "beginDate": null,
                "endDate": null,
                "keyword": null,
                "businessCode": null,
                "roleCode": null,
                "upperOrgAdmin": false
            }
        ],
        "pageNo": 1,
        "pageSize": 20,
        "total": 5,
        "totalPage": 1
    },
    "message": "成功"
}

7 业务组织应用树: (树的范围:超管看全量树,普通帐号依赖角色与应用的关联的并集)

注: 平台超管的业务组织织授权应用的接口不变。 请注意应用场景,不要用错了。

平台超管:给租户授权菜单应用。控制应用池子的大小。

URL : https://biz-admin-sit.smartmideazy.com/v1/iot/main/orgmenu/trees/{org_id}

应用场景: 给业务组织关联菜单应用时获取多个菜单应用树范围。

普通租户: 树的范围: 仅当前登录人所拥有的菜单树。

普通用户的菜单池由登录人所授予的角色关联菜单应用来呈现池子。通过角色与菜单应用的授权来维护。

应用场景:给角色关联菜单应用,获取多棵菜单应用树范围。

原接口: URL: https://biz-admin-sit.smartmideazy.com/v1/iot/main/orgmenu/rel/trees/{org_id}

新接口:POST: URL: https://biz-admin-sit.smartmideazy.com/v1/iot/main/rolemenu/rel/trees/range

results matching ""

    No results matching ""