获取成本中心信息

接口说明: 获取公司的成本中心信息及成本中心的预算信息,包含成本中心id,父成本中心id,成本中心名称以及成本中心编码 共两种情况:

  • costId为空时,获取公司所有成本中心信息

  • costId不为空时,获取公司单个指定成本中心信息

请求方式:POST(HTTPS)
请求地址:https://api.xinrenxinshi.com/v5/department/costcenter/detail/list

请求Header:

key value
access_token 获取的access_token的实际值

Query参数:

key value
sign 签名值

Body参数:

参数 类型 必传(Y/N) 说明
costId String N 成本中心id,不传时,默认返回公司所有成本中心信息
timestamp Long Y 请求时间戳(精确到毫秒)

返回结果:

参数 类型 必传(Y/N) 说明
errcode Integer Y 0成功,其他失败
errmsg String Y 结果描述
data List<CostCenterModel> Y 成本中心信息列表

CostCenterModel

参数 类型 必传(Y/N) 说明
costId String Y 成本中心id
parentId String Y 父成本中心id,顶级父节点id为0
name String Y 成本中心名称
code String Y 成本中心编码
expenseType String N 费用类型
expenseCode String N 费用编码
costRemark String N 成本中心备注
customFields Map<String,String> N 自定义字段
budgetYearModels List<CostBudgetControlYearModel> N 预算信息

CostBudgetControlYearModel

参数 类型 必传(Y/N) 说明
year Integer Y 年份,格式 yyyy
itemModels List<CostBudgetItemModel> Y 预算数据

CostBudgetItemModel

参数 类型 必传(Y/N) 说明
type Integer Y 类型,0-薪酬成本,1-企业人工成本
month1 Double N 1月的预算数据
month2 Double N 2月的预算数据
month3 Double N 3月的预算数据
month4 Double N 4月的预算数据
month5 Double N 5月的预算数据
month6 Double N 6月的预算数据
month7 Double N 7月的预算数据
month8 Double N 8月的预算数据
month9 Double N 9月的预算数据
month10 Double N 10月的预算数据
month11 Double N 11月的预算数据
month12 Double N 12月的预算数据

请求示例(HTTPS):

https://api.xinrenxinshi.com/v5/department/costcenter/detail/list?sign=cwyzXRxvXDiGetbidkMvHYJ7TVI%3D

请求Body示例:

{
  "timestamp": 1606214752569
}

SDK请求示例(java):

CostCenterDetailListRequest request = new CostCenterDetailListRequest(access_token());
XrxsDepartmentService.costCenterList(request);

响应示例:

{
  "errcode": 0,
  "errmsg": "成功",
  "data": [
    {
      "costId": "c03b7ef4fced4e64a256327a740b39fc",
      "parentId": "0",
      "name": "成本中心",
      "code": "cost_center_code",
      "expenseType":"费用类型1",
      "expenseCode":"费用编码1",
      "costRemark":"备注",
      "customFields":{
        "测试自定义字段2":"23",
        "测试自定义字段1":"测试",
        "测试城市":"北京市"
      },
      "budgetYearModels": [
        {
          "itemModels":[
            {
              "month1":1000,
              "month10":1000,
              "month11":1000,
              "month12":1000,
              "month2":1000,
              "month3":1000,
              "month4":1000,
              "month5":1000,
              "month6":1000,
              "month7":1000,
              "month8":1000,
              "month9":1000,
              "type":0
            }
          ],
          "year":2022
        }
      ]
    }
  ]
}
2024 © 企家有道网络技术(北京)有限公司版权所有@京ICP备15035315号 all right reserved,powered by Gitbookupdate by: 2024-06-25 19:46:39

results matching ""

    No results matching ""