预算详情查询v2

  • 接口:common/budgets/v2/findDetails
  • Method:POST
  • 数据格式:JSON
  • 限流信息:100次每天和50次每小时
  • 多语言环境:在接口请求头中添加Key为locale,Value值为语言环境,目前支持的语言有zh_CN(中文)、en_US(英文)、ja_JP(日文)、zh_TW(繁体),请选取其中一种
  • 接口说明:预算根据不同维度查询详情
  • 请求参数:除财年期间以外,必须再传至少一个查询维度(标记为ONE-OF1
  • 其他补充信息:在员工主数据中employee_number是非必填字段的场景下,返回的结果中如果有员工预算维度,可能会缺失员工工号对应的信息

参数:

请求参数

字段名称 字段类型 字段描述 是否必填 长度限制(字节)
page_num Integer 分页页数 (最小1) TRUE
page_size Integer 分页条数 (最小1, 最大100) TRUE
period_name String 财年期间 TRUE 64
period_type String 财年类型(有效值:’ptd’,’ptd2’,’ptd0’,’total’,’total2’,’total0’) FALSE 64
department_code String 部门编码 ONE-OF1 64
budget_code String 预算科目编码 ONE-OF1 64
project_code String 项目编码 ONE-OF1 64
employee_number String 员工工号 ONE-OF1 64
supplier_code String 供应商编码 ONE-OF1 64
column1 String 自定义字段1 ONE-OF1 64
column2 String 自定义字段2 ONE-OF1 64
column3 String 自定义字段3 ONE-OF1 64
column4 String 自定义字段4 ONE-OF1 64
column5 String 自定义字段5 ONE-OF1 64

返回参数

字段名称 字段类型 字段描述
resCode Integer 响应状态码(见附录)
resMsg String 返回信息描述
page_num Integer 当前页数
total_page Integer 总页数
page_size Integer 条数
total_count Integer 当前页总条数
page_info Array 预算详情信息
page_info.cid Integer 预算维度组合唯一编码(只与构成其的预算维度有关,可能对应多个预算计划表)
page_info.department_code String 成本中心编码
page_info.budget_code String 预算科目编码
page_info.project_code String 项目编码
page_info.employee_number String 员工工号
page_info.supplier_code String 供应商编码
page_info.budget_amount BigDecimal 预算金额
page_info.frozen_amount BigDecimal 冻结金额
page_info.request_amount BigDecimal 占用金额
page_info.expense_amount BigDecimal 消耗金额
page_info.budget_breakdown_amount BigDecimal 预算分解金额
page_info.budget_breakdown_balance BigDecimal 预算分解余额
page_info.balance_amount BigDecimal 余额
page_info.request_date Long 占用日期(13位数字时间戳)
page_info.expense_date Long 消耗日期(13位数字时间戳)
page_info.plan_names Array 与预算维度组合唯一编码和财年期间(+财年类型)匹配的所有预算计划表的名称
column1 String 自定义字段1
column2 String 自定义字段2
column3 String 自定义字段3
column4 String 自定义字段4
column5 String 自定义字段5

示例:

01 查询预算详情-ptd父节点预算PTD检查

请求数据

{
  "period_name": "2025年9月",
  "department_code": "D427",
  "page_size": 3,
  "page_num": 1,
  "period_type": "ptd"
}

返回数据

{
  "resCode": 200000,
  "resMsg": "success",
  "data": {
    "page_size": 3,
    "page_num": 1,
    "total_count": 17,
    "total_page": 6,
    "is_first_page": true,
    "is_last_page": false,
    "page_info": [
      {
        "cid": 2,
        "plan_names": [
          "2025年7月预算",
          "2025年8月预算",
          "2025年9月预算"
        ],
        "department_code": "D427",
        "budget_amount": 80000,
        "frozen_amount": 180,
        "request_amount": 1080,
        "expense_amount": 78609.23,
        "balance_amount": 130.77,
        "request_date": 1758057691000,
        "expense_date": 1758187322000
      },
      {
        "cid": 3,
        "plan_names": [
          "2025年7月预算",
          "2025年8月预算",
          "2025年9月预算"
        ],
        "department_code": "D427",
        "employee_number": "1001",
        "budget_amount": 10000,
        "frozen_amount": 80,
        "request_amount": 1890,
        "expense_amount": 8000,
        "balance_amount": 30,
        "request_date": 1758109130000,
        "expense_date": 1758205251000
      },
      {
        "cid": 4,
        "plan_names": [
          "2025年7月预算",
          "2025年8月预算",
          "2025年9月预算"
        ],
        "department_code": "D427",
        "employee_number": "1002",
        "budget_amount": 10000,
        "frozen_amount": 0,
        "request_amount": 0,
        "expense_amount": 9900,
        "balance_amount": 100,
        "expense_date": 1758202045000
      }
    ]
  }
}

02 传入财年期间为'blank',表示该预算记录不限制财年期间,此情形下会忽略period_type

注:本例中,未匹配财年期间,且预算维度组合包含"department_code"为"2050061.02"的只有一条预算记录——所以是否提供"budget_code"参数不影响结果。

请求数据

{
  "period_name": "blank",
  "department_code": "2050061.02",
  "page_size": 3,
  "page_num": 1
}

{
  "period_name": "blank",
  "budget_code": "00008",
  "department_code": "2050061.02",
  "page_size": 3,
  "page_num": 1
}

{
  "period_name": "blank",
  "department_code": "2050061.02",
  "page_size": 3,
  "page_num": 1,
  "period_type": "total"
}

{
  "period_name": "blank",
  "department_code": "2050061.02",
  "page_size": 3,
  "page_num": 1,
  "period_type": "unsupported"
}

返回数据

{
    "resCode": 200000,
    "resMsg": "success",
    "data": {
        "page_size": 3,
        "page_num": 1,
        "total_count": 1,
        "total_page": 1,
        "is_first_page": true,
        "is_last_page": true,
        "page_info": [
            {
                "cid": 143767,
                "budget_code": "00008",
                "department_code": "2050061.02",
                "budget_amount": 60000.00,
                "frozen_amount": 0,
                "request_amount": 0,
                "expense_amount": 0,
                "balance_amount": 60000.00
            }
        ]
    }
}

03 查询预算详情-预算分解场景

被分解区: 余额 = 预算金额 - 冻结金额 - 占用金额 - 消耗金额 - 预算分解余额

分解区: 余额 = 预算金额 - 冻结金额 - 占用金额 - 消耗金额

请求数据

{
    "period_name": "2025年7月",
    "department_code": "YF001",
    "budget_code": "6600",
    "page_size": 6,
    "page_num": 1,
    "period_type": "total"
}

返回数据

{
    "resCode": 200000,
    "resMsg": "success",
    "data": {
        "page_size": 6,
        "page_num": 1,
        "total_count": 3,
        "total_page": 1,
        "is_first_page": true,
        "is_last_page": true,
        "page_info": [
            {
                "cid": 80663,
                "plan_names": [
                    "2025年12月预算"
                ],
                "budget_code": "6600",
                "department_code": "YF001",
                "budget_amount": 3000.00,
                "frozen_amount": 300.00,
                "budget_breakdown_amount": 300.00,
                "budget_breakdown_balance": 300.00,
                "balance_amount": 2400.00
            },
            {
                "cid": 142075,
                "budget_code": "6600",
                "department_code": "YF001",
                "employee_number": "129066",
                "budget_amount": 100.00,
                "balance_amount": 100.00
            },
            {
                "cid": 142076,
                "budget_code": "6600",
                "department_code": "YF001",
                "employee_number": "129088",
                "budget_amount": 200.00,
                "balance_amount": 200.00
            }
        ]
    }
}

04 查询预算详情-total父节点预算总额检查

请求数据

{
    "period_name": "2026年1月",
    "department_code": "19050103",
    "budget_code": "004",
    "page_size": 6,
    "page_num": 1,
    "period_type": "total"
}

返回数据

{
    "resCode": 200000,
    "resMsg": "success",
    "data": {
        "page_size": 6,
        "page_num": 1,
        "total_count": 1,
        "total_page": 1,
        "is_first_page": true,
        "is_last_page": true,
        "page_info": [
            {
                "cid": 143755,
                "plan_names": [
                    "2026年1-3月"
                ],
                "budget_code": "004",
                "department_code": "19050103",
                "budget_amount": 300000.00,
                "balance_amount": 300000.00
            }
        ]
    }
}

05 财年类型和财年期的架构不匹配

例如,财年期间只有单层“年-月”结构,参数period_type的值却为'ptd2',代表二级父节点预算PTD检查

请求数据

{
    "period_name": "2026年1月",
    "department_code": "19050102",
    "budget_code": "004",
    "page_size": 6,
    "page_num": 1,
    "period_type": "ptd2"
}

返回数据

{
    "resCode": 500060,
    "resMsg": "参数异常 :: period_type: ptd2"
}

06 传入period_type参数有误,返回422 Unprocessable Entity,resCode=500060

请求数据

{
  "period_name": "2025年9月",
  "department_code": "2050061.02",
  "page_size": 3,
  "page_num": 1,
  "period_type": "unsupported"
}

返回数据

{
    "resCode": 500060,
    "resMsg": "参数异常,不支持的参数: period_type=unsupported"
}

07 传入财年期间参数有误,返回422 Unprocessable Entity,resCode=500060

请求数据

{
  "period_name": "2025年13月",
  "department_code": "2050061.02",
  "page_size": 3,
  "page_num": 1,
  "period_type": "total"
}

返回数据

{
    "resCode": 500060,
    "resMsg": "参数异常, 无效财年期间: 2025年13月"
}

results matching ""

    No results matching ""