更新成本中心
接口说明: 更新成本中心
请求方式:POST(HTTPS)
请求地址:https://api.xinrenxinshi.com/v5/department/costcenter/update
请求Header:
key | value |
---|---|
access_token | 获取的access_token的实际值 |
Query参数:
key | value |
---|---|
sign | 签名值 |
Body参数:
参数 | 类型 | 必传(Y/N) | 说明 |
---|---|---|---|
costId | String | Y | 成本中心Id |
name | String | Y | 成本中心名称 |
code | String | Y | 成本中心编码 |
parentId | String | N | 父成本中心id,一级成本中心的父成本中心id是0 |
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 | 响应结果,返回null |
请求示例(HTTPS):
https://api.xinrenxinshi.com/v5/department/costcenter/add?sign=LBTdxC91dr0LaR7TYcpZvej8q/E=
请求Body示例:
{
"costId": "170e64a12af446e381de89432c9c8149",
"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):
CostCenterUpdateRequest request = new CostCenterUpdateRequest(access_token());
request.setCostId("170e64a12af446e381de89432c9c8149");
request.setCostRemark("测试备注");
request.setName("测试成本中心");
request.setCode("测试成本中心编码");
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));
rxsDepartmentService.updateCostCenter(request);
响应示例:
{
"errcode":0,
"errmsg":"成功",
"data":null
}