保存操作接口

1 接口介绍
保存操作服务是指通过在请求体中按规范输入json格式的参数,调用界面保存操作,快速保存单笔或大批量的数据。
2 注意事项
1)当一次保存多条数据时,请求体的参数data需要修改为datas;
2)当请求体的list数据中携带有主键id时,默认是更新操作,否则判断为新增保存操作,可以在同一批数据中既执行新增又执行更新操作。
3 接口示例
采购订单保存
URL:{{host}}/kapi/sys/pm_purorderbill/save 请求方式:POST 请求Header参数: Content-Type=application/json accessToken: xxxxxxxxxxxxx |
请求Body: { "data": { "org": { "number": "xyd2024" }, "biztype": { "number": "110" }, "billtype": { "number": "pm_PurOrderBill_Cost_BT_S" }, "biztime": "2021-07-25 15:15:22", "billstatus": "A", "bizorg": { "number": "xyd2024" }, "supplier": { "number": "sup-00122" }, "settlecurrency": { "number": "CNY" }, "exratetable": { "number": "0001" }, "comment":"采购订单备注", "exratedate": "2021-07-25 15:15:22", "paymode": "CREDIT", "exchangerate": 1.0000000000, "istax": "1", "billentry": [ { "material": { "number": "ZH-00009257" }, "qty": "1010", "unit": { "number": "ZH-TON" }, "entrysettleorg":{ "number":"xyd2024" }, "entrycomment":"分录1" }, { "material": { "number": "ZH-00009257" }, "qty": "1020", "unit": { "number": "ZH-TON" }, "entrysettleorg":{ "number":"xyd2024" }, "entrycomment":"分录2" } ] } } |
请求结果: { "data": { "success": true, "needSign": false, "needWfAssignPersons": false, "cancelWriteLog": true, "showMessage": true, "billCount": 1, "successPkIds": [ 1235479318616893440 ], "billNos": { "1235479318616893440": "CGDD-202109-152203" }, "validateResult": { "validateErrors": [], "success": true, "message": "", "errorPkIds": [], "errorDataIndexs": [] }, "allErrorOrValidateInfo": [], "runSecond": 0, "allErrorInfo": [] }, "success": true, "errorCode": "success", "message": null } |
4 返回参数说明
序号 | 参数 | 解释 | 返回值实例 |
1 | success | 是否成功 | true/false |
2 | errorCode | 错误编码 | success/false |
3 | message | 提示信息 | 成功时为null,失败时会返回错误信息 |
4 | data | 业务对象数据 | {"successPkIds":[1235479318616893440],"billNos":{"1235479318616893440": "CGDD-202109-152203"},} |
5. 参数格式示例
保存接口所有字段类型的入参格式可参考下表,其中基础资料类型的字段在入参时,建议通过id或number保存。
序号 | 参数名称 | 入参示例 |
1 | 单据ID | "id": "1007171369592427520" |
2 | 单据编码 | "billno" : "4" |
3 | 单据状态 | "billstatus": "A" |
4 | 创建人 | "creator": { } |
5 | 创建时间 | "createtime": "2020-10-22 14:12:46" |
6 | 组织 | "org": { } |
7 | 文本 | textfield: "4" |
8 | 整数 | "integerfield": 4 |
9 | 小数 | "decimalfield": "4.0000000000" |
10 | 长整数 | "bigintfield": 4 |
11 | 多行文本 | "textareafield": "4" |
12 | 大文本 | "largetextfield": "4" |
13 | 多语言文本 | "mulilangtextfield": { |
14 | 复选框 | "checkboxfield": true |
15 | 单选按钮 | "radiofield": false |
16 | 单选按钮组 | "radiogroupfield": "1" |
17 | 下拉列表 | "combofield": "1" |
18 | 多选下拉列表 | "mulcombofield": "a,b" |
19 | 基础资料 | 用户基础资料 } |
20 | 辅助资料 | "assistantfield": { |
保存操作接口
声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。如若本站内容侵犯了原著者的合法权益,可联系本站删除。



