新增成本中心

接口说明: 新增成本中心

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

请求Header:

key value
access_token 获取的access_token的实际值

Query参数:

key value
sign 签名值

Body参数:

参数 类型 必传(Y/N) 说明
parentId String Y 父成本中心id,一级成本中心的父成本中心id是0
name String Y 成本中心名称
code String Y 成本中心编码
costRemark String N 成本中心备注
expenseType String N 费用类型,费用类型与费用编码必须同时传,且必须是对应的费用类型选项的值,否则会将之前的费用类型值置空
expenseCode String N 费用编码,费用类型与费用编码必须同时传,且必须是对应的费用类型选项的值,否则会将之前的费用类型值置空
budgetYearModels List<CostBudgetControlYearModel> N 预算信息
timestamp Long Y 请求时间戳(精确到毫秒)

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月的预算数据

返回结果:

参数 类型 必传(Y/N) 说明
errcode Integer Y 0成功,其他失败
errmsg String Y 结果描述
data String Y 响应结果,返回成本中心id

请求示例(HTTPS):

https://api.xinrenxinshi.com/v5/department/costcenter/add?sign=LBTdxC91dr0LaR7TYcpZvej8q/E=

请求Body示例:

{
  "parentId": "0",
  "name": "名称",
  "code":"编码",
  "costRemark":"测试备注",
  "budgetYearModels": [{
     "year": 2022,
      "itemModels": [{
        "type": 0,
        "month1": 1000.0,
        "month2": 1000.0,
        "month3": 1000.0,
        "month4": 1000.0,
        "month5": 1000.0,
        "month6": 1000.0,
        "month7": 1000.0,
        "month8": 1000.0,
        "month9": 1000.0,
        "month10": 1000.0,
        "month11": 1000.0,
        "month12": 1000.0
      }]
  }],
  "timestamp": 1606209755763
}

SDK请求示例(java):

   CostCenterAddRequest request = new CostCenterAddRequest(access_token());
   request.setCode("编码");
   request.setName("名称");
   request.setCostRemark("测试备注");
   request.setParentId("0");
   CostBudgetControlYearModel yearModel = new CostBudgetControlYearModel();
   yearModel.setYear(2022);
   CostBudgetItemModel itemModel = new CostBudgetItemModel();
   itemModel.setType(0);
   itemModel.setMonth1(1000.0);
   itemModel.setMonth2(1000.0);
   itemModel.setMonth3(1000.0);
   itemModel.setMonth4(1000.0);
   itemModel.setMonth5(1000.0);
   itemModel.setMonth6(1000.0);
   itemModel.setMonth7(1000.0);
   itemModel.setMonth8(1000.0);
   itemModel.setMonth9(1000.0);
   itemModel.setMonth10(1000.0);
   itemModel.setMonth11(1000.0);
   itemModel.setMonth12(1000.0);
   yearModel.setItemModels(Arrays.asList(itemModel));
   request.setBudgetYearModels(Arrays.asList(yearModel));
   XrxsDepartmentService.addCostCenter(request);

响应示例:

{
    "errcode":0,
    "errmsg":"成功",
    "data":"b85ef53d86fa456da70f5516122e2c6f"
}
2024 © 企家有道网络技术(北京)有限公司版权所有@京ICP备15035315号 all right reserved,powered by Gitbookupdate by: 2024-01-15 15:26:15

results matching ""

    No results matching ""