新增对私报销单据
接口: /reimburse/save POST JSON
请求参数
参数 | 类型 | 必须 | 默认值 | 主键 | 描述 |
---|---|---|---|---|---|
businessCode | string | N | Y | 报销单号,必须唯一,如果不传,系统自动创建 | |
formSubTypeBizCode | string | Y | N | 单据小类业务编码 | |
subsidiaryBizCode | string | Y | N | 业务实体业务编码 | |
reimDepartmentBizCode | string | Y | N | 报销部门业务编码 | |
reimEmployeeId | string | Y | N | 报销员工工号 | |
collectionCurrency | string | Y | N | 单据收款币种 | |
name | string | Y | N | 报销事由 | |
coverEmployeeId | string | Y | N | 承担员工工号 | |
coverDepartmentBizCode | string | Y | N | 承担部门业务编码 | |
comments | string | N | N | 备注 | |
costTrackings | CostTracking 数组 | 单据级辅助核算数组 | |||
multiplePayeeFlag | Boolean | N | false | N | 是否多人收款,true:多人收款;false:非多人收款 |
customFormValues | CustomFormValue 数组 | N | N | 自定义表单内容 (不支持自定义字段-附件) | |
expenses | Expense 数组 | N | N | 费用数组 |
CostTracking 结构
参数 | 类型 | 是否必填 | 默认值 | 描述 |
---|---|---|---|---|
costTrackingName | string | Y | 辅助核算名称 | |
costTrackingItemBizCode | string | Y | 辅助核算选项编码 |
Expense 结构
参数 | 类型 | 必须 | 默认值 | 主键 | 描述 |
---|---|---|---|---|---|
feeTypeBizCode | string | Y | 费用类型业务编码 | ||
consumeTime | Date | Y | 费用消费日期 | ||
consumeCcy | string | Y | 费用消费币种 | ||
consumeAmount | BigDecimal | Y | 费用消费金额 | ||
comments | String | Y | 消费事由 | ||
reimEmployeeId | string | N | 费用报销人工号,多人收款情况下必填;非多人收款情况下系统取单据上的报销人 | ||
consumeLocation | String | N | 消费城市(每刻城市编码) | ||
exchangeRate | BigDecimal | N | 消费币种到收款币种的汇率 | ||
allocatedType | String | N | 分摊类型,AMOUNT:按金额分摊;RATIO:按比例分摊 | ||
allocatedFlag | Boolean | N | false | 是否分摊,true: 开启分摊;false:未开启分摊 | |
costTrackings | CostTracking 数组 | 费用级辅助核算数组 | |||
dynaFields | DynaField 数组 | 动态字段 | |||
expenseAllocations | Expense Allocation 数组 | 费用分摊项数组 | |||
customFormValues | CustomFormValue 数组 | N | N | 自定义表单内容 (不支持自定义字段-附件和明细) | |
children | Expense 数组 | 子费用 |
DynaField 结构
参数 | 类型 | 是否必填 | 默认值 | 描述 |
---|---|---|---|---|
fieldCode | string | Y | 动态字段编码 | |
fieldName | string | Y | 动态字段名称 | |
fieldValue | string | Y | 动态字段值 |
Expense Allocation 结构
参数 | 类型 | 是否必填 | 默认值 | 描述 |
---|---|---|---|---|
coverDepartmentBizCode | string | Y | 承担部门业务编码 | |
coverEmployeeId | string | Y | 承担员工业务编码 | |
allocatedAmount | BigDecimal | Y | 分摊金额 | |
allocatedRatio | BigDecimal | Y | 分摊比例 | |
costTrackings | CostTracking 数组 | Y | 分摊项辅助核算数组 |
CustomFormValue 结构(详细说明请参考-自定义字段参数说明)
参数 | 类型 | 是否必填 | 描述 |
---|---|---|---|
identifier | string | Y | 字段占位符 |
value | string | 字段内容 | |
detailFieldValues | List<Map<String,String>> | 明细类型字段 |
返回数据:
该接口采用单条失败的处理方式,即整批数据中,如果只有其中的几条因为各种原因失败,那么只有那几条数据不会被保存;其它的数据仍然会被正常处理;错误数据的主键(businessCode)会被放在errorData里面;
errorData为结构题, 包含出错记录主键(businessCode), 以及与之对应的出错信息; 类似 {"项目": "部门不存在"}; 具体参见失败实例;
为保持向后兼容, data也会包含有和errorData相同的记录,但后续可能会改变;
示例:
请求示例
{
"timestamp": "1578462629590",
"data": [{
"businessCode": "MK200100491",
"formSubTypeBizCode": "MK001",
"subsidiaryBizCode": "S0001",
"reimDepartmentBizCode": "D0011",
"reimEmployeeId": "008",
"collectionCurrency": "CNY",
"name": "接口保存测试",
"comments": "接口保存测试--备注",
"coverEmployeeId": "008",
"coverDepartmentBizCode": "D0011",
"costTrackings": [{
"costTrackingName": "交通类型",
"costTrackingItemBizCode": "AIRPORT"
}],
"customFormValues":[{
"identifier":"field1",
"value":"自定义字段值"
}],
"expenses": [{
"feeTypeBizCode": "T002",
"consumeTime": "2020-01-10",
"consumeCcy": "CNY",
"consumeAmount": 168,
"consumeLocation": "domestic-ZH1-ZH1_0-ZH1_0_00",
"comments": "保存费用",
"exchangeRate": 1,
"costTrackings": [{
"costTrackingName": "Project Code",
"costTrackingItemBizCode": "P001"
}],
"dynaFields": [{
"fieldCode": "1",
"fieldName": "消费平台",
"fieldValue": "携程商旅"
}],
"children": [{
"feeTypeBizCode": "T002",
"consumeTime": "2020-01-10",
"consumeAmount": 168,
"consumeLocation": "domestic-ZH1-ZH1_0-ZH1_0_00",
"comments": "保存子费用",
"costTrackings": [{
"costTrackingName": "Project Code",
"costTrackingItemBizCode": "P001"
}],
"dynaFields": [{
"fieldCode": "1",
"fieldName": "消费平台",
"fieldValue": "携程商旅"
}]
}]
},
{
"feeTypeBizCode": "T002",
"consumeTime": "2020-01-10",
"consumeCcy": "CNY",
"consumeAmount": 168,
"consumeLocation": "domestic-ZH1-ZH1_0-ZH1_0_00",
"comments": "保存费用",
"exchangeRate": 1,
"costTrackings": [{
"costTrackingName": "Project Code",
"costTrackingItemBizCode": "P001"
}],
"dynaFields": [{
"fieldCode": "1",
"fieldName": "消费平台",
"fieldValue": "携程商旅"
}]
}
]
}
]
}
返回数据(成功)
{
"code": "ACK",
"message": "",
}
返回数据(失败)
{
"code": "NACK",
"message": null,
"data": {
"MK200100490": "报销人工号必填"
},
"args": null,
"linkDetail": false,
"errorData": {
"MK200100490": "报销人工号必填"
}
}