员工个人信息API


  • administrators

    1. 获取Excel模板

    /**
     * @api {POST} /api/v1/swan/manager/staff/static/template   [C/S][管理后台]获取Excel模板
     * @apiGroup Swan Manager
     * @apiVersion __API_VERSION__
     *
     *
     * @apiSuccessExample 获取成功
     * HTTP/1.1 200
     * {
     * }
     *
     * @apiErrorExample  服务异常
     * HTTP/1.1 500
     * {
     *      errcode:sw_error
     *      error: 'XX服务异常'
     * }
     *
     */
    

    2.Excel批量导入staff

    /**
     * @api {POST} /api/v1/swan/manager/staff/:staffId/upload   [C/S][管理后台]Excel批量导入staff
     * @apiGroup Swan Manager
     * @apiVersion __API_VERSION__
     *
     * @apiParam  (RequestBody)      {File}       template        Excel文件
     *
     * @apiSuccessExample 获取成功
     * HTTP/1.1 200
     * {
     *
     * }
     *
     *
     *
     * @apiErrorExample  服务异常
     * HTTP/1.1 500
     * {
     *      errcode:sw_error
     *      error: 'XX服务异常'
     * }
     *
     */
    

    3.新增一个员工

    /**
     * @api {POST} /api/v1/swan/manager/staff   [C/S]新增一个员工
     * @apiGroup Swan Manager
     * @apiVersion __API_VERSION__
     *
     * @apiParam         {String}           [staffId]                  员工的fcid,不允许大写字母。形如:@staff_xxxx:domain
     * @apiParam         {String}           account                    员工的账号
     * @apiParam         {String}           updateUser                 更新人
     * @apiParam         {String}           name                       姓名
     * @apiParam         {String}           [phone]                    手机号
     * @apiParam         {String}           [mail]                     邮箱
     * @apiParam         {Boolean}          [power]                    是否有接单权限,默认是true
     * @apiParam         {Json}             [notice]                   抢单,派单的通知。rush是抢单,dispatch是派单,默认是{rush: true, dispatch: true}
     * @apiParam         {String}           [avatar]                   头像地址
     * @apiParam         {String}           [hotline]                  组织电话
     * @apiParam         {boolean}          [online]                   是否在线,默认是false
     * @apiParam         {[String]}         jobs                       岗位
     * @apiParam         {String}           [employmentTime]           岗位年限
     * @apiParam         {String}           group                      组织
     * @apiParam         {[String]}         [permissionRoles]          页面权限
     * @apiParam         {[String]}         [dataGroups]               数据权限
     * @apiParam         {Json}             [others]                   其他,可以在这里加一些自定义的字段
     * @apiParam         {JsonArray}        [visitingCard]             员工名片,这里是机构自定义样式和内容。是一个二维数组,其中value是内容;ratio占布局的百分比;align代表对齐方式,取值是0,1和2,分别代表居左,居中和居右形如:[[{"value": "", "ratio": 10, align: 0}, {}],[{}]]
     *
     * @apiSuccessExample 获取成功
     * HTTP/1.1 200
     * {
     *     result: "success"
     * }
     *
     *
     * @apiErrorExample  认证失败
     * HTTP/1.1 401
     * {
     *      errcode:sw_error
     *      error: 'token错误'
     * }
     *
     * @apiErrorExample  服务异常
     * HTTP/1.1 500
     * {
     *      errcode:sw_error
     *      error: 'XX服务异常'
     * }
     *
     */
    

    4.修改某员工的信息

    /**
     * @api {PUT} /api/v1/swan/manager/staff/:id   [C/S][管理后台]修改某员工的信息
      * @apiGroup Swan Manager
     * @apiVersion __API_VERSION__
     *
     * @apiParam {String}     id         员工Id
     *
     * @apiParam (RequestBody) {string}      [name]             姓名
     * @apiParam (RequestBody) {string}      [avatar]           头像 URL
     * @apiParam (RequestBody) {string}      [phone]            手机号
     * @apiParam (RequestBody) {string}      [email]            邮箱
     * @apiParam (RequestBody) {bool}        [power]            接单权限
     * @apiParam (RequestBody) {[string]}    [jobs]             岗位
     * @apiParam (RequestBody) {[string]}    [permissionRoles]  关联角色
     * @apiParam (RequestBody) {[string]}    [dataGroups]       数据权限
     * @apiParam (RequestBody) {string}      [group]            组织
     * @apiParam (RequestBody) {string}      [zoneStatus]       工作室状态   //-1:已停用 ; 0:未启用; 1:启用
     * @apiParam (RequestBody) {string}      [practiceNum]      员工编号 (执业编号)
     * @apiParam (RequestBody) {string}      [employmentTime]   岗位从业年限
     * @apiParam (RequestBody) {string}      [wechat]           营业部电话
     * @apiParam (RequestBody) {string}      [hotline]          岗位,体验账号only
     * @apiParam (RequestBody) {string}      [section]          营业部,体验账号only
     * @apiParam (RequestBody) {string}      [wechat]           微信
     * @apiParam (RequestBody) {string}      [company]          {"catalog":"111","name":"111","addr":{ province: '', city: '', area: '' }}体验账号only
     * @apiParam (RequestBody) {bool}        [showJob]          展示职位
     * @apiParam (RequestBody) {bool}        [showGroup]        展示组织
     *
     *
     * @apiSuccessExample 获取成功
     * HTTP/1.1 200
     * {
     *     id: '', //用户id
     * }
     *
     
     *
     * @apiErrorExample  认证失败
     * HTTP/1.1 401
     * {
     *      errcode:sw_error
     *      error: 'token错误'
     * }
     *
     * @apiErrorExample  服务异常
     * HTTP/1.1 500
     * {
     *      errcode:sw_error
     *      error: 'XX服务异常'
     * }
     *
     */
    

    5.获取某员工的信息

    /**
     * @api {GET} /api/v1/swan/manager/staff/:id   [C/S][通用]获取某员工的信息
     * @apiGroup Swan Manager
     * @apiVersion __API_VERSION__
     *
     * @apiParam {String}     id         员工Id
     *
     * @apiSuccessExample 获取成功
     * HTTP/1.1 200
     *{
     *   "id": "@staff_sunhui:im.icbc.com.cn",
     *   "account": "sunhui",
     *   "name": "sunhui",
     *   "avatar": "/api/v1/platform/apps/STAFF/profiles/@staff_sunhui:im.icbc.com.cn/avatar",
     *   "phone": "139000000000",
     *   "email": "",
     *   "hotline": "",
     *   "employmentTime": "",
     *   "notice": {
     *       "dispatch": true,
     *       "rush": true
     *   },
     *   "online": true,
     *   "power": true,
     *   "roles": [
     *       "j1",
     *       "j2"
     *   ],
     *   "jobs": [
     *       {
     *           "_id": "5c91d88424369a6dfcfaea5b",
     *           "jobId": "j1",
     *           "name": "j1",
     *           "updateUser": "",
     *           "updateTime": 1553482353133,
     *           "createTime": 1553482353133
     *       },
     *       {
     *           "_id": "5c91d88c24369a6dfcfaea5d",
     *           "jobId": "j2",
     *           "name": "j2",
     *           "updateUser": "",
     *           "updateTime": 1553482353133,
     *           "createTime": 1553482353133
     *       }
     *   ],
     *   "roleNames": [
     *       "j1",
     *       "j2"
     *   ],
     *   "group": {
     *       "_id": "5c908ce6bff1cc0c9a5f07fd",
     *       "groupId": "b6f80330-4a10-11e9-9c6d-215f71ae2cd1",
     *       "name": "2",
     *       "depth": 2,
     *       "parentId": "aedc0de0-4a10-11e9-9c6d-215f71ae2cd1",
     *       "__v": 0,
     *       "parentIds": [
     *           "aedc0de0-4a10-11e9-9c6d-215f71ae2cd1"
     *       ],
     *       "updateUser": "123",
     *       "updateTime": 1552977126115,
     *       "createTime": 1552977126115,
     *       "location": null,
     *       "staffs": [
     *           "@staff_adviser:im.icbc.com.cn"
     *       ],
     *       "role": [],
     *       "leader": "",
     *       "type": 1,
     *       "contactsName": ""
     *   },
     *   "department": "2",
     *   "view": [
     *       {
     *           "viewId": "v1"
     *       }
     *   ],
     *   "dataGroups": [
     *       {
     *           "_id": "5c908ce6bff1cc0c9a5f07fd",
     *           "groupId": "b6f80330-4a10-11e9-9c6d-215f71ae2cd1",
     *           "name": "2",
     *           "depth": 2,
     *           "parentId": "aedc0de0-4a10-11e9-9c6d-215f71ae2cd1",
     *           "__v": 0,
     *           "parentIds": [
     *               "aedc0de0-4a10-11e9-9c6d-215f71ae2cd1"
     *           ],
     *           "updateUser": "123",
     *           "updateTime": 1552977126115,
     *           "createTime": 1552977126115,
     *           "location": null,
     *           "staffs": [
     *               "@staff_adviser:im.icbc.com.cn"
     *           ],
     *           "role": [],
     *           "leader": "",
     *           "type": 1,
     *           "contactsName": ""
     *       }
     *   ],
     *   "updateTime": 1553481271894,
     *   "updateUser": {
     *       "staffId": "@staff_adviser:im.icbc.com.cn",
     *       "account": "adviser",
     *       "name": "王大大"
     *   },
     *   "state": 0,
     *   "showJob": true,
     *   "showGroup": true,
     *   "company": {
     *       "name": "test公司",
     *       "telephone": "0755-12345678"
     *   }
     *}
     *
     *
     *
     *
     * @apiErrorExample  认证失败
     * HTTP/1.1 401
     * {
     *      errcode:sw_error
     *      error: 'token错误'
     * }
     *
     * @apiErrorExample  服务异常
     * HTTP/1.1 500
     * {
     *      errcode:sw_error
     *      error: 'XX服务异常'
     * }
     *
     */
    

    6.获取员工列表

    /**
     * @api {GET} /api/v1/swan/manager/staff?groupId=&name=&startTime=&endTime=&exportExcel=true?compliancePermission=1    [C/S][管理后台]获取员工列表
     * @apiGroup Swan Manager
     * @apiVersion __API_VERSION__
     *
     * @apiSuccessExample 获取成功
     * HTTP/1.1 200
     * {
     *      total:20,
     *      page:1,
     *      size:20,
     *      result: [
     *          {
     *              id: '', //用户id
     *              name:'', // 姓名
     *              account: '', // 账号
     *              phone:'', // 电话
     *              updateTime: '',
     *              updateUser: '',
     *              power: true
     *          },
     *          ...
     *      ]
     * }
     *
     * @apiErrorExample  认证失败
     * HTTP/1.1 401
     * {
     *      errcode:sw_error
     *      error: 'token错误'
     * }
     *
     * @apiErrorExample  服务异常
     * HTTP/1.1 500
     * {
     *      errcode:sw_error
     *      error: 'XX服务异常'
     * }
     */